You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@wired.com> on 1995/03/12 03:18:55 UTC

setsockopt & keepalives

SGI had suggested we insert this into httpd.c next to the other setsockopt
calls, carte blanche - any comments?  Is this a pretty non-portable patch? 

int keepalive_value = 1;  
if((setsockopt(sd,SOL_SOCKET,SO_KEEPALIVE,(const void *)&keepalive_value,
  sizeof(keepalive_value))) == -1) {
    fprintf(stderr,"httpd: could not set socket option\n"); 
    perror("setsockopt"); 
    exit(1); 
}


        Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@hotwired.com  brian@hyperreal.com  http://www.hotwired.com/Staff/brian/