Skip to content

pmd-pytcp 0.3.2

Choose a tag to compare

@doronz88 doronz88 released this 12 Aug 05:39
· 26 commits to main since this release

Bugfix release

tcp: connect() could leave a half-open session registered when it raised; a concurrent close() was silently swallowed (#9, thanks @vToMy)

TcpSocket.connect() registers the socket (claiming its local port) before the handshake, then awaits the session's connect event. An exception thrown into that await — task cancellation being the everyday case — propagated with the session abandoned in SYN_SENT: it kept retransmitting SYNs until the R2 budget (~127 s) expired, its socket registered and its ephemeral port held the whole time. connect() now aborts the session on any non-TcpSessionError failure before re-raising — silent TCB deletion in unsynchronized states, RST if the handshake had just completed — so a connect() that raises never leaves anything registered.

Separately, a concurrent close()/abort() tearing down a pending connect made the session raise TcpSessionError("Connection canceled"), which matched neither the refused nor the timeout mapping and fell through — connect() returned normally on a dead, unregistered session, and the caller found out on their first send(). It now raises ConnectionAbortedError.

Only pmd-pytcp bumps (0.3.1 → 0.3.2); pmd-net-addr / pmd-net-proto stay at 0.0.3.