6483729de3bdd07902c387855154f30722e3af1f
TCPServer accepted a connection and never revisited it again once it stopped generating epoll events - a connection that completes the TCP handshake and then goes permanently silent (an incomplete TLS handshake, a port scanner/prober) sat in sessions forever, one TCPSession + one fd each. sweepStaleSessions() now drops any session that has gone 30+ seconds without a single byte of real data ever passing through onDataReceived(), run each time a new connection arrives rather than needing a dedicated timer. hasReceivedData latches permanently true on a sessions first real byte, so an ordinary connected-but-briefly-idle client is never at risk. Also raised listen()s backlog from 20 to 128, so a burst of connection attempts has more headroom before the kernel starts dropping SYNs. Verified live on zephora.barant.com: a silent connection held open was reaped within the grace window while a real concurrent connection was left untouched, with the service remaining healthy throughout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Description
This repository provides core functionality for TCP and UDP servers using the epoll linux function.
184 MiB
0 Stars
1 Watchers
0 Forks
Languages
C++
99.6%
Shell
0.4%