Further document the auto_reconnect option

and drop the reconnection timeout to 3 seconds (from 5).
This commit is contained in:
JC Brand 2016-08-19 14:11:37 +00:00
parent 59143c1c72
commit 1ee7d06a08
2 changed files with 14 additions and 2 deletions

View File

@ -256,6 +256,18 @@ auto_reconnect
Automatically reconnect to the XMPP server if the connection drops
unexpectedly.
This option works best when you have `authentication` set to `prebind` and have
also specified a `prebind_url` URL, from where converse.js can fetch the BOSH
tokens. In this case, converse.js will automaticallly reconnect when the
connection drops but also reestablish earlier lost connections (due to
network outages, closing your laptop etc.).
When `authentication` is set to `login`, then this option will only work when
the page hasn't been reloaded yet, because then the user's password has been
wiped from memory. This configuration can however still be useful when using
converse.js in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
or `electron <http://electron.atom.io/>`_.
auto_subscribe
--------------

View File

@ -423,8 +423,8 @@
(converse.disconnection_cause === Strophe.Status.DISCONNECTING ||
converse.disconnection_cause === Strophe.Status.DISCONNECTED) &&
converse.auto_reconnect) {
window.setTimeout(_.partial(converse.reconnect, condition), 5000);
converse.log('RECONNECTING IN 5 SECONDS');
window.setTimeout(_.partial(converse.reconnect, condition), 3000);
converse.log('RECONNECTING IN 3 SECONDS');
return 'reconnecting';
}
}