How can I detect that a client has disconnected from my server?
I have the following code in my AcceptCallBack method
AcceptCallBack
static Socket hand
i had same problem , try this :
void client_handler(Socket client) // set 'KeepAlive' true { while (true) { try { if (client.Connected) { } else { // client disconnected break; } } catch (Exception) { client.Poll(4000, SelectMode.SelectRead);// try to get state } } }