RESTinio
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
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 >:
restinio::socket_type_dependent_settings_t< Derived, Traits::stream_socket_t > restinio::connection_state_listener_holder_t< Traits::connection_state_listener_t > restinio::ip_blocker_holder_t< Traits::ip_blocker_t >

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 & port (std::uint16_t p) &
 Server endpoint. More...
 
Derived && port (std::uint16_t p) &&
 
std::uint16_t port () const
 
Derived & protocol (asio_ns::ip::tcp p) &
 
Derived && protocol (asio_ns::ip::tcp p) &&
 
asio_ns::ip::tcp protocol () const
 
Derived & address (std::string addr) &
 
Derived && address (std::string addr) &&
 
const std::string & 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_tacceptor_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_tsocket_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) &
 Do separate an accept operation and connection instantiation. More...
 
Derived && separate_accept_and_create_connect (bool do_separate) &&
 
bool separate_accept_and_create_connect () const
 
template<typename Func >
Derived & cleanup_func (Func &&func) &
 Cleanup function. More...
 
template<typename Func >
Derived && cleanup_func (Func &&func) &&
 
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 ()=default
 
 socket_type_dependent_settings_t (const socket_type_dependent_settings_t &)=default
 
 socket_type_dependent_settings_t (socket_type_dependent_settings_t &&)=default
 
socket_type_dependent_settings_toperator= (const socket_type_dependent_settings_t &)=default
 
socket_type_dependent_settings_toperator= (socket_type_dependent_settings_t &&)=delete
 

Private Types

using base_type_t = socket_type_dependent_settings_t< Derived, typename Traits::stream_socket_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_tm_request_handler
 Request handler. More...
 
std::unique_ptr< timer_factory_tm_timer_factory
 Timers factory. More...
 
std::unique_ptr< logger_tm_logger
 Logger. More...
 
std::unique_ptr< acceptor_options_setter_tm_acceptor_options_setter
 Acceptor options setter. More...
 
std::unique_ptr< socket_options_setter_tm_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...
 
std::uint16_t m_port
 Server endpoint. More...
 
asio_ns::ip::tcp m_protocol
 
std::string 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_connection_state_listener
 
static constexpr bool has_actual_ip_blocker
 
using request_handler_t = typename Traits::request_handler_t
 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_trequest_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_ttimer_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_tlogger ()
 

Additional Inherited Members

- Protected Member Functions inherited from restinio::socket_type_dependent_settings_t< Derived, Traits::stream_socket_t >
 ~socket_type_dependent_settings_t ()=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 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
 
- 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
 

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
DerivedA drived type. Reference to this derived type will be returned by setters.
TraitsA type with traits for http_server.

Definition at line 442 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 449 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 719 of file settings.hpp.

◆ request_handler_t

template<typename Derived, typename Traits>
using restinio::basic_server_settings_t< Derived, Traits >::request_handler_t = typename Traits::request_handler_t

Request handler.

Definition at line 651 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 690 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 689 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 461 of file settings.hpp.

Member Function Documentation

