Skip to content

Commit 36f8e12

Browse files
author
bzhangxmt
committed
Fix Bug 434761 - Connect onSuccess getting executed for the second when connection closed by server
Signed-off-by: bzhangxmt <zhbinbj@cn.ibm.com>
1 parent 75a06d5 commit 36f8e12

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/CommsCallback.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,12 @@ private void handleActionComplete(MqttToken token)
209209
}
210210

211211
// Set notified so we don't tell the user again about this action.
212-
if ( token instanceof MqttDeliveryToken && token.isComplete()) {
213-
token.internalTok.setNotified(true);
214-
}
212+
if ( token.isComplete() ){
213+
if ( token instanceof MqttDeliveryToken || token.getActionCallback() instanceof ConnectActionListener ) {
214+
token.internalTok.setNotified(true);
215+
}
216+
}
217+
215218

216219
if (token.isComplete()) {
217220
// Finish by doing any post processing such as delete

0 commit comments

Comments
 (0)