Hi,
I also have same problem.I didn't success to indicate when the socket close.
my code is:
FD_ZERO (&exp);
FD_SET (getSocket(), &exp);
selres = select(2, readerSet, NULL, &exp, getTimeout());
if(selres)
{
if (FD_ISSET(getSocket(), &exp))
{
return SOCKET_DISCONNECTED;
}
}
else
{
return NO_RECEIVE;
}
when the server close the socket, the selres get 0 and not 1.
maybe someone can help us.
Thanks,
Idan