WIP: main
This commit is contained in:
parent
f25f34565a
commit
15730b470e
52 changed files with 2438 additions and 208 deletions
43
client/managementserver.h
Normal file
43
client/managementserver.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#ifndef MANAGEMENTSERVER_H
|
||||
#define MANAGEMENTSERVER_H
|
||||
|
||||
#include <QAbstractSocket>
|
||||
#include <QString>
|
||||
|
||||
class QTcpServer;
|
||||
class QTcpSocket;
|
||||
|
||||
class ManagementServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ManagementServer(QObject *parent = nullptr);
|
||||
~ManagementServer();
|
||||
|
||||
bool start(const QString& host, unsigned int port);
|
||||
void stop();
|
||||
bool isOpen() const;
|
||||
|
||||
QString readLine();
|
||||
qint64 writeCommand(const QString& message);
|
||||
|
||||
QTcpSocket* socket() const;
|
||||
|
||||
signals:
|
||||
void readyRead();
|
||||
void serverStarted();
|
||||
|
||||
protected slots:
|
||||
void onAcceptError(QAbstractSocket::SocketError socketError);
|
||||
void onNewConnection();
|
||||
void onReadyRead();
|
||||
void onSocketDisconnected();
|
||||
void onSocketError(QAbstractSocket::SocketError socketError);
|
||||
|
||||
protected:
|
||||
QTcpServer* m_tcpServer;
|
||||
QTcpSocket* m_socket;
|
||||
};
|
||||
|
||||
#endif // MANAGEMENTSERVER_H
|
Loading…
Add table
Add a link
Reference in a new issue