From 292865f62556fad954b421cc8ad0b1c9e35d3d0c Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Sat, 30 Jul 2016 11:45:47 +0800 Subject: [PATCH] Linux only --- shadowsocks/tcprelay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 968e4d1..a167e43 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -565,7 +565,7 @@ class TCPRelayHandler(object): else: remote_sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1) remote_sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) - if platform.system() != 'Windows': + if platform.system() in ['Linux']: remote_sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, 120) remote_sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, 20) remote_sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPCNT, 5)