2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#include <QtNetwork>
|
|
|
|
|
|
|
|
#include "connection.h"
|
|
|
|
#include "server.h"
|
|
|
|
|
|
|
|
Server::Server(QObject *parent)
|
|
|
|
: QTcpServer(parent)
|
|
|
|
{
|
|
|
|
listen(QHostAddress::Any);
|
|
|
|
}
|
|
|
|
|
2012-01-11 15:06:14 +00:00
|
|
|
void Server::incomingConnection(qintptr socketDescriptor)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2018-01-18 02:27:09 +00:00
|
|
|
Connection *connection = new Connection(socketDescriptor, this);
|
2011-04-27 10:05:43 +00:00
|
|
|
emit newConnection(connection);
|
|
|
|
}
|