Browse Source

pkg/transport: enable keep alive

Xiang Li 11 years ago
parent
commit
1d1a4754a7
1 changed files with 1 additions and 0 deletions
  1. 1 0
      pkg/transport/keepalive_listener.go

+ 1 - 0
pkg/transport/keepalive_listener.go

@@ -46,6 +46,7 @@ func (kln *keepaliveListener) Accept() (net.Conn, error) {
 	// detection time: tcp_keepalive_time + tcp_keepalive_probes + tcp_keepalive_intvl
 	// detection time: tcp_keepalive_time + tcp_keepalive_probes + tcp_keepalive_intvl
 	// default on linux:  30 + 8 * 30
 	// default on linux:  30 + 8 * 30
 	// default on osx:    30 + 8 * 75
 	// default on osx:    30 + 8 * 75
+	tcpc.SetKeepAlive(true)
 	tcpc.SetKeepAlivePeriod(30 * time.Second)
 	tcpc.SetKeepAlivePeriod(30 * time.Second)
 	return tcpc, nil
 	return tcpc, nil
 }
 }