mirror of
https://github.com/GameXG/ProxyClient.git
synced 2025-12-24 13:57:50 +08:00
增加 SetLinger
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
// 实际执行部分
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user