http://www.perlmonks.org?node_id=73942


in reply to How can I make a client realize the server connection is gone?

I found another solution after reading through the Unix Socket FAQ. At the beginning of the loop I do:
my $error_code = $socket->sockopt(SO_ERROR);
On FreeBSD this returns a value other than zero if there has been an error on the socket, so I am able to trap that and exit gracefully if an error occurs on the socket.
  • Comment on Re: How can I make a client realize the server connection is gone?
  • Download Code