Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fed8427e8ef8b5bd07b5d886842b0ee8b769bc0e
Ticket: c6ed4acfd8ba465a8e6681297b81b995acfa7acc
Win: failing async socket connect and other sync socket connect hangs
User & Date: oehhar on 2014-12-04 09:10:48
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Chris Shults reported by private E-Mail the following bug:
    
       *   open a server socket to port A
       *   open an async client socket to port B, which will fail, as it has no server on
       *   open a sync client socket to the server socket
    
    TCL hangs.
    
    Demo script:
    <verbatim>
    #This works in:
    #ActiveTcl8.6.1.0.297577-win32-ix86-threaded
    #but is broken in:
    #ActiveTcl8.6.2.0.298433-win32-ix86-threaded
    #ActiveTcl8.6.3.0.298612-win32-ix86-threaded
    proc read_sock {channel} {puts [chan read $channel]}
    
    proc accept {channel address port} {
    	puts "accept $channel $address $port"
    	chan configure $channel -blocking no -buffering none -encoding iso8859-1 -translation binary
    	chan event $channel readable "read_sock $channel"
    }
    
    set ssock [socket -server accept 9902]
    
    proc connection_result {channel} {
    	puts -nonewline "connection_result: "
    	if {[chan configure $channel -error] == ""} {
    		puts connected
    	} else {
    		puts "not connected"
    		chan event $channel readable {}
    	}
    	chan event $channel writable {}
    }
    
    set csock1 [socket -async localhost 9903]
    chan configure $csock1 -blocking no -buffering none -encoding iso8859-1 -translation binary
    chan event $csock1 readable "read_sock $csock1"
    chan event $csock1 writable "connection_result $csock1"
    
    #connect up a client prior to entering the vwait
    set csock2 [socket localhost 9902]
    chan configure $csock2 -blocking no -buffering none -encoding iso8859-1 -translation binary
    chan event $csock2 readable "read_sock $csock2"
    
    after 10000 {puts "This message will never appear"}
    
    vwait forever
    </verbatim>
    
    when I start wish -f with the upper script, it stalls
    
  5. foundin changed to: "8.6.3"
  6. is_private changed to: "0"
  7. login: "oehhar"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "oehhar"
  14. subsystem changed to: "25. Channel System"
  15. title changed to:
    Win: failing async socket connect and other sync socket connect hangs
    
  16. type changed to: "Bug"