|
Electroneum
|
#include <net_helper.h>


Public Types | |
| using | connect_func = boost::unique_future<boost::asio::ip::tcp::socket>(const std::string&, const std::string&, boost::asio::steady_timer&) |
Public Member Functions | |
| 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, epee::net_utils::ssl_support_t ssl_support) |
| 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 std::string &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_service & | get_io_service () |
| boost::asio::ip::tcp::socket & | get_socket () |
| uint64_t | get_bytes_sent () const |
| uint64_t | get_bytes_received () const |
Protected Member Functions | |
| bool | write (const void *data, size_t sz, boost::system::error_code &ec) |
| void | async_write (const void *data, size_t sz, boost::system::error_code &ec) |
| void | async_read (char *buff, size_t sz, boost::asio::detail::transfer_at_least_t transfer_at_least, handler_obj &hndlr) |
Protected Attributes | |
| boost::asio::io_service | m_io_service |
| boost::asio::ssl::context | m_ctx |
| std::shared_ptr< boost::asio::ssl::stream< boost::asio::ip::tcp::socket > > | m_ssl_socket |
| std::function< connect_func > | m_connector |
| ssl_options_t | m_ssl_options |
| bool | m_initialized |
| bool | m_connected |
| boost::asio::steady_timer | m_deadline |
| volatile uint32_t | m_shutdowned |
| std::atomic< uint64_t > | m_bytes_sent |
| std::atomic< uint64_t > | m_bytes_received |
Definition at line 70 of file net_helper.h.
| using epee::net_utils::blocked_mode_client::connect_func = boost::unique_future<boost::asio::ip::tcp::socket>(const std::string&, const std::string&, boost::asio::steady_timer&) |
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.
Definition at line 131 of file net_helper.h.
|
inline |
Definition at line 102 of file net_helper.h.

|
inline |
Definition at line 134 of file net_helper.h.

|
inlineprotected |
Definition at line 667 of file net_helper.h.

|
inlineprotected |
Definition at line 659 of file net_helper.h.

|
inline |
Definition at line 207 of file net_helper.h.

|
inline |
Definition at line 151 of file net_helper.h.


|
inline |
Definition at line 254 of file net_helper.h.
|
inline |
Definition at line 596 of file net_helper.h.
|
inline |
Definition at line 591 of file net_helper.h.
|
inline |
Definition at line 581 of file net_helper.h.
|
inline |
Definition at line 586 of file net_helper.h.
|
inline |
Definition at line 392 of file net_helper.h.
|
inline |
Definition at line 402 of file net_helper.h.

|
inline |
Definition at line 488 of file net_helper.h.

|
inline |
Definition at line 281 of file net_helper.h.

|
inline |
Definition at line 335 of file net_helper.h.

|
inline |
Change the connection routine (proxy, etc.).
Definition at line 248 of file net_helper.h.
|
inline |
Definition at line 141 of file net_helper.h.

|
inline |
Definition at line 561 of file net_helper.h.

|
inline |
Definition at line 157 of file net_helper.h.

|
inlineprotected |
Definition at line 649 of file net_helper.h.

|
protected |
Definition at line 687 of file net_helper.h.
|
protected |
Definition at line 686 of file net_helper.h.
|
protected |
Definition at line 683 of file net_helper.h.
|
protected |
Definition at line 680 of file net_helper.h.
|
protected |
Definition at line 678 of file net_helper.h.
|
protected |
Definition at line 684 of file net_helper.h.
|
protected |
Definition at line 682 of file net_helper.h.
|
protected |
Definition at line 677 of file net_helper.h.
|
protected |
Definition at line 685 of file net_helper.h.
|
protected |
Definition at line 681 of file net_helper.h.
|
protected |
Definition at line 679 of file net_helper.h.