in reply to threads hang
is hanging, and stoping the flow of the code. Is there someway to set a timeout on it, or wrap it in an eval?my $retval = `/usr/bin/snmpget -v1 -c <commstring> $ip sysDescr.0`;
Alarms don't work well in threads, but you could try running a parallel thread to act as a timer, and run the snmpget command thru a piped-open or IPC::Open3 so you get a pid that can be killed when the timer times out.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: threads hang
by Ryszard (Priest) on Jan 17, 2008 at 13:55 UTC | |
by zentara (Cardinal) on Jan 17, 2008 at 15:59 UTC | |
by Ryszard (Priest) on Jan 17, 2008 at 16:17 UTC |