From 2d3aee65a5d59f87dcfd05b73cde6456bf504582 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Sat, 5 Sep 2009 09:57:09 +0000 Subject: Reconnection mechanism --- source/QXmppReconnectionManager.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/QXmppReconnectionManager.h (limited to 'source/QXmppReconnectionManager.h') diff --git a/source/QXmppReconnectionManager.h b/source/QXmppReconnectionManager.h new file mode 100644 index 00000000..77f0e5b6 --- /dev/null +++ b/source/QXmppReconnectionManager.h @@ -0,0 +1,38 @@ +#ifndef QXMPPRECONNECTIONMANAGER_H +#define QXMPPRECONNECTIONMANAGER_H + +#include +#include +#include "QXmppClient.h" + +class QXmppClient; + +class QXmppReconnectionManager : public QObject +{ + Q_OBJECT + +public: + QXmppReconnectionManager(QXmppClient* client); + +signals: + void reconnectingIn(int); + void reconnectingNow(); + +public slots: + void cancelReconnection(); + +private slots: + void connected(); + void error(QXmppClient::Error); + void reconnect(); + +private: + int getNextReconnectingInTime(); + int m_reconnectionTries; + QTimer m_timer; + + // reference to to client object (no ownership) + QXmppClient* m_client; +}; + +#endif // QXMPPRECONNECTIONMANAGER_H -- cgit v1.2.3