ActiveState Powered by ActiveState

ActiveState Community


How to detect socket closed condition

Posted by zpg on 2008-04-09 10:23
OS: All / Any

While in the middle of puts to a client socket, and the client went away, it seems the puts got hung.

How do you detect such a condition under TCL? On Unix, you normally get EPIPE signal to get out of this situation. Is there something similar in TCL?

jeffh | Sun, 2008-05-25 16:03

Tcl has an [eof] command for this case. You can also use non-blocking sockets to prevent the script from hanging, although you need to check that the communication is also going through.

-->