apply tcp keepalive to serving sockets

This commit is contained in:
James F. Carter
2018-01-10 13:49:22 +00:00
parent 24f1e62a73
commit 1d5b315f17
4 changed files with 49 additions and 0 deletions

View File

@@ -422,6 +422,9 @@ void accept_nbd_client(
int slot;
char s_client_address[64] = {0};
FATAL_IF_NEGATIVE( sock_set_keepalive_params( client_fd, CLIENT_KEEPALIVE_TIME, CLIENT_KEEPALIVE_INTVL, CLIENT_KEEPALIVE_PROBES),
"Error setting keepalive parameters on client socket fd %d", client_fd );
if ( !server_should_accept_client( params, client_address, s_client_address, 64 ) ) {
FATAL_IF_NEGATIVE( close( client_fd ),