KD SOAP: KDSoapThreadPool Class Reference

| KD SOAP 1.9.1

Public Member Functions | List of all members
KDSoapThreadPool Class Reference

`#include <KDSoapThreadPool.h>`

Inherits QObject.

## Public Member Functions
| KDSoapThreadPool (QObject *parent=0)
| ~KDSoapThreadPool ()
void | setMaxThreadCount (int maxThreadCount)
int | maxThreadCount () const
int | numConnectedSockets (const KDSoapServer *server) const
int | totalConnectionCount (const KDSoapServer *server) const
void | resetTotalConnectionCount (const KDSoapServer *server)
void | disconnectSockets (KDSoapServer *server)

## Detailed Description

Pool of threads that can be used to handle SOAP requests in a SOAP server. The thread pool is configured with a maximum number of threads.

In case the server application provides different services on different ports, it can decide to use the same thread pool for both services, in order to always respect the maximum number of threads globally.

## Constructor & Destructor Documentation

## ◆ KDSoapThreadPool()

KDSoapThreadPool::KDSoapThreadPool | ( | QObject * | parent = `0` | ) |
| explicit

Constructs a thread pool with the given `parent`.

## ◆ ~KDSoapThreadPool()

KDSoapThreadPool::~KDSoapThreadPool | ( |  | ) |

Destructs the thread pool, after ensuring that all threads finish properly.

## Member Function Documentation

## ◆ setMaxThreadCount()

void KDSoapThreadPool::setMaxThreadCount | ( | int | maxThreadCount | ) |

Sets the maximum number of threads used by the thread pool. Note: The thread pool will always use at least 1 thread, even if `maxThreadCount` limit is zero or negative. The default maxThreadCount is QThread::idealThreadCount().

## ◆ maxThreadCount()

int KDSoapThreadPool::maxThreadCount | ( |  | ) | const

Returns the maximum number of threads used by the thread pool.

## ◆ numConnectedSockets()

int KDSoapThreadPool::numConnectedSockets | ( | const KDSoapServer * | server | ) | const

Returns the number of connected sockets for a given server

## ◆ totalConnectionCount()

int KDSoapThreadPool::totalConnectionCount | ( | const KDSoapServer * | server | ) | const

Returns the number of sockets that have connected to the given server, in this threadpool, since the last call to resetTotalConnectionCount().

Since
  1.2

## ◆ resetTotalConnectionCount()

void KDSoapThreadPool::resetTotalConnectionCount | ( | const KDSoapServer * | server | ) |

Resets totalConnectionCount to 0.

Since
  1.2

## ◆ disconnectSockets()

void KDSoapThreadPool::disconnectSockets | ( | KDSoapServer * | server | ) |

Disconnect all connected sockets for a given server

The documentation for this class was generated from the following files:

- src/KDSoapServer/KDSoapThreadPool.h
- src/KDSoapServer/KDSoapThreadPool.cpp

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/