| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef NETWORKCONTROLLER_H |
| 5 | #define NETWORKCONTROLLER_H |
| 6 | |
| 7 | #include <QObject> |
| 8 | #include <QTcpServer> |
| 9 | #include <QTcpSocket> |
| 10 | |
| 11 | class NetworkController : public QObject |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | |
| 15 | public: |
| 16 | explicit NetworkController(QObject *parent = 0); |
| 17 | |
| 18 | private: |
| 19 | QTcpServer m_server; |
| 20 | |
| 21 | private slots: |
| 22 | void newConnection(); |
| 23 | void disconnected(); |
| 24 | void readyRead(); |
| 25 | |
| 26 | signals: |
| 27 | void commandAccepted(QString command, QString value); |
| 28 | }; |
| 29 | |
| 30 | #endif // NETWORKCONTROLLER_H |