3#include <xrpl/beast/net/IPAddressConversion.h>
5#include <boost/asio/io_context.hpp>
6#include <boost/asio/ip/tcp.hpp>
7#include <boost/intrusive/list.hpp>
17template <
class Protocol = boost::asio::ip::tcp>
23 struct basic_async_op : boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>
34 template <
class Handler>
44 async_op(
Checker& owner, boost::asio::io_context& io_context, Handler&& handler);
58 typename boost::intrusive::make_list<basic_async_op, boost::intrusive::constant_time_size<true>>::type;
67 explicit Checker(boost::asio::io_context& io_context);
94 template <
class Handler>
105template <
class Protocol>
106template <
class Handler>
108 : checker_(owner), socket_(io_context), handler_(
std::
forward<Handler>(handler))
112template <
class Protocol>
113template <
class Handler>
119template <
class Protocol>
120template <
class Handler>
128template <
class Protocol>
129template <
class Handler>
138template <
class Protocol>
143template <
class Protocol>
149template <
class Protocol>
157 for (
auto& c : list_)
162template <
class Protocol>
167 while (!list_.empty())
171template <
class Protocol>
172template <
class Handler>
179 list_.push_back(*op);
181 op->socket_.async_connect(
183 std::bind(&basic_async_op::operator(), op, std::placeholders::_1));
186template <
class Protocol>
191 list_.erase(list_.iterator_to(op));
192 if (list_.size() == 0)
A version-independent IP address and port combination.
Tests remote listening sockets to make sure they are connectable.
boost::system::error_code error_code
typename boost::intrusive::make_list< basic_async_op, boost::intrusive::constant_time_size< true > >::type list_type
void async_connect(beast::IP::Endpoint const &endpoint, Handler &&handler)
Performs an async connection test on the specified endpoint.
void remove(basic_async_op &op)
void stop()
Stop the service.
boost::asio::io_context & io_context_
Checker(boost::asio::io_context &io_context)
std::condition_variable cond_
void wait()
Block until all pending I/O completes.
~Checker()
Destroy the service.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static boost::asio::ip::tcp::endpoint to_asio_endpoint(IP::Endpoint const &address)
typename Protocol::endpoint endpoint_type
void operator()(error_code const &ec) override
typename Protocol::socket socket_type
virtual ~basic_async_op()=default
virtual void operator()(error_code const &ec)=0