mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 13:05:53 +00:00
Evented RPC commands are now on the same level as all other RPC commands and are handled by the RPCHandler class.
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#include "../websocketpp/src/sockets/tls.hpp"
|
|
#include "../websocketpp/src/websocketpp.hpp"
|
|
#include "WSDoor.h"
|
|
#include "Application.h"
|
|
|
|
#include "Log.h"
|
|
#include "NetworkOPs.h"
|
|
|
|
template <typename endpoint_type>
|
|
class WSServerHandler;
|
|
//
|
|
// Storage for connection specific info
|
|
// - Subscriptions
|
|
//
|
|
class WSConnection : public InfoSub
|
|
{
|
|
public:
|
|
typedef websocketpp::WSDOOR_SERVER::handler::connection_ptr connection_ptr;
|
|
typedef websocketpp::WSDOOR_SERVER::handler::message_ptr message_ptr;
|
|
|
|
protected:
|
|
typedef void (WSConnection::*doFuncPtr)(Json::Value& jvResult, Json::Value &jvRequest);
|
|
|
|
WSServerHandler<websocketpp::WSDOOR_SERVER>* mHandler;
|
|
connection_ptr mConnection;
|
|
NetworkOPs& mNetwork;
|
|
|
|
public:
|
|
// WSConnection()
|
|
// : mHandler((WSServerHandler<websocketpp::WSDOOR_SERVER>*)(NULL)),
|
|
// mConnection(connection_ptr()) { ; }
|
|
|
|
WSConnection(WSServerHandler<websocketpp::WSDOOR_SERVER>* wshpHandler, connection_ptr cpConnection)
|
|
: mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()) { ; }
|
|
|
|
virtual ~WSConnection();
|
|
|
|
// Implement overridden functions from base class:
|
|
void send(const Json::Value& jvObj);
|
|
|
|
// Utilities
|
|
Json::Value invokeCommand(Json::Value& jvRequest);
|
|
|
|
};
|
|
|
|
// vim:ts=4
|