To my knowledge that is standard TCP socket behavior.
I did this:
run server on Windows
run client on Mac->connect to Win server
on Mac disable wi-fi while client is running
investigate client socket status on win server (it all reports normal as if connection is alive even though mac has broken connection)
I tried following codes for checking of any disconnect status:
Code:
int w=_socket.wait(0);
int err=WSAGetLastError();
Byte b;
Int l=_socket.receive(&b, 1);
l=::recv((SOCKET)_socket.s, (Char8*)&b, 1, MSG_PEEK);
int err2=WSAGetLastError();
int error=0; int size=SIZE(error);
int e=getsockopt((SOCKET)_socket.s, SOL_SOCKET, SO_ERROR, (Char8*)&error, &size);
but all appears normal.
So what I suggest is to every xx seconds send a message from client to server "I_AM_STILL_ALIVE".
And on the server check if any last message was received more than yy seconds ago, then manually disconnect that client.