I found the answer to my problem. I needed to eval whether a response was received in an amount of time and escape out if not.
eval { local $SIG{ALRM} = sub { die 'Timed Out'; }; alarm 1; #receive response $handle->recv($newmsg, 1024) or die; $packet = Net::DHCP::Packet->new($newmsg); $data = $packet->toString(); close $handle; alarm 0; }; close $handle;
In reply to Re^2: UDP Client Multiple servers
by adwald
in thread UDP Client Multiple servers
by adwald
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |