Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Timing-out network clients?by erroneousBollock (Curate) |
on Dec 03, 2007 at 02:12 UTC ( [id://654494]=note: print w/replies, xml ) | Need Help?? |
IO::Socket::INET's timeout method (or the Timeout hash-param to the constructor) won't do what you want here. That timeout value corresponds to how long the socket should wait for acknowledgment from the peer when it has sent data (or is trying to connect). You definitely do need some sort of "global timer". You're forking, so it's probably as simple as:
I recommend putting the listening socket into an IO::Select object, then adding calls to Timer::HiRes::usleep in your while loop. -David
In Section
Seekers of Perl Wisdom
|
|