KD SOAP API Documentation 2.2
Loading...
Searching...
No Matches
KDSoapSocketList.cpp
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Soap project.
4**
5** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10#include "KDSoapServer.h"
12#include "KDSoapSocketList_p.h"
13#include <QDebug>
14
16 : m_server(server)
17 , m_serverObject(server->createServerObject())
18 , m_totalConnectionCount(0)
19{
20 Q_ASSERT(m_server);
21 Q_ASSERT(m_serverObject);
22}
23
25{
26 delete m_serverObject;
27}
28
30{
31 KDSoapServerSocket *socket = new KDSoapServerSocket(this, m_serverObject);
32 socket->setSocketDescriptor(socketDescriptor);
33
34#ifndef QT_NO_SSL
35 if (m_server->features() & KDSoapServer::Ssl) {
36 // We could call a virtual "m_server->setSslConfiguration(socket)" here,
37 // if more control is needed (e.g. due to SNI)
38 if (!m_server->sslConfiguration().isNull()) {
39 socket->setSslConfiguration(m_server->sslConfiguration());
40 }
41 socket->startServerEncryption();
42 }
43#endif
44
46 m_sockets.insert(socket);
48 return socket;
49}
50
52{
53 // qDebug() << Q_FUNC_INFO;
54 m_sockets.remove(socket);
55}
56
58{
59 return m_sockets.count();
60}
61
63{
64 for (KDSoapServerSocket *socket : qAsConst(m_sockets)) {
65 socket->close(); // will disconnect
66 }
67}
68
70{
71 return m_totalConnectionCount.loadAcquire();
72}
73
75{
76 m_totalConnectionCount.ref();
77 // qDebug() << m_totalConnectionCount << "sockets connected in" << QThread::currentThread();
78}
79
81{
82 m_totalConnectionCount = 0;
83}
void socketDeleted(KDSoapServerSocket *)
QSslConfiguration sslConfiguration() const
Features features() const
int totalConnectionCount() const
KDSoapServerSocket * handleIncomingConnection(int socketDescriptor)
void socketDeleted(KDSoapServerSocket *socket)
KDSoapSocketList(KDSoapServer *server)
T loadAcquire() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void deleteLater()
T qobject_cast(QObject *object)
int count() const const
QSet::iterator insert(const T &value)
bool remove(const T &value)
bool isNull() const const
virtual bool setSocketDescriptor(qintptr socketDescriptor, QAbstractSocket::SocketState state, QIODevice::OpenMode openMode) override
void setSslConfiguration(const QSslConfiguration &configuration)
void startServerEncryption()

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/
Generated on Sat Apr 20 2024 00:04:25 for KD SOAP API Documentation by doxygen 1.9.8