Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Stupid IO::select questionby BlaisePascal (Monk) |
on Aug 03, 2000 at 21:08 UTC ( [id://26029]=perlquestion: print w/replies, xml ) | Need Help?? |
BlaisePascal has asked for the wisdom of the Perl Monks concerning the following question:
Here's the thing...
I've got a socket, created with IO::Socket::INET, that I've registered with an IO::select object. I'm writing to the socket using the following code: I only have one socket registered with the select, so it only writes to the one socket. This code works fine, except... The server I'm talking to has the annoying habit of terminating the connection with no warning. When that happens, the $select->can_write() is not blocking, but immediately returns the one registered socket (which was closed from the other end), and the print fails. Is can_write() supposed to return a handle that I clearly cannot write to? If so, what suggestions can I get for bulletproofing my code?
Back to
Seekers of Perl Wisdom
|
|