pkg/transport: enable keep alive

This commit is contained in:
Xiang Li 2015-01-06 22:02:30 -08:00
parent a15f39e6a2
commit 1d1a4754a7

View File

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