Skip to content

Commit 32c31c9

Browse files
author
Ranjan Dasgupta
authored
Merge pull request #824 from ogis-yamazaki/missing_interface_method_about_disconnectForcibly
missing interface method about disconnectForcibly
2 parents cdde804 + 18300f8 commit 32c31c9

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/IMqttAsyncClient.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,21 @@ public interface IMqttAsyncClient extends AutoCloseable {
313313
*/
314314
void disconnectForcibly(long quiesceTimeout, long disconnectTimeout) throws MqttException;
315315

316+
/**
317+
* Disconnects from the server forcibly to reset all the states. Could be
318+
* useful when disconnect attempt failed.
319+
* <p>
320+
* Because the client is able to establish the TCP/IP connection to a none
321+
* MQTT server and it will certainly fail to send the disconnect packet.
322+
*
323+
* @param quiesceTimeout the amount of time in milliseconds to allow for existing work
324+
* to finish before disconnecting. A value of zero or less means the client will not quiesce.
325+
* @param disconnectTimeout the amount of time in milliseconds to allow send disconnect packet to server.
326+
* @param sendDisconnectPacket if true, will send the disconnect packet to the server
327+
* @throws MqttException if any unexpected error
328+
*/
329+
public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout, boolean sendDisconnectPacket) throws MqttException;
330+
316331
/**
317332
* Determines if this client is currently connected to the server.
318333
*

org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/MqttAsyncClient.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -857,24 +857,11 @@ public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout) thro
857857
comms.disconnectForcibly(quiesceTimeout, disconnectTimeout);
858858
}
859859

860-
/**
861-
* Disconnects from the server forcibly to reset all the states. Could be
862-
* useful when disconnect attempt failed.
863-
* <p>
864-
* Because the client is able to establish the TCP/IP connection to a none
865-
* MQTT server and it will certainly fail to send the disconnect packet.
866-
*
867-
* @param quiesceTimeout
868-
* the amount of time in milliseconds to allow for existing work
869-
* to finish before disconnecting. A value of zero or less means
870-
* the client will not quiesce.
871-
* @param disconnectTimeout
872-
* the amount of time in milliseconds to allow send disconnect
873-
* packet to server.
874-
* @param sendDisconnectPacket
875-
* if true, will send the disconnect packet to the server
876-
* @throws MqttException
877-
* if any unexpected error
860+
/*
861+
* (non-Javadoc)
862+
*
863+
* @see
864+
* org.eclipse.paho.client.mqttv3.IMqttAsyncClient#disconnectForcibly(long, long, boolean)
878865
*/
879866
public void disconnectForcibly(long quiesceTimeout, long disconnectTimeout, boolean sendDisconnectPacket)
880867
throws MqttException {

0 commit comments

Comments
 (0)