Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: IO::Socket doesn't detect lost TCP connections

by tjdmlhw (Acolyte)
on Sep 04, 2004 at 02:42 UTC ( [id://388473]=note: print w/replies, xml ) Need Help??


in reply to Re: IO::Socket doesn't detect lost TCP connections
in thread IO::Socket doesn't detect lost TCP connections

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?

  • Comment on Re^2: IO::Socket doesn't detect lost TCP connections

Replies are listed 'Best First'.
Re^3: IO::Socket doesn't detect lost TCP connections
by kscaldef (Pilgrim) on Sep 04, 2004 at 16:23 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://388473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-23 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found