chris2 has asked for the wisdom of the Perl Monks concerning the following question:

Hi perlmonks, I need some guidance to a new found problem I'm having, I wrote a perl script to calculate uptime of our local services using IO::Socket, now it's been expanded to check services on multiple systems in our branch offices. Problem is IO::Socket seems to be hanging on it at varrying times, sometimes after just a few requests, other times after a couple thousand. I am currently using a timeout of 45 on the socket and I can't use an alarm because it's running on NT. Is there any way to get IO::Socket to stop hanging?? -Thanks in advance Chris Miseresky Teslianet Inc.

Replies are listed 'Best First'.
Re: IO::Socket crapping out
by chromatic (Archbishop) on Apr 05, 2001 at 01:44 UTC
    It's hard to diagnose this without example code. If it's the socket that's hanging, you might look into setting 'reuse' in the constructor.

    If the socket is blocking for input, you might look into the four-argument form of select, or even IO::Select, which will let you determine your own wait limits.

    Without error messages and code, a guess is the best I can do. (With messages and example code, it's still probably the best I can do. :)