]> andersk Git - moira.git/commitdiff
Turn on SO_KEEPALIVE.
authorzacheiss <zacheiss>
Thu, 14 Dec 2000 05:17:19 +0000 (05:17 +0000)
committerzacheiss <zacheiss>
Thu, 14 Dec 2000 05:17:19 +0000 (05:17 +0000)
lib/mr_connect.c

index 5077a5ce6d58d037be6ff2b474b228166f2b85c4..93c3b0cf092c350d11a89d5dc06183cc9012eb66 100644 (file)
@@ -140,6 +140,7 @@ int mr_connect_internal(char *server, char *port)
   char *host = NULL;
   int fd = SOCKET_ERROR;
   int ok = 0;
+  int on = 1; /* Value variable for setsockopt() */
 
   shost = gethostbyname(server);
   if (!shost)
@@ -177,6 +178,9 @@ int mr_connect_internal(char *server, char *port)
   if (fd < 0)
     goto cleanup;
 
+  if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&on, sizeof(int)) < 0)
+    goto cleanup;
+
   if (connect(fd, (struct sockaddr *)&target, sizeof(target)) < 0)
     goto cleanup;
 
This page took 0.192166 seconds and 5 git commands to generate.