StreamingConnectionHandler constructor

StreamingConnectionHandler({
  1. required ServerpodClientShared client,
  2. required void listener(
    1. StreamingConnectionHandlerState state
    ),
  3. int retryEverySeconds = 5,
})

Creates a new connection handler with the specified listener and interval for reconnecting to the server.

Implementation

StreamingConnectionHandler({
  required this.client,
  required this.listener,
  this.retryEverySeconds = 5,
}) {
  _keepAlive = client.streamingConnectionStatus !=
      StreamingConnectionStatus.disconnected;
  client.addStreamingConnectionStatusListener(_onConnectionStatusChanged);
}