X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxnet.c;h=08fb4e170ebce55906be1e6a317889c3c90c4f34;hb=ac61490a5b9f40a3655d363d5a1014112aae7222;hp=1e7d51b7cb5891d1306da35a97aac724d4f3aeee;hpb=a2acc6ae0d9f3afe72e85e583ed50c75479e787a;p=PuTTY.git diff --git a/unix/uxnet.c b/unix/uxnet.c index 1e7d51b7..08fb4e17 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -378,7 +378,7 @@ Socket sk_register(OSSocket sockfd, Plug plug) } 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 @@ -433,6 +433,11 @@ Socket sk_new(SockAddr addr, int port, int privport, int oobinline, 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. */