> Just to spell it out: the problem shown in my testcase, is only
> exibited with overlapped sockets. Non-overlapped don't have any
> problem. Which is strange to me, since MSDN makes no mention of
> situations where setsockopt() can block.
Erm... I tested your testcase and I can reproduce the hang only when
using NON-overlapped sockets created with WSASocket(..., 0).
It works fine with overlapped sockets created with select or
WSASocket(..., WSA_FLAG_OVERLAPPED). I assume the above is just a
typo?