DaemonService/daemonservice.cpp
筱傑 6a70501baa
update
增加手动移出白名单
连续连接移出白名单
2019-01-12 10:40:27 +08:00

26 lines
763 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "daemonservice.h"
#include <QTcpServer>
#include <QTcpSocket>
#include <QDebug>
#include <QThread>
#include "worker.h"
//DaemonService::DaemonService()
//{
// if (this->listen(QHostAddress::AnyIPv4, 9876))
// qDebug("The server started successfully!");
// else
// qCritical("Server failed to startError message%s", this->errorString().toStdString().data()); //错误信息
//}
/**
* @brief 当有新连接进入时
*/
void DaemonService::incomingConnection(qintptr socketDescriptor)
{
// qDebug("new connect is connect %d有新的连接进入", socketDescriptor);
Worker *worker = new Worker(socketDescriptor, this->m_portList);
QThreadPool::globalInstance()->start(worker);
}