Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 217985b200ac9f8eccc2bdade2af6b21a5f44923
Ticket: 557878ffffffffffffffffffffffffffffffffff
server fails with -encoding binary
User & Date: andreas_kupries on 2002-05-25 01:26:58
Changes

  1. icomment:
    Logged In: YES 
    user_id=75003
    
    Yep. What happens is this: When the server socket is 
    reconfigured the system will call TcpWatchProc in 
    tclWinSock.c to update for which events to look. Adding 
    some tracing statements to this routine we see:
    
    $ ./bin/tclsh84s.exe
    % fconfigure [set a [socket -server hoo 0]] -sockname
    0.0.0.0 0.0.0.0 1143
    % fconfigure $a -encoding 1143
    unknown encoding "1143"
    % fconfigure $a -encoding binary
    FD_READ    = 001
    FD_WRITE   = 002
    FD_CLOSE   = 032
    FD_ACCEPT  = 008
    FD_CONNECT = 016
    watch      = 008
    select     = 008
    watch/new  = 000
    select/new = 008
    
    watch determines which events are watched by windows for 
    the handle, and ACCEPT is the event sent if a new 
    connection arrives on the socket. As we can see the 
    ACCEPT is cleared completely. This is because the server 
    socket is neither readable nor writable.
    
    Unix systems are not affected because they check if an 
    acceptProc is set (tclUnixChan.c, line 2354, TcpWatchProc) 
    and avoid messing with the masks and events if that it so.
    
    We have to perform the same check for Windows.
    
    The mechanism on Mac is unclear. This means that this
    report has to be given to the mac maintainers to make sure
    that this bug is not present for that platform too.
    
    
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"