| perl coder 2004-03-19, 12:55 pm |
| Malcolm Dew-Jones said:
>: alarm($previous_alarm);
>
> This restores the original alarm handler.
I just don't see the use. Sorry if I'm dense. :-) I'm trying to
understand and make sure I'm not missing something important...
The module itself doesn't use alarm() internally. And since each child
is forked, they all get their own independant alarm timer (I think?)
So why bother with saving the original timer... Unless maybe you're
using one of the non-forking Net::Server personalities. But the example
code uses Net::Server::PreFork...
> You might also ask yourself
> what happens if there are no lines of stdin at all.
Ok, I checked this... I commented out the final alarm() call, and it
still times out after 30 seconds. You can connect to the port and just
sit there and 30 sec later, the connection is closed.
Same thing happens if you type a line (or even just hit enter) after
connecting to the port. 30 sec after you sent your line, connection
is closed.
--
No crazy stuff in my email. ;-)
|