◆ acceptor_options_setter() [1/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 749 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

Definition at line 760 of file settings.hpp.

◆ acceptor_options_setter() [3/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 766 of file settings.hpp.

◆ address() [1/3]

template<typename Derived, typename Traits>
Derived& restinio::basic_server_settings_t< Derived, Traits >::address ( std::string  addr) &
inline

Definition at line 510 of file settings.hpp.

◆ address() [2/3]

template<typename Derived, typename Traits>
Derived&& restinio::basic_server_settings_t< Derived, Traits >::address ( std::string  addr) &&
inline

Definition at line 517 of file settings.hpp.

◆ address() [3/3]

template<typename Derived, typename Traits>
const std::string& restinio::basic_server_settings_t< Derived, Traits >::address ( ) const
inline

Definition at line 523 of file settings.hpp.

◆ buffer_size() [1/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 536 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

Definition at line 543 of file settings.hpp.

◆ buffer_size() [3/3]

template<typename Derived, typename Traits>
std::size_t restinio::basic_server_settings_t< Derived, Traits >::buffer_size ( ) const
inline

Definition at line 549 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 868 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 876 of file settings.hpp.

◆ concurrent_accepts_count() [1/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 809 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

Definition at line 822 of file settings.hpp.

◆ concurrent_accepts_count() [3/3]

template<typename Derived, typename Traits>
std::size_t restinio::basic_server_settings_t< Derived, Traits >::concurrent_accepts_count ( ) const
inline

Definition at line 828 of file settings.hpp.

◆ connection_state_listener() [1/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>(...) );
...
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 919 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::run( restinio::on_this_thread<my_traits_t>()
.connection_state_listener( std::make_shared<my_state_listener_t>(...) )
.port(...)
...);
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 963 of file settings.hpp.

◆ connection_state_listener() [3/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 979 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 999 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 1115 of file settings.hpp.

◆ giveaway_cleanup_func()

template<typename Derived, typename Traits>
cleanup_functor_t restinio::basic_server_settings_t< Derived, Traits >::giveaway_cleanup_func ( )
inline

Definition at line 882 of file settings.hpp.

◆ handle_request_timeout() [1/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 607 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

Definition at line 614 of file settings.hpp.

◆ handle_request_timeout() [3/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 620 of file settings.hpp.

◆ ip_blocker() [1/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:
...
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>(...) );
...
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 1036 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:
...
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(...)
...);
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 1081 of file settings.hpp.

◆ ip_blocker() [3/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 1096 of file settings.hpp.

◆ logger() [1/3]

template<typename Derived, typename Traits>
template<typename... Params>
Derived& restinio::basic_server_settings_t< Derived, Traits >::logger ( Params &&...  params) &
inline

Definition at line 723 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 732 of file settings.hpp.

◆ logger() [3/3]

template<typename Derived, typename Traits>
std::unique_ptr< logger_t > restinio::basic_server_settings_t< Derived, Traits >::logger ( )
inline

Definition at line 738 of file settings.hpp.

◆ max_pipelined_requests() [1/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 629 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

Definition at line 636 of file settings.hpp.

◆ max_pipelined_requests() [3/3]

template<typename Derived, typename Traits>
std::size_t restinio::basic_server_settings_t< Derived, Traits >::max_pipelined_requests ( ) const
inline

Definition at line 642 of file settings.hpp.

◆ port() [1/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 472 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

Definition at line 479 of file settings.hpp.

◆ port() [3/3]

template<typename Derived, typename Traits>
std::uint16_t restinio::basic_server_settings_t< Derived, Traits >::port ( ) const
inline

Definition at line 485 of file settings.hpp.

◆ protocol() [1/3]

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

Definition at line 491 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 498 of file settings.hpp.

◆ protocol() [3/3]

template<typename Derived, typename Traits>
asio_ns::ip::tcp restinio::basic_server_settings_t< Derived, Traits >::protocol ( ) const
inline

Definition at line 504 of file settings.hpp.

◆ read_next_http_message_timelimit() [1/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 563 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

Definition at line 570 of file settings.hpp.

◆ read_next_http_message_timelimit() [3/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 576 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 1122 of file settings.hpp.

◆ request_handler() [1/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 654 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 662 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 672 of file settings.hpp.

◆ request_handler() [4/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 678 of file settings.hpp.

◆ separate_accept_and_create_connect() [1/3]

template<typename Derived, typename Traits>
Derived& restinio::basic_server_settings_t< Derived, Traits >::separate_accept_and_create_connect ( bool  do_separate) &
inline

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 845 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) &&
inline

Definition at line 852 of file settings.hpp.

◆ separate_accept_and_create_connect() [3/3]

template<typename Derived, typename Traits>
bool restinio::basic_server_settings_t< Derived, Traits >::separate_accept_and_create_connect ( ) const
inline

Definition at line 858 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 1140 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 1129 of file settings.hpp.

◆ socket_options_setter() [1/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 777 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

Definition at line 788 of file settings.hpp.

◆ socket_options_setter() [3/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 794 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 709 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 694 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 703 of file settings.hpp.

◆ write_http_response_timelimit() [1/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 585 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

Definition at line 592 of file settings.hpp.

◆ write_http_response_timelimit() [3/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 598 of file settings.hpp.

Member Data Documentation

◆ has_actual_connection_state_listener

template<typename Derived, typename Traits>
constexpr bool restinio::basic_server_settings_t< Derived, Traits >::has_actual_connection_state_listener
staticprivate
Initial value:
=
connection_state_listener_holder_t<
typename Traits::connection_state_listener_t

Definition at line 451 of file settings.hpp.

◆ has_actual_ip_blocker

template<typename Derived, typename Traits>
constexpr bool restinio::basic_server_settings_t< Derived, Traits >::has_actual_ip_blocker
staticprivate
Initial value:
=
ip_blocker_holder_t< typename Traits::ip_blocker_t >::
has_actual_ip_blocker

Definition at line 456 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 1184 of file settings.hpp.

◆ m_address

template<typename Derived, typename Traits>
std::string restinio::basic_server_settings_t< Derived, Traits >::m_address
private

Definition at line 1153 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 1157 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 1195 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 1189 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 1168 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 1181 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 1172 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 1151 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 1152 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 1162 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 1175 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 1192 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 1187 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 1178 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 1165 of file settings.hpp.


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