support tcp keepalive params (#2863)

This commit is contained in:
fatedier
2022-03-22 19:29:30 +08:00
committed by GitHub
parent 452fe25cc6
commit 100d556336
11 changed files with 29 additions and 8 deletions

View File

@ -186,6 +186,7 @@ func NewService(cfg config.ServerCommonConf) (svr *Service, err error) {
}
svr.muxer = mux.NewMux(ln)
svr.muxer.SetKeepAlive(time.Duration(cfg.TCPKeepAlive) * time.Second)
go svr.muxer.Serve()
ln = svr.muxer.DefaultListener()