Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Answer: How can I make a client realize the server connection is gone?

by Zombie staticsea (Initiate)
on Apr 19, 2001 at 23:20 UTC ( #73942=categorized answer: print w/replies, xml ) Need Help??

Q&A > network programming > How can I make a client realize the server connection is gone? - Answer contributed by Zombie staticsea

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 Answer: How can I make a client realize the server connection is gone?
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-09-28 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (538 votes). Check out past polls.