QtWebApp
stefanfrings::HttpConnectionHandler Class Reference

Alias for QSslConfiguration if OpenSSL is not supported. More...

#include <httpconnectionhandler.h>

Inheritance diagram for stefanfrings::HttpConnectionHandler:
Collaboration diagram for stefanfrings::HttpConnectionHandler:

Public Slots

void handleConnection (const tSocketDescriptor socketDescriptor)
 Received from from the listener, when the handler shall start processing a new connection. More...
 

Public Member Functions

 HttpConnectionHandler (const QSettings *settings, HttpRequestHandler *requestHandler, const QSslConfiguration *sslConfiguration=nullptr)
 Constructor. More...
 
virtual ~HttpConnectionHandler ()
 Destructor.
 
bool isBusy ()
 Returns true, if this handler is in use.
 
void setBusy ()
 Mark this handler as busy.
 

Detailed Description

Alias for QSslConfiguration if OpenSSL is not supported.

The connection handler accepts incoming connections and dispatches incoming requests to to a request mapper. Since HTTP clients can send multiple requests before waiting for the response, the incoming requests are queued and processed one after the other.

Example for the required configuration settings:

readTimeout=60000
maxRequestSize=16000
maxMultiPartSize=1000000

The readTimeout value defines the maximum time to wait for a complete HTTP request.

MaxRequestSize is the maximum size of a HTTP request. In case of multipart/form-data requests (also known as file-upload), the maximum size of the body must not exceed maxMultiPartSize.

Definition at line 52 of file httpconnectionhandler.h.

Constructor & Destructor Documentation

◆ HttpConnectionHandler()

HttpConnectionHandler::HttpConnectionHandler ( const QSettings *  settings,
HttpRequestHandler requestHandler,
const QSslConfiguration *  sslConfiguration = nullptr 
)

Constructor.

Parameters
settingsConfiguration settings of the HTTP webserver
requestHandlerHandler that will process each incoming HTTP request
sslConfigurationSSL (HTTPS) will be used if not NULL

Definition at line 11 of file httpconnectionhandler.cpp.

Member Function Documentation

◆ handleConnection

void HttpConnectionHandler::handleConnection ( const tSocketDescriptor  socketDescriptor)
slot

Received from from the listener, when the handler shall start processing a new connection.

Parameters
socketDescriptorreferences the accepted connection.

Definition at line 80 of file httpconnectionhandler.cpp.


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