mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42:06 +01: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:
parent
fda687b6cb
commit
f94cd2a0d0
1 changed files with 3 additions and 17 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue