9#include "connectionserver.h"
10#include "connection_p.h"
11#include "connectionbackend_p.h"
15class KIO::ConnectionServerPrivate
18 inline ConnectionServerPrivate()
24 ConnectionBackend *backend;
27ConnectionServer::ConnectionServer(
QObject *parent)
29 , d(new ConnectionServerPrivate)
34ConnectionServer::~ConnectionServer() =
default;
36void ConnectionServer::listenForRemote()
38 d->backend =
new ConnectionBackend(
this);
39 if (!d->backend->listenForRemote()) {
45 connect(d->backend, &ConnectionBackend::newConnection,
this, &ConnectionServer::newConnection);
49QUrl ConnectionServer::address()
const
52 return d->backend->address;
57bool ConnectionServer::isListening()
const
59 return d->backend && d->backend->state == ConnectionBackend::Listening;
62void ConnectionServer::close()
68Connection *ConnectionServer::nextPendingConnection()
74 ConnectionBackend *newBackend = d->backend->nextPendingConnection();
79 Connection *result =
new Connection;
80 result->d->setBackend(newBackend);
81 newBackend->setParent(result);
86void ConnectionServer::setNextPendingConnection(Connection *conn)
88 ConnectionBackend *newBackend = d->backend->nextPendingConnection();
91 conn->d->setBackend(newBackend);
92 newBackend->setParent(conn);
97#include "moc_connectionserver.cpp"
A namespace for KIO globals.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)