Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/TetraIF/PrtCnv/TetraTestServer/server.cpp
T
torsten 950d669538 Qt6 Migration: BUILD_RTI guards und CMake fixes
- BUILD_RTI conditional compilation für RTI Connext DDS dependencies
- Namespace fixes in core_dtc.h (Core:: → DDS::Core::)
- CMakeLists.txt: BUILD_RTI option und conditional dependencies
- Handler minelayer: namespace closing mit BUILD_RTI guard
- Build erfolgreich mit BUILD_RTI=OFF validiert

Signed-off-by: Torsten Wierschin <torsten.wierschin@life-maps.com>
2026-08-21 18:37:18 +02:00

38 lines
863 B
C++

#include "server.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtNetwork/QTcpSocket>
#include "worker.h"
TTServer::TTServer(const TTSArgs &ttsArgs) : m_ttsArgs(ttsArgs)
.getNGLLogger("TTServer")),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
connect(this, &TTServer::newConnection,
this, &TTServer::onNewConnection);
}
void TTServer::onNewConnection()
{
QTcpSocket *sock = nextPendingConnection();
if (!sock)
return;
NOTICE_LOG(m_logger) << "New incoming connection from "
<< sock->peerName() << ":"
<< sock->peerPort();
TTWorker *ttw = new TTWorker(sock, m_ttsArgs);
if (!ttw->init())
exit(5);
connect(sock, &QTcpSocket::disconnected,
this, &TTServer::onDisconnect);
}
void TTServer::onDisconnect()
{
NOTICE_LOG(m_logger) << "Disconnected";
}