diff --git a/lib/netutil/tcpdialer.go b/lib/netutil/tcpdialer.go index 688d377551..faf5a243c9 100644 --- a/lib/netutil/tcpdialer.go +++ b/lib/netutil/tcpdialer.go @@ -15,7 +15,11 @@ import ( func NewTCPDialer(name, addr string) *TCPDialer { d := &TCPDialer{ d: &net.Dialer{ - Timeout: time.Second, + // The timeout for establishing a TCP connection. + // 5 seconds should be enough for the majority of cases. + Timeout: 5 * time.Second, + + // How frequently to send keep-alive packets over established TCP connections. KeepAlive: time.Second, },