增加 SetLinger

This commit is contained in:
GameXG
2021-02-08 00:12:52 +08:00
parent 52a4632e21
commit 4999080563
3 changed files with 11 additions and 0 deletions

View File

@@ -118,6 +118,9 @@ func (p *httpProxyClient) DialTCPSAddrTimeout(network string, raddr string, time
return nil, fmt.Errorf("无法连接代理服务器 %v ,错误:%v", p.proxyAddr, err)
}
_ = rawConn.SetLinger(5)
_ = rawConn.SetNoDelay(true)
c := Conn(rawConn)
ch := make(chan int)

View File

@@ -126,6 +126,10 @@ func (p *socksProxyClient) DialTCPSAddrTimeout(network string, raddr string, tim
if err != nil {
return nil, fmt.Errorf("无法连接代理服务器 %v ,错误:%v", p.proxyAddr, err)
}
_ = c.SetLinger(5)
_ = c.SetNoDelay(true)
ch := make(chan int)
// 实际执行部分

View File

@@ -103,6 +103,10 @@ func (p *ssProxyClient) DialTCPSAddrTimeout(network string, raddr string, timeou
if err != nil {
return nil, fmt.Errorf("无法连接代理服务器 %v ,错误:%v", p.proxyAddr, err)
}
_ = c.SetLinger(5)
_ = c.SetNoDelay(true)
ch := make(chan int)
defer close(ch)