disconnectOnNoMessageSent method

void disconnectOnNoMessageSent(
  1. DisconnectOnNoMessageSent event
)

Called when the send message function throws exception a ping response expected from the broker has not arrived in the time period specified by disconnectOnNoResponsePeriod.

Implementation

void disconnectOnNoMessageSent(DisconnectOnNoMessageSent event) {
  MqttLogger.log(
      'MqttClient::disconnectOnNoMessageSent - disconnecting, no message sent due to exception like socket exception');
  // Destroy the existing client socket
  connectionHandler?.connection.disconnect();
  internalDisconnect();
}