mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Move sources to src and build objs in obj.
This commit is contained in:
66
src/RPCServer.h
Normal file
66
src/RPCServer.h
Normal file
@@ -0,0 +1,66 @@
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
#include "../json/value.h"
|
||||
|
||||
#include "HttpRequest.h"
|
||||
#include "RequestParser.h"
|
||||
#include "uint256.h"
|
||||
|
||||
class RPCServer : public boost::enable_shared_from_this<RPCServer>
|
||||
{
|
||||
boost::asio::ip::tcp::socket mSocket;
|
||||
boost::array<char, 8192> mReadBuffer;
|
||||
std::string mReplyStr;
|
||||
|
||||
HttpRequest mIncomingRequest;
|
||||
HttpRequestParser mRequestParser;
|
||||
|
||||
RPCServer(boost::asio::io_service& io_service);
|
||||
|
||||
void handle_write(const boost::system::error_code& error);
|
||||
|
||||
void handle_read(const boost::system::error_code& e, std::size_t bytes_transferred);
|
||||
|
||||
std::string handleRequest(const std::string& requestStr);
|
||||
void sendReply();
|
||||
|
||||
Json::Value doCommand(const std::string& command, Json::Value& params);
|
||||
int getParamCount(const Json::Value& params);
|
||||
bool extractString(std::string& param, const Json::Value& params, int index);
|
||||
|
||||
uint160 parseFamily(const std::string& family);
|
||||
|
||||
Json::Value doCreateFamily(Json::Value& params);
|
||||
Json::Value doFamilyInfo(Json::Value& params);
|
||||
Json::Value doAccountInfo(Json::Value& params);
|
||||
Json::Value doNewAccount(Json::Value& params);
|
||||
Json::Value doLock(Json::Value& params);
|
||||
Json::Value doUnlock(Json::Value& params);
|
||||
Json::Value doSendTo(Json::Value& params);
|
||||
Json::Value doConnect(Json::Value& params);
|
||||
Json::Value doTx(Json::Value& params);
|
||||
Json::Value doLedger(Json::Value& params);
|
||||
Json::Value doAccount(Json::Value& params);
|
||||
|
||||
// parses a string account name into a uint160
|
||||
// can be local or remote
|
||||
uint160 parseAccount(const std::string& account);
|
||||
|
||||
public:
|
||||
typedef boost::shared_ptr<RPCServer> pointer;
|
||||
|
||||
static pointer create(boost::asio::io_service& io_service)
|
||||
{
|
||||
return pointer(new RPCServer(io_service));
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::socket& getSocket()
|
||||
{
|
||||
return mSocket;
|
||||
}
|
||||
|
||||
void connected();
|
||||
};
|
||||
Reference in New Issue
Block a user