how can i check that current state of a socket? if its connected or not
i have multiple clients on a server and i want to check if client X is still connected or not
how can i check that current state of a socket? if its connected or not
i have multiple clients on a server and i want to check if client X is still connected or not
The easiest way is to send across some data every so often and see if the client responds.
If you send to the socket and it returns error 10057 WSAENOTCONN then you know that the socket is not connected.
More details on error handling can be found here;
Winsock error handling