Added stopping for subscriptions handlers and for unsubscription handlers
This commit is contained in:
parent
e7c4e76851
commit
06f199b936
@ -156,9 +156,11 @@ final class MqttClientImpl implements MqttClient {
|
|||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.connectionLost(e);
|
callback.connectionLost(e);
|
||||||
}
|
}
|
||||||
|
pendingSubscriptions.forEach((id, mqttPendingSubscription) -> mqttPendingSubscription.onChannelClosed());
|
||||||
pendingSubscriptions.clear();
|
pendingSubscriptions.clear();
|
||||||
serverSubscriptions.clear();
|
serverSubscriptions.clear();
|
||||||
subscriptions.clear();
|
subscriptions.clear();
|
||||||
|
pendingServerUnsubscribes.forEach((id, mqttPendingServerUnsubscribes) -> mqttPendingServerUnsubscribes.onChannelClosed());
|
||||||
pendingServerUnsubscribes.clear();
|
pendingServerUnsubscribes.clear();
|
||||||
qos2PendingIncomingPublishes.clear();
|
qos2PendingIncomingPublishes.clear();
|
||||||
pendingPublishes.forEach((id, mqttPendingPublish) -> mqttPendingPublish.onChannelClosed());
|
pendingPublishes.forEach((id, mqttPendingPublish) -> mqttPendingPublish.onChannelClosed());
|
||||||
|
|||||||
@ -99,4 +99,8 @@ final class MqttPendingSubscription {
|
|||||||
return once;
|
return once;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onChannelClosed(){
|
||||||
|
this.retransmissionHandler.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,4 +52,8 @@ final class MqttPendingUnsubscription {
|
|||||||
void onUnsubackReceived(){
|
void onUnsubackReceived(){
|
||||||
this.retransmissionHandler.stop();
|
this.retransmissionHandler.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onChannelClosed(){
|
||||||
|
this.retransmissionHandler.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user