<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Paul,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>pcap_loop won't give you any performance enhancement,
expecially at such a low packet rate (50pps is really really low).</FONT></DIV>
<DIV><FONT size=2>I think the bottleneck is the missing code that you commented
as "// walk through the radiotap and TCP/IP structures".</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have you tried just leaving the "++framecounter;"
statement?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=paul.heil@gmail.com href="mailto:paul.heil@gmail.com">Paul Heil</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, September 28, 2007 4:30
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] Which is
faster?</DIV>
<DIV><BR></DIV>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>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>