HttpServer

A simple HTTP server that accepts requests on a given port and address, and lets a configured HttpRequestHandler produce a response, to send back to the client.

Constructors

this
this(HttpRequestHandler handler, string hostname, ushort port, size_t receiveBufferSize, int connectionQueueSize, bool verbose, size_t workerPoolSize)
Undocumented in source.

Members

Functions

configurePreBind
void configurePreBind(Socket socket)

Will be called before the socket is bound to the address. One can set special socket options in here by overriding it.

isReady
bool isReady()

Tells whether the server is ready to receive requests.

isVerbose
bool isVerbose()

Tells whether the server will give verbose output.

setVerbose
HttpServer setVerbose(bool verbose)

Sets the server's verbosity, which determines whether detailed log messages are printed during runtime.

start
void start()

Starts the server on the calling thread, so that it will begin accepting HTTP requests. Once the server is able to accept requests, isReady() will return true, and will remain true until the server is stopped by calling stop().

stop
void stop()

Shuts down the server by closing the server socket, if possible. This will block until all pending requests have been fulfilled.

Meta