restinio::basic_server_settings_t< Derived, Traits > Class Template Reference

Basic container for http_server settings. More...

`#include <settings.hpp>`

Inheritance diagram for restinio::basic_server_settings_t< Derived, Traits >:

## Public Member Functions

| basic_server_settings_t (std::uint16_t port=8080, asio_ns::ip::tcp protocol=asio_ns::ip::tcp::v4())
Derived & | buffer_size (std::size_t s) &
| Size of buffer for io operations. More...
Derived && | buffer_size (std::size_t s) &&
std::size_t | buffer_size () const
Derived & | connection_state_listener (std::shared_ptr< typename Traits::connection_state_listener_t > listener) &
| Setter for connection state listener. More...
Derived && | connection_state_listener (std::shared_ptr< typename Traits::connection_state_listener_t > listener) &&
| Setter for connection state listener. More...
const std::shared_ptr< typename Traits::connection_state_listener_t > & | connection_state_listener () const noexcept
| Get reference to connection state listener. More...
void | ensure_valid_connection_state_listener ()
| Internal method for checking presence of state listener object. More...
Derived & | ip_blocker (std::shared_ptr< typename Traits::ip_blocker_t > blocker) &
| Setter for IP-blocker. More...
Derived && | ip_blocker (std::shared_ptr< typename Traits::ip_blocker_t > blocker) &&
| Setter for IP-blocker. More...
const std::shared_ptr< typename Traits::ip_blocker_t > & | ip_blocker () const noexcept
| Get reference to IP-blocker. More...
void | ensure_valid_ip_blocker ()
| Internal method for checking presence of IP-blocker object. More...
Derived & | acceptor_post_bind_hook (acceptor_post_bind_hook_t hook) &
| A setter for post-bind callback. More...
Derived && | acceptor_post_bind_hook (acceptor_post_bind_hook_t hook) &&
| A setter for post-bind callback. More...
RESTINIO_NODISCARD acceptor_post_bind_hook_t | giveaway_acceptor_post_bind_hook ()
| A getter for post-bind callback. More...
RESTINIO_NODISCARD const incoming_http_msg_limits_t & | incoming_http_msg_limits () const noexcept
| Getter of optional limits for incoming HTTP messages. More...
Derived & | incoming_http_msg_limits (const incoming_http_msg_limits_t &limits) &noexcept
| Setter of optional limits for incoming HTTP messages. More...
Derived && | incoming_http_msg_limits (const incoming_http_msg_limits_t &limits) &&noexcept
| Setter of optional limits for incoming HTTP messages. More...
Derived & | max_parallel_connections (std::size_t value) &noexcept
| Setter for connection count limit. More...
Derived && | max_parallel_connections (std::size_t value) &&noexcept
| Setter for connection count limit. More...
std::size_t | max_parallel_connections () const noexcept
Derived & | port (std::uint16_t p) &
| Server endpoint. More...
Derived && | port (std::uint16_t p) &&
RESTINIO_NODISCARD std::uint16_t | port () const
Derived & | protocol (asio_ns::ip::tcp p) &
Derived && | protocol (asio_ns::ip::tcp p) &&
RESTINIO_NODISCARD asio_ns::ip::tcp | protocol () const
Derived & | address (std::string addr) &
Derived && | address (std::string addr) &&
Derived & | address (asio_ns::ip::address addr) &
Derived && | address (asio_ns::ip::address addr) &&
RESTINIO_NODISCARD const details::address_variant_t & | address () const
Derived & | read_next_http_message_timelimit (std::chrono::steady_clock::duration d) &
| } More...
Derived && | read_next_http_message_timelimit (std::chrono::steady_clock::duration d) &&
std::chrono::steady_clock::duration | read_next_http_message_timelimit () const
Derived & | write_http_response_timelimit (std::chrono::steady_clock::duration d) &
| A period of time wait for response to be written to socket. More...
Derived && | write_http_response_timelimit (std::chrono::steady_clock::duration d) &&
std::chrono::steady_clock::duration | write_http_response_timelimit () const
Derived & | handle_request_timeout (std::chrono::steady_clock::duration d) &
| A period of time that is given for a handler to create response. More...
Derived && | handle_request_timeout (std::chrono::steady_clock::duration d) &&
std::chrono::steady_clock::duration | handle_request_timeout () const
Derived & | max_pipelined_requests (std::size_t mpr) &
| Max pipelined requests able to receive on single connection. More...
Derived && | max_pipelined_requests (std::size_t mpr) &&
std::size_t | max_pipelined_requests () const
Derived & | acceptor_options_setter (acceptor_options_setter_t aos) &
| Acceptor options setter. More...
Derived && | acceptor_options_setter (acceptor_options_setter_t aos) &&
std::unique_ptr< acceptor_options_setter_t > | acceptor_options_setter ()
Derived & | socket_options_setter (socket_options_setter_t sos) &
| Socket options setter. More...
Derived && | socket_options_setter (socket_options_setter_t sos) &&
std::unique_ptr< socket_options_setter_t > | socket_options_setter ()
Derived & | concurrent_accepts_count (std::size_t n) &
| Max number of running concurrent accepts. More...
Derived && | concurrent_accepts_count (std::size_t n) &&
std::size_t | concurrent_accepts_count () const
Derived & | separate_accept_and_create_connect (bool do_separate) &noexcept
| Do separate an accept operation and connection instantiation. More...
Derived && | separate_accept_and_create_connect (bool do_separate) &&noexcept
bool | separate_accept_and_create_connect () const noexcept
template<typename Func >
Derived & | cleanup_func (Func &&func) &
| Cleanup function. More...
template<typename Func >
Derived && | cleanup_func (Func &&func) &&
RESTINIO_NODISCARD cleanup_functor_t | giveaway_cleanup_func ()
Public Member Functions inherited from restinio::socket_type_dependent_settings_t< Derived, Traits::stream_socket_t >
| socket_type_dependent_settings_t () noexcept=default
| socket_type_dependent_settings_t (const socket_type_dependent_settings_t &) noexcept=default
| socket_type_dependent_settings_t (socket_type_dependent_settings_t &&) noexcept=default
socket_type_dependent_settings_t & | operator= (const socket_type_dependent_settings_t &) noexcept=default
socket_type_dependent_settings_t & | operator= (socket_type_dependent_settings_t &&) noexcept=delete

