Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 389047f354c2db7f186ef0a3ffdce7b7a0922dacc880590ea3d6ac25aa17a660
Ticket: 251f46655c1a8b588b01f00f43c435c04ad10c75
close of a pending socket -async fails and loses the buffered output
User & Date: serhiy.storchaka on 2026-10-16 20:59:21
Changes

  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>
    
    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 changed to: "9.0.5, 9.1.0"
  4. login: "serhiy.storchaka"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. severity changed to: "Minor"
  8. status changed to: "Open"
  9. subsystem changed to: "25. Channel System"
  10. title changed to:
    close of a pending socket -async loses the buffered output
    
  11. type changed to: "Bug"