[Winpcap-users] How can i get the new-est packet from buffer? HELP PLEASE~!

Guy Harris guy at alum.mit.edu
Wed May 27 14:37:20 PDT 2009


On May 25, 2009, at 11:31 PM, rst wrote:

> There is a machine, It send packets to my application , and the  
> speed is fixed
> (about 200000 packets/per second = 0.000005 second for a packet),
> the packet include some informations, my application need the  
> informations to do realtime control.
>
> my application need 0.0001 second (0.1 ms) to finish a control loop,

...which means it cannot handle all of the packets, no matter how big  
the buffer.

You might try having one thread which reads packets and puts them into  
a buffer in your application, and another thread which takes packets  
from that buffer and processes them.  If the buffer is full, the first  
thread should discard packets from the beginning of the buffer until  
there's room for the new packet.


More information about the Winpcap-users mailing list