## Private Types

using | base_type_t = socket_type_dependent_settings_t< Derived, typename Traits::stream_socket_t >
using | max_parallel_connections_holder_base_t = details::max_parallel_connections_holder_t< typename connection_count_limit_types< Traits >::limiter_t >

## Private Member Functions

Derived & | reference_to_derived ()
template<typename Target , typename... Params>
Derived & | set_unique_instance (std::unique_ptr< Target > &t, Params &&... params)
template<typename Target , typename... Params>
Derived & | set_shared_instance (std::shared_ptr< Target > &t, Params &&... params)

## Private Attributes

std::size_t | m_buffer_size { 4 * 1024 }
| Size of buffer for io operations. More...
std::size_t | m_max_pipelined_requests { 1 }
| Max pipelined requests to receive on single connection. More...
std::unique_ptr< request_handler_t > | m_request_handler
| Request handler. More...
std::unique_ptr< timer_factory_t > | m_timer_factory
| Timers factory. More...
std::unique_ptr< logger_t > | m_logger
| Logger. More...
std::unique_ptr< acceptor_options_setter_t > | m_acceptor_options_setter
| Acceptor options setter. More...
acceptor_post_bind_hook_t | m_acceptor_post_bind_hook
| A hook to be called just after a successful call to bind for acceptor. More...
std::unique_ptr< socket_options_setter_t > | m_socket_options_setter
| Socket options setter. More...
std::size_t | m_concurrent_accepts_count { 1 }
bool | m_separate_accept_and_create_connect { false }
| Do separate an accept operation and connection instantiation. More...
cleanup_functor_t | m_cleanup_functor
| Optional cleanup functor. More...
incoming_http_msg_limits_t | m_incoming_http_msg_limits
| Limits for incoming HTTP messages. More...
extra_data_factory_handle_t | m_extra_data_factory
| User-data-factory for server. More...
std::uint16_t | m_port
| Server endpoint. More...
asio_ns::ip::tcp | m_protocol
details::address_variant_t | m_address
std::chrono::steady_clock::duration | m_read_next_http_message_timelimit { std::chrono::seconds( 60 ) }
| Operations timeouts. More...
std::chrono::steady_clock::duration | m_write_http_response_timelimit { std::chrono::seconds( 5 ) }
std::chrono::steady_clock::duration | m_handle_request_timeout { std::chrono::seconds( 10 ) }

## Static Private Attributes

static constexpr bool | has_actual_max_parallel_connections
using | request_handler_t = request_handler_type_from_traits_t< Traits >
| Request handler. More...
Derived & | request_handler (std::unique_ptr< request_handler_t > handler) &
template<typename... Params>
Derived & | request_handler (Params &&... params) &
template<typename... Params>
Derived && | request_handler (Params &&... params) &&
std::unique_ptr< request_handler_t > | request_handler ()
using | timer_manager_t = typename Traits::timer_manager_t
| Timers manager. More...
using | timer_factory_t = typename timer_manager_t::factory_t
template<typename... Params>
Derived & | timer_manager (Params &&... params) &
template<typename... Params>
Derived && | timer_manager (Params &&... params) &&
std::unique_ptr< timer_factory_t > | timer_factory ()
using | logger_t = typename Traits::logger_t
| Logger. More...
template<typename... Params>
Derived & | logger (Params &&... params) &
template<typename... Params>
Derived && | logger (Params &&... params) &&
std::unique_ptr< logger_t > | logger ()

## User-data factory.

using | extra_data_factory_t = typename Traits::extra_data_factory_t
| The actual type of extra-data-factory. More...
using | extra_data_factory_handle_t = std::shared_ptr< extra_data_factory_t >
| Type of shared-pointer to extra-data-factory. More...
Derived & | extra_data_factory (extra_data_factory_handle_t factory) &
| Setter for extra-data-factory. More...
Derived && | extra_data_factory (extra_data_factory_handle_t factory) &&
| Setter for extra-data-factory. More...
RESTINIO_NODISCARD extra_data_factory_handle_t | giveaway_extra_data_factory () const noexcept
| Extractor for extra-data-factory. More...

## Additional Inherited Members

Protected Member Functions inherited from restinio::socket_type_dependent_settings_t< Derived, Traits::stream_socket_t >
| ~socket_type_dependent_settings_t () noexcept=default
Protected Member Functions inherited from restinio::connection_state_listener_holder_t< Traits::connection_state_listener_t >
void | check_valid_connection_state_listener_pointer () const
| Checks that pointer to state listener is not null. More...
Protected Member Functions inherited from restinio::ip_blocker_holder_t< Traits::ip_blocker_t >
void | check_valid_ip_blocker_pointer () const
| Checks that pointer to IP-blocker is not null. More...
Protected Member Functions inherited from restinio::details::max_parallel_connections_holder_t< connection_count_limit_types< Traits >::limiter_t >
std::size_t | max_parallel_connections () const noexcept
void | set_max_parallel_connections (std::size_t v) noexcept
Protected Attributes inherited from restinio::connection_state_listener_holder_t< Traits::connection_state_listener_t >
std::shared_ptr< Traits::connection_state_listener_t > | m_connection_state_listener
Protected Attributes inherited from restinio::ip_blocker_holder_t< Traits::ip_blocker_t >
std::shared_ptr< Traits::ip_blocker_t > | m_ip_blocker
Protected Attributes inherited from restinio::details::max_parallel_connections_holder_t< connection_count_limit_types< Traits >::limiter_t >
std::size_t | m_max_parallel_connections
| Actual value of the limit. More...
Static Protected Attributes inherited from restinio::connection_state_listener_holder_t< Traits::connection_state_listener_t >
static constexpr bool | has_actual_connection_state_listener
Static Protected Attributes inherited from restinio::ip_blocker_holder_t< Traits::ip_blocker_t >
static constexpr bool | has_actual_ip_blocker
Static Protected Attributes inherited from restinio::details::max_parallel_connections_holder_t< connection_count_limit_types< Traits >::limiter_t >
static constexpr bool | has_actual_max_parallel_connections

