diff --git a/utils/init_tcp.go b/utils/init_tcp.go index c8d8b65..d491472 100644 --- a/utils/init_tcp.go +++ b/utils/init_tcp.go @@ -3,11 +3,8 @@ package utils import ( "fmt" "net" - "time" ) -const tcpKeepAlivePingPeriod = 2 * time.Second - func InitTCP(conn net.Conn, readBufferSize int, writeBufferSize int) error { tcpConn := conn.(*net.TCPConn) @@ -27,9 +24,5 @@ func InitTCP(conn net.Conn, readBufferSize int, writeBufferSize int) error { return fmt.Errorf("cannot enable keep-alive: %w", err) } - if err := tcpConn.SetKeepAlivePeriod(tcpKeepAlivePingPeriod); err != nil { - return fmt.Errorf("cannot set keep-alive period: %w", err) - } - return nil }