[Winpcap-users] pcap_dispatch not working as expected

Holger Steinhaus hsteinhaus at gmx.de
Mon Mar 5 08:52:35 PST 2012


On my network, there are cyclic broadcasts with a period of 1 second.
After opening a live capture with to_ms=0, I am calling pcap_dispatch
with cnt=1 in a loop. 

After reading the pcap_dispatch documentation, I would expect my
callback to be called more or less exactly once per second, as soon as a
packet arrives. This is also the behavior I see with pcap under Linux.

On Windows with WinPcap, for the first 10...20 seconds nothing happens,
the call of pcap_dispatch simply blocks. Then, within milliseconds, my
callback is called 10..20 times, each with one packet received in
between.

Is this behavior intended?

Regards,
  Holger





More information about the Winpcap-users mailing list