Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a27c33ab7d74e5081b8464460a926f6be8b071e9
Ticket: 219023ffffffffffffffffffffffffffffffffff
Need nonblocking-while-creating sockets
User & Date: nobody on 2000-10-26 01:09:34
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 4000 RFE
    Version: 8.0.5
    SubmitDate: '2000-01-10'
    LastModified: '2000-01-10'
    Severity: LOW
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Windows 95
    FixedDate: '2000-01-10'
    FixedInVersion: 8.2
    ClosedDate: '2000-10-25'
    
    
    Name:
    Kerem HADIMLI
    
    Extensions:
    Pure Tcl 8.0.5 with no extensions
    
    DesiredBehavior:
    Any way to create sockets that are like -async switch (socket creation/connection doesn't block), but understand whether if the socket can connect or not?
    Because I have to use blocking-while-connecting sockets (which are BAD), to understand if the socket can connect or not.
    
    thanks,
    Kerem 'Waster_' HADIMLI
    
    
    
    Note from the newsgroup:
    
    It IS possible to check the connection status of an asynchronous
    socket:
    
         set sock [socket -async $host $port]
         fileevent $sock readable "getConnectState $sock"
         fileevent $sock writable "getConnectState $sock"
    
         proc getConnectState {sock} {
             fileevent $sock readable ""
             fileevent $sock writable ""
    
             set connectState [fconfigure $sock -error]
             if {[string compare $connectState ""] == 0} {
                 puts "connected to server"
             } else {
                 close $sock
                 puts "connection failed"
             }
         }
    
    This solution works well on UNIX.  On Windows it works with Tcl 8.2 or
    higher, because the fileevent command was not implemented properly in
    earlier versions of Tcl under Windows.  You should upgrade to Tcl 8.2.3
    (or 8.3b1).
    
    --
    Csaba Nemethi   http://www.nemethi.de   mailto:[email protected]
     
    -- 01/10/2000 hobbs
    
  4. foundin changed to: "final: 8.0.5"
  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: "63. (unused)"
  10. title changed to: "Need nonblocking-while-creating sockets"
  11. type changed to: "Bug"