Hush lite wallet
https://faq.hush.is/sdl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
697 B
34 lines
697 B
5 years ago
|
#ifndef WEBSOCKETS_H
|
||
|
#define WEBSOCKETS_H
|
||
|
|
||
|
#include "mainwindow.h"
|
||
|
#include "precompiled.h"
|
||
|
|
||
|
|
||
|
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
|
||
|
QT_FORWARD_DECLARE_CLASS(QWebSocket)
|
||
|
|
||
|
class WSServer : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit WSServer(quint16 port, bool debug = false, QObject *parent = nullptr);
|
||
|
~WSServer();
|
||
|
|
||
|
Q_SIGNALS:
|
||
|
void closed();
|
||
|
|
||
|
private Q_SLOTS:
|
||
|
void onNewConnection();
|
||
|
void processTextMessage(QString message);
|
||
|
void processBinaryMessage(QByteArray message);
|
||
|
void socketDisconnected();
|
||
|
|
||
|
private:
|
||
|
QWebSocketServer *m_pWebSocketServer;
|
||
|
MainWindow *m_mainWindow;
|
||
|
QList<QWebSocket *> m_clients;
|
||
|
bool m_debug;
|
||
|
};
|
||
|
|
||
|
#endif // WEBSOCKETS_H
|