Browse Source

Remove redundant setting of TCP keepalive since it is default

tags/v2.1.3^2
9seconds 4 years ago
parent
commit
bc3b517e8b
1 changed files with 0 additions and 4 deletions
  1. 0
    4
      network/sockopts.go

+ 0
- 4
network/sockopts.go View File

20
 }
20
 }
21
 
21
 
22
 func setCommonSocketOptions(conn *net.TCPConn) error {
22
 func setCommonSocketOptions(conn *net.TCPConn) error {
23
-	if err := conn.SetKeepAlive(true); err != nil {
24
-		return fmt.Errorf("cannot disable TCP keepalive probes: %w", err)
25
-	}
26
-
27
 	if err := conn.SetKeepAlivePeriod(DefaultTCPKeepAlivePeriod); err != nil {
23
 	if err := conn.SetKeepAlivePeriod(DefaultTCPKeepAlivePeriod); err != nil {
28
 		return fmt.Errorf("cannot set time period of TCP keepalive probes: %w", err)
24
 		return fmt.Errorf("cannot set time period of TCP keepalive probes: %w", err)
29
 	}
25
 	}

Loading…
Cancel
Save