## Detailed Description

template<typename Derived, typename Traits>
class restinio::basic_server_settings_t< Derived, Traits >

Basic container for http_server settings.

It exists to provide ablity to create various derived classes like server_settings_t, run_on_this_thread_settings_t, run_on_this_thread_settings_t and so on.

Template Parameters

  Derived | A drived type. Reference to this derived type will be returned by setters.
  Traits | A type with traits for http_server.

Definition at line 549 of file settings.hpp.

## Member Typedef Documentation

## base_type_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::base_type_t = socket_type_dependent_settings_t< Derived, typename Traits::stream_socket_t>

private

Definition at line 557 of file settings.hpp.

## extra_data_factory_handle_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::extra_data_factory_handle_t = std::shared_ptr< extra_data_factory_t >

Type of shared-pointer to extra-data-factory.

Since
  v.0.6.13

Definition at line 1556 of file settings.hpp.

## extra_data_factory_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::extra_data_factory_t = typename Traits::extra_data_factory_t

The actual type of extra-data-factory.

Since
  v.0.6.13

Definition at line 1551 of file settings.hpp.

## logger_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::logger_t = typename Traits::logger_t

Logger.

Definition at line 913 of file settings.hpp.

## max_parallel_connections_holder_base_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::max_parallel_connections_holder_base_t = details::max_parallel_connections_holder_t< typename connection_count_limit_types<Traits>::limiter_t >

private

Definition at line 560 of file settings.hpp.

## request_handler_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::request_handler_t = request_handler_type_from_traits_t< Traits >

Request handler.

Definition at line 845 of file settings.hpp.

## timer_factory_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::timer_factory_t = typename timer_manager_t::factory_t

Definition at line 884 of file settings.hpp.

## timer_manager_t

template<typename Derived , typename Traits >

using restinio::basic_server_settings_t< Derived, Traits >::timer_manager_t = typename Traits::timer_manager_t

Timers manager.

Definition at line 883 of file settings.hpp.

## Constructor & Destructor Documentation

## basic_server_settings_t()

template<typename Derived , typename Traits >

restinio::basic_server_settings_t< Derived, Traits >::basic_server_settings_t | ( | std::uint16_t | port = `8080`,
|  | asio_ns::ip::tcp | protocol = `asio_ns::ip::tcp::v4()`
| ) |  |

inline

Definition at line 575 of file settings.hpp.

## Member Function Documentation

## acceptor_options_setter() [1/3]

template<typename Derived , typename Traits >

std::unique_ptr< acceptor_options_setter_t > restinio::basic_server_settings_t< Derived, Traits >::acceptor_options_setter | ( |  | ) |

inline

Definition at line 960 of file settings.hpp.

## acceptor_options_setter() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::acceptor_options_setter | ( | acceptor_options_setter_t | aos | ) | &

inline

Acceptor options setter.

Definition at line 943 of file settings.hpp.

## acceptor_options_setter() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::acceptor_options_setter | ( | acceptor_options_setter_t | aos | ) | &&

inline

Definition at line 954 of file settings.hpp.

## acceptor_post_bind_hook() [1/2]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::acceptor_post_bind_hook | ( | acceptor_post_bind_hook_t | hook | ) | &

inline

A setter for post-bind callback.

Usage example:

using my_server_t = restinio::http_server_t< my_server_traits_t >;
my_server_t server{
restinio::own_io_context(),
[](auto & settings) {
settings.port(...);
settings.address(...);
settings.acceptor_post_bind_hook(
[](asio::ip::tcp::acceptor & acceptor) {
...
})
settings.request_handler(...);
...
}
};
restinio::http_server_t
Class for http-server.
Definition: http_server.hpp:169
restinio::own_io_context
io_context_holder_t own_io_context()
Function which tells that http_server should create and use its own instance of io_context.
Definition: http_server.hpp:65

Since
  v.0.6.11

Definition at line 1346 of file settings.hpp.

## acceptor_post_bind_hook() [2/2]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::acceptor_post_bind_hook | ( | acceptor_post_bind_hook_t | hook | ) | &&

inline

A setter for post-bind callback.

Usage example:

restinio::run(
restinio::on_this_thread()
.port(...)
.address(...)
.acceptor_post_bind_hook(
[](asio::ip::tcp::acceptor & acceptor) {
...
})
.request_handler(...)
);
restinio::basic_server_settings_t::address
RESTINIO_NODISCARD const details::address_variant_t & address() const
Definition: settings.hpp:717
restinio::basic_server_settings_t::request_handler
std::unique_ptr< request_handler_t > request_handler()
Definition: settings.hpp:872
restinio::basic_server_settings_t::acceptor_post_bind_hook
Derived & acceptor_post_bind_hook(acceptor_post_bind_hook_t hook) &
A setter for post-bind callback.
Definition: settings.hpp:1346
restinio::basic_server_settings_t::port
RESTINIO_NODISCARD std::uint16_t port() const
Definition: settings.hpp:600
restinio::on_this_thread
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
Definition: http_server_run.hpp:123
restinio::run
void run(asio_ns::io_context &ioctx, run_on_this_thread_settings_t< Traits > &&settings)
Helper function for running http server until ctrl+c is hit.
Definition: http_server_run.hpp:216

Since
  v.0.6.11

Definition at line 1375 of file settings.hpp.

## address() [1/5]

template<typename Derived , typename Traits >

RESTINIO_NODISCARD const details::address_variant_t & restinio::basic_server_settings_t< Derived, Traits >::address | ( |  | ) | const

inline

Definition at line 717 of file settings.hpp.

## address() [2/5]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::address | ( | asio_ns::ip::address | addr | ) | &

inline

Sets the IP address for a server in binary form.

Usage example:

auto actual_ip = asio::ip::address::from_string(app.config().ip_addr());
...
using my_server_t = restinio::http_server_t< my_server_traits_t >;
my_server_t server{
restinio::own_io_context(),
[actual_ip](auto & settings) {
settings.port(8080);
settings.address(actual_ip);
settings.request_handler(...);
...
}
};
restinio::utils::from_string
Value_Type from_string(string_view_t s)
Get a value from string.
Definition: from_string.hpp:105

Definition at line 688 of file settings.hpp.

