[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tcpdump-workers
Subject:    Re: [tcpdump-workers] libpcap & poll()
From:       Eloy Paris <peloy () chapus ! net>
Date:       2008-11-14 19:03:22
Message-ID: 20081114190322.GA18117 () chapus ! net
[Download RAW message or body]

Hi Gianluca,

On Fri, Nov 14, 2008 at 08:06:10AM -0800, Gianluca Varenni wrote:

>> Windows has select() but it is my understanding that you can't use it
>> on a packet capture descriptor. At least pcap_get_selectable_fd() is
>> not available on Windows, according to the pcap man page.
>
> True, select() on windows basically works on sockets only.
> The reason is that while on the various unix flavors select
> is a system call, on Windows it's a shim over the native
> WaitForSingleObject/WaitForMultipleObjects (as much as file
> descriptors are a shim over the native HANDLEs). The Windows folks
> decided to create this select shim over sockets, only.
>
> On Windows, you cannot get a selectable file descriptor to
> make a select() on, but you can call pcap_gethandle() and use
> WaitForSingleObject/WaitForMultipleObjects on it. In particular you
> can wait on multiple pcap_t handles by getting a waitable handle on
> each of them and then calling "WaitForMultipleObjects" on them.
>
> Hope it helps

This is very helpful; thanks for the info! It seems like there is hope
for a Windows port of my application ;-)

Cheers,

Eloy Paris.-
netexpect.org
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic