<div dir="ltr">Hello,<div style>I'm trying to achieve a portable way of reading from multiple pcap devices in non blocking.</div><div style>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 <span style="color:rgb(0,0,0)">obtain a win32 HANDLE with pcap_getevent() and wait on it with WaitForSingleObject/MultipleObjects(Ex).</span></div>
<div style><font color="#000000">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.</font></div>
<div style><font color="#000000"><br></font></div><div style><font color="#000000">On the other hand, I read on release changelog on Winpcap.org:</font></div><div style><font color="#000000"><br></font></div><h1 style="margin:0px;padding:0px;height:auto;font-size:17px;line-height:19px;color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif">
Version 3.01 alpha </h1><ul style="margin:0px 0px 20px 35px;padding:0px;height:auto;list-style:none;color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:13.333333015441895px"><li style="margin:0px;padding:0px;height:auto;list-style:disc;font-size:13px;line-height:17px">
<tt style="margin:0px;padding:0px;height:auto">pcap_fileno</tt> returns a valid description also in case of a remote capture, so that the<tt style="margin:0px;padding:0px;height:auto">'select()'</tt> function can be used to check if packets are waiting to be read</li>
</ul><div style><font color="#000000"> So I'm a little bit confused. </font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">¿What is the most portable ( and correct ) approach to read from multiple interfaces with winpcap ?</font></div>
<div style><font color="#000000">pcap_fileno returns a valid descriptor or not?</font></div><div style><font color="#000000"><br></font></div><div style><font color="#000000">Thanks,</font></div><div style><font color="#000000"><br>
</font></div></div>