disconnect method

  1. @override
MqttConnectionState disconnect ()
override

Disconnects

Implementation

@override
MqttConnectionState disconnect() {
  MqttLogger.log('SynchronousMqttServerConnectionHandler::disconnect');
  if (connectionStatus.state == MqttConnectionState.connected) {
    // Send a disconnect message to the broker
    sendMessage(MqttDisconnectMessage());
  }
  // Disconnect
  _performConnectionDisconnect();
  return connectionStatus.state;
}