in reply to Windows socket timout code

I haven't tried this myself but the perldoc on IO::Socket::INET mentions a parameter on the constructor...
Timeout Timeout value for various operations
If you haven't already, try adding it to your connect...
my $sock = new IO::Socket::INET ( PeerAddr => "$hostip", PeerPort => "$hostport", Proto => 'tcp', Timeout => $TIMEOUT, );

Replies are listed 'Best First'.
Re^2: Windows socket timout code
by smack (Beadle) on Sep 04, 2004 at 12:08 UTC
    I did try that already... several times even. Can't get it to work. I read up on this a bit as well. It seems a lot of people have trouble getting any timeout method to work on sockets in windows. I have read that the alarm function is limited in windows.... maybe it just can't work with sockets? For now I am using Net::Ping to make sure the host exists first, but that is really ineffecient. Maybe I should use a module of some sort?

    Thanx for your reply =)

    smack
Re^2: Windows socket timout code
by smack (Beadle) on Sep 04, 2004 at 12:13 UTC
    another accidental posting, deleted =)
Re^2: Windows socket timout code
by smack (Beadle) on Sep 04, 2004 at 12:12 UTC
    accidental posting, deleted =)