zimboloo has asked for the wisdom of the Perl Monks concerning the following question:
The filter was specifically written as to NOT capture stuff... In other words: I'm trying to write a bit of code that forces a timeout. A timeout never happens. If I put a filter in there that actually matches stuff, I can get Net::Pcap::Easy to work just fine.my $pcap_device='eth0'; my $pcap = Net::Pcap::Easy-> new( dev => $pcap_device, filter => 'port 6653', packets_per_loop => 1, timeout_in_ms => 1, promiscuous => 0, tcp_callback => sub { $tcp_total++; print "tcp seen\n"; }, udp_callback => sub { $udp_total++; print "udp seen\n"; }, ); while ( 1 ) { $pcap->loop; print "oink\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: no timeout in Net::Pcap::Easy
by VinsWorldcom (Prior) on Mar 27, 2014 at 17:24 UTC |