Skip to content
Tcl Source Code History Of Ticket 219273
Login

History Of Ticket 219273

Artifacts Associated With Ticket 219273

  1. Ticket change [0ab910bf33] (rid 113874) by nobody on 2000-10-26 05:09:43:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. 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;
      
          
      
          
      
      
      
    4. foundin initialized to: "final: 8.0.5"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "63. (unused)"
    10. title initialized to:
      socket -async combined with fileevent is broken on the Mac
      
    11. type initialized to: "Bug"
  2. Ticket change [b3a36bc459] (rid 124891) by dgp on 2001-04-01 01:47:31:

    1. subsystem changed to: "27. Channel Types"
  3. Ticket change [d4be633fd8] (rid 123500) by das on 2001-08-25 00:30:56:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      
      
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. subsystem changed to: "68. Mac Classic (obsolete)"
    5. username: "das"
  4. Ticket change [8d33a3af5e] (rid 127888) by andreas_kupries on 2001-09-08 06:41:54:

    1. assignee changed to: "das"
  5. Ticket change [df77c730f6] (rid 115020) by dgp on 2002-07-06 04:09:31:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Is this bug still present in 8.4 ?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [67bdd29796] (rid 102942) by das on 2004-03-30 14:30:36:

    1. closedate changed to: "2004-03-30T07:30:36"
    2. closer changed to: "das"
    3. icomment:
      Logged In: YES 
      user_id=90580
      
      mac classic bugs closed as "Out of date" 
      
      
    4. login: "das"
    5. mimetype: "text/plain"
    6. resolution changed to: "Out of Date"
    7. status changed to: "Closed"
    8. username: "das"