Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+7
-8
@@ -18,11 +18,10 @@
|
||||
namespace ExerciseEventManagement
|
||||
{
|
||||
|
||||
WebSocketHandler::WebSocketHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
WebSocketHandler::WebSocketHandler(QObject *parent) : QObject(parent)
|
||||
, m_webSocketServer(new QWebSocketServer(QStringLiteral("AVS-Server"), QWebSocketServer::NonSecureMode, this))
|
||||
, m_timer(new QTimer())
|
||||
{
|
||||
, m_timer(new QTimer()),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
connect(m_timer, &QTimer::timeout,
|
||||
this, &WebSocketHandler::onSendMessage);
|
||||
|
||||
@@ -44,7 +43,7 @@ bool WebSocketHandler::init(quint16 listenPort)
|
||||
{
|
||||
if (!m_webSocketServer->listen(QHostAddress::Any, listenPort))
|
||||
{
|
||||
WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting";
|
||||
WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting";
|
||||
return false;
|
||||
}
|
||||
// inform calling process via stdout about the port/url
|
||||
@@ -61,7 +60,7 @@ bool WebSocketHandler::sendTelegram(const QString &jsonStr)
|
||||
if (!isConnected())
|
||||
return false;
|
||||
|
||||
ERROR_LOG() << "jsonStr" << jsonStr;
|
||||
ERROR_LOG(m_logger) << "jsonStr" << jsonStr;
|
||||
|
||||
bool bOk = false;
|
||||
for (QWebSocket *ws : std::as_const(m_webSockets))
|
||||
@@ -79,7 +78,7 @@ void WebSocketHandler::onNewConnection()
|
||||
QWebSocket *ws = m_webSocketServer->nextPendingConnection();
|
||||
if (!ws)
|
||||
return;
|
||||
INFO_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
|
||||
INFO_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
|
||||
|
||||
connect(ws, &QWebSocket::disconnected,
|
||||
this, &WebSocketHandler::onWebSocketDisconnected);
|
||||
@@ -91,7 +90,7 @@ void WebSocketHandler::onNewConnection()
|
||||
|
||||
void WebSocketHandler::onSendMessage()
|
||||
{
|
||||
ERROR_LOG() << "Send message: ";
|
||||
ERROR_LOG(m_logger) << "Send message: ";
|
||||
|
||||
QJsonObject obj;
|
||||
|
||||
|
||||
+1
@@ -40,6 +40,7 @@ private Q_SLOTS:
|
||||
void onWebSocketDisconnected();
|
||||
void onSendMessage();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QWebSocketServer *m_webSocketServer;
|
||||
QSet<QWebSocket *> m_webSockets;
|
||||
QTimer *m_timer;
|
||||
|
||||
Reference in new issue
Block a user