|
xrpld
|


Classes | |
| struct | Msg |
Public Member Functions | |
| WSClientImpl (Config const &cfg, bool v2, unsigned rpcVersion, std::unordered_map< std::string, std::string > const &headers={}) | |
| ~WSClientImpl () override | |
| json::Value | invoke (std::string const &cmd, json::Value const ¶ms) override |
| Submit a command synchronously. | |
| std::optional< json::Value > | getMsg (std::chrono::milliseconds const &timeout) override |
| Retrieve a message. | |
| std::optional< json::Value > | findMsg (std::chrono::milliseconds const &timeout, std::function< bool(json::Value const &)> pred) override |
| Retrieve a message that meets the predicate criteria. | |
| unsigned | version () const override |
| Get RPC 1.0 or RPC 2.0. | |
| void | disconnect () override |
| Close the client's connection to the server. | |
Private Types | |
| using | ErrorCode = boost::system::error_code |
Private Member Functions | |
| void | cleanup () |
| void | onReadMsg (ErrorCode const &ec) |
Static Private Member Functions | |
| static boost::asio::ip::tcp::endpoint | getEndpoint (BasicConfig const &cfg, bool v2) |
| template<class ConstBuffers> | |
| static std::string | bufferString (ConstBuffers const &b) |
Private Attributes | |
| boost::asio::io_context | ios_ |
| std::optional< boost::asio::executor_work_guard< boost::asio::io_context::executor_type > > | work_ |
| boost::asio::strand< boost::asio::io_context::executor_type > | strand_ |
| std::thread | thread_ |
| boost::asio::ip::tcp::socket | stream_ |
| boost::beast::websocket::stream< boost::asio::ip::tcp::socket & > | ws_ |
| boost::beast::multi_buffer | rb_ |
| bool | peerClosed_ = false |
| xrpl::Mutex< bool > | readEnded_ |
| std::condition_variable | readEndCv_ |
| std::mutex | m_ |
| std::condition_variable | cv_ |
| std::list< std::shared_ptr< Msg > > | msgs_ |
| unsigned | rpcVersion_ |
Static Private Attributes | |
| static constexpr auto | kDisconnectTimeout = std::chrono::seconds{1} |
Definition at line 50 of file WSClient.cpp.
|
private |
Definition at line 52 of file WSClient.cpp.
| xrpl::test::WSClientImpl::WSClientImpl | ( | Config const & | cfg, |
| bool | v2, | ||
| unsigned | rpcVersion, | ||
| std::unordered_map< std::string, std::string > const & | headers = {} ) |
Definition at line 157 of file WSClient.cpp.
|
override |
Definition at line 192 of file WSClient.cpp.
|
staticprivate |
Definition at line 64 of file WSClient.cpp.
|
staticprivate |
Definition at line 96 of file WSClient.cpp.
|
private |
Definition at line 130 of file WSClient.cpp.
|
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.
| cmd | The command to execute |
| params | json::Value of null or object type with zero or more key/value pairs. |
Implements xrpl::test::AbstractClient.
Definition at line 198 of file WSClient.cpp.
|
overridevirtual |
|
overridevirtual |
Retrieve a message that meets the predicate criteria.
Implements xrpl::test::WSClient.
Definition at line 266 of file WSClient.cpp.
|
nodiscardoverridevirtual |
Get RPC 1.0 or RPC 2.0.
Implements xrpl::test::AbstractClient.
Definition at line 292 of file WSClient.cpp.
|
overridevirtual |
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.
Implements xrpl::test::AbstractClient.
Definition at line 298 of file WSClient.cpp.
|
private |
Definition at line 337 of file WSClient.cpp.
|
private |
Definition at line 106 of file WSClient.cpp.
|
private |
Definition at line 107 of file WSClient.cpp.
|
private |
Definition at line 108 of file WSClient.cpp.
|
private |
Definition at line 109 of file WSClient.cpp.
|
private |
Definition at line 110 of file WSClient.cpp.
|
private |
Definition at line 111 of file WSClient.cpp.
|
private |
Definition at line 112 of file WSClient.cpp.
|
private |
Definition at line 114 of file WSClient.cpp.
|
staticconstexprprivate |
Definition at line 118 of file WSClient.cpp.
|
private |
Definition at line 119 of file WSClient.cpp.
|
private |
Definition at line 120 of file WSClient.cpp.
|
private |
Definition at line 123 of file WSClient.cpp.
|
private |
Definition at line 124 of file WSClient.cpp.
|
private |
Definition at line 125 of file WSClient.cpp.
|
private |
Definition at line 127 of file WSClient.cpp.