make protoconnection to invalid host less blocking

Former-commit-id: e7a89c87b15fbe9809ec63468b59ecc55c6d3e72
This commit is contained in:
redpanther
2016-02-25 15:21:25 +01:00
parent 878538eb50
commit ea89a85ddb
2 changed files with 45 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
#include <QColor>
#include <QImage>
#include <QTcpSocket>
#include <QTimer>
#include <QMap>
// hyperion util
@@ -19,8 +20,11 @@
///
/// Connection class to setup an connection to the hyperion server and execute commands
///
class ProtoConnection
class ProtoConnection : public QObject
{
Q_OBJECT
public:
///
/// Constructor
@@ -74,10 +78,13 @@ public:
///
void sendMessage(const proto::HyperionRequest & message);
private:
private slots:
/// Try to connect to the Hyperion host
void connectToHost();
private:
///
/// Parse a reply message
///
@@ -99,4 +106,7 @@ private:
/// Skip receiving reply messages from Hyperion if set
bool _skipReply;
QTimer _timer;
QAbstractSocket::SocketState _prevSocketState;
};