Skip to content

Commit 2912fcb

Browse files
author
Ian Craggs
committed
Add reconnect function to interfaces #483
1 parent 75370af commit 2912fcb

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,12 @@ public IMqttToken unsubscribe(String[] topicFilters, Object userContext, IMqttAc
872872
*/
873873
public void setManualAcks(boolean manualAcks);
874874

875+
/**
876+
* Will attempt to reconnect to the server after the client has lost connection.
877+
* @throws MqttException if an error occurs attempting to reconnect
878+
*/
879+
public void reconnect() throws MqttException;
880+
875881
/**
876882
* Indicate that the application has completed processing the message with id messageId.
877883
* This will cause the MQTT acknowledgement to be sent to the server.

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2015 IBM Corp.
2+
* Copyright (c) 2009, 2018 IBM Corp.
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
@@ -947,6 +947,12 @@ public interface IMqttClient extends AutoCloseable { //extends IMqttAsyncClient
947947
*/
948948
public void setManualAcks(boolean manualAcks);
949949

950+
/**
951+
* Will attempt to reconnect to the server after the client has lost connection.
952+
* @throws MqttException if an error occurs attempting to reconnect
953+
*/
954+
public void reconnect() throws MqttException;
955+
950956
/**
951957
* Indicate that the application has completed processing the message with id messageId.
952958
* This will cause the MQTT acknowledgement to be sent to the server.

0 commit comments

Comments
 (0)