Преглед изворни кода

Merge pull request #151 from FollowMeDown/master

Fix Keep-Alive Issue for OpenBSD/ArchLinux
tags/v1.0.6^2
Sergey Arkhipov пре 5 година
родитељ
комит
e286dea650
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…
Откажи
Сачувај