RESTinio
Loading...
Searching...
No Matches
connection_state_listener.hpp
Go to the documentation of this file.
1/*
2 * RESTinio
3 */
4
12#pragma once
13
16#include <restinio/variant.hpp>
17#include <restinio/tls_fwd.hpp>
18
19namespace restinio
20{
21
22namespace connection_state
23{
24
36{
46
47public:
52
60 bool
62
92 template< typename Lambda >
93 void
94 try_inspect_tls( Lambda && lambda ) const;
95
128 template< typename Lambda >
129 decltype(auto)
131
169 template< typename Lambda, typename T >
170 T
172};
173
183{
184};
185
198
213
261
274{
275 // empty type by design.
276};
277
278} /* namespace connection_state */
279
280} /* namespace restinio */
281
Type of object that tells that new connection has been accepted.
decltype(auto) inspect_tls_or_throw(Lambda &&lambda) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
Definition tls.hpp:109
RESTINIO_NODISCARD bool is_tls_connection() const noexcept
Checks if the accepted connection is a TLS-connection.
T inspect_tls_or_default(Lambda &&lambda, T &&default_value) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
Definition tls.hpp:120
tls_socket_t * m_tls_socket
An optional pointer to TLS-related connection.
void try_inspect_tls(Lambda &&lambda) const
Calls the specified lambda-function if the accepted connection is a TLS-connection.
Definition tls.hpp:101
Type of object that tells that the connection has been closed.
An object with info about connection to be passed to state listener.
RESTINIO_NODISCARD cause_t cause() const noexcept
Get the cause for the notification.
RESTINIO_NODISCARD connection_id_t connection_id() const noexcept
Get the connection id.
RESTINIO_NODISCARD endpoint_t remote_endpoint() const noexcept
Get the remote endpoint for the connection.
notice_t(connection_id_t conn_id, endpoint_t remote_endpoint, cause_t cause)
Initializing constructor.
Type of object that tells that the connection has been upgraded to WebSocket.
Socket adapter for asio::ssl::stream< asio::ip::tcp::socket >.
Detection of compiler version and absence of various features.
#define RESTINIO_NODISCARD
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.
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.
Forward declarations for TLS-related things.
#define const
Definition zconf.h:230