WebSocketConfig constructor

const WebSocketConfig({
  1. required String url,
  2. Duration connectionTimeout = const Duration(seconds: 30),
  3. bool enableReconnection = true,
  4. int maxReconnectionAttempts = 10,
  5. Duration initialReconnectionDelay = const Duration(seconds: 1),
  6. Duration maxReconnectionDelay = const Duration(minutes: 5),
  7. double backoffMultiplier = 2.0,
  8. bool enableMessageQueue = true,
  9. int maxQueueSize = 1000,
  10. Duration heartbeatInterval = const Duration(seconds: 30),
  11. bool enableHeartbeat = true,
  12. Map<String, String> headers = const {},
  13. List<String> protocols = const [],
  14. 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,
});