Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 43f529f81343bfb5ac18f2ffa6c35a0490f5d0b3
Ticket: ac661a684d5abbdd0ef142176cfeb7a1a4f600b8
Tcl_NotifyChannel man page: "no writable callback on pending flush" missing
User & Date: oehhar on 2014-03-14 17:27:26
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    The man-page of Tcl_NotifyChannel [http://www.tcl.tk/man/tcl8.6/TclLib/CrtChannel.htm] writes:
    <verbatim>
    Tcl_NotifyChannel is called by a channel driver to indicate to the generic layer that the events specified by mask have occurred on the channel. Channel drivers are responsible for invoking this function whenever the channel handlers need to be called for the channel.
    </verbatim>
    
    It suggests that a registered writable proc is called after this notification.
    This is not the case, if a flush is pending and no error occured for the channel. In this case, a flush is tried and no proc is called.
    
    IMHO this fact should be noted on the man-page.
    
    The following code brings a channel in the state, where a Tcl_NotifyChannel will not fire the fileevent:
    <verbatim>
    set h [socket -async unreachable a]
    fileevent $h writable "puts Write;close $h"
    fconfigure $h -blocking 0
    puts $h ABC
    flush $h
    # Now a flush is pending on the socket
    # When the cahnnel driver now calls Tcl_NotifyChannel, nothing happens the </verbatim>
    
    On a second call to Tcl_NotifyChannel, the fileevent will fire, as the first flush falied and it is in error state.
    
  5. foundin changed to: "8.6.1"
  6. is_private changed to: "0"
  7. login: "oehhar"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "oehhar"
  14. subsystem changed to: "25. Channel System"
  15. title changed to:
    Tcl_NotifyChannel man page: "no writable callback on pending flush" missing
    
  16. type changed to: "Bug"