Merge pull request #2051 from xiang90/fix_keepalive

pkg/transport: enable keep alive
This commit is contained in:
Xiang Li 2015-01-07 08:37:07 -08:00
commit f98d0ef817

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
}