WSAPoll() was fixed in Windows 10 2004 according to MSDN:
https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll
However, there really isn't much of a reason to use WSAPoll() over select() in
Windows...with one caveat.
In Windows, select() functions more like poll() than select(). fd_set in
Windows is an array of handles rather than an array of bits. Although there is
the FD_SETSIZE macro, the fd_set structure is actually considered to be
variable-sized by the OS.
If you create a structure in memory that looks like this:
struct MyFdSet
{
u_int fd_count;
SOCKET fd_array[];
};
you can use any number of sockets, regardless of the value you #define
FD_SETSIZE to. This makes Windows select() very much like poll(), with the
biggest differences in the way that the socket status is reported:
read/write/exception instead of all those POLL* flags.
So rather than using WSAPoll(), I'd say we'd be better off using a poll()-like
design that calls select().
From: curl-library <[email protected]> On Behalf Of Howard Chu
via curl-library
Sent: Wednesday, July 6, 2022 3:04 AM
To: libcurl development <[email protected]>
Cc: Howard Chu <[email protected]>
Subject: Re: WSAPoll() anyone?
Gisle Vanem via curl-library wrote: > Daniel Stenberg wrote: > >> Is there a
compelling reason to switch over to WSAPoll()? >> >> It took a long time before
we found that poll issue the last time. If there is an edge
Gisle Vanem via curl-library wrote:
> Daniel Stenberg wrote:
>
>> Is there a compelling reason to switch over to WSAPoll()?
>>
>> It took a long time before we found that poll issue the last time. If there
>> is an edge case still where they aren't compatible, I can imagine it won't
>> be easy
>> to reproduce but might introduce strange hard-to-debug side effects down the
>> line.
>
> I would just like to hear if other Windows users here have
> an opinion or what experience they have with 'WSAPoll()'.
> It can't b that bad still?
That doesn't sound like a reason to make a change. If it ain't broke don't fix
it.
>
>> Since we don't know in which Windows version the function was fixed, we
>> might still have curl users with broken WSAPoll implementations - even if
>> more recent
>> versions work better.
>
> That would be a problem, yes.
>
--
-- Howard Chu
CTO, Symas Corp.
https://urldefense.com/v3/__http://www.symas.com__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9iRLAAq0$<https://urldefense.com/v3/__http:/www.symas.com__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9iRLAAq0$>
Director, Highland Sun
https://urldefense.com/v3/__http://highlandsun.com/hyc/__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9rjYRdg3$<https://urldefense.com/v3/__http:/highlandsun.com/hyc/__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9rjYRdg3$>
Chief Architect, OpenLDAP
https://urldefense.com/v3/__http://www.openldap.org/project/__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9gCJ8Qqv$<https://urldefense.com/v3/__http:/www.openldap.org/project/__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9gCJ8Qqv$>
--
Unsubscribe:
https://urldefense.com/v3/__https://lists.haxx.se/listinfo/curl-library__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9llL0O4A$<https://urldefense.com/v3/__https:/lists.haxx.se/listinfo/curl-library__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9llL0O4A$>
Etiquette:
https://urldefense.com/v3/__https://curl.se/mail/etiquette.html__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9v2RbSOi$<https://urldefense.com/v3/__https:/curl.se/mail/etiquette.html__;!!Ci6f514n9QsL8ck!gHtVvEeyBO_hMVoDYAGHeX1NyuwDPwZmiHKzH4CSVUqgVquuGJn0Idvd9tlArOukYkNDpR0u1fhVjI8BYkqR9v2RbSOi$>
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html