From bf94fb53caf61244abeb031a6088566290702a0d Mon Sep 17 00:00:00 2001 From: Bhoppi Chaw Date: Wed, 7 Apr 2021 00:37:28 +0800 Subject: [PATCH] Fix QUIC disconnecting issue (#475) Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com> --- transport/internet/quic/dialer.go | 2 +- transport/internet/quic/hub.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index e5a33129..a1d5488f 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -148,7 +148,7 @@ func (s *clientSessions) openConnection(destAddr net.Addr, config *Config, tlsCo quicConfig := &quic.Config{ ConnectionIDLength: 12, - MaxIdleTimeout: time.Second * 30, + KeepAlive: true, } conn, err := wrapSysConn(rawConn, config) diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index eebf1617..605b52dc 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -103,7 +103,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti quicConfig := &quic.Config{ ConnectionIDLength: 12, - MaxIdleTimeout: time.Second * 45, + KeepAlive: true, MaxIncomingStreams: 32, MaxIncomingUniStreams: -1, }