Package 

Class DefaultReconnectPolicy

  • 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.

    • Constructor Detail

      • DefaultReconnectPolicy

        DefaultReconnectPolicy(List<Duration> retryDelays, Duration maxReconnectionTimeout)
    • 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.

      • 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.