Two pennies from my side:
- to check if a socket gets connected in general, one may set a write
event on it.
(works well on Unix)
- I suppose your readable event gets called due to a read error.
set error [fconfigure $id -error]
switch $error {
"" { #ok
}
"connection time out" - "connection refused" { # react on error }
default { # generic error }
}
This snipped is from the IMHO brilliant book (but from a write event
error handler):
http://wiki.tcl.tk/27614
-Harald