mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
added skeleton for the json connection server
This commit is contained in:
36
include/jsonserver/JsonServer.h
Normal file
36
include/jsonserver/JsonServer.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
// system includes
|
||||
#include <cstdint>
|
||||
|
||||
// Qt includes
|
||||
#include <QTcpServer>
|
||||
#include <QSet>
|
||||
|
||||
// Hyperion includes
|
||||
#include <hyperion/Hyperion.h>
|
||||
|
||||
class JsonClientConnection;
|
||||
|
||||
class JsonServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
JsonServer(Hyperion * hyperion, uint16_t port = 19444);
|
||||
~JsonServer();
|
||||
|
||||
uint16_t getPort() const;
|
||||
|
||||
private slots:
|
||||
void newConnection();
|
||||
|
||||
void closedConnection(JsonClientConnection * connection);
|
||||
|
||||
private:
|
||||
Hyperion * _hyperion;
|
||||
|
||||
QTcpServer _server;
|
||||
|
||||
QSet<JsonClientConnection *> _openConnections;
|
||||
};
|
Reference in New Issue
Block a user