From 5e27e481293faba3c6a6b8777af99216ac68c278 Mon Sep 17 00:00:00 2001 From: DEFACE Date: Mon, 15 Jun 2020 21:23:43 +0200 Subject: [PATCH] Fix Keep-Alive Issue for OpenBSD/ArchLinux --- utils/init_tcp.go | 7 ------- 1 file changed, 7 deletions(-) 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 }