|
RESTinio
|
Helper type for controlling the lifetime of the connection. More...
#include <connection_count_limiter.hpp>
Public Member Functions | |
| template<typename Acceptor_Type> | |
| connection_lifetime_monitor_t (Acceptor_Type &acceptor, not_null_pointer_t< Count_Manager > manager) noexcept | |
| ~connection_lifetime_monitor_t () | |
| connection_lifetime_monitor_t (const connection_lifetime_monitor_t &)=delete | |
| connection_lifetime_monitor_t (connection_lifetime_monitor_t &&other) noexcept | |
| connection_lifetime_monitor_t & | operator= (connection_lifetime_monitor_t &&other) noexcept |
| connection_lifetime_monitor_t & | operator= (const connection_lifetime_monitor_t &)=delete |
Private Attributes | |
| std::any | m_acceptor |
| Holder of std::shared_ptr<acceptor_t>. | |
| Count_Manager * | m_manager |
| Pointer to manager object that counts live connections. | |
Friends | |
| void | swap (connection_lifetime_monitor_t &a, connection_lifetime_monitor_t &b) noexcept |
Helper type for controlling the lifetime of the connection.
Connection count limiter should be informed when a new connection created and when an existing connection is closed. An instance of connection_lifetime_monitor_t should be used for that purpose: a new instance of connection_lifetime_monitor_t should be created and bound to a connection object. The constructor of connection_lifetime_monitor_t will inform the limiter about the creation of a new connection. The destructor of connection_lifetime_monitor_t will inform the limiter about the destruction of a connection.
Definition at line 376 of file connection_count_limiter.hpp.
|
inlinenoexcept |
Definition at line 398 of file connection_count_limiter.hpp.
|
inline |
Definition at line 407 of file connection_count_limiter.hpp.
|
delete |
|
inlinenoexcept |
Definition at line 426 of file connection_count_limiter.hpp.
|
inlinenoexcept |
Definition at line 437 of file connection_count_limiter.hpp.
|
delete |
|
friend |
Definition at line 417 of file connection_count_limiter.hpp.
|
private |
Holder of std::shared_ptr<acceptor_t>.
The acceptor shouldn't be destroyed while this monitor object is alive. To ensure this a shared_ptr has to be stored inside monitor instance. But acceptor_t depends on Traits type that in not available here. For simplicity shared_ptr is wrapped into std::any.
Definition at line 388 of file connection_count_limiter.hpp.
|
private |
Pointer to manager object that counts live connections.
Definition at line 394 of file connection_count_limiter.hpp.