mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
30 lines
584 B
C++
30 lines
584 B
C++
#ifndef WSSERVER_H
|
|
#define WSSERVER_H
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QList>
|
|
#include <QtCore/QByteArray>
|
|
#include "WSRequestHandler.h"
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
|
|
QT_FORWARD_DECLARE_CLASS(QWebSocket)
|
|
|
|
class WSServer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit WSServer(quint16 port, QObject *parent = Q_NULLPTR);
|
|
virtual ~WSServer();
|
|
void broadcast(QString message);
|
|
|
|
private Q_SLOTS:
|
|
void onNewConnection();
|
|
void socketDisconnected();
|
|
|
|
private:
|
|
QWebSocketServer *_wsServer;
|
|
QList<WSRequestHandler *> _clients;
|
|
};
|
|
|
|
#endif // WSSERVER_H
|