## address() [3/5]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::address | ( | asio_ns::ip::address | addr | ) | &&

inline

Sets the IP address for a server in binary form.

Usage example:

auto actual_ip = asio::ip::address::from_string(app.config().ip_addr());
...
restinio::run(
restinio::on_this_thread()
.port(...)
.address(actual_ip)
.request_handler(...)
);

Definition at line 710 of file settings.hpp.

## address() [4/5]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::address | ( | std::string | addr | ) | &

inline

Sets the IP address for a server in textual form.

Usage example:

using my_server_t = restinio::http_server_t< my_server_traits_t >;
my_server_t server{
restinio::own_io_context(),
[](auto & settings) {
settings.port(8080);
settings.address("192.168.1.1");
settings.request_handler(...);
...
}
};

Definition at line 643 of file settings.hpp.

## address() [5/5]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::address | ( | std::string | addr | ) | &&

inline

Sets the IP address for a server in textual form.

Usage example:

restinio::run(
restinio::on_this_thread()
.port(...)
.address("192.168.1.1")
.request_handler(...)
);

Definition at line 663 of file settings.hpp.

## buffer_size() [1/3]

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::buffer_size | ( |  | ) | const

inline

Definition at line 743 of file settings.hpp.

## buffer_size() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::buffer_size | ( | std::size_t | s | ) | &

inline

Size of buffer for io operations.

