mirror of https://github.com/XTLS/Xray-core
Update system_listener.go
parent
ba6c3040e3
commit
c5a171eeb8
|
@ -2,12 +2,12 @@ package internet
|
|||
|
||||
import (
|
||||
"context"
|
||||
gonet "net"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/pires/go-proxyproto"
|
||||
"github.com/sagernet/sing/common/control"
|
||||
|
@ -88,7 +88,13 @@ func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *S
|
|||
network = addr.Network()
|
||||
address = addr.String()
|
||||
lc.Control = getControlFunc(ctx, sockopt, dl.controllers)
|
||||
lc.KeepAlive = time.Duration(-1)
|
||||
lc.KeepAliveConfig = gonet.KeepAliveConfig{
|
||||
// Set Enable to true but all other fields to -1 to use system defaults (see https://pkg.go.dev/net#KeepAliveConfig)
|
||||
Enable: true,
|
||||
Idle: -1,
|
||||
Interval: -1,
|
||||
Count: -1,
|
||||
}
|
||||
if sockopt != nil {
|
||||
if sockopt.TcpMptcp {
|
||||
lc.SetMultipathTCP(true)
|
||||
|
|
Loading…
Reference in New Issue