Skip to content

Commit

Permalink
关闭TCP默认连续读写超时
Browse files Browse the repository at this point in the history
  • Loading branch information
csznet committed Mar 14, 2024
1 parent d8d0de3 commit 171fb51
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions forward/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ func (cs *ConnectionStats) handleTCPConnection(wg *sync.WaitGroup, clientConn ne
defer wg.Done()
defer clientConn.Close()

// 设置连接读写超时时间
clientConn.SetReadDeadline(time.Now().Add(time.Duration(5) * time.Second))
clientConn.SetWriteDeadline(time.Now().Add(time.Duration(5) * time.Second))

remoteConn, err := net.Dial("tcp", cs.RemoteAddr+":"+cs.RemotePort)
if err != nil {
fmt.Println("连接远程地址时发生错误:", err)
Expand Down

0 comments on commit 171fb51

Please sign in to comment.