[Winpcap-users] SPAM: Re: Telling the difference between devices

Vasanth Neel vsn.vasanth at gmail.com
Thu Nov 22 00:30:12 PST 2012


Hello Everyone,

I am having the same issue on windows when i snif multiple ports that my
applicaiton loss huge packet loss.

i have used two pcap_next_ex for each handle in a single thread to read
packet from each interface.

How to use the WaitForMultipleObjects here, any sample code will be
appreciated.

Thanks Much
On Thu, Nov 22, 2012 at 12:55 AM, Guy Harris <guy at alum.mit.edu> wrote:

>
> On Nov 21, 2012, at 10:30 AM, "Joe Anello" <joe.anello at roadrunner.com>
> wrote:
>
> > Thanks for that tidbit.  I was away for a couple of days and just figured
> > that out a little while ago, so thanks for the confirmation.
> >
> > I've gotten a few replies from folks who have suggested that simultaneous
> > capture on multiple ports doesn't work, but that has me very confused...
>
> I think *they're* confused.
>
> The pcap APIs aren't thread-safe in the sense that a given pcap_t * handle
> can be manipulated in more than one thread at a time; there are no locks on
> pcap_t's to prevent collisions if you do that.
>
> However, as long as you have a separate thread for each pcap_t * handle,
> you can capture from more than one pcap_t * handle at a time.
>
> In addition, you could do all the capturing in a single thread, with a
> wait loop that uses select()/poll()/epoll()/kqueues on UN*X or
> WaitForMultipleObjects()/MsgWaitForMultipleObjects() on Windows, although
> that means that you don't make use of multiple processors/processor cores.
> _______________________________________________
> 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/20121122/2fe3379c/attachment.html>


More information about the Winpcap-users mailing list