WebSocketConfig constructor
const
WebSocketConfig({
- required String url,
- Duration connectionTimeout = const Duration(seconds: 30),
- bool enableReconnection = true,
- int maxReconnectionAttempts = 10,
- Duration initialReconnectionDelay = const Duration(seconds: 1),
- Duration maxReconnectionDelay = const Duration(minutes: 5),
- double backoffMultiplier = 2.0,
- bool enableMessageQueue = true,
- int maxQueueSize = 1000,
- Duration heartbeatInterval = const Duration(seconds: 30),
- bool enableHeartbeat = true,
- Map<
String, String> headers = const {}, - List<
String> protocols = const [], - bool enableCompression = false,
Creates a new WebSocketConfig.
Implementation
const WebSocketConfig({
required this.url,
this.connectionTimeout = const Duration(seconds: 30),
this.enableReconnection = true,
this.maxReconnectionAttempts = 10,
this.initialReconnectionDelay = const Duration(seconds: 1),
this.maxReconnectionDelay = const Duration(minutes: 5),
this.backoffMultiplier = 2.0,
this.enableMessageQueue = true,
this.maxQueueSize = 1000,
this.heartbeatInterval = const Duration(seconds: 30),
this.enableHeartbeat = true,
this.headers = const {},
this.protocols = const [],
this.enableCompression = false,
});