FD_ZERO(&fdRdSet); //empty read set
FD_SET(iSocket, &fdRdSet); //add socket to read set
select(0, &fdRdSet, NULL, NULL, &tTimeout);
//if socket is readable
if (FD_ISSET(iSocket, &fdRdSet))
{
unsigned long iBytesPending;
ioctlsocket(iSocket, FIONREAD, &iBytesPending);
}
An iBytesPending value of zero should indicate a graceful disconnection by the server, correct?
- CheeseMonger
Graceful disconnection.
Lets say the server wants to disconnect gracefully and there is no pending data to be received by the client.
In the non-blocking client:
- CheeseMonger
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement