Overview
| Artifact ID: | 93b3bd781f430932dc01aaf212d4dc9408445c1c |
|---|---|
| Ticket: | 1749581fffffffffffffffffffffffffffffffff
chan pending not updated without a gets |
| User & Date: | mpc_janssen on 2007-07-07 12:39:41 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
When a socket is configured non-blocking, chan pending is not updated if [gets] is not called. For example the following script, will: 1) Always puts 0 to stdout 2) Fire the event handler very rapidly. # ----- socket -server test 80 proc test {sock args} { fileevent $sock readable [list pending $sock] fconfigure $sock -blocking 0 } proc pending {sock} { puts [chan pending input $sock] } vwait forever # ----- If a [gets $sock] is added in the pending proc, the chan pending result will be correct and the readable event will not continue to fire. This will limit the usefulness of chan pending in cases where the read data is not line based (and thus gets is not a good fit) Furthermore, the behaviour is not consistent with the manual page which states: returns the number of bytes of input or output (respectively) currently buffered internally for channelId Nowhere does it state that chan pending will only be updated after a unsuccesful input operation (which can only be achieved by [gets], because read always returns some data (in the unblocking case)). Additional info: > tclsh % parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = windows tcl_platform(pointerSize) = 4 tcl_platform(user) = mjanssen tcl_platform(wordSize) = 4 % info patch 8.5a7 - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "mpc_janssen"
- subsystem changed to: "24. Channel Commands"
- title changed to: "chan pending not updated without a gets"
- type changed to: "Bug"