hyperion.ng
FlatBufferServer.h
1 #pragma once
2 
3 // util
4 #include <utils/Logger.h>
5 #include <utils/settings.h>
6 
7 // qt
8 #include <QVector>
9 
10 class QTcpServer;
11 class FlatBufferClient;
12 
17 class FlatBufferServer : public QObject
18 {
19  Q_OBJECT
20 public:
21  FlatBufferServer(const QJsonDocument& config, QObject* parent = nullptr);
23 
24 public slots:
30  void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
31 
32  void initServer();
33 
34 private slots:
38  void newConnection();
39 
43  void clientDisconnected();
44 
45 private:
49  void startServer();
50 
54  void stopServer();
55 
56 
57 private:
58  QTcpServer* _server;
59  Logger* _log;
60  int _timeout;
61  quint16 _port;
62  const QJsonDocument _config;
63 
64  QVector<FlatBufferClient*> _openConnections;
65 };
Definition: Logger.h:32
Socket (client) of FlatBufferServer.
Definition: FlatBufferClient.h:24
A TcpServer to receive images of different formats with Google Flatbuffer Images will be forwarded to...
Definition: FlatBufferServer.h:17
void handleSettingsUpdate(const settings::type &type, const QJsonDocument &config)
Handle settings update.
Definition: FlatBufferServer.cpp:33