rippled
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::test::JSONRPCClient Class Reference
Inheritance diagram for ripple::test::JSONRPCClient:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::JSONRPCClient:
Collaboration graph
[legend]

Public Member Functions

 JSONRPCClient (Config const &cfg, unsigned rpc_version)
 
 ~JSONRPCClient () override
 
Json::Value invoke (std::string const &cmd, Json::Value const &params) override
 Submit a command synchronously. More...
 
unsigned version () const override
 Get RPC 1.0 or RPC 2.0. More...
 

Static Private Member Functions

static boost::asio::ip::tcp::endpoint getEndpoint (BasicConfig const &cfg)
 
template<class ConstBufferSequence >
static std::string buffer_string (ConstBufferSequence const &b)
 

Private Attributes

boost::asio::ip::tcp::endpoint ep_
 
boost::asio::io_service ios_
 
boost::asio::ip::tcp::socket stream_
 
boost::beast::multi_buffer bin_
 
boost::beast::multi_buffer bout_
 
unsigned rpc_version_
 

Detailed Description

Definition at line 35 of file JSONRPCClient.cpp.

Constructor & Destructor Documentation

◆ JSONRPCClient()

ripple::test::JSONRPCClient::JSONRPCClient ( Config const &  cfg,
unsigned  rpc_version 
)
explicit

Definition at line 80 of file JSONRPCClient.cpp.

◆ ~JSONRPCClient()

ripple::test::JSONRPCClient::~JSONRPCClient ( )
override

Definition at line 86 of file JSONRPCClient.cpp.

Member Function Documentation

◆ getEndpoint()

static boost::asio::ip::tcp::endpoint ripple::test::JSONRPCClient::getEndpoint ( BasicConfig const &  cfg)
staticprivate

Definition at line 38 of file JSONRPCClient.cpp.

◆ buffer_string()

template<class ConstBufferSequence >
static std::string ripple::test::JSONRPCClient::buffer_string ( ConstBufferSequence const &  b)
staticprivate

Definition at line 63 of file JSONRPCClient.cpp.

◆ invoke()

Json::Value ripple::test::JSONRPCClient::invoke ( std::string const &  cmd,
Json::Value const &  params 
)
overridevirtual

Submit a command synchronously.

The arguments to the function and the returned JSON are in a normalized format, the same whether the client is using the JSON-RPC over HTTP/S or WebSocket transport.

Parameters
cmdThe command to execute
paramsJson::Value of null or object type with zero or more key/value pairs.
Returns
The server response in normalized format.

Implements ripple::test::AbstractClient.

Definition at line 99 of file JSONRPCClient.cpp.

◆ version()

unsigned ripple::test::JSONRPCClient::version ( ) const
overridevirtual

Get RPC 1.0 or RPC 2.0.

Implements ripple::test::AbstractClient.

Definition at line 148 of file JSONRPCClient.cpp.

Member Data Documentation

◆ ep_

boost::asio::ip::tcp::endpoint ripple::test::JSONRPCClient::ep_
private

Definition at line 72 of file JSONRPCClient.cpp.

◆ ios_

boost::asio::io_service ripple::test::JSONRPCClient::ios_
private

Definition at line 73 of file JSONRPCClient.cpp.

◆ stream_

boost::asio::ip::tcp::socket ripple::test::JSONRPCClient::stream_
private

Definition at line 74 of file JSONRPCClient.cpp.

◆ bin_

boost::beast::multi_buffer ripple::test::JSONRPCClient::bin_
private

Definition at line 75 of file JSONRPCClient.cpp.

◆ bout_

boost::beast::multi_buffer ripple::test::JSONRPCClient::bout_
private

Definition at line 76 of file JSONRPCClient.cpp.

◆ rpc_version_

unsigned ripple::test::JSONRPCClient::rpc_version_
private

Definition at line 77 of file JSONRPCClient.cpp.