Struct ServerinoConfig

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

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

   return config;
}

Methods

NameDescription
addListener (address, port) Add a new listener.
create () Create a new instance of ServerinoConfig
disableKeepAlive () Enable/Disable keep-alive for http/1.1
disableRemoteIp ()
enableKeepAlive (enable, timeout) Enable/Disable keep-alive for http/1.1
enableRemoteIp (enable) Add a x-remote-ip header
setHttpTimeout (dur) How long the socket will wait for a request after the connection?
setListenerBacklog (val) Max number of pending connections
setLogLevel (level) Min log level to display. Default == LogLevel.all
setMaxDynamicWorkerIdling (dur) Max time a dynamic worker can be idle. After this time, worker is terminated. This is used only if the number of workers is greater than minWorkers.
setMaxRequestSize (bytes) Max size of a request. If a request is bigger than this value, error 413 is returned.
setMaxRequestTime (dur) Max time a request can take. After this time, worker is terminated.
setMaxWorkerIdling (dur) Max time a worker can be idle. After this time, worker is terminated.
setMaxWorkerLifetime (dur) Max time a worker can live. After this time, worker is terminated.
setMaxWorkers (val) Max number of workers
setMinWorkers (val) Min number of workers
setReturnCode (retCode) Every value != 0 is used to terminate server immediatly.
setWorkerGroup (s) For example: "www-data"
setWorkers (val) Same as setMaxWorkers(v); setMinWorkers(v);
setWorkerUser (s) For example: "www-data"

Enums

NameDescription
ListenerProtocol Protocol used by listener