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.
Constructors
-
ReconnectConfig({required ReconnectMode mode, Duration interval = const Duration(seconds: 2), int maxAttempts = 5, Future<
Map< reconnectHeader()?, dynamic onReconnect()?})String, String> >
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- interval → Duration
-
final
- maxAttempts → int
-
final
- mode → ReconnectMode
-
final
- onReconnect → dynamic Function()?
-
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