Server settings

This section describes setter method of restinio::server_settings_t. For each method, a type of setter’s argument is specified and a brief description of a setter is provided.

Traits independent settings

acceptor_options_setter

Type:acceptor_options_setter_t
Description:Set an option setter of server’s acceptor (see Acceptor section for more details).

address

Type:std::string
Description:Address for server endpoint. Can be set to a concrete IP address when running on a machine with two or more network cards. Also supports values localhost, ip6-localhost.

buffer_size

Type:std::size_t
Description:It limits a size of the chunk that can be read from a socket in a single read operation (when receiving HTTP request).

cleanup_func

Type:function-object
Description:Cleanup function.

concurrent_accepts_count

Type:std:: size_t
Description:Max number of running concurrent accepts. When running server on N threads then up to N accepts can be handled concurrently.

handle_request_timeout

Type:std::chrono::steady_clock::duration
Description:A period of time that is given for a handler to create any response.

max_pipelined_requests

Type:std::size_t
Description:Max pipelined requests able to receive on a single connection.

port

Type:std::uint16_t
Description:Server port to be listened by HTTP server.

protocol

Type:asio::ip::tcp
Description:Protocol ipv4/ipv6 used for server endpoint.

separate_accept_and_create_connect

Type:bool
Description:For the cases when a lot of connection can be fired by clients in a short time interval, it is vital to accept connections and initiate new accept operations as quick as possible. So creating connection instance that involves allocations and initialization can be done in a context that is independent of acceptors one.

socket_options_setter

Type:socket_options_setter_t
Description:Socket options setter.

write_http_response_timelimit

Type:std::chrono::steady_clock::duration
Description:A period of time to wait for a response to be written to a socket.

Traits dependent settings

logger

Type:Params &&...
Description:Constructs the logger object from the provided params (see logger_t section).

request_handler

Type:std::unique_ptr<typename Traits::request_handler_t>
Description:Sets a request handler.

timer_manager

Type:Params &&...
Description:Constructs the timers manager object from the provided params (see timer_manager_t section).