Adds q2 repos to migrate
This commit is contained in:
1 parent
ad1f62c4ee
commit
17f1c61c9e
991 files changed
+178451
No files matched your search
@@ -0,0 +1,38 @@
|
||||
|
||||
|
||||
#include "server.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <QtNetwork/QTcpSocket>
|
||||
|
||||
#include "worker.h"
|
||||
|
||||
TTServer::TTServer(const TTSArgs &ttsArgs)
|
||||
: m_ttsArgs(ttsArgs)
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("TTServer"))
|
||||
{
|
||||
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";
|
||||
}
|
||||
Reference in new issue
Block a user