Skip to content
Tcl Source Code History Of Ticket 251f46655c
Login

History Of Ticket 251f46655c

Artifacts Associated With Ticket 251f46655c

  1. Ticket change [389047f354] (rid 258284) by serhiy.storchaka on 2026-10-16 20:59:21:

    1. cmimetype initialized to: "text/x-fossil-wiki"
    2. 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.
      
    3. foundin initialized to: "9.0.5, 9.1.0"
    4. login: "serhiy.storchaka"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. severity initialized to: "Minor"
    8. status initialized to: "Open"
    9. subsystem initialized to: "25. Channel System"
    10. title initialized to:
      close of a pending socket -async loses the buffered output
      
    11. type initialized to: "Bug"
  2. Ticket change [6a7b59dd02] (rid 258285) by serhiy.storchaka on 2026-10-16 20:59:35:

    1. login: "serhiy.storchaka"
    2. submitter changed to: "serhiy.storchaka"
  3. Ticket change [b5fe37a4a9] (rid 258286) by serhiy.storchaka on 2026-10-16 21:08:27:

    1. cmimetype changed to: "text/x-fossil-wiki"
    2. 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.
      
    3. login: "serhiy.storchaka"
    4. title changed to:
      close of a pending socket -async fails and loses the buffered output
      
  4. Ticket change [c41312943f] (rid 258294) by serhiy.storchaka on 2026-10-16 21:16:36:

    1. 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.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"