Artifacts Associated With Ticket 219273
Ticket change [0ab910bf33] (rid 113874) by nobody on 2000-10-26 05:09:43:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1663 Bug Version: 8.0.5 SubmitDate: '1999-03-30' LastModified: '2000-04-14' Severity: CRIT Status: UnAssn Submitter: pat ChangedBy: hobbs RelatedBugIDs: 1776 OS: Macintosh OSVersion: 8.0 (PPC) Machine: Power PC FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: mo ReproducibleScript: set server ftp.netscape.com set port 12345 if {[catch { set sock [socket -async $server $port] } err]} { puts "socket -async connect error 1 \"$err\"" } # define file event callback proc firstWritable { sock } { # remove writable fileevent handler fileevent $sock writable {} #find out if the connection worked by testing the -peername if [catch {fconfigure $sock -peername} peerinfo] { close $sock puts "socket -async connect error 2 \"$peerinfo\"" } else { puts "socket -async connect worked" } } # set up file event on the socket so we know # when it connects (or fails to connect) fileevent $sock writable "firstWritable $sock" ObservedBehavior: When this code is run under MacOS with Tcl 8.0.5 it will fail to run the fileevent callback in the case where the host is unreachable. This same code works perfectly under Unix. While this is bad, it gets even worse if you invoke the fconfigure command like this: fconfigure $sock Doing this will kill wish completely with an error dialog that says "error closing async connect socket" This is no way to recover from this! DesiredBehavior: I need to be able to test to see if the async socket connect worked using the writable fileevent. There is simply no other way to check the status of the socket without doing a read on the socket and doing a read on the socket is not an option because the program can not block Tk events during a network operation. It looks like the problem is located here. I am not sure what the fix is but a panic in this case does not seem like the correct action. tcl8.0.5/mac/tclMacSock.c:734 /* * If this socket is in the midddle on async connect we can just * abort the connect and release the stream right now. */ if (statePtr->flags & TCP_ASYNC_CONNECT) { InitMacTCPParamBlock(&closePB, TCPClose); closePB.tcpStream = tcpStream; closePB.ioCompletion = NULL; err = PBControlSync((ParmBlkPtr) &closePB); if (err != noErr) { panic("error closing async connect socket"); } statePtr->flags |= TCP_RELEASE; - foundin initialized to: "final: 8.0.5"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "63. (unused)"
- title initialized to:
socket -async combined with fileevent is broken on the Mac
- type initialized to: "Bug"
Ticket change [b3a36bc459] (rid 124891) by dgp on 2001-04-01 01:47:31:
- subsystem changed to: "27. Channel Types"
Ticket change [d4be633fd8] (rid 123500) by das on 2001-08-25 00:30:56:
- icomment:
Logged In: YES user_id=90580
- login: "das"
- mimetype: "text/plain"
- subsystem changed to: "68. Mac Classic (obsolete)"
- username: "das"
- icomment:
Ticket change [8d33a3af5e] (rid 127888) by andreas_kupries on 2001-09-08 06:41:54:
- assignee changed to: "das"
Ticket change [df77c730f6] (rid 115020) by dgp on 2002-07-06 04:09:31:
- icomment:
Logged In: YES user_id=80530 Is this bug still present in 8.4 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [67bdd29796] (rid 102942) by das on 2004-03-30 14:30:36:
- closedate changed to: "2004-03-30T07:30:36"
- closer changed to: "das"
- icomment:
Logged In: YES user_id=90580 mac classic bugs closed as "Out of date"
- login: "das"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- status changed to: "Closed"
- username: "das"