Grover has asked for the wisdom of the Perl Monks concerning the following question:
It always gets stuck at this line: "$Socket->recv($Info{Data},16384) or next;" which happens when nothing is received back from the server. What do I have to do exactly to get it to time out? I have been working at this for the last 12 hours and it's beyond my ability to get it working. I will use any hack of a solution anyone can come up with, I am really desparate to get this working.my $Socket = new IO::Socket::INET ( Proto => "udp", PeerAddr => $Settings{ServerIP}, PeerPort => $Settings{ServerPort}, ); if ($Socket) { open (ERROR, ">/dev/null") or die $!; STDERR->fdopen(\*ERROR, "w") or die $!; $Socket->send($Settings{RCONCommand}) or next; $SIG{ALRM} = \&Timeout; print"."; eval { alarm (4); $Socket->recv($Info{Data},16384) or next; alarm (0); close $Socket; } } else { close $Socket; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket::INET $Socket->recv won't time out
by targetsmart (Curate) on Mar 13, 2009 at 07:01 UTC | |
by zwon (Abbot) on Mar 13, 2009 at 19:28 UTC | |
|
Re: IO::Socket::INET $Socket->recv won't time out
by zwon (Abbot) on Mar 13, 2009 at 19:19 UTC |