1#include <xrpld/rpc/RPCCall.h>
2#include <xrpld/rpc/RPCSub.h>
4#include <xrpl/basics/Log.h>
5#include <xrpl/basics/StringUtilities.h>
6#include <xrpl/basics/contract.h>
7#include <xrpl/json/to_string.h>
19 boost::asio::io_context& io_context,
33 ,
j_(logs.journal(
"RPCSub"))
39 Throw<std::runtime_error>(
"Failed to parse url.");
40 else if (pUrl.
scheme ==
"https")
42 else if (pUrl.
scheme !=
"http")
43 Throw<std::runtime_error>(
"Only http and https is supported.");
51 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork sub: ip=" <<
mIp
53 <<
" ssl= " << (
mSSL ?
"yes" :
"no") <<
" path='"
65 JLOG(jm) <<
"RPCCall::fromNetwork push: " << jvObj;
72 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork start";
124 jvEvent[
"seq"] = seq;
136 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork: " <<
mIp;
154 <<
"RPCCall::fromNetwork exception: " << e.
what();
191 boost::asio::io_context& io_context,
A generic endpoint for log messages.
Abstracts the source of subscription data.
Manages a client's subscription to data feeds.
A pool of threads to perform work.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
Manages partitions for logging.
std::deque< std::pair< int, Json::Value > > mDeque
void setPassword(std::string const &strPassword) override
boost::asio::io_context & m_io_context
void setUsername(std::string const &strUsername) override
void send(Json::Value const &jvObj, bool broadcast) override
RPCSubImp(InfoSub::Source &source, boost::asio::io_context &io_context, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)
Subscription object for JSON RPC.
RPCSub(InfoSub::Source &source)
An endpoint that consumes resources.
void fromNetwork(boost::asio::io_context &io_context, std::string const &strIp, std::uint16_t const iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, bool const bSSL, bool const quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool parseUrl(parsedURL &pUrl, std::string const &strUrl)
std::shared_ptr< RPCSub > make_RPCSub(InfoSub::Source &source, boost::asio::io_context &io_context, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)
std::optional< std::uint16_t > port