Package io.ably.lib.util

Class ReconnectionStrategy

java.lang.Object
io.ably.lib.util.ReconnectionStrategy

public class ReconnectionStrategy extends Object
  • Constructor Details

    • ReconnectionStrategy

      public ReconnectionStrategy()
  • Method Details

    • getRetryTime

      public static int getRetryTime(long initialTimeout, int retryAttempt)
      Spec: RTB1
      Parameters:
      initialTimeout - The initial timeout value
      retryAttempt - integer indicating retryAttempt
      Returns:
      RetryTimeout value for given timeout and retryAttempt. If x is the value returned then, Upper bound = min((retryAttempt + 2) / 3, 2) * initialTimeout, Lower bound = 0.8 * Upper bound, Lower bound < x < Upper bound