Artifacts Associated With Ticket 251f46655c
Ticket change [389047f354] (rid 258284) by serhiy.storchaka on 2026-10-16 20:59:21:
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
On Unix, closing a <nowiki>[socket -async]</nowiki> channel while the connection is still being established loses the data written to it: <verbatim> set s [socket -async $host $port] ;# connect still pending puts $s hello close $s ;# error: transport endpoint is not connected; the server gets nothing </verbatim> 8.6 sends the data. Since [d5bc305ad2] Tcl_Close() always shuts down the read side before flushing, and TcpClose2Proc() calls shutdown(SHUT_RD) on the still connecting socket, which aborts the connect on Linux.
- foundin initialized to: "9.0.5, 9.1.0"
- login: "serhiy.storchaka"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- subsystem initialized to: "25. Channel System"
- title initialized to:
close of a pending socket -async loses the buffered output
- type initialized to: "Bug"
Ticket change [6a7b59dd02] (rid 258285) by serhiy.storchaka on 2026-10-16 20:59:35:
- login: "serhiy.storchaka"
- submitter changed to: "serhiy.storchaka"
Ticket change [b5fe37a4a9] (rid 258286) by serhiy.storchaka on 2026-10-16 21:08:27:
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
On Unix, closing a <nowiki>[socket -async]</nowiki> channel while the connection is still being established loses the data written to it: <verbatim> set s [socket -async $host $port] ;# connect still pending puts $s hello close $s ;# error: transport endpoint is not connected; the server gets nothing </verbatim> The same happens for a non-blocking channel, where the error is also raised by close. 8.6 sends the data. Since [d5bc305ad2] Tcl_Close() always shuts down the read side before flushing, and TcpClose2Proc() calls shutdown(SHUT_RD) on the still connecting socket, which aborts the connect on Linux.
- login: "serhiy.storchaka"
- title changed to:
close of a pending socket -async fails and loses the buffered output
Ticket change [c41312943f] (rid 258294) by serhiy.storchaka on 2026-10-16 21:16:36:
- icomment:
Proposed fix in branch [/timeline?r=unix-async-close-pending|unix-async-close-pending]: TcpClose2Proc() does not shut down the read side while the connect is pending. Test socket-14.20. This also fixes <nowiki>[chan close $s read]</nowiki> on a pending socket, which aborted the connect even in 8.6.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment: