obs-websocket/WSServer.h
2016-11-11 18:13:23 +01:00

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