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
1 changed files with 3 additions and 17 deletions

View File

@ -22,7 +22,7 @@ public class ReconnectionManager implements ConnectionListener {
private int secondBetweenReconnection = 5 * 60; // 5 minutes
// Holds the thread that produces a periodical reconnection.
static private Thread reconnectionThread;
private Thread reconnectionThread;
// Holds the connection to the server
private XMPPConnection connection;
@ -81,17 +81,6 @@ public class ReconnectionManager implements ConnectionListener {
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.
* The algorithm is been executed when the first connection error is detected.
@ -157,12 +146,9 @@ public class ReconnectionManager implements ConnectionListener {
.notifyAttemptToReconnectIn(remainingSeconds);
}
catch (InterruptedException e1) {
// We want to be able to legitimately interrupt this thread so we can
// force a reconnection.
remainingSeconds = 0;
// e1.printStackTrace();
e1.printStackTrace();
// Notify the reconnection has failed
// ReconnectionManager.this.notifyReconnectionFailed(e1);
ReconnectionManager.this.notifyReconnectionFailed(e1);
}
}
// Waiting time have finished