Skip to content

Commit 16e5b5b

Browse files
unknownunknown
authored andcommitted
Fix a small bug in keep-alive
1 parent 6847efc commit 16e5b5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/com/tokudu/demo/PushService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ private synchronized void keepAlive() {
254254
if (mStarted == true && mConnection != null) {
255255
mConnection.sendKeepAlive();
256256
} else {
257-
reconnectIfNecessary();
257+
if (isNetworkAvailable()) {
258+
reconnectIfNecessary();
259+
}
258260
}
259261
} catch (MqttException e) {
260262
mConnection.disconnect();

0 commit comments

Comments
 (0)