Turn on SO_KEEPALIVE on network connections. Since we limit the number
of connections, we cannot afford to allow "disappeared" client to cause us to leave one of the 14 connections open and hanging in a read() forever. (SO_KEEPALIVE causes probe packets to be sent after a few hours of IDLE time where no data has been transferred. Sup should NEVER do this, so the only time it will have an effect is if it looses the remote machine)
This commit is contained in:
parent
40c20cfcd6
commit
95de3496b4
@ -69,6 +69,9 @@
|
||||
* since Tahoe version of <netinet/in.h> does not define them.
|
||||
*
|
||||
* $Log: scm.c,v $
|
||||
* Revision 1.2 1995/12/26 05:02:49 peter
|
||||
* Apply ports/net/sup/patches/patch-aa...
|
||||
*
|
||||
* Revision 1.1.1.1 1995/12/26 04:54:47 peter
|
||||
* Import the unmodified version of the sup that we are using.
|
||||
* The heritage of this version is not clear. It appears to be NetBSD
|
||||
@ -268,6 +271,8 @@ char *server;
|
||||
return (scmerr (errno, stderr, "Can't create socket for connections"));
|
||||
if (setsockopt (sock,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(int)) < 0)
|
||||
(void) scmerr (errno, stderr, "Can't set SO_REUSEADDR socket option");
|
||||
if (setsockopt (sock,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(int)) < 0)
|
||||
(void) scmerr (errno, stderr, "Can't set SO_KEEPALIVE socket option");
|
||||
(void) bzero ((char *)&sin,sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = port;
|
||||
|
Loading…
x
Reference in New Issue
Block a user