mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Moved cpp code to src/cpp and js code to src/js.
This commit is contained in:
67
src/cpp/ripple/RPCServer.h
Normal file
67
src/cpp/ripple/RPCServer.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef __RPCSERVER__
|
||||
#define __RPCSERVER__
|
||||
|
||||
#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 "RippleAddress.h"
|
||||
#include "NetworkOPs.h"
|
||||
#include "SerializedLedger.h"
|
||||
#include "RPCHandler.h"
|
||||
|
||||
class RPCServer : public boost::enable_shared_from_this<RPCServer>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef boost::shared_ptr<RPCServer> pointer;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
NetworkOPs* mNetOps;
|
||||
RPCHandler mRPCHandler;
|
||||
|
||||
boost::asio::ip::tcp::socket mSocket;
|
||||
|
||||
boost::asio::streambuf mLineBuffer;
|
||||
std::vector<unsigned char> mQueryVec;
|
||||
std::string mReplyStr;
|
||||
|
||||
HTTPRequest mHTTPRequest;
|
||||
|
||||
|
||||
int mRole;
|
||||
|
||||
RPCServer(boost::asio::io_service& io_service, NetworkOPs* nopNetwork);
|
||||
|
||||
RPCServer(const RPCServer&); // no implementation
|
||||
RPCServer& operator=(const RPCServer&); // no implementation
|
||||
|
||||
void handle_write(const boost::system::error_code& ec);
|
||||
void handle_read_line(const boost::system::error_code& ec);
|
||||
void handle_read_req(const boost::system::error_code& ec);
|
||||
|
||||
std::string handleRequest(const std::string& requestStr);
|
||||
|
||||
public:
|
||||
static pointer create(boost::asio::io_service& io_service, NetworkOPs* mNetOps)
|
||||
{
|
||||
return pointer(new RPCServer(io_service, mNetOps));
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::socket& getSocket()
|
||||
{
|
||||
return mSocket;
|
||||
}
|
||||
|
||||
void connected();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user