/** * Returns true if the reconnection mechanism is enabled. * * @return true if automatic reconnection is allowed. */ private boolean isReconnectionPossible(XMPPConnection connection) { return !done && !connection.isConnected() && isAutomaticReconnectEnabled(); }
@Override public void connectionClosedOnError(Exception e) { done = false; if (!isAutomaticReconnectEnabled()) { return; } if (e instanceof StreamErrorException) { StreamErrorException xmppEx = (StreamErrorException) e; StreamError error = xmppEx.getStreamError(); if (StreamError.Condition.conflict == error.getCondition()) { return; } } reconnect(); } };
/** * Returns true if the reconnection mechanism is enabled. * * @return true if automatic reconnection is allowed. */ private boolean isReconnectionPossible(XMPPConnection connection) { return !done && !connection.isConnected() && isAutomaticReconnectEnabled(); }
ReconnectionManager reconnectionManager = ReconnectionManager.getInstanceFor(mConnection); if (!reconnectionManager.isAutomaticReconnectEnabled()) { reconnectionManager.enableAutomaticReconnection(); }
@Override public void connectionClosedOnError(Exception e) { done = false; if (!isAutomaticReconnectEnabled()) { return; } if (e instanceof StreamErrorException) { StreamErrorException xmppEx = (StreamErrorException) e; StreamError error = xmppEx.getStreamError(); if (StreamError.Condition.conflict == error.getCondition()) { return; } } reconnect(); } };