public static final class CocoClient.ConnectivityTimers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_BACKGROUND_MAX_RETRY_PERIOD |
static long |
DEFAULT_FAST_RETRY_DURATION |
static long |
DEFAULT_FOREGROUND_MAX_RETRY_PERIOD |
static long |
DEFAULT_KEEP_ALIVE_INTERVAL |
static long |
DEFAULT_KEEP_ALIVE_TIMEOUT |
Constructor and Description |
---|
ConnectivityTimers()
Empty constructor that initializes default timers.
|
ConnectivityTimers(long fastRetryDuration,
long backgroundMaxRetryPeriod,
long foregroundMaxRetryPeriod,
long keepAliveInterval,
long keepAliveTimeout)
Overloaded constructor for a developer to set customized timers.
|
Modifier and Type | Method and Description |
---|---|
CocoClient.ConnectivityTimers |
toBackgroundMaxRetryPeriod(long backgroundMaxRetryPeriod) |
CocoClient.ConnectivityTimers |
toFastRetryDuration(long fastRetryDuration) |
CocoClient.ConnectivityTimers |
toForegroundMaxRetryPeriod(long foregroundMaxRetryPeriod) |
CocoClient.ConnectivityTimers |
toKeepAliveInterval(long keepAliveInterval) |
CocoClient.ConnectivityTimers |
toKeepAliveTimeout(long keepAliveTimeout) |
public static final long DEFAULT_FAST_RETRY_DURATION
public static final long DEFAULT_BACKGROUND_MAX_RETRY_PERIOD
public static final long DEFAULT_FOREGROUND_MAX_RETRY_PERIOD
public static final long DEFAULT_KEEP_ALIVE_TIMEOUT
public static final long DEFAULT_KEEP_ALIVE_INTERVAL
public ConnectivityTimers()
public ConnectivityTimers(long fastRetryDuration, long backgroundMaxRetryPeriod, long foregroundMaxRetryPeriod, long keepAliveInterval, long keepAliveTimeout)
fastRetryDuration
- non-negative integer after which SDK will connect to other nodesbackgroundMaxRetryPeriod
- interval when the app is in background connectivity modeforegroundMaxRetryPeriod
- interval when the app is in foreground connectivity modekeepAliveInterval
- SDK nodes will send a keep alive packet at keepAliveInterval secondskeepAliveTimeout
- the timeout in seconds for which SDK will waitpublic CocoClient.ConnectivityTimers toFastRetryDuration(long fastRetryDuration)
public CocoClient.ConnectivityTimers toBackgroundMaxRetryPeriod(long backgroundMaxRetryPeriod)
public CocoClient.ConnectivityTimers toForegroundMaxRetryPeriod(long foregroundMaxRetryPeriod)
public CocoClient.ConnectivityTimers toKeepAliveInterval(long keepAliveInterval)
public CocoClient.ConnectivityTimers toKeepAliveTimeout(long keepAliveTimeout)