From 45b04800a43583f0e7b3909cbdb23f203eb8d559 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 4 Jul 2016 08:20:57 +0200 Subject: [PATCH] Handle AlreadyConnectedException in ReconnectionManager Fixes SMACK-725. --- .../java/org/jivesoftware/smack/ReconnectionManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java b/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java index b75159b51..f6711e74e 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java @@ -238,7 +238,11 @@ public class ReconnectionManager { // Makes a reconnection attempt try { if (isReconnectionPossible(connection)) { - connection.connect(); + try { + connection.connect(); + } catch (SmackException.AlreadyConnectedException e) { + LOGGER.log(Level.FINER, "Connection was already connected on reconnection attempt", e); + } } // TODO Starting with Smack 4.2, connect() will no // longer login automatically. So change this and the