To use WSAEventSelect and differentiate actions, you need to call WSAEnumNetworkEvents . Make sure that you process every reported event, not just the first one.
WSAAsyncSelect makes it easy to determine the cause and is often used with MsgWaitForMultipleObjects .
That way you can use WSAAsyncSelect instead of WSAEventSelect .
In addition, I think you have a fundamental misunderstanding of the difference between edge triggering and level triggering. Your reasoning is more about auto-reset vs manual-reset events.
source share