rippled
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...

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_service &io_service)
 
 ~Checker ()
 Destroy the service. More...
 
void stop ()
 Stop the service. More...
 
void wait ()
 Block until all pending I/O completes. More...
 
template<class Handler >
void async_connect (beast::IP::Endpoint const &endpoint, Handler &&handler)
 Performs an async connection test on the specified endpoint. More...
 

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_service & io_service_
 
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 39 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 42 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 85 of file Checker.h.

Constructor & Destructor Documentation

◆ Checker()

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

Definition at line 171 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_service have no more work remaining.

Definition at line 177 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 184 of file Checker.h.

◆ wait()

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

Block until all pending I/O completes.

Definition at line 197 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 207 of file Checker.h.

◆ remove()

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

Definition at line 224 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 87 of file Checker.h.

◆ cond_

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

Definition at line 88 of file Checker.h.

◆ io_service_

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

Definition at line 89 of file Checker.h.

◆ list_

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

Definition at line 90 of file Checker.h.

◆ stop_

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

Definition at line 91 of file Checker.h.