#include <net_helper.h>
|
| | async_blocked_mode_client () |
| | ~async_blocked_mode_client () |
| bool | shutdown () |
| bool | send (const void *data, size_t sz) |
| | 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 |
Definition at line 694 of file net_helper.h.
◆ async_blocked_mode_client()
| epee::net_utils::async_blocked_mode_client::async_blocked_mode_client |
( |
| ) |
|
|
inline |
Definition at line 697 of file net_helper.h.
698 {
699
700
701
702
703 m_send_deadline.expires_at(boost::posix_time::pos_infin);
704
705
706 check_send_deadline();
707 }
boost::asio::io_service m_io_service
◆ ~async_blocked_mode_client()
| epee::net_utils::async_blocked_mode_client::~async_blocked_mode_client |
( |
| ) |
|
|
inline |
Definition at line 708 of file net_helper.h.
709 {
710 m_send_deadline.cancel();
711 }
◆ send()
| bool epee::net_utils::async_blocked_mode_client::send |
( |
const void * | data, |
|
|
size_t | sz ) |
|
inline |
Definition at line 721 of file net_helper.h.
722 {
723 try
724 {
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747 boost::system::error_code ec;
748
749 size_t writen =
write(data, sz, ec);
750
751 if (!writen || ec)
752 {
754 return false;
755 }else
756 {
757 m_send_deadline.expires_at(boost::posix_time::pos_infin);
758 }
759 }
760
761 catch(const boost::system::system_error& er)
762 {
763 LOG_ERROR(
"Some problems at connect, message: " << er.what());
764 return false;
765 }
766 catch(...)
767 {
769 return false;
770 }
771
772 return true;
773 }
bool write(const void *data, size_t sz, boost::system::error_code &ec)
◆ shutdown()
| bool epee::net_utils::async_blocked_mode_client::shutdown |
( |
| ) |
|
|
inline |
Definition at line 713 of file net_helper.h.
714 {
716 m_send_deadline.cancel();
717 return true;
718 }
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/contrib/epee/include/net/net_helper.h