It limits a size of chunk that can be read from socket in a single read operattion (async read). {

Definition at line 730 of file settings.hpp.

## buffer_size() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::buffer_size | ( | std::size_t | s | ) | &&

inline

Definition at line 737 of file settings.hpp.

## cleanup_func() [1/2]

template<typename Derived , typename Traits >
template<typename Func >

Derived & restinio::basic_server_settings_t< Derived, Traits >::cleanup_func | ( | Func && | func | ) | &

inline

Cleanup function.

Definition at line 1062 of file settings.hpp.

## cleanup_func() [2/2]

template<typename Derived , typename Traits >
template<typename Func >

Derived && restinio::basic_server_settings_t< Derived, Traits >::cleanup_func | ( | Func && | func | ) | &&

inline

Definition at line 1070 of file settings.hpp.

## concurrent_accepts_count() [1/3]

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::concurrent_accepts_count | ( |  | ) | const

inline

Definition at line 1022 of file settings.hpp.

## concurrent_accepts_count() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::concurrent_accepts_count | ( | std::size_t | n | ) | &

inline

Max number of running concurrent accepts.

When running server on N threads then up to N accepts can be handled concurrently.

Definition at line 1003 of file settings.hpp.

## concurrent_accepts_count() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::concurrent_accepts_count | ( | std::size_t | n | ) | &&

inline

Definition at line 1016 of file settings.hpp.

## connection_state_listener() [1/3]

template<typename Derived , typename Traits >

const std::shared_ptr< typename Traits::connection_state_listener_t > & restinio::basic_server_settings_t< Derived, Traits >::connection_state_listener | ( |  | ) | const

inlinenoexcept

Get reference to connection state listener.

Attention
  This method can't be called if the default no-op state listener is used in server traits.

Since
  v.0.5.1

Definition at line 1180 of file settings.hpp.

## connection_state_listener() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::connection_state_listener | ( | std::shared_ptr< typename Traits::connection_state_listener_t > | listener | ) | &

inline

Setter for connection state listener.

Note
  connection_state_listener() method should be called if user specify its type for connection_state_listener_t traits. For example:
  class my_state_listener_t {
  ...
  public:
  ...
  void state_changed(const restinio::connection_state::notice_t & notice) noexcept {
  ...
  }
  };
  struct my_traits_t : public restinio::default_traits_t {
  using connection_state_listener_t = my_state_listener_t;
  };
  restinio::server_setting_t<my_traits_t> settings;
  setting.connection_state_listener( std::make_shared<my_state_listener_t>(...) );
  ...
  restinio::connection_state::notice_t
  An object with info about connection to be passed to state listener.
  Definition: connection_state_listener.hpp:225
  restinio::traits_t
  Definition: traits.hpp:147

Attention
  This method can't be called if the default no-op state listener is used in server traits.

Since
  v.0.5.1

Definition at line 1120 of file settings.hpp.

## connection_state_listener() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::connection_state_listener | ( | std::shared_ptr< typename Traits::connection_state_listener_t > | listener | ) | &&

inline

Setter for connection state listener.

Note
  connection_state_listener() method should be called if user specify its type for connection_state_listener_t traits. For example:
  class my_state_listener_t {
  ...
  public:
  ...
  void state_changed(const restinio::connection_state::notice_t & notice) noexcept {
  ...
  }
  };
  struct my_traits_t : public restinio::default_traits_t {
  using connection_state_listener_t = my_state_listener_t;
  };
  restinio::run( restinio::on_this_thread<my_traits_t>()
  .connection_state_listener( std::make_shared<my_state_listener_t>(...) )
  .port(...)
  ...);
  restinio::basic_server_settings_t::connection_state_listener
  const std::shared_ptr< typename Traits::connection_state_listener_t > & connection_state_listener() const noexcept
  Get reference to connection state listener.
  Definition: settings.hpp:1180

Attention
  This method can't be called if the default no-op state listener is used in server traits.

Since
  v.0.5.1

Definition at line 1164 of file settings.hpp.

## ensure_valid_connection_state_listener()

template<typename Derived , typename Traits >

void restinio::basic_server_settings_t< Derived, Traits >::ensure_valid_connection_state_listener | ( |  | ) |

inline

Internal method for checking presence of state listener object.

If a user specifies custom state listener type but doesn't set a pointer to listener object that method throws an exception.

Since
  v.0.5.1

Definition at line 1200 of file settings.hpp.

## ensure_valid_ip_blocker()

template<typename Derived , typename Traits >

void restinio::basic_server_settings_t< Derived, Traits >::ensure_valid_ip_blocker | ( |  | ) |

inline

Internal method for checking presence of IP-blocker object.

If a user specifies custom IP-blocker type but doesn't set a pointer to blocker object that method throws an exception.

Since
  v.0.5.1

Definition at line 1316 of file settings.hpp.

## extra_data_factory() [1/2]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::extra_data_factory | ( | extra_data_factory_handle_t | factory | ) | &

inline

Setter for extra-data-factory.

Usage example:

class my_extra_data_factory {
... // Some factory's data.
public:
struct data_t {...};
my_extra_data_factory(...) {...}
void make_within(restinio::extra_data_buffer_t<data_t> buf) {
new(buf.get()) data_t{...};
}
};
struct my_traits : public restinio::default_traits_t {
using extra_data_factory_t = my_extra_data_factory;
};
restinio::server_settings_t<my_traits> settings;
...
settings.extra_data_factory(std::make_shared<my_extra_data_factory>(...));
...
auto server = restinio::run_async(
restinio::own_io_context(),
std::move(settings),
std::thread::hardware_concurrency());
restinio::basic_server_settings_t::extra_data_factory
Derived & extra_data_factory(extra_data_factory_handle_t factory) &
Setter for extra-data-factory.
Definition: settings.hpp:1592
restinio::basic_server_settings_t::extra_data_factory_t
typename Traits::extra_data_factory_t extra_data_factory_t
The actual type of extra-data-factory.
Definition: settings.hpp:1551
restinio::extra_data_buffer_t
Helper for holding a pointer to a buffer where a new object of type Extra_Data should be constructed.
Definition: request_handler.hpp:52
restinio::extra_data_buffer_t::get
RESTINIO_NODISCARD void * get() const noexcept
Definition: request_handler.hpp:60
restinio::server_settings_t
A fluent style interface for setting http server params.
Definition: settings.hpp:1768
nonstd::optional_lite::std11::move
T & move(T &t)
Definition: optional.hpp:465
restinio::run_async
RESTINIO_NODISCARD running_server_handle_t< Traits > run_async(io_context_holder_t io_context, server_settings_t< Traits > &&settings, std::size_t thread_pool_size)
Creates an instance of HTTP-server and launches it on a separate thread or thread pool.
Definition: http_server_run.hpp:1112

Since
  v.0.6.13

Definition at line 1592 of file settings.hpp.

## extra_data_factory() [2/2]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::extra_data_factory | ( | extra_data_factory_handle_t | factory | ) | &&

inline

Setter for extra-data-factory.

Usage example:

class my_extra_data_factory {
... // Some factory's data.
public:
struct data_t {...};
my_extra_data_factory(...) {...}
void make_within(restinio::extra_data_buffer_t<data_t> buf) {
new(buf.get()) data_t{...};
}
};
struct my_traits : public restinio::default_traits_t {
using extra_data_factory_t = my_extra_data_factory;
};
auto server = restinio::run_async(
restinio::own_io_context(),
restinio::server_settings_t<my_traits>{}
.extra_data_factory(std::make_shared<my_extra_data_factory>(...))
...
,
std::thread::hardware_concurrency());

Since
  v.0.6.13

Definition at line 1632 of file settings.hpp.

## giveaway_acceptor_post_bind_hook()

template<typename Derived , typename Traits >

RESTINIO_NODISCARD acceptor_post_bind_hook_t restinio::basic_server_settings_t< Derived, Traits >::giveaway_acceptor_post_bind_hook | ( |  | ) |

inline

A getter for post-bind callback.

Note
  This method is intended to be used by RESTinio and it can be changed or removed in future versions of RESTinio without any notice.

Since
  v.0.6.11

Definition at line 1392 of file settings.hpp.

## giveaway_cleanup_func()

template<typename Derived , typename Traits >

RESTINIO_NODISCARD cleanup_functor_t restinio::basic_server_settings_t< Derived, Traits >::giveaway_cleanup_func | ( |  | ) |

inline

Note
  This method is intended to be used by RESTinio and it can be changed or removed in future versions of RESTinio without any notice.

Definition at line 1083 of file settings.hpp.

## giveaway_extra_data_factory()

template<typename Derived , typename Traits >

RESTINIO_NODISCARD extra_data_factory_handle_t restinio::basic_server_settings_t< Derived, Traits >::giveaway_extra_data_factory | ( |  | ) | const

inlinenoexcept

Extractor for extra-data-factory.

Since
  v.0.6.13

Definition at line 1644 of file settings.hpp.

## handle_request_timeout() [1/3]

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::handle_request_timeout | ( |  | ) | const

inline

Definition at line 814 of file settings.hpp.

## handle_request_timeout() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::handle_request_timeout | ( | std::chrono::steady_clock::duration | d | ) | &

inline

A period of time that is given for a handler to create response.

Definition at line 801 of file settings.hpp.

## handle_request_timeout() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::handle_request_timeout | ( | std::chrono::steady_clock::duration | d | ) | &&

inline

Definition at line 808 of file settings.hpp.

## incoming_http_msg_limits() [1/3]

template<typename Derived , typename Traits >

RESTINIO_NODISCARD const incoming_http_msg_limits_t & restinio::basic_server_settings_t< Derived, Traits >::incoming_http_msg_limits | ( |  | ) | const

inlinenoexcept

Getter of optional limits for incoming HTTP messages.

In v.0.6.12 if the limits for incoming HTTP messages are not set explicitely then a defaultly constructed instance of incoming_http_msg_limits_t is used. This means the absence of any limits.

But if the limits were set by using appropriate setters then a reference to an instance with user-defined limits is returned.

Since
  v.0.6.12

Definition at line 1412 of file settings.hpp.

## incoming_http_msg_limits() [2/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::incoming_http_msg_limits | ( | const incoming_http_msg_limits_t & | limits | ) | &&

inlinenoexcept

Setter of optional limits for incoming HTTP messages.

Usage example:

struct my_traits : public restinio::default_traits_t { ... };
...
auto server = restinio::run_async(
restinio::own_io_context(),
restinio::server_settings_t<my_traits>{}
...
.incoming_http_msg_limits(
restinio::incoming_http_msg_limits_t{}
.max_url_size(8000u)
.max_field_name_size(2048u)
.max_field_value_size(4096u)
),
std::thread::hardware_concurrency());
restinio::basic_server_settings_t::incoming_http_msg_limits
RESTINIO_NODISCARD const incoming_http_msg_limits_t & incoming_http_msg_limits() const noexcept
Getter of optional limits for incoming HTTP messages.
Definition: settings.hpp:1412
restinio::incoming_http_msg_limits_t
A type of holder of limits related to an incoming HTTP message.
Definition: incoming_http_msg_limits.hpp:69
restinio::incoming_http_msg_limits_t::max_url_size
RESTINIO_NODISCARD std::size_t max_url_size() const noexcept
Definition: incoming_http_msg_limits.hpp:81

Since
  v.0.6.12

Definition at line 1470 of file settings.hpp.

## incoming_http_msg_limits() [3/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::incoming_http_msg_limits | ( | const incoming_http_msg_limits_t & | limits | ) | &

inlinenoexcept

Setter of optional limits for incoming HTTP messages.

Usage example:

struct my_traits : public restinio::default_traits_t { ... };
restinio::server_settings_t<my_traits> settings;
settings.incoming_http_msg_limits(
restinio::incoming_http_msg_limits_t{}
.max_url_size(8000u)
.max_field_name_size(2048u)
.max_field_value_size(4096u)
);
...
auto server = restinio::run_async(
restinio::own_io_context(),
std::move(settings),
std::thread::hardware_concurrency());

Since
  v.0.6.12

Definition at line 1440 of file settings.hpp.

## ip_blocker() [1/3]

template<typename Derived , typename Traits >

const std::shared_ptr< typename Traits::ip_blocker_t > & restinio::basic_server_settings_t< Derived, Traits >::ip_blocker | ( |  | ) | const

inlinenoexcept

Get reference to IP-blocker.

Attention
  This method can't be called if the default no-op IP-blocker is used in server traits.

Since
  v.0.5.1

Definition at line 1297 of file settings.hpp.

## ip_blocker() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::ip_blocker | ( | std::shared_ptr< typename Traits::ip_blocker_t > | blocker | ) | &

inline

Setter for IP-blocker.

Note
  ip_blocker() method should be called if user specify its type for ip_blocker_t traits. For example:
  class my_ip_blocker_t {
  ...
  public:
  ...
  restinio::ip_blocker::inspection_result_t
  inspect(const restinio::ip_blocker::incoming_info_t & info) noexcept {
  ...
  }
  };
  struct my_traits_t : public restinio::default_traits_t {
  using ip_blocker_t = my_ip_blocker_t;
  };
  restinio::server_setting_t<my_traits_t> settings;
  setting.ip_blocker( std::make_shared<my_ip_blocker_t>(...) );
  ...
  restinio::ip_blocker::incoming_info_t
  An information about new incoming connection to be passed to IP-blocker object.
  Definition: ip_blocker.hpp:64
  restinio::ip_blocker::inspection_result_t
  inspection_result_t
  Enumeration of result of inspecting new incoming connection.
  Definition: ip_blocker.hpp:31

Attention
  This method can't be called if the default no-op IP-blocker is used in server traits.

Since
  v.0.5.1

Definition at line 1237 of file settings.hpp.

## ip_blocker() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::ip_blocker | ( | std::shared_ptr< typename Traits::ip_blocker_t > | blocker | ) | &&

inline

Setter for IP-blocker.

Note
  ip_blocker() method should be called if user specify its type for ip_blocker_t traits. For example:
  class my_ip_blocker_t {
  ...
  public:
  ...
  restinio::ip_blocker::inspection_result_t
  inspect(const restinio::ip_blocker::incoming_info_t & info) noexcept {
  ...
  }
  };
  struct my_traits_t : public restinio::default_traits_t {
  using ip_blocker_t = my_ip_blocker_t;
  };
  restinio::run( restinio::on_this_thread<my_traits_t>()
  .ip_blocker( std::make_shared<my_ip_blocker_t>(...) )
  .port(...)
  ...);
  restinio::basic_server_settings_t::ip_blocker
  const std::shared_ptr< typename Traits::ip_blocker_t > & ip_blocker() const noexcept
  Get reference to IP-blocker.
  Definition: settings.hpp:1297

Attention
  This method can't be called if the default no-op state listener is used in server traits.

Since
  v.0.5.1

Definition at line 1282 of file settings.hpp.

## logger() [1/3]

template<typename Derived , typename Traits >

std::unique_ptr< logger_t > restinio::basic_server_settings_t< Derived, Traits >::logger | ( |  | ) |

inline

Definition at line 932 of file settings.hpp.

## logger() [2/3]

template<typename Derived , typename Traits >
template<typename... Params>

Derived & restinio::basic_server_settings_t< Derived, Traits >::logger | ( | Params &&... | params | ) | &

inline

Definition at line 917 of file settings.hpp.

## logger() [3/3]

template<typename Derived , typename Traits >
template<typename... Params>

Derived && restinio::basic_server_settings_t< Derived, Traits >::logger | ( | Params &&... | params | ) | &&

inline

Definition at line 926 of file settings.hpp.

## max_parallel_connections() [1/3]

template<typename Derived , typename Traits >

std::size_t restinio::details::max_parallel_connections_holder_t< Count_Limiter >::max_parallel_connections | ( |  | ) | const

inlinenoexcept

Definition at line 495 of file settings.hpp.

## max_parallel_connections() [2/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::max_parallel_connections | ( | std::size_t | value | ) | &&

inlinenoexcept

Setter for connection count limit.

Note
  This setter can be called only if the usage of connection count limit is turned on explicitly.

Usage example:

struct my_traits : public restinio::default_traits_t {
static constexpr bool use_connection_count_limiter = true;
};
...
auto server = restinio::run_async(
restinio::own_io_context(),
restinio::server_settings_t<my_traits>{}
...
.max_parallel_connections(1000u),
std::thread::hardware_concurrency());
restinio::basic_server_settings_t::max_parallel_connections
Derived & max_parallel_connections(std::size_t value) &noexcept
Setter for connection count limit.
Definition: settings.hpp:1501

Since
  v.0.6.12

Definition at line 1536 of file settings.hpp.

## max_parallel_connections() [3/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::max_parallel_connections | ( | std::size_t | value | ) | &

inlinenoexcept

Setter for connection count limit.

Note
  This setter can be called only if the usage of connection count limit is turned on explicitly.

Usage example:

struct my_traits : public restinio::default_traits_t {
static constexpr bool use_connection_count_limiter = true;
};
...
restinio::server_settings_t<my_traits> settings;
settings.max_parallel_connections( 1000u );
...
auto server = restinio::run_async(
restinio::own_io_context(),
std::move(settings),
std::thread::hardware_concurrency());

Since
  v.0.6.12

Definition at line 1501 of file settings.hpp.

## max_pipelined_requests() [1/3]

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::max_pipelined_requests | ( |  | ) | const

inline

Definition at line 836 of file settings.hpp.

## max_pipelined_requests() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::max_pipelined_requests | ( | std::size_t | mpr | ) | &

inline

Max pipelined requests able to receive on single connection.

Definition at line 823 of file settings.hpp.

## max_pipelined_requests() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::max_pipelined_requests | ( | std::size_t | mpr | ) | &&

inline

Definition at line 830 of file settings.hpp.

## port() [1/3]

template<typename Derived , typename Traits >

RESTINIO_NODISCARD std::uint16_t restinio::basic_server_settings_t< Derived, Traits >::port | ( |  | ) | const

inline

Definition at line 600 of file settings.hpp.

## port() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::port | ( | std::uint16_t | p | ) | &

inline

Server endpoint.

Definition at line 586 of file settings.hpp.

## port() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::port | ( | std::uint16_t | p | ) | &&

inline

Definition at line 593 of file settings.hpp.

## protocol() [1/3]

template<typename Derived , typename Traits >

RESTINIO_NODISCARD asio_ns::ip::tcp restinio::basic_server_settings_t< Derived, Traits >::protocol | ( |  | ) | const

inline

Definition at line 620 of file settings.hpp.

## protocol() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::protocol | ( | asio_ns::ip::tcp | p | ) | &

inline

Definition at line 606 of file settings.hpp.

## protocol() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::protocol | ( | asio_ns::ip::tcp | p | ) | &&

inline

Definition at line 613 of file settings.hpp.

## read_next_http_message_timelimit() [1/3]

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::read_next_http_message_timelimit | ( |  | ) | const

inline

Definition at line 770 of file settings.hpp.

## read_next_http_message_timelimit() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::read_next_http_message_timelimit | ( | std::chrono::steady_clock::duration | d | ) | &

inline

}

