internalDisconnect method

  1. @protected
void internalDisconnect ()
@protected

Internal disconnect This is always passed to the connection handler to allow the client to close itself down correctly on disconnect.

Implementation

@protected
void internalDisconnect() {
  if (autoReconnect) {
    if (!connectionHandler.autoReconnectInProgress) {
      // Fire an automatic auto reconnect request
      clientEventBus.fire(AutoReconnect(userReconnect: false));
    } else {
      MqttLogger.log(
          'MqttClient::internalDisconnect - not invoking auto connect, already in progress');
    }
  } else {
    // Unsolicited disconnect
    _disconnect(unsolicited: true);
  }
}