Set SO_KEEPALIVE for all accept()ed sockets.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 25 Sep 2009 09:07:41 +0000 (12:07 +0300)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 25 Sep 2009 09:07:41 +0000 (12:07 +0300)
lib/silcutil/unix/silcunixnet.c

index 2332672d4643d125180f7923315020246153c51c..cdf382cbfa303f21c565ead575cdcd0a676b2e81 100644 (file)
@@ -115,6 +115,7 @@ SILC_TASK_CALLBACK(silc_net_accept)
 
   /* Set socket options */
   silc_net_set_socket_opt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
+  silc_net_set_socket_opt(sock, SOL_SOCKET, SO_KEEPALIVE, 1);
 
   /* Create socket stream */
   silc_socket_tcp_stream_create(sock, listener->lookup,