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

joe kibz chikabanga2005 at yahoo.com
Sat May 13 12:31:31 GMT 2006


Reply :

Gianluca , thank, i tried it, i see what you mean . In the capture loop , the UI tends to go dead and unresponsive to clicks and stuff . I think i'll do it the thread way . 

Gianluca Varenni <gianluca.varenni at cacetech.com> wrote: 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 ." 
To: 
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 
>>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


		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060513/e1ee8846/attachment.htm


More information about the Winpcap-users mailing list