Manager constructor
Manager({
- dynamic uri,
- Map? options,
Implementation
Manager({uri, Map? options}) {
options = options ?? <dynamic, dynamic>{};
options['path'] ??= '/socket.io';
this.options = options;
_reconnection = options['reconnection'] != false;
_reconnectionAttempts = options['reconnectionAttempts'] ?? double.infinity;
_reconnectionDelay = options['reconnectionDelay'] ?? 1000;
reconnectionDelayMax = options['reconnectionDelayMax'] ?? 5000;
randomizationFactor = options['randomizationFactor'] ?? 0.5;
backoff = _Backoff(
min: _reconnectionDelay,
max: reconnectionDelayMax,
jitter: randomizationFactor);
timeout = options['timeout'] ?? 20000;
this.uri = uri;
autoConnect = options['autoConnect'] != false;
if (autoConnect) open();
}