Stellarium  0.90.0
httpconnectionhandlerpool.h
1 #ifndef HTTPCONNECTIONHANDLERPOOL_H
2 #define HTTPCONNECTIONHANDLERPOOL_H
3 
4 #include <QList>
5 #include <QTimer>
6 #include <QObject>
7 #include <QMutex>
8 #include "httpglobal.h"
10 
16 {
18  : minThreads(1), maxThreads(100), cleanupInterval(1000)
19  {}
20 
29  QString sslKeyFile;
31  QString sslCertFile;
32 };
33 
70 class DECLSPEC HttpConnectionHandlerPool : public QObject {
71  Q_OBJECT
72  Q_DISABLE_COPY(HttpConnectionHandlerPool)
73 public:
74 
82 
84  virtual ~HttpConnectionHandlerPool();
85 
87  HttpConnectionHandler* getConnectionHandler();
88 
89 private:
90 
93 
95  HttpRequestHandler* requestHandler;
96 
98  QList<HttpConnectionHandler*> pool;
99 
101  QTimer cleanupTimer;
102 
104  QMutex mutex;
105 
107  HttpSslConfiguration* sslConfiguration;
108 
110  void loadSslConfig();
111 
112 private slots:
113 
115  void cleanup();
116 
117 };
118 
119 #endif // HTTPCONNECTIONHANDLERPOOL_H
The request handler generates a response for each HTTP request.
QString sslCertFile
The file path to the SSL cert file.
int cleanupInterval
The time after which inactive threads are stopped in msec.
int minThreads
The minimal number of threads kept in the pool at all times.
The connection handler accepts incoming connections and dispatches incoming requests to to a request ...
QSslConfiguration HttpSslConfiguration
Alias for QSslConfiguration if OpenSSL is not supported.
Contains all settings for the connection handler pool and the child connection handlers.
int maxThreads
The maximal number of threads.
QString sslKeyFile
The file path to the SSL key file.
Pool of http connection handlers.
Contains all settings for the connection handler.