#include <rpc_client.h>
|
| | t_rpc_client (uint32_t ip, uint16_t port, boost::optional< epee::net_utils::http::login > user, epee::net_utils::ssl_options_t ssl_options) |
| template<typename T_req, typename T_res> |
| bool | basic_json_rpc_request (T_req &req, T_res &res, std::string const &method_name) |
| template<typename T_req, typename T_res> |
| bool | json_rpc_request (T_req &req, T_res &res, std::string const &method_name, std::string const &fail_msg) |
| template<typename T_req, typename T_res> |
| bool | rpc_request (T_req &req, T_res &res, std::string const &relative_url, std::string const &fail_msg) |
| bool | check_connection () |
Definition at line 45 of file rpc_client.h.
◆ t_rpc_client()
Definition at line 50 of file rpc_client.h.
56 : m_http_client{}
57 {
58 m_http_client.set_server(
60 );
61 }
◆ basic_json_rpc_request()
template<typename T_req, typename T_res>
| bool tools::t_rpc_client::basic_json_rpc_request |
( |
T_req & | req, |
|
|
T_res & | res, |
|
|
std::string const & | method_name ) |
|
inline |
Definition at line 64 of file rpc_client.h.
69 {
71
73 if (!ok)
74 {
75 fail_msg_writer() <<
"Couldn't connect to daemon: " << m_http_client.get_host() <<
":" << m_http_client.get_port();
76 return false;
77 }
79 if (!ok)
80 {
82 return false;
83 }
84 else
85 {
86 return true;
87 }
88 }
connection(typename TProtocol::config_type &ref_config)
bool invoke_http_json_rpc(const boost::string_ref uri, std::string method_name, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref http_method="GET", const std::string &req_id="0")
◆ check_connection()
| bool tools::t_rpc_client::check_connection |
( |
| ) |
|
|
inline |
◆ json_rpc_request()
template<typename T_req, typename T_res>
| bool tools::t_rpc_client::json_rpc_request |
( |
T_req & | req, |
|
|
T_res & | res, |
|
|
std::string const & | method_name, |
|
|
std::string const & | fail_msg ) |
|
inline |
Definition at line 91 of file rpc_client.h.
97 {
99
101 if (!ok)
102 {
103 fail_msg_writer() <<
"Couldn't connect to daemon: " << m_http_client.get_host() <<
":" << m_http_client.get_port();
104 return false;
105 }
108 {
110 return false;
111 }
112 else
113 {
114 return true;
115 }
116 }
#define CORE_RPC_STATUS_OK
◆ rpc_request()
template<typename T_req, typename T_res>
| bool tools::t_rpc_client::rpc_request |
( |
T_req & | req, |
|
|
T_res & | res, |
|
|
std::string const & | relative_url, |
|
|
std::string const & | fail_msg ) |
|
inline |
Definition at line 119 of file rpc_client.h.
125 {
127
129 if (!ok)
130 {
131 fail_msg_writer() <<
"Couldn't connect to daemon: " << m_http_client.get_host() <<
":" << m_http_client.get_port();
132 return false;
133 }
136 {
138 return false;
139 }
140 else
141 {
142 return true;
143 }
144 }
bool invoke_http_json(const boost::string_ref uri, const t_request &out_struct, t_response &result_struct, t_transport &transport, std::chrono::milliseconds timeout=std::chrono::seconds(15), const boost::string_ref method="GET")
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/src/common/rpc_client.h