#include <net_helper.h>
|
| using | connect_func = boost::unique_future<boost::asio::ip::tcp::socket>(const std::string&, const std::string&, boost::asio::steady_timer&) |
|
| | blocked_mode_client () |
| | ~blocked_mode_client () |
| void | set_ssl (ssl_options_t ssl_options) |
| bool | connect (const std::string &addr, int port, std::chrono::milliseconds timeout) |
| try_connect_result_t | try_connect (const std::string &addr, const std::string &port, std::chrono::milliseconds timeout) |
| bool | connect (const std::string &addr, const std::string &port, std::chrono::milliseconds timeout) |
| void | set_connector (std::function< connect_func > connector) |
| | Change the connection routine (proxy, etc.).
|
| bool | disconnect () |
| bool | send (const boost::string_ref buff, std::chrono::milliseconds timeout) |
| bool | send (const void *data, size_t sz) |
| bool | is_connected (bool *ssl=NULL) |
| bool | recv (std::string &buff, std::chrono::milliseconds timeout) |
| bool | recv_n (std::string &buff, int64_t sz, std::chrono::milliseconds timeout) |
| bool | shutdown () |
| boost::asio::io_context & | get_io_service () |
| boost::asio::ip::tcp::socket & | get_socket () |
| uint64_t | get_bytes_sent () const |
| uint64_t | get_bytes_received () const |
◆ connect_func
The first/second parameters are host/port respectively. The third parameter is for setting the timeout callback - the timer is already set by the caller, the callee only needs to set the behavior.
Additional asynchronous operations should be queued using the io_service from the timer. The implementation should assume multi-threaded I/O processing.
If the callee cannot start an asynchronous operation, an exception should be thrown to signal an immediate failure.
The return value is a future to a connected socket. Asynchronous failures should use the set_exception method.
◆ try_connect_result_t
| Enumerator |
|---|
| CONNECT_SUCCESS | |
| CONNECT_FAILURE | |
| CONNECT_NO_SSL | |
◆ blocked_mode_client()
| epee::net_utils::blocked_mode_client::blocked_mode_client |
( |
| ) |
|
|
inline |
◆ ~blocked_mode_client()
| epee::net_utils::blocked_mode_client::~blocked_mode_client |
( |
| ) |
|
|
inline |
◆ async_read()
| void epee::net_utils::blocked_mode_client::async_read |
( |
char * | buff, |
|
|
size_t | sz, |
|
|
boost::asio::detail::transfer_at_least_t | transfer_at_least, |
|
|
handler_obj & | hndlr ) |
|
inlineprotected |
◆ async_write()
| void epee::net_utils::blocked_mode_client::async_write |
( |
const void * | data, |
|
|
size_t | sz, |
|
|
boost::system::error_code & | ec ) |
|
inlineprotected |
◆ check_deadline()
| void epee::net_utils::blocked_mode_client::check_deadline |
( |
| ) |
|
|
inlineprivate |
◆ connect() [1/2]
| bool epee::net_utils::blocked_mode_client::connect |
( |
const std::string & | addr, |
|
|
const std::string & | port, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ connect() [2/2]
| bool epee::net_utils::blocked_mode_client::connect |
( |
const std::string & | addr, |
|
|
int | port, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ disconnect()
| bool epee::net_utils::blocked_mode_client::disconnect |
( |
| ) |
|
|
inline |
◆ get_bytes_received()
| uint64_t epee::net_utils::blocked_mode_client::get_bytes_received |
( |
| ) |
const |
|
inline |
◆ get_bytes_sent()
| uint64_t epee::net_utils::blocked_mode_client::get_bytes_sent |
( |
| ) |
const |
|
inline |
◆ get_io_service()
| boost::asio::io_context & epee::net_utils::blocked_mode_client::get_io_service |
( |
| ) |
|
|
inline |
◆ get_socket()
| boost::asio::ip::tcp::socket & epee::net_utils::blocked_mode_client::get_socket |
( |
| ) |
|
|
inline |
◆ is_connected()
| bool epee::net_utils::blocked_mode_client::is_connected |
( |
bool * | ssl = NULL | ) |
|
|
inline |
◆ recv()
| bool epee::net_utils::blocked_mode_client::recv |
( |
std::string & | buff, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ recv_n()
| bool epee::net_utils::blocked_mode_client::recv_n |
( |
std::string & | buff, |
|
|
int64_t | sz, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ send() [1/2]
| bool epee::net_utils::blocked_mode_client::send |
( |
const boost::string_ref | buff, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ send() [2/2]
| bool epee::net_utils::blocked_mode_client::send |
( |
const void * | data, |
|
|
size_t | sz ) |
|
inline |
◆ set_connector()
| void epee::net_utils::blocked_mode_client::set_connector |
( |
std::function< connect_func > | connector | ) |
|
|
inline |
Change the connection routine (proxy, etc.).
◆ set_ssl()
| void epee::net_utils::blocked_mode_client::set_ssl |
( |
ssl_options_t | ssl_options | ) |
|
|
inline |
◆ shutdown()
| bool epee::net_utils::blocked_mode_client::shutdown |
( |
| ) |
|
|
inline |
◆ shutdown_ssl()
| void epee::net_utils::blocked_mode_client::shutdown_ssl |
( |
| ) |
|
|
inlineprivate |
◆ try_connect()
| try_connect_result_t epee::net_utils::blocked_mode_client::try_connect |
( |
const std::string & | addr, |
|
|
const std::string & | port, |
|
|
std::chrono::milliseconds | timeout ) |
|
inline |
◆ write()
| bool epee::net_utils::blocked_mode_client::write |
( |
const void * | data, |
|
|
size_t | sz, |
|
|
boost::system::error_code & | ec ) |
|
inlineprotected |
◆ m_bytes_received
| std::atomic<uint64_t> epee::net_utils::blocked_mode_client::m_bytes_received |
|
protected |
◆ m_bytes_sent
| std::atomic<uint64_t> epee::net_utils::blocked_mode_client::m_bytes_sent |
|
protected |
◆ m_connected
| bool epee::net_utils::blocked_mode_client::m_connected |
|
protected |
◆ m_connector
| std::function<connect_func> epee::net_utils::blocked_mode_client::m_connector |
|
protected |
◆ m_ctx
| boost::asio::ssl::context epee::net_utils::blocked_mode_client::m_ctx |
|
protected |
◆ m_deadline
| boost::asio::steady_timer epee::net_utils::blocked_mode_client::m_deadline |
|
protected |
◆ m_initialized
| bool epee::net_utils::blocked_mode_client::m_initialized |
|
protected |
◆ m_io_service
| boost::asio::io_context epee::net_utils::blocked_mode_client::m_io_service |
|
protected |
◆ m_shutdowned
| std::atomic<bool> epee::net_utils::blocked_mode_client::m_shutdowned |
|
protected |
◆ m_ssl_options
| ssl_options_t epee::net_utils::blocked_mode_client::m_ssl_options |
|
protected |
◆ m_ssl_socket
| std::shared_ptr<boost::asio::ssl::stream<boost::asio::ip::tcp::socket> > epee::net_utils::blocked_mode_client::m_ssl_socket |
|
protected |
The documentation for this class was generated from the following file: