]> andersk Git - moira.git/commitdiff
set keep alives if requested
authormar <mar>
Tue, 1 Dec 1992 11:51:46 +0000 (11:51 +0000)
committermar <mar>
Tue, 1 Dec 1992 11:51:46 +0000 (11:51 +0000)
gdb/gdb_conn.c

index cecc0b99bd798af0f327f9bb9e03157253cfb084..c819b3e88a723bb4bf6d36e6d9d66234ab7f718e 100644 (file)
@@ -291,6 +291,7 @@ char *id;
 {
        int peer;                               /* socket for talking to
                                                   peer */
+       int on = 1;                             /* flag for ioctl */
        struct sockaddr_in target;              /* build the peer address */
                                                /* here */
        struct hostent *peer_host;              /* host where peer is */
@@ -362,6 +363,13 @@ char *id;
                }
        }
 
+       if ((gdb_Options & GDB_OPT_KEEPALIVE) &&
+           setsockopt(peer, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0) {
+           gdb_perror("gdb: unable to start keepalives");
+           g_stop_with_errno(con);
+           return(TRUE);
+       }
+
        /*----------------------------------------------------------*/
        /*      
        /*      The connection has been made, fill in the connection
This page took 0.549514 seconds and 5 git commands to generate.