ReconnectConfig class
Reconnect configuration for the client. Reconnect config takes three parameters:
- mode: ReconnectMode, which can be linear or exponential.
- interval: Duration, the time interval between reconnection attempts. If mode is linear, the interval is fixed. If mode is exponential, the interval is multiplied by 2 after each attempt.
- maxAttempts: int, the maximum number of reconnection attempts.
- onReconnect: Function, a callback function that is called when the client reconnects.
- maxBackoff: Duration, the maximum backoff duration for exponential mode.
- connectionTimeout: Duration, idle timeout — connection is dropped if no data received within this duration.
Constructors
Properties
- connectionTimeout → Duration?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → Duration
-
final
- maxAttempts → int
-
final
- maxBackoff → Duration
-
final
- mode → ReconnectMode
-
final
- onReconnect → void Function(int attempt, Duration delay)?
-
final
-
reconnectHeader
→ Future<
Map< Function()?String, String> > -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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