session CHANGE enable keep-alive on server/client sockets
diff --git a/src/session_client.c b/src/session_client.c
index f79182b..aed5ad2 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -930,6 +930,15 @@
             return -1;
         }
 
+        /* enable keep-alive */
+        i = 1;
+        if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &i, sizeof i) == -1) {
+            ERR("Setsockopt failed (%s).", strerror(errno));
+            close(sock);
+            freeaddrinfo(res_list);
+            return -1;
+        }
+
         /* we're done, network connection established */
         break;
     }