WebSocketPingValidatorProperties constructor
WebSocketPingValidatorProperties({
- required void onMessage(
- dynamic
- void onConnected()?,
- void onError()?,
- void onConnectionClosed()?,
- void onConnectionLost()?,
- void onReconnectStarted()?,
- required void onNewInstanceCreated(),
- required Future<
bool> reconnectOnError(), - Future<
bool> reconnectOnConnectionLost()?, - Duration periodicDurationToMakePing = const Duration(seconds: 5),
- Duration reconnectIn = const Duration(seconds: 3),
- Future<
bool> validateIfCanMakeConnection()?,
Implementation
WebSocketPingValidatorProperties({
required this.onMessage,
this.onConnected,
this.onError,
this.onConnectionClosed,
this.onConnectionLost,
this.onReconnectStarted,
required this.onNewInstanceCreated,
required this.reconnectOnError,
final Future<bool> Function()? reconnectOnConnectionLost,
this.periodicDurationToMakePing = const Duration(seconds: 5),
this.reconnectIn = const Duration(seconds: 3),
final Future<bool> Function()? validateIfCanMakeConnection,
}) : reconnectOnConnectionLost =
reconnectOnConnectionLost ?? (() async => true),
validateIfCanMakeConnection =
validateIfCanMakeConnection ?? (() async => true);