Stellarium  0.90.0
List of all members | Public Member Functions
HttpConnectionHandlerPool Class Reference

Pool of http connection handlers. More...

#include <httpconnectionhandlerpool.h>

+ Inheritance diagram for HttpConnectionHandlerPool:
+ Collaboration diagram for HttpConnectionHandlerPool:

Public Member Functions

 HttpConnectionHandlerPool (const HttpConnectionHandlerPoolSettings &settings, HttpRequestHandler *requestHandler)
 Constructor. More...
 
virtual ~HttpConnectionHandlerPool ()
 Destructor. More...
 
HttpConnectionHandlergetConnectionHandler ()
 Get a free connection handler, or 0 if not available. More...
 

Detailed Description

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.

See also
HttpConnectionHandler for description of the readTimeout
HttpRequest for description of config settings maxRequestSize and maxMultiPartSize

Definition at line 70 of file httpconnectionhandlerpool.h.

Constructor & Destructor Documentation

HttpConnectionHandlerPool::HttpConnectionHandlerPool ( const HttpConnectionHandlerPoolSettings settings,
HttpRequestHandler requestHandler 
)

Constructor.

Parameters
settingsConfiguration settings for the HTTP server. Must not be 0.
requestHandlerThe handler that will process each received HTTP request.
Warning
The requestMapper gets deleted by the destructor of this pool
virtual HttpConnectionHandlerPool::~HttpConnectionHandlerPool ( )
virtual

Destructor.

Member Function Documentation

HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler ( )

Get a free connection handler, or 0 if not available.


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