xrpld
Loading...
Searching...
No Matches
xrpl::test::AbstractClient Class Referenceabstract

#include <AbstractClient.h>

Inheritance diagram for xrpl::test::AbstractClient:

Public Member Functions

virtual ~AbstractClient ()=default
 AbstractClient ()=default
 AbstractClient (AbstractClient const &)=delete
AbstractClientoperator= (AbstractClient const &)=delete
virtual json::Value invoke (std::string const &cmd, json::Value const &params={})=0
 Submit a command synchronously.
virtual unsigned version () const =0
 Get RPC 1.0 or RPC 2.0.
virtual void disconnect ()=0
 Close the client's connection to the server.

Detailed Description

Definition at line 14 of file AbstractClient.h.

Constructor & Destructor Documentation

◆ ~AbstractClient()

virtual xrpl::test::AbstractClient::~AbstractClient ( )
virtualdefault

◆ AbstractClient() [1/2]

xrpl::test::AbstractClient::AbstractClient ( )
default

◆ AbstractClient() [2/2]

xrpl::test::AbstractClient::AbstractClient ( AbstractClient const & )
delete

Member Function Documentation

◆ operator=()

AbstractClient & xrpl::test::AbstractClient::operator= ( AbstractClient const & )
delete

◆ invoke()

virtual json::Value xrpl::test::AbstractClient::invoke ( std::string const & cmd,
json::Value const & params = {} )
pure virtual

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.

Implemented in xrpl::test::JSONRPCClient, and xrpl::test::WSClientImpl.

◆ version()

virtual unsigned xrpl::test::AbstractClient::version ( ) const
nodiscardpure virtual

Get RPC 1.0 or RPC 2.0.

Implemented in xrpl::test::JSONRPCClient, and xrpl::test::WSClientImpl.

◆ disconnect()

virtual void xrpl::test::AbstractClient::disconnect ( )
pure virtual

Close the client's connection to the server.

Releases the connection the client holds against the server's per-port connection limit. After this call the client must not be used to invoke() again. Tests use this to deterministically free the slot rather than waiting for the server's idle timeout to drop it.

Implemented in xrpl::test::JSONRPCClient, and xrpl::test::WSClientImpl.