Overview
| Artifact ID: | a27c33ab7d74e5081b8464460a926f6be8b071e9 |
|---|---|
| Ticket: | 219023ffffffffffffffffffffffffffffffffff
Need nonblocking-while-creating sockets |
| User & Date: | nobody on 2000-10-26 01:09:34 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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 - foundin changed to: "final: 8.0.5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "63. (unused)"
- title changed to: "Need nonblocking-while-creating sockets"
- type changed to: "Bug"