UvosSmartHomeInterface/src/service/tcpserver.h

34 lines
683 B
C++

#ifndef TCPSERVER_SERVER_H
#define TCPSERVER_SERVER_H
#include <QTcpServer>
#include <vector>
#include "server.h"
class TcpServer : public Server
{
Q_OBJECT
QTcpServer server;
public:
TcpServer(QObject* parent = nullptr);
virtual bool launch(const QHostAddress &address = QHostAddress::Any, quint16 port = 0) override;
virtual void sendJson(const QJsonObject& json) override;
signals:
void sigRequestSave();
private slots:
void incomingConnection();
void socketReadyRead();
protected:
virtual void processIncomeingJson(const QByteArray& jsonbytes) override;
private:
void processComand(const QByteArray& command, Client& client);
};
#endif // TCPSERVER_SERVER_H