[Libwebsockets] Dealing with socket file descriptors >30000 on windows

Roger Light roger at atchoo.org
Thu Jan 29 11:26:03 CET 2015


On Thu, Jan 29, 2015 at 3:00 AM, Andy Green <andy at warmcat.com> wrote:

>  - arbitrary limit of 1024 is not really any good... in unix it's not set to
> 1024 you can control its fd limit from the parent process to be as few or a
> many as you like with ulimit.  1024 is just the default in some distros.  At
> least on Windows, you'd need to be able to set this number from outside (eg,
> info struct at context create, or maybe env var or whatever "this is not
> ulimit" scheme Microsoft created to be different with)

According to the MSDN documentation for WSAWaitForMultipleEvents[1]
the maximum number of events that you can wait for at once is
WSA_MAXIMUM_WAIT_EVENTS. This is defined in winsock2.h to be
MAXIMUM_WAIT_OBJECTS, which is defined in winnt.h to be 64, at least
on the version that I have.

WSAPoll()[2], which is very similar to poll(), gives you a limit of
1024 sockets but see[2]. If you want more, I believe the only option
is the IO completion API which is significantly different to
select/poll etc.

Cheers,

Roger

[1] https://msdn.microsoft.com/en-us/library/aa922422.aspx
[2] https://msdn.microsoft.com/en-us/library/windows/desktop/ms741669%28v=vs.85%29.aspx
[3] http://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/



More information about the Libwebsockets mailing list