8#include <QtCore/qobject.h>
9#include <QtCore/qlist.h>
10#include <QtCore/qbytearray.h>
11#include <QtNetwork/qsslerror.h>
12#include <QtCore/qtimer.h>
17class QWebSocketServer;
31 bool sendHttpRequest(
const std::string& operation,
const std::string&
url,
const std::string& jsonData, std::string& response);
43 void setRelayUrl(
const std::string& _url) { m_relayUrl = _url; };
44 const std::string&
getRelayUrl(
void)
const {
return m_relayUrl; };
60 void onNewConnection(
void);
61 void processMessage(QString message);
62 void socketDisconnected(
void);
63 void onSslErrors(
const QList<QSslError> &errors);
64 void slotSocketClosed(
void);
75 void processMessages(
void);
77 void sendQueueWSMessage(
const std::string operation,
const std::string
senderIP,
const std::string jsonData);
78 std::string sendProcessWSMessage(
const std::string operation,
const std::string
senderIP,
const std::string jsonData);
79 std::string getSystemInformation(
void);
81 std::string m_websocketIp;
82 unsigned int m_websocketPort;
83 std::string m_relayUrl;
85 QWebSocketServer *m_pWebSocketServer;
86 QList<QWebSocket *> m_clients;
87 std::string responseText;
88 bool responseReceived;
90 std::chrono::system_clock::time_point m_lastReceiveTime;
91 QTimer* m_keepAliveTimer;
const char * senderIP
Definition dllmain.cpp:205
Q_DECLARE_METATYPE(const char *)
Definition SocketServer.h:24
const std::string & getWebsocketIp(void) const
Definition SocketServer.h:38
void setWebsocketPort(unsigned int _port)
Definition SocketServer.h:40
void deallocateData(const char *data)
Definition SocketServer.cpp:188
static SocketServer & instance(void)
Definition SocketServer.cpp:24
unsigned int getWebsocketPort(void) const
Definition SocketServer.h:41
bool startServer(void)
Definition SocketServer.cpp:29
const std::string & getRelayUrl(void) const
Definition SocketServer.h:44
bool sendHttpRequest(const std::string &operation, const std::string &url, const std::string &jsonData, std::string &response)
Definition SocketServer.cpp:75
void queueAction(const char *json, const char *senderIP)
Definition SocketServer.cpp:158
QString performAction(const char *json, const char *senderIP)
Definition SocketServer.cpp:108
void setWebsocketIp(const std::string &_ip)
Definition SocketServer.h:37
void setRelayUrl(const std::string &_url)
Definition SocketServer.h:43