From 4ec20e91297b50b68a4c6421b95784d6d903ea4b Mon Sep 17 00:00:00 2001 From: xqzr <34030394+xqzr@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:05:07 +0800 Subject: [PATCH] Update system_dialer.go --- transport/internet/system_dialer.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/transport/internet/system_dialer.go b/transport/internet/system_dialer.go index 4945ff61..28a81491 100644 --- a/transport/internet/system_dialer.go +++ b/transport/internet/system_dialer.go @@ -3,7 +3,6 @@ package internet import ( "context" "math/rand" - gonet "net" "syscall" "time" @@ -88,22 +87,10 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne Dest: destAddr, }, nil } - TCPKeepAlive := time.Duration(1) - TCPKeepAliveConfig := gonet.KeepAliveConfig { - Enable: true, - Idle: 45 * time.Second, - Interval: 45 * time.Second, - Count: -1, - } - 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, + KeepAlive: time.Duration(-1), } if sockopt != nil || len(d.controllers) > 0 {