[Winpcap-users] Portable way of implementing the reading of several interfaces with Pcap/WinPcap

Asier Martínez axierr at gmail.com
Mon May 27 07:26:55 PDT 2013


Hello,
I'm trying to achieve a portable way of reading from multiple pcap devices
in non blocking.
As far as I know, on Windows select() function it's nos usable with Winpcap
because there is no file descriptor for that purposes available into the
library, and this functionality must be implemented obtain a win32 HANDLE
with pcap_getevent() and wait on it with
WaitForSingleObject/MultipleObjects(Ex).
I was thinking on doing it with a for iterating over all interfaces and
sleep function with pcap_dispatch and pcap in non blocking mode, but
probably this approach isn't very performance wise.

On the other hand, I read on release changelog on Winpcap.org:

Version 3.01 alpha

   - pcap_fileno returns a valid description also in case of a remote
   capture, so that the'select()' function can be used to check if packets
   are waiting to be read

 So I'm a little bit confused.

¿What is the most portable ( and correct ) approach to read from multiple
interfaces with winpcap ?
pcap_fileno returns a valid descriptor or not?

Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winpcap.org/pipermail/winpcap-users/attachments/20130527/0a95927a/attachment.html>


More information about the Winpcap-users mailing list