mirror of https://github.com/XTLS/Xray-core
RM TCPKeepAliveConfig
parent
ba2f6cfd87
commit
560704db35
|
@ -3,7 +3,6 @@ package internet
|
|||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
gonet "net"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
|
@ -88,22 +87,14 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
|
|||
Dest: destAddr,
|
||||
}, nil
|
||||
}
|
||||
TCPKeepAlive := time.Duration(0)
|
||||
TCPKeepAliveConfig := gonet.KeepAliveConfig {
|
||||
Enable: true,
|
||||
Idle: 45 * time.Second,
|
||||
Interval: 45 * time.Second,
|
||||
Count: -1,
|
||||
}
|
||||
TCPKeepAlive := time.Duration(45)
|
||||
if sockopt != nil && (sockopt.TcpKeepAliveInterval != 0 || sockopt.TcpKeepAliveIdle != 0) {
|
||||
TCPKeepAlive = time.Duration(-1)
|
||||
TCPKeepAliveConfig.Enable = false
|
||||
}
|
||||
dialer := &net.Dialer{
|
||||
Timeout: time.Second * 16,
|
||||
LocalAddr: resolveSrcAddr(dest.Network, src),
|
||||
KeepAlive: TCPKeepAlive,
|
||||
KeepAliveConfig: TCPKeepAliveConfig,
|
||||
}
|
||||
|
||||
if sockopt != nil || len(d.controllers) > 0 {
|
||||
|
|
Loading…
Reference in New Issue