Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 99b0dce3ae570f8bc2827589f11fdd0e0c1272b7
Ticket: 3295154fffffffffffffffffffffffffffffffff
Sockets not responding
User & Date: mb-austin on 2011-04-29 22:34:42
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OS - Windows Vista
    Tcl Version - Activestate  8.6b1.2
    
    creating multiple client sockets over a short period of time cause the server socket to quit responding.  Incoming connections are accepted, but the command for the server socket server is never called.
    
    I've include a single file that causes the problem on my machine.  it builds a socket server that just listens for connections and logs when one comes in.
    It also creates 10 client requests.
    Only some fraction of these client requests are logged.
    
    I was worried that it might be caused from the client/server running from the same program, so I split up and ran with client on one machine and server on another.  The same problem still happened.  
    
    ---- server.tcl -----
    set connection_count 0
    proc connect {args} {
        incr ::connection_count
        puts stdout "$::connection_count -- connect from $args"
    }
    
    
    socket -server connect 4444
    
    puts stdout "waiting for connection"
    vwait forever
    
    ------- end of server.tcl ------------
    
    
    
    ----- client.tcl -------------
    proc doit {{count 10}} {
        for {set x 1} {$x <= $count} {incr x} {
            puts stdout "$x  -- start connection "
            socket localhost 4444
            #after  1
        }
    }
    doit
    
    -------- end of client.tcl ------
    
    Expected Output:
    I would expect for the server to show 10 connections.
    the actual result is some number < 10.. by tweaking the after value in the client you can slow it down enough to get all 10 requests.
    
    
    I thought this might be a problem with too many sockets in a TIMED_WAIT state, but I waited until I had no sockets in the timed wait state, ran the test and got this result
    
    
    $ tcl sockettest.tcl
    1 -- start CLIENT
    1 -- SERVER -- connect from  sock420 127.0.0.1 61692
    2 -- start CLIENT
    2 -- SERVER -- connect from  sock428 127.0.0.1 61693
    3 -- start CLIENT
    3 -- SERVER -- connect from  sock440 127.0.0.1 61694
    4 -- start CLIENT
    5 -- start CLIENT
    4 -- SERVER -- connect from  sock460 127.0.0.1 61695
    6 -- start CLIENT
    7 -- start CLIENT
    8 -- start CLIENT
    9 -- start CLIENT
    10 -- start CLIENT
    total connections:  4
    
    
    
    
  4. foundin changed to: "obsolete: 8.6b1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "mb-austin"
  10. subsystem changed to: "02. Event Loops"
  11. title changed to: "Sockets not responding"
  12. type changed to: "Bug"