13 #include <restinio/null_mutex.hpp> 14 #include <restinio/default_strands.hpp> 16 #include <restinio/utils/tagged_scalar.hpp> 87 std::size_t index )
noexcept = 0;
100 std::size_t index )
noexcept = 0;
114 template<
typename Mutex_Type >
176 not_null_pointer_t< acceptor_callback_iface_t > acceptor,
177 max_parallel_connections_t max_parallel_connections,
178 max_active_accepts_t max_pending_indexes )
276 not_null_pointer_t< connection_count_limits::impl::acceptor_callback_iface_t > acceptor,
277 max_parallel_connections_t ,
296 m_acceptor->call_accept_now( index );
309 template<
typename Strand >
310 class connection_count_limiter_t;
373 template<
typename Count_Manager >
380 not_null_pointer_t< Count_Manager > manager )
noexcept 457 template<
typename Traits >
connection_lifetime_monitor_t & operator=(const connection_lifetime_monitor_t &)=delete
An interface of acceptor to be used by connection count limiters.
not_null_pointer_t< Count_Manager > m_manager
Helper type for controlling the lifetime of the connection.
std::vector< std::size_t > m_pending_indexes
The storage for holding pending socket's slots.
Mutex_Type m_lock
Lock object to be used.
std::size_t m_connections
The counter of active connections.
not_null_pointer_t< acceptor_callback_iface_t > m_acceptor
Mandatory pointer to the acceptor connected with this limiter.
actual_limiter_t(actual_limiter_t &&)=delete
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, std::optional< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in std::optional<Value_Type> if parameter exis...
void increment_parallel_connections() noexcept
void decrement_parallel_connections() noexcept
std::size_t m_active_accepts
The counter of active accept() operations.
connection_lifetime_monitor_t(connection_lifetime_monitor_t &&other) noexcept
actual_limiter_t(not_null_pointer_t< acceptor_callback_iface_t > acceptor, max_parallel_connections_t max_parallel_connections, max_active_accepts_t max_pending_indexes)
connection_lifetime_monitor_t & operator=(connection_lifetime_monitor_t &&other) noexcept
Actual implementation of connection count limiter.
connection_lifetime_monitor_t(not_null_pointer_t< noop_connection_count_limiter_t >) noexcept
virtual void schedule_next_accept_attempt(std::size_t index) noexcept=0
void increment_parallel_connections() noexcept
void decrement_parallel_connections() noexcept
noop_connection_count_limiter_t(not_null_pointer_t< connection_count_limits::impl::acceptor_callback_iface_t > acceptor, max_parallel_connections_t, max_active_accepts_t)
void accept_next(std::size_t index) noexcept
virtual void call_accept_now(std::size_t index) noexcept=0
void accept_next(std::size_t index) noexcept
connection_lifetime_monitor_t(const connection_lifetime_monitor_t &)=delete
A kind of metafunction that deduces actual types related to connection count limiter in the dependecy...
bool has_free_slots() const noexcept
friend void swap(connection_lifetime_monitor_t &a, connection_lifetime_monitor_t &b) noexcept
const std::size_t m_max_parallel_connections
The limit for parallel connections.
actual_limiter_t(const actual_limiter_t &)=delete
~connection_lifetime_monitor_t()
not_null_pointer_t< connection_count_limits::impl::acceptor_callback_iface_t > m_acceptor
An implementation of connection count limiter for the case when connection count is not limited...
connection_lifetime_monitor_t(not_null_pointer_t< Count_Manager > manager) noexcept