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 <[email protected]> wrote: > > On Nov 21, 2012, at 10:30 AM, "Joe Anello" <[email protected]> > 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 > [email protected] > https://www.winpcap.org/mailman/listinfo/winpcap-users >
_______________________________________________ Winpcap-users mailing list [email protected] https://www.winpcap.org/mailman/listinfo/winpcap-users
