[Winpcap-users] Re: breaking out of a pcap_next_ex() loop

Gubrush . vga_planets at hotmail.com
Mon May 15 09:02:53 GMT 2006


Hi

It was a little late on friday for me as well. Didnt realize what he did. 
Except pcap_breakloop is working as intended for my use.

I didn't know pcap_breakloop was bad, if it is, then why is it there? :)

It solves my problems of stopping captures when I want them to stop.


>From: "Gianluca Varenni" <gianluca.varenni at cacetech.com>
>Reply-To: winpcap-users at winpcap.org
>To: <winpcap-users at winpcap.org>
>Subject: Re: [Winpcap-users] Re: breaking out of a pcap_next_ex() loop
>Date: Fri, 12 May 2006 08:55:08 -0700
>
>Well, pcap_breakloop would work but, as I wrote in the other mail, the UI 
>is not responsive since it's stuck receiving packets in the 
>"onButtonCapture" handler...
>
>In any case, I usually prefer not to use "pcap_breakloop". This API is 
>there mainly to interrupt a pcap_loop or pcap_dispatch call, if you use 
>pcap_next_ex you don't have the problem of breaking the internal loop of 
>"pcap_loop" or "pcap_dispatch", because you explicitely create the loop 
>surrounding pcap_next_ex.
>
>Have a nice day
>GV
>
>
>
>
>----- Original Message ----- From: "Gubrush ." <vga_planets at hotmail.com>
>To: <winpcap-users at winpcap.org>
>Sent: Friday, May 12, 2006 7:53 AM
>Subject: RE: [Winpcap-users] Re: breaking out of a pcap_next_ex() loop
>
>
>>Hi
>>
>>How about pcap_breakloop( pointer_to_handle );
>>
>>http://www.winpcap.org/docs/docs31/html/group__wpcapfunc.html#ga15
>>
>>
>>
>>>From: joe kibz <chikabanga2005 at yahoo.com>
>>>Reply-To: winpcap-users at winpcap.org
>>>To: winpcap-users at winpcap.org
>>>Subject: [Winpcap-users] Re: breaking out of a pcap_next_ex() loop
>>>Date: Fri, 12 May 2006 05:53:59 -0700 (PDT)
>>>
>>>problem:
>>>
>>>   here's my code in brief:
>>>
>>>   void CButton::onButtonCapture(){
>>>
>>>   open a device handle;
>>>
>>>   while(pcap_next_ex())//capture packets;
>>>
>>>   }
>>>
>>>   ?How do i break out or stop a pcap_next_ex() loop whenever i want ?
>>>   ?How does the timeout value in pcap_next_ex() parameters work ?
>>>
>>>
>>>   joe
>>>
>>>
>>>---------------------------------
>>>Yahoo! Mail goes everywhere you do.  Get it on your phone.
>>
>>
>>>_______________________________________________
>>>Winpcap-users mailing list
>>>Winpcap-users at winpcap.org
>>>https://www.winpcap.org/mailman/listinfo/winpcap-users
>>
>>
>>_______________________________________________
>>Winpcap-users mailing list
>>Winpcap-users at winpcap.org
>>https://www.winpcap.org/mailman/listinfo/winpcap-users
>
>_______________________________________________
>Winpcap-users mailing list
>Winpcap-users at winpcap.org
>https://www.winpcap.org/mailman/listinfo/winpcap-users




More information about the Winpcap-users mailing list