mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 23:09:08 +01:00
Address wrong comments
This commit is contained in:
@@ -806,7 +806,8 @@ func (conn *Conn) evalStatus() ConnStatus {
|
|||||||
//
|
//
|
||||||
// The result is a tri-state:
|
// The result is a tri-state:
|
||||||
// - ConnStatusConnected: all available transports are up
|
// - ConnStatusConnected: all available transports are up
|
||||||
// - ConnStatusPartiallyConnected: relay is up but ICE is still pending/reconnecting
|
// - ConnStatusPartiallyConnected: one transport carries the traffic and the other does
|
||||||
|
// not: relay up with ICE down, or ICE up with the shared relay transport down
|
||||||
// - ConnStatusDisconnected: no working transport
|
// - ConnStatusDisconnected: no working transport
|
||||||
func (conn *Conn) isConnectedOnAllWay() (status guard.ConnStatus) {
|
func (conn *Conn) isConnectedOnAllWay() (status guard.ConnStatus) {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ type ConnStatus int
|
|||||||
const (
|
const (
|
||||||
// ConnStatusDisconnected means neither ICE nor Relay is connected.
|
// ConnStatusDisconnected means neither ICE nor Relay is connected.
|
||||||
ConnStatusDisconnected ConnStatus = iota
|
ConnStatusDisconnected ConnStatus = iota
|
||||||
// ConnStatusPartiallyConnected means Relay is connected but ICE is not.
|
// ConnStatusPartiallyConnected means one transport is usable and the other is not:
|
||||||
|
// relay connected with ICE down, or ICE connected with the shared relay transport down.
|
||||||
ConnStatusPartiallyConnected
|
ConnStatusPartiallyConnected
|
||||||
// ConnStatusConnected means all required connections are established.
|
// ConnStatusConnected means all required connections are established.
|
||||||
ConnStatusConnected
|
ConnStatusConnected
|
||||||
@@ -75,8 +76,9 @@ func (g *Guard) SetICEConnDisconnected() {
|
|||||||
// - Connected: no action, the peer is fully reachable.
|
// - Connected: no action, the peer is fully reachable.
|
||||||
// - Disconnected (neither ICE nor Relay): retries aggressively with exponential backoff (800ms doubling
|
// - Disconnected (neither ICE nor Relay): retries aggressively with exponential backoff (800ms doubling
|
||||||
// up to timeout), never gives up. This ensures rapid recovery when the peer has no connectivity at all.
|
// up to timeout), never gives up. This ensures rapid recovery when the peer has no connectivity at all.
|
||||||
// - PartiallyConnected (Relay up, ICE not): retries up to 3 times with exponential backoff, then switches
|
// - PartiallyConnected (one transport usable, the other not): retries up to 3 times
|
||||||
// to one attempt per hour. This limits signaling traffic when relay already provides connectivity.
|
// with exponential backoff, then switches to one attempt per hour. This limits
|
||||||
|
// signaling traffic while the peer still has a working path.
|
||||||
//
|
//
|
||||||
// External events (relay/ICE disconnect, signal/relay reconnect, candidate changes) reset the retry
|
// External events (relay/ICE disconnect, signal/relay reconnect, candidate changes) reset the retry
|
||||||
// counter and backoff ticker, giving ICE a fresh chance after network conditions change.
|
// counter and backoff ticker, giving ICE a fresh chance after network conditions change.
|
||||||
|
|||||||
Reference in New Issue
Block a user