forked from quic-go/quic-go
log keep alive packets
This commit is contained in:
@@ -511,7 +511,8 @@ runLoop:
|
|||||||
pacingDeadline = s.sentPacketHandler.TimeUntilSend()
|
pacingDeadline = s.sentPacketHandler.TimeUntilSend()
|
||||||
}
|
}
|
||||||
if s.config.KeepAlive && !s.keepAlivePingSent && s.handshakeComplete && time.Since(s.lastNetworkActivityTime) >= s.peerParams.IdleTimeout/2 {
|
if s.config.KeepAlive && !s.keepAlivePingSent && s.handshakeComplete && time.Since(s.lastNetworkActivityTime) >= s.peerParams.IdleTimeout/2 {
|
||||||
// send the PING frame since there is no activity in the session
|
// send a PING frame since there is no activity in the session
|
||||||
|
s.logger.Debugf("Sending a keep-alive ping to keep the connection alive.")
|
||||||
s.packer.QueueControlFrame(&wire.PingFrame{})
|
s.packer.QueueControlFrame(&wire.PingFrame{})
|
||||||
s.keepAlivePingSent = true
|
s.keepAlivePingSent = true
|
||||||
} else if !pacingDeadline.IsZero() && now.Before(pacingDeadline) {
|
} else if !pacingDeadline.IsZero() && now.Before(pacingDeadline) {
|
||||||
|
|||||||
Reference in New Issue
Block a user