diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java b/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java index a6d8219..f1609db 100644 --- a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java +++ b/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java @@ -229,6 +229,17 @@ public void reconnectionFailed(Exception e) { mucClientManager.reconnectionFailed(MucClient.this); logger.warn("Reconnection failed: ", e); + + // If there was an error reconnecting, do not give up, let's retry (reconnection stops if the connection + // is connected, but we have another error after the connection is established). This can happen if we retry + // too quickly and prosody is not fully up ('invalid-namespace' error) + if (MucClient.this.connectRetry != null && xmppConnection.isConnected()) + { + xmppConnection.instantShutdown(); + + MucClient.this.connectRetry.runRetryingTask( + new SimpleRetryTask(0, 2000, true, getConnectAndLoginCallable())); + } } }; @@ -675,10 +686,7 @@ private Callable getConnectAndLoginCallable() { try { - if (!xmppConnection.isConnected()) - { - xmppConnection.connect(); - } + xmppConnection.connect(); } catch(Exception t) { diff --git a/pom.xml b/pom.xml index 5c91d4d..c1acbe3 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 3.0.10 0.12.6 1.78.1 - 4.4.6 + 4.4.8