Hi,

I've this piece of code on my Server, which tries to understand if a certian Client has sent data of has closed his socket.

Code:
WSAEVENT hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
	ret = WSAEventSelect(m_client, hEvent, FD_READ | FD_CLOSE);

	do 
	{
		DWORD dReturn = WaitForSingleObject(hEvent, INFINITE);

		int r = recv(m_client, sData, 64, 0);

		printf("Status: %d\n", dReturn);
	} while(true);
the value of 'dReturn' always equals ZERO and my question is:

How can I distinguish between: FD_READ to FD_CLOSE ??

Thanks