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
Printable View
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
If you use your own protocol for the client-server application, then you can add in a functionality in both client and server side to perform "ping" when the client is idle.
For example: TELNET protocol has Are You There (AYT) command.
http://support.microsoft.com/kb/231866
As explained by xander_tan, create some communication protocol to test your client server protocol.
thia is the only way....
thanks for the help :)
recv() function returns 0 when the connection was closed.