This is one of the first things that I tried. The return value is true and the $! returns blank on the first print. Thanks for the suggestion though, keep them coming.
A search of Google turned up an article about $SIG(PIPE) as being a way of determining if a connection is lost, but I don't know how to use this. Is anyone familiar with the $SIG(PIPE)? Could it be a solution to the problem?
| [reply] |
Your process will get a SIGPIPE if you attempt to write to a socket that is closed. However, the default action for SIGPIPE is to terminate your process (with no error message!), so that probably isn't what's happening to you. However, that's not to say that it probably wouldn't be a good idea to set up a SIGPIPE handler to prevent this in the future.
If you are not familiar with this stuff already, then you might want to get your hands on Stein's book on network programming in Perl, and Stevens on Unix network programming.
| [reply] |