Repository navigation
tcp 2.0.2: TCP_NODELAY by default, peer_closed()
Small follow-ups to 2.0.1. No breaking change.
Changes
TCP_NODELAYby default. Passconnect(..., nodelay=False)to opt out. Measured on Linux (loopback), a request sent in 5 small writes to a server that replies once per request took 56 µs withTCP_NODELAYand 40.6 ms without, because of the delayed-ACK stall. PostgreSQL's extended query and HTTP both follow that pattern, so pg'sexec_paramsloses a 40 ms stall per query on Linux. macOS showed no stall either way. The README also covers the opposite case, a peer that answers every segment with its own small write.peer_closed(): a non-blocking check that the peer hasn't closed the connection, for reusing pooled sockets.- Docs: the README now states that DNS resolution isn't covered by
timeout_secs.
Testing
- 30 tests on Linux and macOS.
- requests, websocket and pg suites pass with this version.
- tls live sweep: 24 sites plus 4 bad endpoints, all correct. 55-site sweep: 54 of 55 (www.netflix.com fails with every tcp version).