Monero
Loading...
Searching...
No Matches
epee::levin::async_protocol_handler< t_connection_context > Class Template Reference

#include <levin_protocol_handler_async.h>

Collaboration diagram for epee::levin::async_protocol_handler< t_connection_context >:

Classes

struct  invoke_response_handler_base
struct  anvoke_handler

Public Types

enum  stream_state { stream_state_head , stream_state_body }
typedef t_connection_context connection_context
typedef async_protocol_handler_config< t_connection_context > config_type

Public Member Functions

template<class callback_t>
bool add_invoke_response_handler (const callback_t &cb, uint64_t timeout, async_protocol_handler &con, int command)
 async_protocol_handler (net_utils::i_service_endpoint *psnd_hndlr, config_type &config, t_connection_context &conn_context)
virtual ~async_protocol_handler ()
bool start_outer_call ()
bool finish_outer_call ()
bool release_protocol ()
bool close ()
void update_connection_context (const connection_context &contxt)
void request_callback ()
void handle_qued_callback ()
virtual bool handle_recv (const void *ptr, size_t cb)
bool after_init_connection ()
template<class callback_t>
bool async_invoke (int command, message_writer in_msg, const callback_t &cb, size_t timeout=LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED)
int invoke (int command, message_writer in_msg, std::string &buff_out)
int send (byte_slice message)
boost::uuids::uuid get_connection_id ()
t_connection_context & get_context_ref ()

Public Attributes

std::atomic< bool > m_protocol_released
std::atomic< bool > m_invoke_buf_ready
volatile int m_invoke_result_code
critical_section m_local_inv_buff_lock
std::string m_local_inv_buff
critical_section m_call_lock
std::atomic< uint32_tm_wait_count
std::atomic< uint32_tm_close_called
bucket_head2 m_current_head
net_utils::i_service_endpointm_pservice_endpoint
config_typem_config
t_connection_context & m_connection_context
std::atomic< uint64_tm_max_packet_size
net_utils::buffer m_cache_in_buffer
stream_state m_state
int32_t m_oponent_protocol_ver
bool m_connection_initialized
critical_section m_invoke_response_handlers_lock
std::list< boost::shared_ptr< invoke_response_handler_base > > m_invoke_response_handlers

Private Member Functions

bool send_message (byte_slice message)

Private Attributes

std::string m_fragment_buffer

Friends

template<class callback_t>
struct anvoke_handler

Member Typedef Documentation

◆ config_type

template<class t_connection_context = net_utils::connection_context_base>
typedef async_protocol_handler_config<t_connection_context> epee::levin::async_protocol_handler< t_connection_context >::config_type

◆ connection_context

template<class t_connection_context = net_utils::connection_context_base>
typedef t_connection_context epee::levin::async_protocol_handler< t_connection_context >::connection_context

Member Enumeration Documentation

◆ stream_state

template<class t_connection_context = net_utils::connection_context_base>
enum epee::levin::async_protocol_handler::stream_state
Enumerator
stream_state_head 
stream_state_body 

Constructor & Destructor Documentation

◆ async_protocol_handler()

template<class t_connection_context = net_utils::connection_context_base>
epee::levin::async_protocol_handler< t_connection_context >::async_protocol_handler ( net_utils::i_service_endpoint * psnd_hndlr,
config_type & config,
t_connection_context & conn_context )
inline

◆ ~async_protocol_handler()

template<class t_connection_context = net_utils::connection_context_base>
virtual epee::levin::async_protocol_handler< t_connection_context >::~async_protocol_handler ( )
inlinevirtual

Member Function Documentation

◆ add_invoke_response_handler()

template<class t_connection_context = net_utils::connection_context_base>
template<class callback_t>
bool epee::levin::async_protocol_handler< t_connection_context >::add_invoke_response_handler ( const callback_t & cb,
uint64_t timeout,
async_protocol_handler< t_connection_context > & con,
int command )
inline

◆ after_init_connection()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::after_init_connection ( )
inline

◆ async_invoke()

template<class t_connection_context = net_utils::connection_context_base>
template<class callback_t>
bool epee::levin::async_protocol_handler< t_connection_context >::async_invoke ( int command,
message_writer in_msg,
const callback_t & cb,
size_t timeout = LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED )
inline

◆ close()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::close ( )
inline

◆ finish_outer_call()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::finish_outer_call ( )
inline

◆ get_connection_id()

template<class t_connection_context = net_utils::connection_context_base>
boost::uuids::uuid epee::levin::async_protocol_handler< t_connection_context >::get_connection_id ( )
inline

◆ get_context_ref()

template<class t_connection_context = net_utils::connection_context_base>
t_connection_context & epee::levin::async_protocol_handler< t_connection_context >::get_context_ref ( )
inline

◆ handle_qued_callback()

template<class t_connection_context = net_utils::connection_context_base>
void epee::levin::async_protocol_handler< t_connection_context >::handle_qued_callback ( )
inline

◆ handle_recv()

template<class t_connection_context = net_utils::connection_context_base>
virtual bool epee::levin::async_protocol_handler< t_connection_context >::handle_recv ( const void * ptr,
size_t cb )
inlinevirtual

