[Winpcap-users] How can i get the new-est packet frombuffer?HELPPLEASE~!

David Chang dchang at fsautomation.com
Mon May 25 22:59:01 PDT 2009


I don't think there is a way to get to the front of the queue to get the latest packet.  You have to sequentially read through the queue.

Can you explain what your application is doing?  When you say you want the newest packet, what does that mean (i.e. each packet received is the newest packet at that moment in time)?

DC
  ----- Original Message ----- 
  From: rst 
  To: winpcap-users at winpcap.org 
  Sent: Monday, May 25, 2009 10:17 PM
  Subject: Re: [Winpcap-users] How can i get the new-est packet frombuffer?HELPPLEASE~!


  Sorry, does it has another way to do this?
  my application do lots works,
  it can't get pakcets so fast.

  i hope i can only get the new-est packet,
  and others old packets not need.


  Thanks for your help.
    ----- Original Message ----- 
    From: David Chang 
    To: winpcap-users at winpcap.org 
    Sent: Tuesday, May 26, 2009 12:52 PM
    Subject: Re: [Winpcap-users] How can i get the new-est packet from buffer?HELPPLEASE~!


    Just keep calling pcap_next_ex.  It's a circular queue.  That is, new data is constantly being put in the queue.  Your application has to get the data out of the queue fast enough so that it doesn't drop packets.  If you don't take the data out of the queue fast enough (by calling pcap_next_ex), then it overwrites the oldest data.

    DC


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20090525/4c797366/attachment.htm 


More information about the Winpcap-users mailing list