Skip to content
Tcl Source Code History Of Ticket 219307ffffffffff
Login

History Of Ticket 219307ffffffffff

Artifacts Associated With Ticket 219307ffffffffff

  1. Ticket change [6086f9392e] (rid 116015) by nobody on 2000-10-26 05:10:27:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 3319 Bug
      Version: 8.2.1
      SubmitDate: '1999-11-05'
      LastModified: '1999-11-11'
      Severity: MED
      Status: UnAssn
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Linux-Red Hat
      OSVersion: RedHat 5.2 (intel)
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      Mo DeJong
      
      ReproducibleScript:
      # First, start the "server" and listen for connections.
      # When a connection arrives just close the socket.
      
      set port 6789
      
      proc incomingConnection { stream addr port } {
          puts "incomingConnection from $addr $port"
          close $stream
      }
      
      set server [socket -server incomingConnection $port]
      
      # Now create the "client" socket which makes a connection
      # This causes the error {error writing "sock7": broken pipe}
      
      proc canWrite { } {
        global socket
        if {[eof $socket]} {
          puts "EOF ON SOCKET"
        }
      
        puts "Writing to socket"
        puts $socket "CLOSE"
      }
      
      set socket [socket localhost $port]
      fconfigure $socket -buffering line -blocking 0
      fileevent $socket writable canWrite
      
      vwait forever
      
      ObservedBehavior:
      This generates an error on UNIX systems when the socket is closed on the
      server side. The client tries to write when it gets a fileevent writable
      event, and this generates and during the write() call because the socket
      was closed.
      
      
      It does not work on these systems:
      RedHat Linux 5.2 with Tcl 8.2.1
      Solaris 5.6 with Tcl 8.2.1
      IRIX 6.2 with Tcl 8.2.1
      
      But under NT with Tcl 8.2.1, the extra fileevent
      callback is not generated.
      
      DesiredBehavior:
      A fileevent writable callback should not be generated on a closed socket
      under UNIX systems.
      
      
      
      Newsgroup reports indicate that NT has the incorrect behavior. 
      -- 11/11/1999 hobbs
      
    4. foundin initialized to: "obsolete: 8.2.1"
    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:
      Tcl's fileevent callback on a socket does not work the same 
      
    11. type initialized to: "Bug"
  2. Ticket change [72d99b28df] (rid 104936) by dkf on 2001-01-16 21:21:56:

    1. icomment:
      It looks to me like the behaviour described as being erroneous is quite possible, since the [socket] command (as written) returns a connected socket, meaning that the server will have had a chance to close the socket off.    Either the socket being opened or being closed would be sufficient reason to trigger the writable callback (which is also called when the socket is in an error condition, e.g. closed.)
      
      The real question is why are no callbacks being performed for the channel at the Tcl end under Windows?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [3157822b1b] (rid 93411) by hinteger on 2001-01-23 03:07:13:

    1. icomment:
      I thought the right way to use callbacks is always to check for eof on both readable and writable channels, that's how all my scripts do and I don't have any problems with that. The man page is quite clear about that for readable channels and not so clear for writable, but I think eof _is_ an error condition.
      
      
    2. login: "hinteger"
    3. mimetype: "text/plain"
    4. username: "hinteger"
  4. Ticket change [cbf58c71a3] (rid 95608) by dgp on 2001-04-01 01:47:31:

    1. subsystem changed to: "27. Channel Types"
  5. Ticket change [fdf76e98f0] (rid 108509) by dkf on 2002-04-27 05:46:03:

    1. assignee changed to: "andreas_kupries"
  6. Ticket change [04c8a16c7b] (rid 88932) by davygrvy on 2003-04-23 03:39:38:

    1. assignee changed to: "davygrvy"
    2. icomment:
      Logged In: YES 
      user_id=7549
      
      IMO, as the generic layer can use the concept of 2 uni-
      directional channels, the single bi-direction type of a socket 
      needs to force eof from both sides and is the responsibility of 
      the driver.
      
      The [eof] command is ONLY for the read side, not the write 
      side.  But this doesn't mean checking for [eof] within a write 
      callback is wrong.  This extra fileevent can be added.
      
      
    3. login: "davygrvy"
    4. mimetype: "text/plain"
    5. username: "davygrvy"
  7. Ticket change [b894d445fe] (rid 128987) by davygrvy on 2003-12-17 08:34:59:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=7549
      
      Andreas, did your recent patch fix this?
      
      
    3. login: "davygrvy"
    4. mimetype: "text/plain"
    5. username: "davygrvy"
  8. Ticket change [90851dae3b] (rid 120464) by dkf on 2003-12-17 16:06:17:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Andreas is on vacation (and away from Internet) until
      January.  Good for him, but not quite so good for turnaround
      time on this bug...  :^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [fd6b77ac09] (rid 108411) by dgp on 2006-03-10 23:30:27:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      status?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"