ServerinoConfig

Struct used to setup serverino. You must return this struct from a function with @onServerInit UDA attached.

@onServerInit
auto configure()
{
   // You can chain methods
   ServerinoConfig config =
      ServerinoConfig.create()
      .setWorkers(5)
      .enableKeepAlive();

   return config;
}

Constructors

this
this()
Undocumented in source.

Members

Enums

ListenerProtocol
enum ListenerProtocol

Protocol used by listener

Functions

addListener
ServerinoConfig addListener(string address, ushort port)

Add a new listener.

disableKeepAlive
ServerinoConfig disableKeepAlive()

Enable/Disable keep-alive for http/1.1

disableRemoteIp
ServerinoConfig disableRemoteIp()
enableKeepAlive
ServerinoConfig enableKeepAlive(bool enable, Duration timeout)
ServerinoConfig enableKeepAlive(Duration timeout)

Enable/Disable keep-alive for http/1.1

enableRemoteIp
ServerinoConfig enableRemoteIp(bool enable)

Add a x-remote-ip header

setHttpTimeout
ServerinoConfig setHttpTimeout(Duration dur)

How long the socket will wait for a request after the connection?

setListenerBacklog
ServerinoConfig setListenerBacklog(int val)

Max number of pending connections

setLogLevel
ServerinoConfig setLogLevel(LogLevel level)

Min log level to display. Default == LogLevel.all

setMaxRequestSize
ServerinoConfig setMaxRequestSize(size_t bytes)

Max size of a request. If a request is bigger than this value, error 413 is returned.

setMaxRequestTime
ServerinoConfig setMaxRequestTime(Duration dur)

Max time a request can take. After this time, worker is terminated.

setMaxWorkerIdling
ServerinoConfig setMaxWorkerIdling(Duration dur)

Max time a worker can be idle. After this time, worker is terminated.

setMaxWorkerLifetime
ServerinoConfig setMaxWorkerLifetime(Duration dur)

Max time a worker can live. After this time, worker is terminated.

setMaxWorkers
ServerinoConfig setMaxWorkers(size_t val)

Max number of workers

setMinWorkers
ServerinoConfig setMinWorkers(size_t val)

Min number of workers

setReturnCode
ServerinoConfig setReturnCode(int retCode)

Every value != 0 is used to terminate server immediatly.

setWorkerGroup
ServerinoConfig setWorkerGroup(string s)

For example: "www-data"

setWorkerUser
ServerinoConfig setWorkerUser(string s)

For example: "www-data"

setWorkers
ServerinoConfig setWorkers(size_t val)

Same as setMaxWorkers(v); setMinWorkers(v);

validate
void validate()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

create
ServerinoConfig create()

Create a new instance of ServerinoConfig

Variables

daemonConfig
DaemonConfig daemonConfig;
Undocumented in source.
returnCode
int returnCode;
Undocumented in source.
workerConfig
WorkerConfig workerConfig;
Undocumented in source.

Meta