1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-07-03 08:42:35 +02:00

Reverted last change about reconnection. To force a reconnection just use XMPPConnection#connect()

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10841 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2008-10-24 02:12:39 +00:00 committed by gato
parent fda687b6cb
commit f94cd2a0d0

View file

@ -22,7 +22,7 @@ public class ReconnectionManager implements ConnectionListener {
private int secondBetweenReconnection = 5 * 60; // 5 minutes private int secondBetweenReconnection = 5 * 60; // 5 minutes
// Holds the thread that produces a periodical reconnection. // Holds the thread that produces a periodical reconnection.
static private Thread reconnectionThread; private Thread reconnectionThread;
// Holds the connection to the server // Holds the connection to the server
private XMPPConnection connection; private XMPPConnection connection;
@ -81,17 +81,6 @@ public class ReconnectionManager implements ConnectionListener {
this.secondBetweenReconnection = secondBetweenReconnection; this.secondBetweenReconnection = secondBetweenReconnection;
} }
/**
* Forces an immediate reconnection and attempts an immediate reconnection.
*
* Interrupts the existing reconnection thread so that it can try an immediate connection attempt.
*/
static public void forceReconnection() {
if (reconnectionThread != null) {
reconnectionThread.interrupt();
}
}
/** /**
* Starts a reconnection mechanism if it was configured to do that. * Starts a reconnection mechanism if it was configured to do that.
* The algorithm is been executed when the first connection error is detected. * The algorithm is been executed when the first connection error is detected.
@ -157,12 +146,9 @@ public class ReconnectionManager implements ConnectionListener {
.notifyAttemptToReconnectIn(remainingSeconds); .notifyAttemptToReconnectIn(remainingSeconds);
} }
catch (InterruptedException e1) { catch (InterruptedException e1) {
// We want to be able to legitimately interrupt this thread so we can e1.printStackTrace();
// force a reconnection.
remainingSeconds = 0;
// e1.printStackTrace();
// Notify the reconnection has failed // Notify the reconnection has failed
// ReconnectionManager.this.notifyReconnectionFailed(e1); ReconnectionManager.this.notifyReconnectionFailed(e1);
} }
} }
// Waiting time have finished // Waiting time have finished