fix: fail to set KeepAliveIntervall #715

This commit is contained in:
Larvan2 2023-09-25 13:28:11 +08:00
parent 0dfe696300
commit fdd327d58d

View File

@ -51,6 +51,6 @@ func SplitHostPort(s string) (host, port string, hasPort bool, err error) {
func TCPKeepAlive(c net.Conn) { func TCPKeepAlive(c net.Conn) {
if tcp, ok := c.(*net.TCPConn); ok { if tcp, ok := c.(*net.TCPConn); ok {
_ = tcp.SetKeepAlive(true) _ = tcp.SetKeepAlive(true)
_ = tcp.SetKeepAlivePeriod(KeepAliveInterval * time.Second) _ = tcp.SetKeepAlivePeriod(KeepAliveInterval)
} }
} }