rippled
Loading...
Searching...
No Matches
WSClient.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2016 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_TEST_WSCLIENT_H_INCLUDED
21#define RIPPLE_TEST_WSCLIENT_H_INCLUDED
22
23#include <test/jtx/AbstractClient.h>
24
25#include <xrpld/core/Config.h>
26
27#include <chrono>
28#include <memory>
29#include <optional>
30
31namespace ripple {
32namespace test {
33
35{
36public:
41 0}) = 0;
42
46 std::chrono::milliseconds const& timeout,
47 std::function<bool(Json::Value const&)> pred) = 0;
48};
49
53 Config const& cfg,
54 bool v2 = true,
55 unsigned rpc_version = 2,
57
58} // namespace test
59} // namespace ripple
60
61#endif
Represents a JSON value.
Definition: json_value.h:149
virtual std::optional< Json::Value > getMsg(std::chrono::milliseconds const &timeout=std::chrono::milliseconds{ 0})=0
Retrieve a message.
virtual std::optional< Json::Value > findMsg(std::chrono::milliseconds const &timeout, std::function< bool(Json::Value const &)> pred)=0
Retrieve a message that meets the predicate criteria.
std::unique_ptr< WSClient > makeWSClient(Config const &cfg, bool v2, unsigned rpc_version, std::unordered_map< std::string, std::string > const &headers)
Returns a client operating through WebSockets/S.
Definition: WSClient.cpp:302
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25