ServerConfig

Configuration properties for the HttpServer.

Members

Aliases

ServerShutdownFunction
alias ServerShutdownFunction = void delegate(HttpServer server)

An alias for a delegate function that is called after the server has stopped.

SocketConfigureFunction
alias SocketConfigureFunction = void delegate(Socket socket)

An alias for a delegate function that can be used to modify a socket.

Variables

connectionQueueSize
int connectionQueueSize;

The number of connections to accept into the queue.

defaultHeaders
string[string] defaultHeaders;

A set of default headers that are added to all HTTP responses.

enableWebSockets
bool enableWebSockets;

Whether to enable websocket functionality. If enabled, an extra thread is spawned to manage websocket connections, separate from the main worker pool.

hostname
string hostname;

The hostname that the server will bind to.

port
ushort port;

The port that the server will bind to.

postShutdownCallbacks
ServerShutdownFunction[] postShutdownCallbacks;

A set of functions to run after the server has been stopped.

preBindCallbacks
SocketConfigureFunction[] preBindCallbacks;

A set of functions to run before the server's socket is bound.

receiveBufferSize
size_t receiveBufferSize;

The size of the buffer for receiving requests.

requestQueueSize
size_t requestQueueSize;

The size of the internal queue used for distributing requests to workers.

reuseAddress
bool reuseAddress;

Whether to set the REUSEADDR flag for the socket.

workerPoolManagerIntervalMs
uint workerPoolManagerIntervalMs;

The number of milliseconds that the worker pool manager should wait between each health check it performs.

workerPoolSize
size_t workerPoolSize;

The number of worker threads for processing requests.