On Windows we've noticed an issue where killing a client process, and thus not going through the normal client shutdown process, will cause the crash monitor process to stay alive indefinitely, either due to a bug in Windows handling of unix domain sockets, or just taking longer than is reasonable to reap the resources of the killed process. This PR adds a simple stale_timeout to the Server::run to optionally check that each client connection has sent a message within the specified window, and if not, close the connection on the server side. To help, a Client::ping method has been added so that pings can be sent to server to indicate the client is still alive, in case the client is not sending messages frequently to the server to indicate it is still alive.
On Windows we've noticed an issue where killing a client process, and thus not going through the normal client shutdown process, will cause the crash monitor process to stay alive indefinitely, either due to a bug in Windows handling of unix domain sockets, or just taking longer than is reasonable to reap the resources of the killed process. This PR adds a simple
stale_timeout
to theServer::run
to optionally check that each client connection has sent a message within the specified window, and if not, close the connection on the server side. To help, aClient::ping
method has been added so that pings can be sent to server to indicate the client is still alive, in case the client is not sending messages frequently to the server to indicate it is still alive.