mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 14:02:06 +01:00
1) Added conflict check in ReconnectionManager.
2) Fixed compilation errors due to change in interface name. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6122 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
f5371f42a7
commit
4e0397e80a
3 changed files with 18 additions and 6 deletions
|
@ -1,5 +1,7 @@
|
|||
package org.jivesoftware.smack;
|
||||
|
||||
import org.jivesoftware.smack.packet.StreamError;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -7,12 +9,12 @@ import java.util.List;
|
|||
* Handles the automatic reconnection process. Every time a connection is dropped without
|
||||
* the application explicitly closing it, the manager automatically tries to reconnect to
|
||||
* the server.<p>
|
||||
*
|
||||
* <p/>
|
||||
* The reconnection mechanism will try to reconnect periodically:
|
||||
* <ol>
|
||||
* <li>First it will try 6 times every 10 seconds.
|
||||
* <li>Then it will try 10 times every 1 minute.
|
||||
* <li>Finally it will try indefinitely every 5 minutes.
|
||||
* <li>First it will try 6 times every 10 seconds.
|
||||
* <li>Then it will try 10 times every 1 minute.
|
||||
* <li>Finally it will try indefinitely every 5 minutes.
|
||||
* </ol>
|
||||
*
|
||||
* @author Francisco Vives
|
||||
|
@ -218,6 +220,16 @@ public class ReconnectionManager implements ConnectionListener {
|
|||
|
||||
public void connectionClosedOnError(Exception e) {
|
||||
done = false;
|
||||
if (e instanceof XMPPException) {
|
||||
XMPPException xmppEx = (XMPPException) e;
|
||||
StreamError error = xmppEx.getStreamError();
|
||||
String reason = error.getCode();
|
||||
|
||||
if ("conflict".equals(reason)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isReconnectionAllowed()) {
|
||||
this.reconnect();
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ public class FileTransferNegotiator {
|
|||
// ignore
|
||||
}
|
||||
|
||||
public void reconectionSuccessful() {
|
||||
public void reconnectionSuccessful() {
|
||||
// ignore
|
||||
}
|
||||
|
||||
|
|
|
@ -2622,7 +2622,7 @@ public class MultiUserChat {
|
|||
// ignore
|
||||
}
|
||||
|
||||
public void reconectionSuccessful() {
|
||||
public void reconnectionSuccessful() {
|
||||
// ignore
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue