20 #include <ripple/basics/Log.h>
21 #include <ripple/basics/StringUtilities.h>
22 #include <ripple/basics/contract.h>
23 #include <ripple/json/to_string.h>
24 #include <ripple/net/RPCCall.h>
25 #include <ripple/net/RPCSub.h>
36 boost::asio::io_service& io_service,
50 ,
j_(logs.journal(
"RPCSub"))
56 Throw<std::runtime_error>(
"Failed to parse url.");
57 else if (pUrl.
scheme ==
"https")
59 else if (pUrl.
scheme !=
"http")
60 Throw<std::runtime_error>(
"Only http and https is supported.");
68 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork sub: ip=" <<
mIp
70 <<
" ssl= " << (
mSSL ?
"yes" :
"no") <<
" path='"
84 JLOG(
j_.
warn()) <<
"RPCCall::fromNetwork drop";
89 JLOG(jm) <<
"RPCCall::fromNetwork push: " << jvObj;
96 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork start";
148 jvEvent[
"seq"] = seq;
160 JLOG(
j_.
info()) <<
"RPCCall::fromNetwork: " <<
mIp;
178 <<
"RPCCall::fromNetwork exception: " << e.
what();
217 boost::asio::io_service& io_service,
224 return std::make_shared<RPCSubImp>(
std::deque< std::pair< int, Json::Value > > mDeque
RPCSub(InfoSub::Source &source)
Subscription object for JSON RPC.
Manages partitions for logging.
boost::asio::io_service & m_io_service
Manages a client's subscription to data feeds.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
void setPassword(std::string const &strPassword) override
void setUsername(std::string const &strUsername) override
void send(Json::Value const &jvObj, bool broadcast) override
std::optional< std::uint16_t > port
Abstracts the source of subscription data.
bool parseUrl(parsedURL &pUrl, std::string const &strUrl)
A generic endpoint for log messages.
std::shared_ptr< RPCSub > make_RPCSub(InfoSub::Source &source, boost::asio::io_service &io_service, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)
A pool of threads to perform work.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
An endpoint that consumes resources.
void fromNetwork(boost::asio::io_service &io_service, std::string const &strIp, const std::uint16_t iPort, std::string const &strUsername, std::string const &strPassword, std::string const &strPath, std::string const &strMethod, Json::Value const &jvParams, const bool bSSL, const bool quiet, Logs &logs, std::function< void(Json::Value const &jvInput)> callbackFuncP, std::unordered_map< std::string, std::string > headers)
RPCSubImp(InfoSub::Source &source, boost::asio::io_service &io_service, JobQueue &jobQueue, std::string const &strUrl, std::string const &strUsername, std::string const &strPassword, Logs &logs)