Skip to content

Add TCP push server for node detection forwarding#9

Merged
jonnyspicer merged 2 commits into
mainfrom
feature/tcp-push-server
Mar 11, 2026
Merged

Add TCP push server for node detection forwarding#9
jonnyspicer merged 2 commits into
mainfrom
feature/tcp-push-server

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Summary

  • Adds a TCP server that accepts persistent connections from radar nodes pushing newline-delimited JSON detection frames
  • Implements token-based authentication (rejects invalid tokens with immediate RST)
  • Auto-provisions tracker instances for unknown nodes with valid tokens, allocating ports from a configurable range
  • Introduces a DetectionSource protocol so TrackerInstance works with both HTTP-polled and TCP-pushed sources
  • Includes TcpReceiver (bounded async queue with drop-oldest overflow, timestamp dedup) and TcpServer (connection routing, heartbeat filtering)
  • Adds node simulator CLI tool (tests/simulate_node.py) for local testing
  • 28 tests covering TCP receiver, server, and auto-provisioning

Test plan

  • All 28 unit tests pass (pytest tests/ -v)
  • Manual integration testing with node simulator: single node, multi-node, disconnect/reconnect, invalid token, heartbeat-only, malformed data
  • Deploy server-side first (Phase 1: no nodes pushing yet, zero risk)
  • Test with single node in dual-mode (Phase 2: HTTP + TCP in parallel)
  • Migrate nodes one at a time (Phase 3-4)

🤖 Generated with Claude Code

jonnyspicer and others added 2 commits March 11, 2026 16:40
Replace HTTP polling with persistent TCP connections where nodes push
newline-delimited JSON detection frames directly to the server. Includes
token-based authentication, auto-provisioning of unknown nodes, heartbeat
support, and a pluggable DetectionSource protocol that supports both
HTTP-polled and TCP-pushed sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts between TCP push server and geolocator support:
- config.yaml: radar4 uses TCP mode with geolocator enabled
- config.py: keep both mode detection logic and geolocator parsing
- instance.py: keep DetectionSource import, drop redundant startup check
- manager.py: use main's results capture for gather()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonnyspicer jonnyspicer merged commit 213bf38 into main Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant