Stub subscribe for JSON-RPC.

This commit is contained in:
Arthur Britto
2012-12-29 14:42:38 -08:00
parent 86d7781255
commit 192dae3b74
7 changed files with 203 additions and 54 deletions

37
src/cpp/ripple/RPCSub.h Normal file
View 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