disconnectOnNoPingResponse method

void disconnectOnNoPingResponse(
  1. DisconnectOnNoPingResponse event
)

Called when the keep alive mechanism has determined that a ping response expected from the broker has not arrived in the time period specified by disconnectOnNoResponsePeriod.

Implementation

void disconnectOnNoPingResponse(DisconnectOnNoPingResponse event) {
  MqttLogger.log(
      'Mqtt5Client::_disconnectOnNoPingResponse - disconnecting, no ping request response for $disconnectOnNoResponsePeriod seconds');
  // Destroy the existing client socket
  connectionHandler?.connection.disconnect();
  internalDisconnect();
}