[Winpcap-users] Beginner questions

Gianluca Varenni gianluca.varenni at cacetech.com
Thu Jun 14 16:26:41 GMT 2007


----- Original Message ----- 
From: <ceo at triplebit.com>
To: <winpcap-users at winpcap.org>
Sent: Saturday, June 09, 2007 12:29 AM
Subject: Re: [Winpcap-users] Beginner questions


>
> Thanks GV,
>
>> 2. Is pcap_open_live supported on XP and Vista?
>>
>> --GV--
>> Yes. Are you encountering problems with this API?
>
> No , I just misunderstood that from the doc.
>
> Can I use pcap_loop in a secondary thread?

Yes. Just be very careful not to touch the pcap_t handle from two threads 
concurrently. Why do you want to open a pcap_t handle on a thread and read 
the packets on another one?

What about the callback handle, I
> believe it would belong to the same thread.

The callback function is called in the same thread as pcap_loop. It's 
actually called internally by pcap_loop itself.

> Is it common in Windows programming?

Uhm... there are Win32 apis that work in the same way. I don't know if it's 
common practice. Personally I don't like pcap_loop and pcap_dispatch at all, 
as they don't give me an easy method to stop the capture. I usually strongly 
suggest to use pcap_next_ex to receive packets.

Have a nice day
GV

> Regards
>
> I. lesher
>
> _______________________________________________
> 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