onTransportDisconnect method

void onTransportDisconnect(
  1. WebSocketInterface? socket,
  2. ErrorCause cause
)

Implementation

void onTransportDisconnect(WebSocketInterface? socket, ErrorCause cause) {
  // Run _onTransportError_ callback on every client transaction using _transport_.
  _transactions.removeAll().forEach((TransactionBase transaction) {
    transaction.onTransportError();
  });

  emit(EventSocketDisconnected(socket: socket, cause: cause));

  // Call registrator _onTransportClosed_.
  _registrator.onTransportClosed();

  if (_status != C.STATUS_USER_CLOSED) {
    _status = C.STATUS_NOT_READY;
  }
}