| 7 | #include <QtNetwork> |
| 8 | |
| 9 | class BaseXThread : public QThread |
| 10 | { |
| 11 | Q_OBJECT |
| 12 | public: |
| 13 | explicit BaseXThread(QString &host, quint16 port, QObject *parent = 0); |
| 14 | ~BaseXThread(); |
| 15 | |
| 16 | int addRequest(QString request); |
| 17 | void run(); |
| 18 | |
| 19 | |
| 20 | signals: |
| 21 | void newResult(const QByteArray *res); |
| 22 | void socketError(int socketError, const QString &message); |
| 23 | void error(int error, const QString &message); |
| 24 | private: |
| 25 | QString hostName; |
| 26 | quint16 port; |
| 27 | QMutex mutex; |
| 28 | QWaitCondition cond; |
| 29 | bool quit; |
| 30 | bool firstRun; |
| 31 | |
| 32 | QString dbuser; |
| 33 | QString dbpasswd; |
| 34 | QQueue<QString> requestQueue; |
| 35 | |
| 36 | QByteArray END_RES; |
| 37 | QByteArray RES_FAIL; |
| 38 | |
| 39 | QTcpSocket *socket; |
| 40 | |
| 41 | bool connectToBasex(); |
| 42 | const int Timeout; |
| 43 | |
| 44 | }; |
| 45 | |
| 46 | #endif // BASEXTHREAD_H |
nothing calls this directly
no outgoing calls
no test coverage detected