Stellarium 0.15.2
|
Listens for incoming TCP connections and and passes all incoming HTTP requests to your implementation of HttpRequestHandler, which processes the request and generates the response (usually a HTML document). More...
#include <httplistener.h>
Signals | |
void | handleConnection (tSocketDescriptor socketDescriptor) |
Sent to the connection handler to process a new incoming connection. More... | |
Public Member Functions | |
HttpListener (const HttpListenerSettings &settings, HttpRequestHandler *requestHandler, QObject *parent=NULL) | |
Constructor. More... | |
virtual | ~HttpListener () |
Destructor. More... | |
void | listen () |
Restart listeing after close(). More... | |
void | close () |
Closes the listener, waits until all pending requests are processed, then closes the connection pool. More... | |
Protected Member Functions | |
void | incomingConnection (tSocketDescriptor socketDescriptor) |
Serves new incoming connection requests. More... | |
Listens for incoming TCP connections and and passes all incoming HTTP requests to your implementation of HttpRequestHandler, which processes the request and generates the response (usually a HTML document).
Example for the required settings in the config file:
;host=192.168.0.100 port=8080 minThreads=1 maxThreads=10 cleanupInterval=1000 readTimeout=60000 ;sslKeyFile=ssl/my.key ;sslCertFile=ssl/my.cert maxRequestSize=16000 maxMultiPartSize=1000000
The optional host parameter binds the listener to one network interface. The listener handles all network interfaces if no host is configured. The port number specifies the incoming TCP port that this listener listens to.
Definition at line 57 of file httplistener.h.
HttpListener::HttpListener | ( | const HttpListenerSettings & | settings, |
HttpRequestHandler * | requestHandler, | ||
QObject * | parent = NULL |
||
) |
Constructor.
Creates a connection pool and starts listening on the configured host and port.
settings | Configuration settings for the HTTP server. Must not be 0. |
requestHandler | Processes each received HTTP request, usually by dispatching to controller classes. |
parent | Parent object. |
|
virtual |
Destructor.
void HttpListener::close | ( | ) |
Closes the listener, waits until all pending requests are processed, then closes the connection pool.
|
signal |
Sent to the connection handler to process a new incoming connection.
socketDescriptor | references the accepted connection. |
|
protected |
Serves new incoming connection requests.
void HttpListener::listen | ( | ) |
Restart listeing after close().