onClose method

  1. @protected
void onClose(
  1. bool forced
)

Implementation

@protected
void onClose(bool forced) {
  if (forced) {
    emit(Event.close, forced);
  } else {
    if (reconnectAttempts < _options.maxReconnectAttempts) {
      reconnectAttempts++;
      connect(host, port);
    } else {
      emit(Event.close, forced);
    }
  }
}