diff options
author | Christian Klinger | 2016-09-29 15:40:18 +0200 |
---|---|---|
committer | Christian Klinger | 2016-09-29 15:40:18 +0200 |
commit | 3d82bfc698165bb20f3c38d42f2b77ab855c1edf (patch) | |
tree | 2c170bcdd5c89259bb0b530fa11fdfe701c99850 /src/client/net/serverdiscovery.h | |
parent | added an information dialog that displays ip and hostname. (diff) | |
download | pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.gz pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.xz pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.zip |
astyle.
Diffstat (limited to 'src/client/net/serverdiscovery.h')
-rw-r--r-- | src/client/net/serverdiscovery.h | 81 |
1 files changed, 41 insertions, 40 deletions
diff --git a/src/client/net/serverdiscovery.h b/src/client/net/serverdiscovery.h index a41c946..d7d6010 100644 --- a/src/client/net/serverdiscovery.h +++ b/src/client/net/serverdiscovery.h @@ -8,46 +8,47 @@ class ServerDiscovery : public QObject { - Q_OBJECT - - public: - enum class ErrorType{ - InvalidIpList, - InvalidHash - }; - - explicit ServerDiscovery(QObject *parent = 0); - ~ServerDiscovery(); - - void start(const QByteArray& sessionName, QString mgrIP); - void stop(); - inline bool isActive(){ return _discoveryTimer.isActive(); } - - private: - QTimer _discoveryTimer; - const int _minDiscoveryInterval; - const int _maxDiscoveryInterval; - int _hashErrorCount; - int _ipErrorCount; - QByteArray _nameBytes; - QByteArray _salt2; - QUdpSocket _discoverySocket; - NetworkMessage _packet; - - QHostAddress _mgrIP; - - static const int UDPBUFSIZ = 9000; - static const int SALT_LEN = 18; - - signals: - void serverDetected(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect); - void error(ErrorType e, int count); - - public slots: - - private slots: - void doDiscovery(); - void onUdpReadyRead(); + Q_OBJECT + +public: + enum class ErrorType + { + InvalidIpList, + InvalidHash + }; + + explicit ServerDiscovery(QObject *parent = 0); + ~ServerDiscovery(); + + void start(const QByteArray& sessionName, QString mgrIP); + void stop(); + inline bool isActive() { return _discoveryTimer.isActive(); } + +private: + QTimer _discoveryTimer; + const int _minDiscoveryInterval; + const int _maxDiscoveryInterval; + int _hashErrorCount; + int _ipErrorCount; + QByteArray _nameBytes; + QByteArray _salt2; + QUdpSocket _discoverySocket; + NetworkMessage _packet; + + QHostAddress _mgrIP; + + static const int UDPBUFSIZ = 9000; + static const int SALT_LEN = 18; + +signals: + void serverDetected(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect); + void error(ErrorType e, int count); + +public slots: + +private slots: + void doDiscovery(); + void onUdpReadyRead(); }; |