}
Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
- int nodelay, Plug plug)
+ int nodelay, int keepalive, Plug plug)
{
int s;
#ifdef IPV6
setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (void *) &b, sizeof(b));
}
+ if (keepalive) {
+ int b = TRUE;
+ setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (void *) &b, sizeof(b));
+ }
+
/*
* Bind to local address.
*/