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?
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.