Stellarium 0.15.2
|
Pool of http connection handlers. More...
#include <httpconnectionhandlerpool.h>
Public Member Functions | |
HttpConnectionHandlerPool (const HttpConnectionHandlerPoolSettings &settings, HttpRequestHandler *requestHandler) | |
Constructor. More... | |
virtual | ~HttpConnectionHandlerPool () |
Destructor. More... | |
HttpConnectionHandler * | getConnectionHandler () |
Get a free connection handler, or 0 if not available. More... | |
Pool of http connection handlers.
The size of the pool grows and shrinks on demand.
Example for the required configuration settings:
minThreads=4 maxThreads=100 cleanupInterval=60000 readTimeout=60000 ;sslKeyFile=ssl/my.key ;sslCertFile=ssl/my.cert maxRequestSize=16000 maxMultiPartSize=1000000
After server start, the size of the thread pool is always 0. Threads are started on demand when requests come in. The cleanup timer reduces the number of idle threads slowly by closing one thread in each interval. But the configured minimum number of threads are kept running.
For SSL support, you need an OpenSSL certificate file and a key file. Both can be created with the command
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout my.key -out my.cert
Visit http://slproweb.com/products/Win32OpenSSL.html to download the Light version of OpenSSL for Windows.
Please note that a listener with SSL settings can only handle HTTPS protocol. To support both HTTP and HTTPS simultaneously, you need to start two listeners on different ports - one with SLL and one without SSL.
Definition at line 70 of file httpconnectionhandlerpool.h.
HttpConnectionHandlerPool::HttpConnectionHandlerPool | ( | const HttpConnectionHandlerPoolSettings & | settings, |
HttpRequestHandler * | requestHandler | ||
) |
Constructor.
settings | Configuration settings for the HTTP server. Must not be 0. |
requestHandler | The handler that will process each received HTTP request. |
|
virtual |
Destructor.
HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler | ( | ) |
Get a free connection handler, or 0 if not available.