KD SOAP API Documentation: KDSoapServerThread_p.h Source File

| KD SOAP API Documentation 2.2

Loading...
Searching...
No Matches
KDSoapServerThread_p.h
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#ifndef KDSOAPSERVERTHREAD_P_H
11#define KDSOAPSERVERTHREAD_P_H
12
13#include <QHash>
14#include <QMutex>
15#include <QSemaphore>
16#include <QThread>
17class KDSoapServer;
18class KDSoapSocketList;
19
20// clazy:excludeall=ctor-missing-parent-argument
21 class KDSoapServerThreadImpl : public QObject
22{
23 Q_OBJECT
24public:
25 KDSoapServerThreadImpl(); // created on stack, clazy:exclude=ctor-missing-parent-argument
26 ~KDSoapServerThreadImpl();
27
28public Q_SLOTS:
29 void handleIncomingConnection(int socketDescriptor, KDSoapServer *server);
30 void disconnectSocketsForServer(KDSoapServer *server, QSemaphore *semaphore);
31 void quit();
32
33public:
34 int socketCount();
35 int socketCountForServer(const KDSoapServer *server);
36 int totalConnectionCountForServer(const KDSoapServer *server);
37 void resetTotalConnectionCountForServer(const KDSoapServer *server);
38
39 void addIncomingConnection();
40
41private:
42 QMutex m_socketListMutex;
43 KDSoapSocketList *socketListForServer(KDSoapServer *server);
44 typedef QHash<KDSoapServer *, KDSoapSocketList *> SocketLists;
45 SocketLists m_socketLists;
46
47 QAtomicInt m_incomingConnectionCount;
48};
49
50 class KDSoapServerThread : public QThread
51{
52 Q_OBJECT
53public:
54 explicit KDSoapServerThread(QObject *parent = 0);
55 ~KDSoapServerThread();
56
57 void startThread();
58 void quitThread();
59
60 int socketCount() const;
61 int socketCountForServer(const KDSoapServer *server) const;
62 int totalConnectionCountForServer(const KDSoapServer *server) const;
63 void resetTotalConnectionCountForServer(const KDSoapServer *server);
64
65 void disconnectSocketsForServer(KDSoapServer *server, QSemaphore &semaphore);
66 void handleIncomingConnection(int socketDescriptor, KDSoapServer *server);
67
68protected:
69 virtual void run() override;
70
71private:
72 void start(); // use startThread instead
73 void quit(); // use quitThread instead
74 KDSoapServerThreadImpl *d;
75 QSemaphore m_semaphore;
76};
77
78#endif // KDSOAPSERVERTHREAD_P_H
KDSoapServerThreadImpl
Definition KDSoapServerThread_p.h:22
KDSoapServerThreadImpl::~KDSoapServerThreadImpl
~KDSoapServerThreadImpl()
Definition KDSoapServerThread.cpp:105
KDSoapServerThreadImpl::KDSoapServerThreadImpl
KDSoapServerThreadImpl()
Definition KDSoapServerThread.cpp:99
KDSoapServerThreadImpl::totalConnectionCountForServer
int totalConnectionCountForServer(const KDSoapServer *server)
Definition KDSoapServerThread.cpp:172
KDSoapServerThreadImpl::disconnectSocketsForServer
void disconnectSocketsForServer(KDSoapServer *server, QSemaphore *semaphore)
Definition KDSoapServerThread.cpp:162
KDSoapServerThreadImpl::resetTotalConnectionCountForServer
void resetTotalConnectionCountForServer(const KDSoapServer *server)
Definition KDSoapServerThread.cpp:179
KDSoapServerThreadImpl::quit
void quit()
Definition KDSoapServerThread.cpp:150
KDSoapServerThreadImpl::socketCount
int socketCount()
Definition KDSoapServerThread.cpp:111
KDSoapServerThreadImpl::socketCountForServer
int socketCountForServer(const KDSoapServer *server)
Definition KDSoapServerThread.cpp:155
KDSoapServerThreadImpl::handleIncomingConnection
void handleIncomingConnection(int socketDescriptor, KDSoapServer *server)
Definition KDSoapServerThread.cpp:141
KDSoapServerThreadImpl::addIncomingConnection
void addIncomingConnection()
Definition KDSoapServerThread.cpp:134
KDSoapServerThread
Definition KDSoapServerThread_p.h:51
KDSoapServerThread::socketCountForServer
int socketCountForServer(const KDSoapServer *server) const
Definition KDSoapServerThread.cpp:46
KDSoapServerThread::disconnectSocketsForServer
void disconnectSocketsForServer(KDSoapServer *server, QSemaphore &semaphore)
Definition KDSoapServerThread.cpp:69
KDSoapServerThread::startThread
void startThread()
Definition KDSoapServerThread.cpp:78
KDSoapServerThread::totalConnectionCountForServer
int totalConnectionCountForServer(const KDSoapServer *server) const
Definition KDSoapServerThread.cpp:54
KDSoapServerThread::resetTotalConnectionCountForServer
void resetTotalConnectionCountForServer(const KDSoapServer *server)
Definition KDSoapServerThread.cpp:62
KDSoapServerThread::run
virtual void run() override
Definition KDSoapServerThread.cpp:29
KDSoapServerThread::~KDSoapServerThread
~KDSoapServerThread()
Definition KDSoapServerThread.cpp:25
KDSoapServerThread::handleIncomingConnection
void handleIncomingConnection(int socketDescriptor, KDSoapServer *server)
Definition KDSoapServerThread.cpp:89
KDSoapServerThread::quitThread
void quitThread()
Definition KDSoapServerThread.cpp:84
KDSoapServerThread::socketCount
int socketCount() const
Definition KDSoapServerThread.cpp:38
KDSoapServer
Definition KDSoapServer.h:30
KDSoapSocketList
Definition KDSoapSocketList_p.h:23
QAtomicInt
QHash
QMutex
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::Q_SLOTS
Q_SLOTSQ_SLOTS
QObject::parent
QObject * parent() const const
QSemaphore
QThread

© 2010-2024 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 Sun Jan 7 2024 11:47:36 for KD SOAP API Documentation by doxygen 1.9.8