[PATCH] ws2_32: Automatically sets a socket to non-blocking mode when WSAAsyncSelect or WSAEventSelect is called.

Dmitry Timoshkov dmitry at baikal.ru
Mon May 20 06:02:43 CDT 2013


Qian Hong <qhong at codeweavers.com> wrote:

> Thanks for the comment, actually I already guess you will point out it
> requires a test :)
> 
> There is no win32 api to detect whether a socket is blocking or
> non-blocking, do you have any advice how to test it in our Wine test
> framework?

http://stackoverflow.com/questions/5489562/in-win32-is-there-a-way-to-test-if-a-socket-is-non-blocking
seems to confirm that.

MSDN page you referenced has a hint how this behaviour could be tested:

"The WSAAsyncSelect or WSAEventSelect routine automatically sets a socket
to non-blocking mode. If WSAAsyncSelect or WSAEventSelect has been issued
on a socket, then any attempt to use WSAIoctl to set the socket back to
blocking mode will fail with WSAEINVAL. To set the socket back to blocking
mode, an application must first disable WSAAsyncSelect by calling WSAAsyncSelect
with the lEvent parameter equal to zero, or disable WSAEventSelect by calling
WSAEventSelect with the lNetworkEvents parameter equal to zero."

-- 
Dmitry.



More information about the wine-devel mailing list