BtcReconnectPolicy class Models

Controls how a BtcReconnectingConnection retries after the link drops.

Reconnect delays grow exponentially (initialBackoff, initialBackoff * backoffMultiplier, ...), capped at maxBackoff.

Constructors

BtcReconnectPolicy({int? maxAttempts, Duration initialBackoff = const Duration(seconds: 1), Duration maxBackoff = const Duration(seconds: 30), double backoffMultiplier = 2.0, Duration? connectTimeout = const Duration(seconds: 15)})
Creates a reconnect policy. The defaults retry forever with 1s → 30s exponential backoff and a 15s per-attempt connect timeout.
const

Properties

backoffMultiplier double
Factor the backoff grows by after each failed retry.
final
connectTimeout Duration?
Per-attempt connect timeout, or null to wait indefinitely.
final
hashCode int
The hash code for this object.
no setterinherited
initialBackoff Duration
Delay before the first retry.
final
maxAttempts int?
Maximum consecutive reconnect attempts (retries) before giving up.
final
maxBackoff Duration
Upper bound on the backoff delay.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

backoffForAttempt(int attempt) Duration
The exponential, capped backoff before reconnect attempt (1-based).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited