From 9184a0c6ac13f2c73cd31f712239e28a26b93ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Thu, 25 Sep 2025 13:01:11 +0200 Subject: [PATCH] Update logs and doc --- client/internal/peer/guard/guard.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/internal/peer/guard/guard.go b/client/internal/peer/guard/guard.go index 7b5833a34..183f68475 100644 --- a/client/internal/peer/guard/guard.go +++ b/client/internal/peer/guard/guard.go @@ -15,12 +15,15 @@ type isConnectedFunc func() bool // Guard is responsible for the reconnection logic. // It will trigger to send an offer to the peer then has connection issues. +// Only the offer error will start the timer to resend offer periodically. +// // Watch these events: // - Relay client reconnected to home server // - Signal server connection state changed // - ICE connection disconnected // - Relayed connection disconnected // - ICE candidate changes +// - Failed to send offer to remote peer type Guard struct { log *log.Entry isConnectedOnAllWay isConnectedFunc @@ -82,19 +85,19 @@ func (g *Guard) reconnectLoopWithRetry(ctx context.Context, callback func()) { for { select { case <-g.relayedConnDisconnected: - g.log.Debugf("Relay connection changed, reset reconnection ticker") + g.log.Debugf("Relay connection changed, retry connection") offerResendTimer.Stop() if !g.isConnectedOnAllWay() { callback() } case <-g.iCEConnDisconnected: - g.log.Debugf("ICE connection changed, reset reconnection ticker") + g.log.Debugf("ICE connection changed, retry connection") offerResendTimer.Stop() if !g.isConnectedOnAllWay() { callback() } case <-srReconnectedChan: - g.log.Debugf("has network changes, reset reconnection ticker") + g.log.Debugf("has network changes, retry connection") offerResendTimer.Stop() if !g.isConnectedOnAllWay() { callback()