Shvalb
November 3rd, 2008, 07:29 AM
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.
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
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.
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