mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Stub subscribe for JSON-RPC.
This commit is contained in:
37
src/cpp/ripple/RPCSub.h
Normal file
37
src/cpp/ripple/RPCSub.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef __RPCSUB__
|
||||
#define __RPCSUB__
|
||||
|
||||
#include "NetworkOPs.h"
|
||||
|
||||
// Subscription object for JSON-RPC
|
||||
class RPCSub : public InfoSub
|
||||
{
|
||||
std::string mUrl;
|
||||
std::string mIp;
|
||||
int mPort;
|
||||
std::string mUsername;
|
||||
std::string mPassword;
|
||||
|
||||
public:
|
||||
RPCSub(const std::string& strUrl, const std::string& strUsername, const std::string& strPassword);
|
||||
|
||||
// Implement overridden functions from base class:
|
||||
void send(const Json::Value& jvObj);
|
||||
|
||||
void setUsername(const std::string& strUsername)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLockInfo);
|
||||
|
||||
mUsername = strUsername;
|
||||
}
|
||||
|
||||
void setPassword(const std::string& strPassword)
|
||||
{
|
||||
boost::mutex::scoped_lock sl(mLockInfo);
|
||||
|
||||
mPassword = strPassword;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user