Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7e32896b18a7480396933878288f1499777ec889
Ticket: 478565ffffffffffffffffffffffffffffffffff
fconfigure -sockname performance issue
User & Date: nobody on 2001-11-06 05:25:50
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    On Windows NT 4.0 SP6a with Tcl 8.3.2, using fconfigure -sockname on a server socket can 
    cause 
    a 10-20 second delay depending upon the system configuration.
    
    The following code snippet illustrates the behavior:
    
    proc ServerAccept { cid addr port } {
        return
    }
    set sock [socket -server ServerAccept 0]
    puts "socket: $sock"
    set data [fconfigure $sock -sockname]
    puts "DATA: $data"
    
    fconfigure -sockname triggers a call to gethostbyaddr() on the local IP address, 0.0.0.0 in this 
    case.  On NT 4.0 (but not Windows 2000 or UNIX), this leads to a 10-20 second delay while the 
    gethostbyaddr() call times out.
    
    Although this is actually an NT issue and not a Tcl one, a simple workaround in the Tcl code would 
    be to avoid the gethostbyaddr() call if the IP address is 0.0.0.0 on NT 4.0.  A workaround for the 
    end user with the current code is to add a line to c:\winnt\system32\drivers\etc\hosts:
    
    0.0.0.0  0.0.0.0
    
  4. foundin changed to: "obsolete: 8.3.2"
  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: "24. Channel Commands"
  10. title changed to: "fconfigure -sockname performance issue"
  11. type changed to: "Bug"