QtWebApp
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 
11 namespace stefanfrings {
12 
84 class DECLSPEC HttpConnectionHandlerPool : public QObject {
85  Q_OBJECT
86  Q_DISABLE_COPY(HttpConnectionHandlerPool)
87 public:
88 
94  HttpConnectionHandlerPool(const QSettings* settings, HttpRequestHandler *requestHandler);
95 
97  virtual ~HttpConnectionHandlerPool();
98 
100  HttpConnectionHandler* getConnectionHandler();
101 
102 private:
103 
105  const QSettings* settings;
106 
108  HttpRequestHandler* requestHandler;
109 
111  QList<HttpConnectionHandler*> pool;
112 
114  QTimer cleanupTimer;
115 
117  QMutex mutex;
118 
120  QSslConfiguration* sslConfiguration;
121 
123  void loadSslConfig();
124 
125 private slots:
126 
128  void cleanup();
129 
130 };
131 
132 } // end of namespace
133 
134 #endif // HTTPCONNECTIONHANDLERPOOL_H
Alias for QSslConfiguration if OpenSSL is not supported.
The request handler generates a response for each HTTP request.