ConnectionConfig class
Configuration for connection behavior
Allows customization of reconnection strategy, heartbeat intervals, and other connection parameters.
Constructors
- ConnectionConfig({int maxReconnectAttempts = 10, Duration baseReconnectDelay = const Duration(seconds: 1), Duration maxReconnectDelay = const Duration(seconds: 30), Duration pingInterval = const Duration(seconds: 30), Duration pongTimeout = const Duration(seconds: 10), bool autoReconnect = true, Duration connectTimeout = const Duration(seconds: 10)})
-
const
Properties
- autoReconnect → bool
-
Enable/disable automatic reconnection
final
- baseReconnectDelay → Duration
-
Base delay for exponential backoff (first retry)
final
- connectTimeout → Duration
-
Timeout for initial WebSocket connection
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxReconnectAttempts → int
-
Maximum number of reconnection attempts before giving up
final
- maxReconnectDelay → Duration
-
Maximum delay between reconnection attempts
final
- pingInterval → Duration
-
How often to send ping messages
final
- pongTimeout → Duration
-
How long to wait for pong before declaring connection stale
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.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- development → const ConnectionConfig
- Preset for development (no reconnection, immediate feedback)
- mobile → const ConnectionConfig
- Preset for mobile networks (more aggressive reconnection)
- stable → const ConnectionConfig
- Preset for stable connections (less aggressive)