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>
16template <
class Protocol = boost::asio::ip::tcp>
23 boost::intrusive::link_mode<boost::intrusive::normal_link>>
34 template <
class Handler>
61 boost::intrusive::make_list<BasicAsyncOp, boost::intrusive::constant_time_size<true>>::type;
70 explicit Checker(boost::asio::io_context& ioContext);
97 template <
class Handler>
108template <
class Protocol>
109template <
class Handler>
112 boost::asio::io_context& ioContext,
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>
180 list_.push_back(*op);
182 op->socket.async_connect(
184 std::bind(&BasicAsyncOp::operator(), op, std::placeholders::_1));
187template <
class Protocol>
193 if (
list_.size() == 0)
A version-independent IP address and port combination.
boost::system::error_code error_code
void asyncConnect(beast::IP::Endpoint const &endpoint, Handler &&handler)
Performs an async connection test on the specified endpoint.
void stop()
Stop the service.
Checker(boost::asio::io_context &ioContext)
boost::intrusive::make_list< BasicAsyncOp, boost::intrusive::constant_time_size< true > >::type list_type
std::condition_variable cond_
boost::asio::io_context & ioContext_
void remove(BasicAsyncOp &op)
void wait()
Block until all pending I/O completes.
~Checker()
Destroy the service.
static boost::asio::ip::tcp::endpoint toAsioEndpoint(IP::Endpoint const &address)
void operator()(error_code const &ec) override
AsyncOp(Checker &owner, boost::asio::io_context &ioContext, Handler &&handler)
Protocol::endpoint endpoint_type
Protocol::socket socket_type
virtual void operator()(error_code const &ec)=0
virtual ~BasicAsyncOp()=default