From a50ca30e769a628f609f8cc0eedf5bc10b3f1b5a Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sat, 21 Feb 2015 06:39:20 +0100 Subject: Use a timer to try reconnecting to the XMPP server only each 2 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the connection is lost, immediately try to reconnect, then try to reconnect every 2 seconds. This is much better than the previous “Try to re-connect as fast as possible”. --- src/xmpp/xmpp_component.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/xmpp/xmpp_component.hpp') diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp index 64b2ff7..951d5a3 100644 --- a/src/xmpp/xmpp_component.hpp +++ b/src/xmpp/xmpp_component.hpp @@ -241,6 +241,12 @@ public: * Whether or not we ever succeeded our authentication to the XMPP server */ bool ever_auth; + /** + * Whether or not this is the first consecutive try on connecting to the + * XMPP server. We use this to delay the connection attempt for a few + * seconds, if it is not the first try. + */ + bool first_connection_try; private: /** -- cgit v1.2.3