Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: af1c372bd88255c826de0993a5d7d07b31a0d78f
Ticket: 218553ffffffffffffffffffffffffffffffffff
Gets blocks in a readable fileevent
User & Date: nobody on 2000-10-26 01:02:05
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1051 Bug
    Version: 8.1b1
    SubmitDate: '1999-01-15'
    LastModified: '1999-03-23'
    Severity: CRIT
    Status: Released
    Submitter: pat
    ChangedBy: redman
    OS: Windows 95
    Machine: X86
    FixedDate: '1999-03-23'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Graham Haley
    
    ReproducibleScript:
    Set up a readable fileevent handler on stdin ...
    
    fileevent stdin readable {
        puts "handler fired"
        if {[gets stdin line] >= 0} {
            puts "$line"
        } else {
            puts "gets failed"
        }
    }
    
    and configure stdin to be non-blocking/line-buffered ...
    
    fconfigure stdin -blocking 0 -buffering line
    
    Process events ...
    
    set result 0
    vwait result
    
    The handler immediately fires and gets blocks waiting for data.  When it
    arrives, gets returns, prints it and immediately fires again.
    
    Surely this is wrong - the whole point of having an event handler is to
    prevent gets from blocking.
    
    This works ok on Solaris.
    
    
    
    ObservedBehavior:
    gets hangs
    
    
    
    DesiredBehavior:
    The event handler should only be called if there is data to read (and hence
    gets shouldn't block)
    
    
    
    
    03/23/1999 16:05 - redman - Fixed tclWinConsole.c, fileevents are now firing when an entire line is available.  Test case in tests/winConsole.test.
    
    
    
  4. foundin changed to: "obsolete: 8.1b1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "Gets blocks in a readable fileevent"
  11. type changed to: "Bug"