Refactor server services to share more code

This commit is contained in:
Carl Philipp Klemm 2026-03-30 16:58:52 +02:00
parent 37c0c5d17b
commit 5cd7c782ce
9 changed files with 280 additions and 85 deletions

View file

@ -0,0 +1,32 @@
#ifndef WEBSOCKETSERVER_SERVER_H
#define WEBSOCKETSERVER_SERVER_H
#include <QWebSocketServer>
#include <vector>
#include "server.h"
class WebSocketServer : public Server
{
Q_OBJECT
QWebSocketServer server;
public:
WebSocketServer(const QString &serverName, QObject* parent = nullptr);
virtual ~WebSocketServer();
virtual bool launch(const QHostAddress &address = QHostAddress::Any, quint16 port = 0) override;
virtual void sendJson(const QJsonObject& json) override;
private slots:
void incomingConnection();
void textMessageReceived(const QString &message);
protected:
virtual void processIncomeingJson(const QByteArray& jsonbytes) override;
signals:
void sigRequestSave();
};
#endif // WEBSOCKETSERVER_SERVER_H