KD SOAP  1.8.0
KDSoapSocketList_p.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com.
3 ** All rights reserved.
4 **
5 ** This file is part of the KD Soap library.
6 **
7 ** Licensees holding valid commercial KD Soap licenses may use this file in
8 ** accordance with the KD Soap Commercial License Agreement provided with
9 ** the Software.
10 **
11 **
12 ** This file may be distributed and/or modified under the terms of the
13 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
14 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
15 **
16 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 **
19 ** Contact info@kdab.com if any conditions of this licensing are not
20 ** clear to you.
21 **
22 **********************************************************************/
23 #ifndef KDSOAPSOCKETLIST_P_H
24 #define KDSOAPSOCKETLIST_P_H
25 
26 #include <QSet>
27 #include <QObject>
28 QT_BEGIN_NAMESPACE
29 class QTcpSocket;
30 class QObject;
31 QT_END_NAMESPACE
32 class KDSoapServer;
33 class KDSoapServerSocket;
34 
35 class KDSoapSocketList : public QObject
36 {
37  Q_OBJECT
38 public:
39  explicit KDSoapSocketList(KDSoapServer *server);
40  ~KDSoapSocketList();
41 
42  KDSoapServerSocket *handleIncomingConnection(int socketDescriptor);
43 
44  int socketCount() const;
45  void disconnectAll();
46 
47  int totalConnectionCount() const;
48  void increaseConnectionCount();
49  void resetTotalConnectionCount();
50 
51  KDSoapServer *server() const
52  {
53  return m_server;
54  }
55 
56 public Q_SLOTS:
57  void socketDeleted(KDSoapServerSocket *socket);
58 
59 private:
60  KDSoapServer *m_server;
61  QObject *m_serverObject;
62  QSet<KDSoapServerSocket *> m_sockets;
63  QAtomicInt m_totalConnectionCount;
64 };
65 
66 #endif // KDSOAPSOCKETLIST_P_H
Definition: KDSoapServer.h:42

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-soap/