◆ invoke()

template<class t_connection_context = net_utils::connection_context_base>
int epee::levin::async_protocol_handler< t_connection_context >::invoke ( int command,
message_writer in_msg,
std::string & buff_out )
inline

◆ release_protocol()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::release_protocol ( )
inline

◆ request_callback()

template<class t_connection_context = net_utils::connection_context_base>
void epee::levin::async_protocol_handler< t_connection_context >::request_callback ( )
inline

◆ send()

template<class t_connection_context = net_utils::connection_context_base>
int epee::levin::async_protocol_handler< t_connection_context >::send ( byte_slice message)
inline

Sends message without adding a levin header. The message must have been created with make_noise_notify, make_fragmented_notify, or message_writer::finalize_notify. See additional instructions for make_fragmented_notify.

Returns
1 on success

◆ send_message()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::send_message ( byte_slice message)
inlineprivate

◆ start_outer_call()

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::start_outer_call ( )
inline

◆ update_connection_context()

template<class t_connection_context = net_utils::connection_context_base>
void epee::levin::async_protocol_handler< t_connection_context >::update_connection_context ( const connection_context & contxt)
inline

◆ anvoke_handler

template<class t_connection_context = net_utils::connection_context_base>
template<class callback_t>
friend struct anvoke_handler
friend

Member Data Documentation

◆ m_cache_in_buffer

template<class t_connection_context = net_utils::connection_context_base>
net_utils::buffer epee::levin::async_protocol_handler< t_connection_context >::m_cache_in_buffer

◆ m_call_lock

template<class t_connection_context = net_utils::connection_context_base>
critical_section epee::levin::async_protocol_handler< t_connection_context >::m_call_lock

◆ m_close_called

template<class t_connection_context = net_utils::connection_context_base>
std::atomic<uint32_t> epee::levin::async_protocol_handler< t_connection_context >::m_close_called

◆ m_config

template<class t_connection_context = net_utils::connection_context_base>
config_type& epee::levin::async_protocol_handler< t_connection_context >::m_config

◆ m_connection_context

template<class t_connection_context = net_utils::connection_context_base>
t_connection_context& epee::levin::async_protocol_handler< t_connection_context >::m_connection_context

◆ m_connection_initialized

template<class t_connection_context = net_utils::connection_context_base>
bool epee::levin::async_protocol_handler< t_connection_context >::m_connection_initialized

◆ m_current_head

template<class t_connection_context = net_utils::connection_context_base>
bucket_head2 epee::levin::async_protocol_handler< t_connection_context >::m_current_head

◆ m_fragment_buffer

template<class t_connection_context = net_utils::connection_context_base>
std::string epee::levin::async_protocol_handler< t_connection_context >::m_fragment_buffer
private

◆ m_invoke_buf_ready

template<class t_connection_context = net_utils::connection_context_base>
std::atomic<bool> epee::levin::async_protocol_handler< t_connection_context >::m_invoke_buf_ready

◆ m_invoke_response_handlers

template<class t_connection_context = net_utils::connection_context_base>
std::list<boost::shared_ptr<invoke_response_handler_base> > epee::levin::async_protocol_handler< t_connection_context >::m_invoke_response_handlers

◆ m_invoke_response_handlers_lock

template<class t_connection_context = net_utils::connection_context_base>
critical_section epee::levin::async_protocol_handler< t_connection_context >::m_invoke_response_handlers_lock

◆ m_invoke_result_code

template<class t_connection_context = net_utils::connection_context_base>
volatile int epee::levin::async_protocol_handler< t_connection_context >::m_invoke_result_code

◆ m_local_inv_buff

template<class t_connection_context = net_utils::connection_context_base>
std::string epee::levin::async_protocol_handler< t_connection_context >::m_local_inv_buff

◆ m_local_inv_buff_lock

template<class t_connection_context = net_utils::connection_context_base>
critical_section epee::levin::async_protocol_handler< t_connection_context >::m_local_inv_buff_lock

◆ m_max_packet_size

template<class t_connection_context = net_utils::connection_context_base>
std::atomic<uint64_t> epee::levin::async_protocol_handler< t_connection_context >::m_max_packet_size

◆ m_oponent_protocol_ver

template<class t_connection_context = net_utils::connection_context_base>
int32_t epee::levin::async_protocol_handler< t_connection_context >::m_oponent_protocol_ver

◆ m_protocol_released

template<class t_connection_context = net_utils::connection_context_base>
std::atomic<bool> epee::levin::async_protocol_handler< t_connection_context >::m_protocol_released

◆ m_pservice_endpoint

template<class t_connection_context = net_utils::connection_context_base>
net_utils::i_service_endpoint* epee::levin::async_protocol_handler< t_connection_context >::m_pservice_endpoint

◆ m_state

template<class t_connection_context = net_utils::connection_context_base>
stream_state epee::levin::async_protocol_handler< t_connection_context >::m_state

◆ m_wait_count

template<class t_connection_context = net_utils::connection_context_base>
std::atomic<uint32_t> epee::levin::async_protocol_handler< t_connection_context >::m_wait_count

The documentation for this class was generated from the following file: