Adds latest migration results
This commit is contained in:
829 files changed
+35074
-70886
No files matched your search
@@ -4,9 +4,17 @@
|
||||
#include "logger.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtNetwork/QHostAddress>
|
||||
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
#include <QtWebSockets/QWebSocketServer>
|
||||
#include <QtWebSockets/qwebsocketprotocol.h>
|
||||
#else
|
||||
namespace LtsWebSocket { class QWebSocketServerStub; }
|
||||
using QWebSocketServer = LtsWebSocket::QWebSocketServerStub;
|
||||
namespace QWebSocketProtocol { enum class CloseCode { NormalClosure = 1000 }; }
|
||||
#endif
|
||||
|
||||
namespace LtsWebSocket
|
||||
{
|
||||
@@ -21,6 +29,7 @@ class ConnectionHandler : public QObject
|
||||
explicit ConnectionHandler(QObject* parent = nullptr);
|
||||
~ConnectionHandler();
|
||||
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
bool init(const QString& serviceName, unsigned short port);
|
||||
|
||||
void sendToAllClients(ReplyMessage* message);
|
||||
@@ -29,6 +38,11 @@ class ConnectionHandler : public QObject
|
||||
{
|
||||
return m_server->serverPort();
|
||||
}
|
||||
#else
|
||||
bool init(const QString& /*serviceName*/, unsigned short /*port*/) { return false; }
|
||||
void sendToAllClients(ReplyMessage* /*message*/) {}
|
||||
unsigned short webSocketPort() { return 0; }
|
||||
#endif
|
||||
|
||||
signals:
|
||||
|
||||
@@ -39,12 +53,18 @@ class ConnectionHandler : public QObject
|
||||
void clientConnected(ClientConnection* client);
|
||||
|
||||
private slots:
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
void onServerError(QWebSocketProtocol::CloseCode closeCode);
|
||||
void onNewConnection();
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
#ifdef QT6_WEBSOCKETS_AVAILABLE
|
||||
QWebSocketServer* m_server;
|
||||
#else
|
||||
void* m_server;
|
||||
#endif
|
||||
QSet<ClientConnection*> m_connections;
|
||||
};
|
||||
} // namespace LtsWebSocket
|
||||
Reference in new issue
Block a user