소스 검색

Fix Keep-Alive Issue for OpenBSD/ArchLinux

tags/v1.0.6^2
DEFACE 6 년 전
부모
커밋
5e27e48129
No account linked to committer's email address
1개의 변경된 파일0개의 추가작업 그리고 7개의 파일을 삭제
  1. 0
    7
      utils/init_tcp.go

+ 0
- 7
utils/init_tcp.go 파일 보기

@@ -3,11 +3,8 @@ package utils
3 3
 import (
4 4
 	"fmt"
5 5
 	"net"
6
-	"time"
7 6
 )
8 7
 
9
-const tcpKeepAlivePingPeriod = 2 * time.Second
10
-
11 8
 func InitTCP(conn net.Conn, readBufferSize int, writeBufferSize int) error {
12 9
 	tcpConn := conn.(*net.TCPConn)
13 10
 
@@ -27,9 +24,5 @@ func InitTCP(conn net.Conn, readBufferSize int, writeBufferSize int) error {
27 24
 		return fmt.Errorf("cannot enable keep-alive: %w", err)
28 25
 	}
29 26
 
30
-	if err := tcpConn.SetKeepAlivePeriod(tcpKeepAlivePingPeriod); err != nil {
31
-		return fmt.Errorf("cannot set keep-alive period: %w", err)
32
-	}
33
-
34 27
 	return nil
35 28
 }

Loading…
취소
저장