handleSessionEvent method

  1. @protected
FutureOr<void> handleSessionEvent(
  1. SessionEvent event
)

Handle a SessionEvent from one of this host's sessions.

The base handles the events every mode shares (SessionEventType). Overrides deal with their own protocol's events first and forward the rest with super.handleSessionEvent(event).

Implementation

@protected
FutureOr<void> handleSessionEvent(SessionEvent event) async {
  if (event is SessionEventGeneric) {
    switch (event.type) {
      case SessionEventType.error:
        return handleSessionEventError(event);

      case SessionEventType.pingReceived:
        return handleSessionEventPingReceived(event);

      case SessionEventType.disconnected:
        return handleSessionEventDisconnected(event);
    }
  }
}