mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-29 15:29:14 +00:00
4304b065cb
A half-open handshake consumed the only smoltcp listener socket, so other clients were rejected until its timeout. Closed listener sockets could also remain unusable after a network interruption. Register logical TCP listeners with the reactor without preallocating socket slots. Allocate one temporary smoltcp socket for each new SYN; repeated SYNs reuse the existing connection. Limit each listener to sixteen pending handshakes or completed connections. Batch ordinary ingress packets through smoltcp and scan listener state once per batch. Before admitting a SYN, advance timers, reclaim stale pending sockets, and flush queued packets. Process only a newly allocated socket's SYN separately to preserve packet order. Keep the global tuple lookup off unmatched and full-listener rejection paths. Promote established connections to the normal timeout, reclaim closed connections, and transfer accepted sockets to streams. Keep one long-lived logical listener in SmolTcpStack and cover concurrency, retransmission, timeout recovery, capacity, and cleanup in tests.