[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Hang with MHD_OPTION_THREAD_POOL_SIZE on Windows
From: |
Jonathan McDougall |
Subject: |
Re: [libmicrohttpd] Hang with MHD_OPTION_THREAD_POOL_SIZE on Windows |
Date: |
Sun, 9 Dec 2018 13:47:11 -0500 |
On 12/9/18, Evgeny Grin <address@hidden> wrote:
> Why do you this that flag WSA_FLAG_OVERLAPPED should fix something?
> Looking at documentation, it should change nothing to non-overlapped I/O.
> https://docs.microsoft.com/en-us/windows/desktop/winsock/overlapped-i-o-and-event-objects-2
Most of my previous message was an attempt at explaining this, so I'll
have to repeat a few things.
Your link doesn't mention non-blocking sockets because it's specifically
about overlapped I/O. The article about overlapped vs. non-blocking
says[1]:
Although the current Winsock implementation requires
overlapped I/O attribute for nonblocking socket mode, [...]
It refers to another support article, #179942, but it's a 404. A google
search of its title finds a cached version, which says[2]:
The Winsock 2 socket flag WSA_FLAG_OVERLAPPED needs to be
set if the socket will be used in non-blocking mode when
running on Windows NT 4.0. Failure to set this flag can
result in subsequent Winsock API failure.
[...] If the socket will be set to non-blocking mode (on
Windows NT 4.0), the socket must also be created with its
overlapped attribute set, even if no overlapped I/O will
be performed with the socket.
Regarding the mentions of Windows NT 4.0, I don't see a date on the
article, but it talks about the differences between Windows 95 and NT
4.0, so I'd guess it was written in 1996-1997, at a time when the kernel
was different between these two versions. Since Windows has been using
the NT kernel since XP, I assume this article still applies to recent
versions.
These two articles, combined with other bits of information I found in
my other post, plus the fact that it does solve all the symptoms, leads
me to believe that the flag is mandatory for non-blocking sockets, even
if no overlapped I/O is performed.
[1]
https://support.microsoft.com/en-ca/help/181611/socket-overlapped-i-o-versus-blocking-nonblocking-mode
[2] http://www.voidcn.com/article/p-cabdrnfn-sp.html
--
Jonathan McDougall