A period for holding connection before completely receiving new http-request. Starts counting since connection is establised or a previous request was responsed.

Generaly it defines timeout for keep-alive connections.

Definition at line 757 of file settings.hpp.

## read_next_http_message_timelimit() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::read_next_http_message_timelimit | ( | std::chrono::steady_clock::duration | d | ) | &&

inline

Definition at line 764 of file settings.hpp.

## reference_to_derived()

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::reference_to_derived | ( |  | ) |

inlineprivate

Definition at line 1656 of file settings.hpp.

## request_handler() [1/4]

template<typename Derived , typename Traits >

std::unique_ptr< request_handler_t > restinio::basic_server_settings_t< Derived, Traits >::request_handler | ( |  | ) |

inline

Definition at line 872 of file settings.hpp.

## request_handler() [2/4]

template<typename Derived , typename Traits >
template<typename... Params>

Derived & restinio::basic_server_settings_t< Derived, Traits >::request_handler | ( | Params &&... | params | ) | &

inline

Definition at line 856 of file settings.hpp.

## request_handler() [3/4]

template<typename Derived , typename Traits >
template<typename... Params>

Derived && restinio::basic_server_settings_t< Derived, Traits >::request_handler | ( | Params &&... | params | ) | &&

inline

Definition at line 866 of file settings.hpp.

