Browse Source

update quic config

pull/1435/head v4.6.3
Darien Raymond 6 years ago
parent
commit
a1801b5d6f
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 3
      transport/internet/quic/dialer.go
  2. 9
      transport/internet/quic/hub.go

3
transport/internet/quic/dialer.go

@ -96,10 +96,9 @@ func (s *clientSessions) openConnection(destAddr net.Addr, config *Config, tlsCo
quicConfig := &quic.Config{ quicConfig := &quic.Config{
ConnectionIDLength: 12, ConnectionIDLength: 12,
KeepAlive: true,
HandshakeTimeout: time.Second * 4, HandshakeTimeout: time.Second * 4,
IdleTimeout: time.Second * 60, IdleTimeout: time.Second * 60,
MaxReceiveStreamFlowControlWindow: 256 * 1024, MaxReceiveStreamFlowControlWindow: 512 * 1024,
MaxReceiveConnectionFlowControlWindow: 2 * 1024 * 1024, MaxReceiveConnectionFlowControlWindow: 2 * 1024 * 1024,
MaxIncomingUniStreams: -1, MaxIncomingUniStreams: -1,
} }

9
transport/internet/quic/hub.go

@ -43,8 +43,8 @@ func (l *Listener) keepAccepting() {
conn, err := l.listener.Accept() conn, err := l.listener.Accept()
if err != nil { if err != nil {
newError("failed to accept QUIC sessions").Base(err).WriteToLog() newError("failed to accept QUIC sessions").Base(err).WriteToLog()
l.listener.Close() time.Sleep(time.Second)
return continue
} }
go l.acceptStreams(conn) go l.acceptStreams(conn)
} }
@ -85,11 +85,10 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti
quicConfig := &quic.Config{ quicConfig := &quic.Config{
ConnectionIDLength: 12, ConnectionIDLength: 12,
KeepAlive: true,
HandshakeTimeout: time.Second * 4, HandshakeTimeout: time.Second * 4,
IdleTimeout: time.Second * 60, IdleTimeout: time.Second * 60,
MaxReceiveStreamFlowControlWindow: 256 * 1024, MaxReceiveStreamFlowControlWindow: 512 * 1024,
MaxReceiveConnectionFlowControlWindow: 2 * 1024 * 1024, MaxReceiveConnectionFlowControlWindow: 4 * 1024 * 1024,
MaxIncomingStreams: 64, MaxIncomingStreams: 64,
MaxIncomingUniStreams: -1, MaxIncomingUniStreams: -1,
} }

Loading…
Cancel
Save