mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 23:42: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;
|
package org.jivesoftware.smack;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.packet.StreamError;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -7,12 +9,12 @@ import java.util.List;
|
||||||
* Handles the automatic reconnection process. Every time a connection is dropped without
|
* 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 application explicitly closing it, the manager automatically tries to reconnect to
|
||||||
* the server.<p>
|
* the server.<p>
|
||||||
*
|
* <p/>
|
||||||
* The reconnection mechanism will try to reconnect periodically:
|
* The reconnection mechanism will try to reconnect periodically:
|
||||||
* <ol>
|
* <ol>
|
||||||
* <li>First it will try 6 times every 10 seconds.
|
* <li>First it will try 6 times every 10 seconds.
|
||||||
* <li>Then it will try 10 times every 1 minute.
|
* <li>Then it will try 10 times every 1 minute.
|
||||||
* <li>Finally it will try indefinitely every 5 minutes.
|
* <li>Finally it will try indefinitely every 5 minutes.
|
||||||
* </ol>
|
* </ol>
|
||||||
*
|
*
|
||||||
* @author Francisco Vives
|
* @author Francisco Vives
|
||||||
|
@ -218,6 +220,16 @@ public class ReconnectionManager implements ConnectionListener {
|
||||||
|
|
||||||
public void connectionClosedOnError(Exception e) {
|
public void connectionClosedOnError(Exception e) {
|
||||||
done = false;
|
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()) {
|
if (this.isReconnectionAllowed()) {
|
||||||
this.reconnect();
|
this.reconnect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class FileTransferNegotiator {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reconectionSuccessful() {
|
public void reconnectionSuccessful() {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2622,7 +2622,7 @@ public class MultiUserChat {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reconectionSuccessful() {
|
public void reconnectionSuccessful() {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue