disconnectOnNoPingResponse method Null safety

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(
      'MqttClient::_disconnectOnNoPingResponse - disconnecting, no ping request response for $disconnectOnNoResponsePeriod seconds');
  // Destroy the existing client socket
  connectionHandler?.connection?.disconnect();
  internalDisconnect();
}