alarm and pcap::loop
- From: michael.gale@xxxxxxxxxxxxxxxx (Michael Gale)
- Date: Sun, 28 Aug 2005 16:01:30 -0600
Hello,
I am having a problem with the following piece of code:
Current Net::Pcap is setup to have a capture limit of 1. So if 1 packet is received my script exits and prints the message "time out did not occure. But if a packet arrives after the timeout it prints "time out occured".
But with use of the alarm function, should it not be exiting after 10 seconds even if a packet has not been received ??
--snip-- &packet_cap_setup(); eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm 10; Net::Pcap::loop($pcap_t, 1, \&packet_cap_process, 'dhcp'); alarm 0; } ; if ($@) { die unless $@ eq "alarm\n"; print "Time out occured\n"; } else { print "Time out did not occue\n"; } &packet_cap_close(); --snip--
Thanks
Michael .
- Follow-Ups:
- Re: alarm and pcap::loop
- From: Michael Gale
- Re: alarm and pcap::loop
- Prev by Date: RE: Directory Size
- Next by Date: Re: alarm and pcap::loop
- Previous by thread: File downloads when I try mod_perl redirect
- Next by thread: Re: alarm and pcap::loop
- Index(es):
Relevant Pages
|
|