What is the best way to implement a heartbeat in C++ to check for socket connectivity? -


Hey gang I wrote to the client and server in C ++ using CS / socket, I should handle that situation Where the client is still active but the server is down one suggestion has been made to use a heartbeat to stress connectivity from time to time. And if any y does not try to reconnect for time every x seconds, and then to finish the time.

Is this the best way to check "heartbeat" connectivity?

The socket I am using may contain information, is there a way to check that there is a connection of disturbances without buffer?

Here is one that defines some of the reasons for TCP Can use for; It describes how to configure your socket to use TCP coup at runtime.

It seems that you can enable the TCP Container in Windows Sockets by using SIO_KEEPALIVE_VALS by using the function.

P> If you are using UDP sockets on IP then you will need to make your heart beat in your protocol.


Comments