Skip to content

Commit 13478ed

Browse files
PitelIng. Jan Kaláb
authored andcommitted
Set conState when disconnecting forcibly
Sending the disconnect packet can take some time and it may lead to some already alredy (dis)connecting exceptions. Setting the proper state fixes the issue. Signed-off-by: Ing. Jan Kaláb <jan+github@kalabovi.org>
1 parent 0edc19c commit 13478ed

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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

org.eclipse.paho.client.mqttv3/src/main/java-templates/org/eclipse/paho/client/mqttv3/internal/ClientComms.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout) thro
530530
* @throws MqttException if an error occurs whilst disconnecting
531531
*/
532532
public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout, boolean sendDisconnectPacket) throws MqttException {
533+
conState = DISCONNECTING;
533534
// Allow current inbound and outbound work to complete
534535
if (clientState != null) {
535536
clientState.quiesce(quiesceTimeout);

0 commit comments

Comments
 (0)