I'm having performance issues with pcap_next_ex() and I was wondering if it was any faster to use pcap_loop() with a dispatch function?<br>The frames I want to capture are only 24 bytes, but I want to be able to count all of them if they arrive at 50 frames per second. Wireshark has no trouble seeing them all, but I only count around 90%
<br><br>What I'm doing now looks like this:<br><br>PcapInit()<br>{<br> pcap_open( timeout = 100ms );<br> pcap_compile();<br> pcap_setfilter();<br> pcap_setmintocopy( 128 bytes );<br>}<br>ListenThread()<br>{<br>
// listen for 10 seconds after that, m_bListening is set to false by another thread<br> while( m_bListening == TRUE && pcap_next_ex( pcapHandle, &pkt_header, &pkt_data ) >= 0 )<br> {<br> // walk through the radiotap and TCP/IP structures getting the data and
<br> // statistics I want from the captured frames.<br> ++framecounter;<br> }<br>}<br><br>Thanks,<br>PaulH<br>