## request_handler() [4/4]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::request_handler | ( | std::unique_ptr< request_handler_t > | handler | ) | &

inline

Definition at line 848 of file settings.hpp.

## separate_accept_and_create_connect() [1/3]

template<typename Derived , typename Traits >

bool restinio::basic_server_settings_t< Derived, Traits >::separate_accept_and_create_connect | ( |  | ) | const

inlinenoexcept

Definition at line 1052 of file settings.hpp.

## separate_accept_and_create_connect() [2/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::separate_accept_and_create_connect | ( | bool | do_separate | ) | &&

inlinenoexcept

Definition at line 1046 of file settings.hpp.

## separate_accept_and_create_connect() [3/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::separate_accept_and_create_connect | ( | bool | do_separate | ) | &

inlinenoexcept

Do separate an accept operation and connection instantiation.

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 to acceptors one.

Definition at line 1039 of file settings.hpp.

## set_shared_instance()

template<typename Derived , typename Traits >
template<typename Target , typename... Params>

Derived & restinio::basic_server_settings_t< Derived, Traits >::set_shared_instance | ( | std::shared_ptr< Target > & | t,
|  | Params &&... | params
| ) |  |

inlineprivate

Definition at line 1674 of file settings.hpp.

## set_unique_instance()

template<typename Derived , typename Traits >
template<typename Target , typename... Params>

Derived & restinio::basic_server_settings_t< Derived, Traits >::set_unique_instance | ( | std::unique_ptr< Target > & | t,
|  | Params &&... | params
| ) |  |

inlineprivate

Definition at line 1663 of file settings.hpp.

## socket_options_setter() [1/3]

template<typename Derived , typename Traits >

std::unique_ptr< socket_options_setter_t > restinio::basic_server_settings_t< Derived, Traits >::socket_options_setter | ( |  | ) |

inline

Definition at line 988 of file settings.hpp.

## socket_options_setter() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::socket_options_setter | ( | socket_options_setter_t | sos | ) | &

inline

Socket options setter.

Definition at line 971 of file settings.hpp.

## socket_options_setter() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::socket_options_setter | ( | socket_options_setter_t | sos | ) | &&

inline

Definition at line 982 of file settings.hpp.

## timer_factory()

template<typename Derived , typename Traits >

std::unique_ptr< timer_factory_t > restinio::basic_server_settings_t< Derived, Traits >::timer_factory | ( |  | ) |

inline

Definition at line 903 of file settings.hpp.

## timer_manager() [1/2]

template<typename Derived , typename Traits >
template<typename... Params>

Derived & restinio::basic_server_settings_t< Derived, Traits >::timer_manager | ( | Params &&... | params | ) | &

inline

