rippled
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ripple::Door< Handler > Class Template Reference

A listening socket. More...

Inheritance diagram for ripple::Door< Handler >:
Inheritance graph
[legend]
Collaboration diagram for ripple::Door< Handler >:
Collaboration graph
[legend]

Classes

class  Detector
 

Public Member Functions

 Door (Handler &handler, boost::asio::io_context &io_context, Port const &port, beast::Journal j)
 
void run ()
 
void close () override
 Close the Door listening socket and connections. More...
 
endpoint_type get_endpoint () const
 
io_listios ()
 Return the io_list associated with the work. More...
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 

Private Types

using clock_type = std::chrono::steady_clock
 
using timer_type = boost::asio::basic_waitable_timer< clock_type >
 
using error_code = boost::system::error_code
 
using yield_context = boost::asio::yield_context
 
using protocol_type = boost::asio::ip::tcp
 
using acceptor_type = protocol_type::acceptor
 
using endpoint_type = protocol_type::endpoint
 
using socket_type = boost::asio::ip::tcp::socket
 
using stream_type = boost::beast::tcp_stream
 

Private Member Functions

void reOpen ()
 
template<class ConstBufferSequence >
void create (bool ssl, ConstBufferSequence const &buffers, stream_type &&stream, endpoint_type remote_address)
 
void do_accept (yield_context yield)
 
template<class = void>
void destroy ()
 

Private Attributes

const beast::Journal j_
 
Port const & port_
 
Handler & handler_
 
boost::asio::io_context & ioc_
 
acceptor_type acceptor_
 
boost::asio::io_context::strand strand_
 
bool ssl_
 
bool plain_
 
io_listios_ = nullptr
 

Detailed Description

template<class Handler>
class ripple::Door< Handler >

A listening socket.

Definition at line 47 of file Door.h.

Member Typedef Documentation

◆ clock_type

template<class Handler >
using ripple::Door< Handler >::clock_type = std::chrono::steady_clock
private

Definition at line 51 of file Door.h.

◆ timer_type

template<class Handler >
using ripple::Door< Handler >::timer_type = boost::asio::basic_waitable_timer<clock_type>
private

Definition at line 52 of file Door.h.

◆ error_code

template<class Handler >
using ripple::Door< Handler >::error_code = boost::system::error_code
private

Definition at line 53 of file Door.h.

◆ yield_context

template<class Handler >
using ripple::Door< Handler >::yield_context = boost::asio::yield_context
private

Definition at line 54 of file Door.h.

◆ protocol_type

template<class Handler >
using ripple::Door< Handler >::protocol_type = boost::asio::ip::tcp
private

Definition at line 55 of file Door.h.

◆ acceptor_type

template<class Handler >
using ripple::Door< Handler >::acceptor_type = protocol_type::acceptor
private

Definition at line 56 of file Door.h.

◆ endpoint_type

template<class Handler >
using ripple::Door< Handler >::endpoint_type = protocol_type::endpoint
private

Definition at line 57 of file Door.h.

◆ socket_type

template<class Handler >
using ripple::Door< Handler >::socket_type = boost::asio::ip::tcp::socket
private

Definition at line 58 of file Door.h.

◆ stream_type

template<class Handler >
using ripple::Door< Handler >::stream_type = boost::beast::tcp_stream
private

Definition at line 59 of file Door.h.

Constructor & Destructor Documentation

◆ Door()

template<class Handler >
ripple::Door< Handler >::Door ( Handler &  handler,
boost::asio::io_context &  io_context,
Port const &  port,
beast::Journal  j 
)

Definition at line 284 of file Door.h.

Member Function Documentation

◆ reOpen()

template<class Handler >
void ripple::Door< Handler >::reOpen
private

Definition at line 228 of file Door.h.

◆ run()

template<class Handler >
void ripple::Door< Handler >::run

Definition at line 308 of file Door.h.

◆ close()

template<class Handler >
void ripple::Door< Handler >::close
overridevirtual

Close the Door listening socket and connections.

The listening socket is closed, and all open connections belonging to the Door are closed. Thread Safety: May be called concurrently

Implements ripple::io_list::work.

Definition at line 320 of file Door.h.

◆ get_endpoint()

template<class Handler >
endpoint_type ripple::Door< Handler >::get_endpoint ( ) const

Definition at line 126 of file Door.h.

◆ create()

template<class Handler >
template<class ConstBufferSequence >
void ripple::Door< Handler >::create ( bool  ssl,
ConstBufferSequence const &  buffers,
stream_type &&  stream,
endpoint_type  remote_address 
)
private

Definition at line 334 of file Door.h.

◆ do_accept()

template<class Handler >
void ripple::Door< Handler >::do_accept ( yield_context  yield)
private

Definition at line 366 of file Door.h.

◆ destroy()

template<class = void>
void ripple::io_list::work::destroy ( )
privateinherited

Definition at line 182 of file io_list.h.

◆ ios()

io_list& ripple::io_list::work::ios ( )
inherited

Return the io_list associated with the work.

Requirements: The call to io_list::emplace to create the work has already returned.

Definition at line 60 of file io_list.h.

Member Data Documentation

◆ j_

template<class Handler >
const beast::Journal ripple::Door< Handler >::j_
private

Definition at line 93 of file Door.h.

◆ port_

template<class Handler >
Port const& ripple::Door< Handler >::port_
private

Definition at line 94 of file Door.h.

◆ handler_

template<class Handler >
Handler& ripple::Door< Handler >::handler_
private

Definition at line 95 of file Door.h.

◆ ioc_

template<class Handler >
boost::asio::io_context& ripple::Door< Handler >::ioc_
private

Definition at line 96 of file Door.h.

◆ acceptor_

template<class Handler >
acceptor_type ripple::Door< Handler >::acceptor_
private

Definition at line 97 of file Door.h.

◆ strand_

template<class Handler >
boost::asio::io_context::strand ripple::Door< Handler >::strand_
private

Definition at line 98 of file Door.h.

◆ ssl_

template<class Handler >
bool ripple::Door< Handler >::ssl_
private

Definition at line 99 of file Door.h.

◆ plain_

template<class Handler >
bool ripple::Door< Handler >::plain_
private

Definition at line 100 of file Door.h.

◆ ios_

io_list* ripple::io_list::work::ios_ = nullptr
privateinherited

Definition at line 45 of file io_list.h.