rippled
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ripple::PeerFinder::Checker< Protocol > Class Template Reference

Tests remote listening sockets to make sure they are connectible. More...

#include <Checker.h>

Collaboration diagram for ripple::PeerFinder::Checker< Protocol >:
Collaboration graph
[legend]

Classes

struct  async_op
 
struct  basic_async_op
 

Public Member Functions

 Checker (boost::asio::io_context &io_context)
 
 ~Checker ()
 Destroy the service.
 
void stop ()
 Stop the service.
 
void wait ()
 Block until all pending I/O completes.
 
template<class Handler >
void async_connect (beast::IP::Endpoint const &endpoint, Handler &&handler)
 Performs an async connection test on the specified endpoint.
 

Private Types

using error_code = boost::system::error_code
 
using list_type = typename boost::intrusive::make_list< basic_async_op, boost::intrusive::constant_time_size< true > >::type
 

Private Member Functions

void remove (basic_async_op &op)
 

Private Attributes

std::mutex mutex_
 
std::condition_variable cond_
 
boost::asio::io_context & io_context_
 
list_type list_
 
bool stop_ = false
 

Detailed Description

template<class Protocol = boost::asio::ip::tcp>
class ripple::PeerFinder::Checker< Protocol >

Tests remote listening sockets to make sure they are connectible.

Definition at line 19 of file Checker.h.

Member Typedef Documentation

◆ error_code

template<class Protocol = boost::asio::ip::tcp>
using ripple::PeerFinder::Checker< Protocol >::error_code = boost::system::error_code
private

Definition at line 22 of file Checker.h.

◆ list_type

template<class Protocol = boost::asio::ip::tcp>
using ripple::PeerFinder::Checker< Protocol >::list_type = typename boost::intrusive::make_list< basic_async_op, boost::intrusive::constant_time_size<true> >::type
private

Definition at line 63 of file Checker.h.

Constructor & Destructor Documentation

◆ Checker()

template<class Protocol >
ripple::PeerFinder::Checker< Protocol >::Checker ( boost::asio::io_context &  io_context)
explicit

Definition at line 151 of file Checker.h.

◆ ~Checker()

template<class Protocol >
ripple::PeerFinder::Checker< Protocol >::~Checker ( )

Destroy the service.

Any pending I/O operations will be canceled. This call blocks until all pending operations complete (either with success or with operation_aborted) and the associated thread and io_context have no more work remaining.

Definition at line 157 of file Checker.h.

Member Function Documentation

◆ stop()

template<class Protocol >
void ripple::PeerFinder::Checker< Protocol >::stop ( )

Stop the service.

Pending I/O operations will be canceled. This issues cancel orders for all pending I/O operations and then returns immediately. Handlers will receive operation_aborted errors, or if they were already queued they will complete normally.

Definition at line 164 of file Checker.h.

◆ wait()

template<class Protocol >
void ripple::PeerFinder::Checker< Protocol >::wait ( )

Block until all pending I/O completes.

Definition at line 177 of file Checker.h.

◆ async_connect()

template<class Protocol >
template<class Handler >
void ripple::PeerFinder::Checker< Protocol >::async_connect ( beast::IP::Endpoint const &  endpoint,
Handler &&  handler 
)

Performs an async connection test on the specified endpoint.

The port must be non-zero. Note that the execution guarantees offered by asio handlers are NOT enforced.

Definition at line 187 of file Checker.h.

◆ remove()

template<class Protocol >
void ripple::PeerFinder::Checker< Protocol >::remove ( basic_async_op op)
private

Definition at line 204 of file Checker.h.

Member Data Documentation

◆ mutex_

template<class Protocol = boost::asio::ip::tcp>
std::mutex ripple::PeerFinder::Checker< Protocol >::mutex_
private

Definition at line 67 of file Checker.h.

◆ cond_

template<class Protocol = boost::asio::ip::tcp>
std::condition_variable ripple::PeerFinder::Checker< Protocol >::cond_
private

Definition at line 68 of file Checker.h.

◆ io_context_

template<class Protocol = boost::asio::ip::tcp>
boost::asio::io_context& ripple::PeerFinder::Checker< Protocol >::io_context_
private

Definition at line 69 of file Checker.h.

◆ list_

template<class Protocol = boost::asio::ip::tcp>
list_type ripple::PeerFinder::Checker< Protocol >::list_
private

Definition at line 70 of file Checker.h.

◆ stop_

template<class Protocol = boost::asio::ip::tcp>
bool ripple::PeerFinder::Checker< Protocol >::stop_ = false
private

Definition at line 71 of file Checker.h.