Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
@@ -9,10 +9,9 @@
|
||||
|
||||
using namespace LtsWebSocket;
|
||||
|
||||
ConnectionHandler::ConnectionHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_server(nullptr)
|
||||
{}
|
||||
ConnectionHandler::ConnectionHandler(QObject *parent) : QObject(parent)
|
||||
, m_server(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
ConnectionHandler::~ConnectionHandler()
|
||||
{
|
||||
@@ -33,13 +32,13 @@ bool ConnectionHandler::init(const QString &serviceName, unsigned short port)
|
||||
connect(m_server, &QWebSocketServer::newConnection, this, &ConnectionHandler::onNewConnection);
|
||||
connect(m_server, &QWebSocketServer::serverError, this, &ConnectionHandler::onServerError);
|
||||
|
||||
DEBUG_LOG() << "Trying to listen ";
|
||||
DEBUG_LOG(m_logger) << "Trying to listen ";
|
||||
if (!m_server->listen(QHostAddress::Any, port))
|
||||
{
|
||||
ERROR_LOG() << "Not possible to listen to port " << port;
|
||||
ERROR_LOG(m_logger) << "Not possible to listen to port " << port;
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "... ok, port " << m_server->serverPort();
|
||||
DEBUG_LOG(m_logger) << "... ok, port " << m_server->serverPort();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -54,7 +53,7 @@ void ConnectionHandler::sendToAllClients(ReplyMessage *message)
|
||||
|
||||
void ConnectionHandler::onServerError(QWebSocketProtocol::CloseCode closeCode)
|
||||
{
|
||||
ERROR_LOG() << "Got server error with close code " << closeCode;
|
||||
ERROR_LOG(m_logger) << "Got server error with close code " << closeCode;
|
||||
}
|
||||
|
||||
void ConnectionHandler::onNewConnection()
|
||||
@@ -71,7 +70,7 @@ void ConnectionHandler::onNewConnection()
|
||||
|
||||
if (!newConnection->init())
|
||||
{
|
||||
ERROR_LOG() << "Failed to initialise new client";
|
||||
ERROR_LOG(m_logger) << "Failed to initialise new client";
|
||||
delete newConnection;
|
||||
newConnection = nullptr;
|
||||
continue;
|
||||
@@ -84,6 +83,6 @@ void ConnectionHandler::onNewConnection()
|
||||
|
||||
m_connections.insert(newConnection);
|
||||
emit clientConnected(newConnection);
|
||||
INFO_LOG() << "New client connected ip: " << socket->localAddress().toString() << ":" << socket->localPort();
|
||||
INFO_LOG(m_logger) << "New client connected ip: " << socket->localAddress().toString() << ":" << socket->localPort();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user