Go to the documentation of this file.
22 namespace connection_state
92 template<
typename Lambda >
128 template<
typename Lambda >
169 template< typename Lambda, typename T >
236 : m_conn_id{ conn_id }
237 , m_remote_endpoint{ remote_endpoint }
#define RESTINIO_NODISCARD
T inspect_tls_or_default(Lambda &&lambda, T &&default_value) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
asio_ns::ip::tcp::endpoint endpoint_t
An alias for endpoint type from Asio.
std::uint64_t connection_id_t
Type for ID of connection.
tls_socket_t * m_tls_socket
An optional pointer to TLS-related connection.
Type of object that tells that new connection has been accepted.
RESTINIO_NODISCARD connection_id_t connection_id() const noexcept
Get the connection id.
connection_id_t m_conn_id
Socket adapter for asio::ssl::stream< asio::ip::tcp::socket >.
Forward declarations for TLS-related things.
An object with info about connection to be passed to state listener.
Type of object that tells that the connection has been closed.
accepted_t(tls_socket_t *tls_socket)
Detection of compiler version and absence of various features.
RESTINIO_NODISCARD bool is_tls_connection() const noexcept
Checks if the accepted connection is a TLS-connection.
Type of object that tells that the connection has been upgraded to WebSocket.
decltype(auto) inspect_tls_or_throw(Lambda &&lambda) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
RESTINIO_NODISCARD cause_t cause() const noexcept
Get the cause for the notification.
RESTINIO_NODISCARD endpoint_t remote_endpoint() const noexcept
Get the remote endpoint for the connection.
The default no-op state listener.
void try_inspect_tls(Lambda &&lambda) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
notice_t(connection_id_t conn_id, endpoint_t remote_endpoint, cause_t cause)
Initializing constructor.
endpoint_t m_remote_endpoint