File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
backend/pkg/transport/network/tcp Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,13 @@ func NewClientConfig(laddr net.Addr) ClientConfig {
2424 Dialer : net.Dialer {
2525 Timeout : time .Second ,
2626 LocalAddr : laddr ,
27- KeepAlive : time .Second , // Going under 1 second won't work in most systems
27+ KeepAlive : - 1 , // managed via KeepAliveConfig
28+ KeepAliveConfig : net.KeepAliveConfig {
29+ Enable : true ,
30+ Idle : time .Second ,
31+ Interval : time .Second ,
32+ Count : 3 ,
33+ },
2834 },
2935
3036 Context : context .TODO (),
@@ -69,7 +75,13 @@ type ServerConfig struct {
6975func NewServerConfig () ServerConfig {
7076 return ServerConfig {
7177 ListenConfig : net.ListenConfig {
72- KeepAlive : time .Second ,
78+ KeepAlive : - 1 , // managed via KeepAliveConfig
79+ KeepAliveConfig : net.KeepAliveConfig {
80+ Enable : true ,
81+ Idle : time .Second ,
82+ Interval : time .Second ,
83+ Count : 3 ,
84+ },
7385 },
7486 Context : context .TODO (),
7587 }
You can’t perform that action at this time.
0 commit comments