static void on_disconnect(struct mosquitto *mosq, void *obj, int rc)
{
MQTTClient* client = (__bridge MQTTClient*)obj;
LogDebug(@"[%@] on_disconnect rc = %d", client.clientID, rc);
[client.publishHandlers removeAllObjects];
[client.subscriptionHandlers removeAllObjects];
[client.unsubscriptionHandlers removeAllObjects];
client.connected = NO;
if (client.disconnectionHandler) {
client.disconnectionHandler(rc);
}
}
Inside on_disconnect method, remove all the callbacks including publishHandlers, subscriptionHandlers, and unsubscriptionHandlers.
If the publish qos is AtLeastOnce or ExactlyOnce, remove the publishHandlers on disconnect seems not making sense.
Inside on_disconnect method, remove all the callbacks including publishHandlers, subscriptionHandlers, and unsubscriptionHandlers.
If the publish qos is AtLeastOnce or ExactlyOnce, remove the publishHandlers on disconnect seems not making sense.