Definition at line 888 of file settings.hpp.

## timer_manager() [2/2]

template<typename Derived , typename Traits >
template<typename... Params>

Derived && restinio::basic_server_settings_t< Derived, Traits >::timer_manager | ( | Params &&... | params | ) | &&

inline

Definition at line 897 of file settings.hpp.

## write_http_response_timelimit() [1/3]

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::write_http_response_timelimit | ( |  | ) | const

inline

Definition at line 792 of file settings.hpp.

## write_http_response_timelimit() [2/3]

template<typename Derived , typename Traits >

Derived & restinio::basic_server_settings_t< Derived, Traits >::write_http_response_timelimit | ( | std::chrono::steady_clock::duration | d | ) | &

inline

A period of time wait for response to be written to socket.

Definition at line 779 of file settings.hpp.

## write_http_response_timelimit() [3/3]

template<typename Derived , typename Traits >

Derived && restinio::basic_server_settings_t< Derived, Traits >::write_http_response_timelimit | ( | std::chrono::steady_clock::duration | d | ) | &&

inline

Definition at line 786 of file settings.hpp.

## Member Data Documentation

## has_actual_max_parallel_connections

template<typename Derived , typename Traits >

constexpr bool restinio::details::max_parallel_connections_holder_t< Count_Limiter >::has_actual_max_parallel_connections

staticconstexprprivate

Definition at line 483 of file settings.hpp.

## m_acceptor_options_setter

template<typename Derived , typename Traits >

std::unique_ptr< acceptor_options_setter_t > restinio::basic_server_settings_t< Derived, Traits >::m_acceptor_options_setter

private

Acceptor options setter.

Definition at line 1722 of file settings.hpp.

## m_acceptor_post_bind_hook

template<typename Derived , typename Traits >

acceptor_post_bind_hook_t restinio::basic_server_settings_t< Derived, Traits >::m_acceptor_post_bind_hook

private

Initial value:
{
[](asio_ns::ip::tcp::acceptor &) {}
}

A hook to be called just after a successful call to bind for acceptor.

An empty lambda is used by default.

Since
  v.0.6.11

Definition at line 1730 of file settings.hpp.

## m_address

template<typename Derived , typename Traits >

details::address_variant_t restinio::basic_server_settings_t< Derived, Traits >::m_address

private

Note
  This member has type address_variant_t since v.0.6.11

Definition at line 1691 of file settings.hpp.

## m_buffer_size

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::m_buffer_size { 4 * 1024 }

private

Size of buffer for io operations.

Definition at line 1695 of file settings.hpp.

## m_cleanup_functor

template<typename Derived , typename Traits >

cleanup_functor_t restinio::basic_server_settings_t< Derived, Traits >::m_cleanup_functor

private

Optional cleanup functor.

Definition at line 1743 of file settings.hpp.

## m_concurrent_accepts_count

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::m_concurrent_accepts_count { 1 }

private

Definition at line 1737 of file settings.hpp.

## m_extra_data_factory

template<typename Derived , typename Traits >

extra_data_factory_handle_t restinio::basic_server_settings_t< Derived, Traits >::m_extra_data_factory

private

User-data-factory for server.

Since
  v.0.6.13

Definition at line 1757 of file settings.hpp.

## m_handle_request_timeout

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::m_handle_request_timeout { std::chrono::seconds( 10 ) }

private

Definition at line 1706 of file settings.hpp.

## m_incoming_http_msg_limits

template<typename Derived , typename Traits >

incoming_http_msg_limits_t restinio::basic_server_settings_t< Derived, Traits >::m_incoming_http_msg_limits

private

Limits for incoming HTTP messages.

Since
  v.0.6.12

Definition at line 1750 of file settings.hpp.

## m_logger

template<typename Derived , typename Traits >

std::unique_ptr< logger_t > restinio::basic_server_settings_t< Derived, Traits >::m_logger

private

Logger.

Definition at line 1719 of file settings.hpp.

## m_max_pipelined_requests

template<typename Derived , typename Traits >

std::size_t restinio::basic_server_settings_t< Derived, Traits >::m_max_pipelined_requests { 1 }

private

Max pipelined requests to receive on single connection.

Definition at line 1710 of file settings.hpp.

## m_port

template<typename Derived , typename Traits >

std::uint16_t restinio::basic_server_settings_t< Derived, Traits >::m_port

private

Server endpoint.

Definition at line 1685 of file settings.hpp.

## m_protocol

template<typename Derived , typename Traits >

asio_ns::ip::tcp restinio::basic_server_settings_t< Derived, Traits >::m_protocol

private

Definition at line 1686 of file settings.hpp.

## m_read_next_http_message_timelimit

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::m_read_next_http_message_timelimit { std::chrono::seconds( 60 ) }

private

Operations timeouts.

Definition at line 1700 of file settings.hpp.

## m_request_handler

template<typename Derived , typename Traits >

std::unique_ptr< request_handler_t > restinio::basic_server_settings_t< Derived, Traits >::m_request_handler

private

Request handler.

Definition at line 1713 of file settings.hpp.

## m_separate_accept_and_create_connect

template<typename Derived , typename Traits >

bool restinio::basic_server_settings_t< Derived, Traits >::m_separate_accept_and_create_connect { false }

private

Do separate an accept operation and connection instantiation.

Definition at line 1740 of file settings.hpp.

## m_socket_options_setter

template<typename Derived , typename Traits >

std::unique_ptr< socket_options_setter_t > restinio::basic_server_settings_t< Derived, Traits >::m_socket_options_setter

private

Socket options setter.

Definition at line 1735 of file settings.hpp.

## m_timer_factory

template<typename Derived , typename Traits >

std::unique_ptr< timer_factory_t > restinio::basic_server_settings_t< Derived, Traits >::m_timer_factory

private

Timers factory.

Definition at line 1716 of file settings.hpp.

## m_write_http_response_timelimit

template<typename Derived , typename Traits >

std::chrono::steady_clock::duration restinio::basic_server_settings_t< Derived, Traits >::m_write_http_response_timelimit { std::chrono::seconds( 5 ) }

private

Definition at line 1703 of file settings.hpp.

The documentation for this class was generated from the following file:

- restinio/settings.hpp