20#include <xrpld/rpc/RPCCall.h>
21#include <xrpld/rpc/RPCSub.h>
23#include <xrpl/basics/Log.h>
24#include <xrpl/basics/StringUtilities.h>
25#include <xrpl/basics/contract.h>
26#include <xrpl/json/to_string.h>
38 boost::asio::io_context& io_context,
52 ,
j_(logs.journal(
"RPCSub"))
58 Throw<std::runtime_error>(
"Failed to parse url.");
59 else if (pUrl.
scheme ==
"https")
61 else if (pUrl.
scheme !=
"http")
62 Throw<std::runtime_error>(
"Only http and https is supported.");
70 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork sub: ip=" <<
mIp
72 <<
" ssl= " << (
mSSL ?
"yes" :
"no") <<
" path='"
84 JLOG(jm) <<
"RPCCall::fromNetwork push: " << jvObj;
91 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork start";
143 jvEvent[
"seq"] = seq;
155 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork: " <<
mIp;
173 <<
"RPCCall::fromNetwork exception: " << e.
what();
210 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