in reply to Re^4: IO::Socket reconnect
in thread IO::Socket reconnect
The correct way to handle this is to do what golux (++) said.
Here is the sequence of events on failure:
* You attempt to SEND to the client
* Client has closed the socket
* The error is indicated to your program via a $SIG{PIPE}
* You need to trap that signal as golux suggested, and set the value of the global $b_err
* You check the value of $b_err before the next activity on the socket.
* IF triggered, close the client socket, and wait for the client to reconnect (Go back to "accept").
"Think of how stupid the average person is, and realize half of them are stupider than that." - George Carlin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: IO::Socket reconnect
by nikita.af (Acolyte) on Feb 18, 2016 at 12:52 UTC |