|
Monero
|
Represents a single connection from a client. More...
#include <abstract_tcp_server2.h>


Classes | |
| struct | state_t |
| struct | timers_t |
| struct | shared_state |
Public Types | |
| typedef t_protocol_handler::connection_context | t_connection_context |
Public Member Functions | |
| connection (io_context_t &io_context, std::shared_ptr< shared_state > state, t_connection_type connection_type, epee::net_utils::ssl_support_t ssl_support, t_connection_context &&initial=t_connection_context{}) | |
| Construct a connection with the given io_context. | |
| connection (io_context_t &io_context, boost::asio::ip::tcp::socket &&sock, std::shared_ptr< shared_state > state, t_connection_type connection_type, epee::net_utils::ssl_support_t ssl_support, t_connection_context &&initial=t_connection_context{}) | |
| virtual | ~connection () noexcept(false) |
| bool | start (bool is_income, bool is_multithreaded) |
| Start the first asynchronous operation for the connection. | |
| bool | start (bool is_income, bool is_multithreaded, network_address real_remote) |
| void | get_context (t_connection_context &context_) |
| void | call_back_starter () |
| void | save_dbg_log () |
| bool | speed_limit_is_enabled () const |
| tells us should we be sleeping here (e.g. do not sleep on RPC connections) | |
| bool | cancel () |
| void | setRpcStation () |
| Public Member Functions inherited from epee::net_utils::connection_basic | |
| connection_basic (boost::asio::io_context &context, boost::asio::ip::tcp::socket &&sock, std::shared_ptr< connection_basic_shared_state > state, ssl_support_t ssl_support) | |
| connection_basic (boost::asio::io_context &context, std::shared_ptr< connection_basic_shared_state > state, ssl_support_t ssl_support) | |
| virtual | ~connection_basic () noexcept(false) |
| connection_basic_shared_state & | get_state () noexcept |
| boost::asio::ip::tcp::socket & | socket () |
| ssl_support_t | get_ssl_support () const |
| void | disable_ssl () |
| bool | handshake (boost::asio::ssl::stream_base::handshake_type type, boost::asio::const_buffer buffer={}) |
| template<typename MutableBufferSequence, typename ReadHandler> | |
| void | async_read_some (const MutableBufferSequence &buffers, ReadHandler &&handler) |
| template<typename ConstBufferSequence, typename WriteHandler> | |
| void | async_write_some (const ConstBufferSequence &buffers, WriteHandler &&handler) |
| template<typename ConstBufferSequence, typename WriteHandler> | |
| void | async_write (const ConstBufferSequence &buffers, WriteHandler &&handler) |
| void | do_send_handler_write (const void *ptr, size_t cb) |
| void | do_send_handler_write_from_queue (const boost::system::error_code &e, size_t cb, int q_len) |
| void | logger_handle_net_write (size_t size) |
| void | logger_handle_net_read (size_t size) |
| void | sleep_before_packet (size_t packet_size, int phase, int q_len) |
Private Types | |
| enum | status_t { TERMINATED , RUNNING , INTERRUPTED , TERMINATING , WASTED } |
| using | connection_t = connection<t_protocol_handler> |
| using | connection_ptr = boost::shared_ptr<connection_t> |
| using | ssl_support_t = epee::net_utils::ssl_support_t |
| using | timer_t = boost::asio::steady_timer |
| using | duration_t = timer_t::duration |
| using | ec_t = boost::system::error_code |
| using | handshake_t = boost::asio::ssl::stream_base::handshake_type |
| using | io_context_t = boost::asio::io_context |
| using | strand_t = io_context_t::strand |
| using | socket_t = boost::asio::ip::tcp::socket |
| using | network_throttle_t = epee::net_utils::network_throttle |
| using | network_throttle_manager_t = epee::net_utils::network_throttle_manager |
Private Member Functions | |
| unsigned int | host_count (int delta=0) |
| duration_t | get_default_timeout () |
| duration_t | get_timeout_from_bytes_read (size_t bytes) const |
| void | state_status_check () |
| void | start_timer (duration_t duration, bool add={}) |
| void | async_wait_timer () |
| void | cancel_timer () |
| void | start_handshake () |
| void | start_read () |
| void | finish_read (size_t bytes_transferred) |
| void | start_write () |
| void | start_shutdown () |
| void | cancel_socket () |
| void | cancel_handler () |
| void | interrupt () |
| void | on_interrupted () |
| void | terminate () |
| void | on_terminating () |
| void | terminate_async () |
| bool | send (epee::byte_slice message) |
| bool | start_internal (bool is_income, bool is_multithreaded, boost::optional< network_address > real_remote) |
| virtual bool | do_send (byte_slice message) |
| (see do_send from i_service_endpoint) | |
| virtual bool | send_done () |
| virtual bool | close () |
| virtual bool | call_run_once_service_io () |
| virtual bool | request_callback () |
| virtual io_context_t & | get_io_context () |
| virtual bool | add_ref () |
| virtual bool | release () |
Private Attributes | |
| io_context_t & | m_io_context |
| t_connection_type | m_connection_type |
| t_connection_context | m_conn_context {} |
| strand_t | m_strand |
| timers_t | m_timers |
| connection_ptr | self {} |
| bool | m_local {} |
| std::string | m_host {} |
| state_t | m_state {} |
| t_protocol_handler | m_handler |
Additional Inherited Members | |
| Static Public Member Functions inherited from epee::net_utils::connection_basic | |
| static void | set_rate_up_limit (uint64_t limit) |
| static void | set_rate_down_limit (uint64_t limit) |
| static uint64_t | get_rate_up_limit () |
| static uint64_t | get_rate_down_limit () |
| static void | set_tos_flag (int tos) |
| static int | get_tos_flag () |
| static void | save_limit_to_file (int limit) |
| for dr-monero | |
| static double | get_sleep_time (size_t cb) |
| Public Attributes inherited from epee::net_utils::connection_basic | |
| std::unique_ptr< connection_basic_pimpl > | mI |
| std::atomic< bool > | m_want_close_connection |
| std::atomic< bool > | m_was_shutdown |
| critical_section | m_send_que_lock |
| std::deque< byte_slice > | m_send_que |
| volatile bool | m_is_multithreaded |
| boost::asio::io_context::strand | strand_ |
| Strand to ensure the connection's handlers are not called concurrently. | |
| boost::asio::ssl::stream< boost::asio::ip::tcp::socket > | socket_ |
| Socket for the connection. | |
| ssl_support_t | m_ssl_support |
| Protected Member Functions inherited from epee::net_utils::i_service_endpoint | |
| virtual | ~i_service_endpoint () noexcept(false) |
Represents a single connection from a client.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| typedef t_protocol_handler::connection_context epee::net_utils::connection< t_protocol_handler >::t_connection_context |
|
private |
|
private |
|
explicit |
Construct a connection with the given io_context.
|
explicit |
|
virtual |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
|
private |
| void epee::net_utils::connection< t_protocol_handler >::call_back_starter | ( | ) |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
| bool epee::net_utils::connection< T >::cancel | ( | ) |
|
private |
|
private |
|
private |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
|
privatevirtual |
(see do_send from i_service_endpoint)
Implements epee::net_utils::i_service_endpoint.
|
private |
|
inline |
|
private |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
|
private |
|
private |
|
private |
|
private |
|
private |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
| void epee::net_utils::connection< T >::save_dbg_log | ( | ) |
|
private |
|
privatevirtual |
Implements epee::net_utils::i_service_endpoint.
| void epee::net_utils::connection< T >::setRpcStation | ( | ) |
| bool epee::net_utils::connection< T >::speed_limit_is_enabled | ( | ) | const |
tells us should we be sleeping here (e.g. do not sleep on RPC connections)
| bool epee::net_utils::connection< T >::start | ( | bool | is_income, |
| bool | is_multithreaded ) |
Start the first asynchronous operation for the connection.
| bool epee::net_utils::connection< T >::start | ( | bool | is_income, |
| bool | is_multithreaded, | ||
| network_address | real_remote ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |