[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:53:34 CDT 2013


Qian Hong <qhong at codeweavers.com> wrote:

> The above description implies two behaviors:
> A: 'The WSAAsyncSelect or WSAEventSelect routine automatically sets a
> socket to non-blocking mode'
> B:  'any attempt to use WSAIoctl to set the socket back to blocking
> mode will fail with WSAEINVAL'
> 
> Currently Wine's winsock implementation already respects the behavior
> B, but doesn't respect the behavior A. I can add a test to proof
> behavior B, is that enough?

I'd test it like the following:

1. create a socket
2. check that WSAIoctl works
3. call WSAAsyncSelect/WSAEventSelect
4. check that WSAIoctl fails
5. set the socket back to blocking mode using described technique
6. check that WSAIoctl works

of course checking for exact error codes and such.

-- 
Dmitry.



More information about the wine-devel mailing list