-
- All Implemented Interfaces:
-
io.livekit.android.room.network.ReconnectPolicy
public final class DefaultReconnectPolicy implements ReconnectPolicy
A reconnect policy that takes in a list of delays to iterate through.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultReconnectPolicy.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<Duration>retryDelaysprivate final DurationmaxReconnectionTimeout
-
Constructor Summary
Constructors Constructor Description DefaultReconnectPolicy(List<Duration> retryDelays, Duration maxReconnectionTimeout)
-
Method Summary
Modifier and Type Method Description final List<Duration>getRetryDelays()The list of delays to use. final DurationgetMaxReconnectionTimeout()The max total time to try reconnecting. DurationgetNextRetryDelay(ReconnectContext context)Called after a disconnect is detected, and between each reconnect attempt. -
-
Method Detail
-
getRetryDelays
final List<Duration> getRetryDelays()
The list of delays to use. If the number of retries exceeds the size of the list, reconnection is cancelled.
Defaults to aggressively retrying multiple times before exponentially backing off, up to 5 seconds.
-
getMaxReconnectionTimeout
final Duration getMaxReconnectionTimeout()
The max total time to try reconnecting. Defaults to 60 seconds.
-
getNextRetryDelay
Duration getNextRetryDelay(ReconnectContext context)
Called after a disconnect is detected, and between each reconnect attempt.
Note: To prevent infinitely retrying, there is a hard cap of 30 retries, regardless of policy.
-
-
-
-