mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add support for JSON-RPC subscriptions.
This commit is contained in:
@@ -1,20 +1,37 @@
|
||||
#ifndef __RPCSUB__
|
||||
#define __RPCSUB__
|
||||
|
||||
#include <deque>
|
||||
|
||||
#include "../json/value.h"
|
||||
|
||||
#include "NetworkOPs.h"
|
||||
|
||||
#define RPC_EVENT_QUEUE_MAX 32
|
||||
|
||||
// Subscription object for JSON-RPC
|
||||
class RPCSub : public InfoSub
|
||||
{
|
||||
std::string mUrl;
|
||||
std::string mIp;
|
||||
int mPort;
|
||||
std::string mUsername;
|
||||
std::string mPassword;
|
||||
std::string mUrl;
|
||||
std::string mIp;
|
||||
int mPort;
|
||||
std::string mUsername;
|
||||
std::string mPassword;
|
||||
|
||||
int mId; // Next id to allocate.
|
||||
|
||||
bool mSending; // Sending threead is active.
|
||||
|
||||
std::deque<std::pair<int, Json::Value> > mDeque;
|
||||
|
||||
protected:
|
||||
void sendThread();
|
||||
|
||||
public:
|
||||
RPCSub(const std::string& strUrl, const std::string& strUsername, const std::string& strPassword);
|
||||
|
||||
virtual ~RPCSub() { ; }
|
||||
|
||||
// Implement overridden functions from base class:
|
||||
void send(const Json::Value& jvObj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user