Index: jk_connect.c
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v
retrieving revision 1.3
diff -u -3 -r1.3 jk_connect.c
--- jk_connect.c	4 Jul 2001 16:59:38 -0000	1.3
+++ jk_connect.c	22 Jun 2002 15:48:48 -0000
@@ -109,6 +109,7 @@
 
 int jk_open_socket(struct sockaddr_in *addr, 
                    int ndelay,
+                   int keepalive,
                    jk_logger_t *l)
 {
     int sock;
@@ -134,6 +135,7 @@
 
         /* Check if we connected */
         if(0 == ret) {
+                                                int keep = 1;
             if(ndelay) {
                 int set = 1;
 
@@ -144,6 +146,15 @@
                            (char *)&set, 
                            sizeof(set));
             }   
+
+                                                if (keepalive) {
+                                                        jk_log(l, JK_LOG_DEBUG, "jk_open_socket, set SO_KEEPALIVE to on\n");
+                                                    setsockopt(sock,
+                                                               SOL_SOCKET,
+                                                               SO_KEEPALIVE,
+                                                               (char *)&keep,
+                                                                sizeof(keep));
+                                                 }
 
             jk_log(l, JK_LOG_DEBUG, "jk_open_socket, return, sd = %d\n", sock);
             return sock;
