rippled
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
ripple::ServerImpl< Handler > Class Template Reference
Inheritance diagram for ripple::ServerImpl< Handler >:
Inheritance graph
[legend]
Collaboration diagram for ripple::ServerImpl< Handler >:
Collaboration graph
[legend]

Public Member Functions

 ServerImpl (Handler &handler, boost::asio::io_service &io_service, beast::Journal journal)
 
 ~ServerImpl ()
 
beast::Journal journal () override
 Returns the Journal associated with the server. More...
 
Endpoints ports (std::vector< Port > const &ports) override
 Set the listening port settings. More...
 
void close () override
 Close the server. More...
 
io_listios ()
 
boost::asio::io_service & get_io_service ()
 
bool closed ()
 

Private Types

enum  { historySize = 100 }
 
using clock_type = std::chrono::system_clock
 

Static Private Member Functions

static int ceil_log2 (unsigned long long x)
 

Private Attributes

Handler & handler_
 
const beast::Journal j_
 
boost::asio::io_service & io_service_
 
boost::asio::io_service::strand strand_
 
std::optional< boost::asio::io_service::work > work_
 
std::mutex m_
 
std::vector< Portports_
 
std::vector< std::weak_ptr< Door< Handler > > > list_
 
int high_ = 0
 
std::array< std::size_t, 64 > hist_
 
io_list ios_
 

Detailed Description

template<class Handler>
class ripple::ServerImpl< Handler >

Definition at line 76 of file ServerImpl.h.

Member Typedef Documentation

◆ clock_type

template<class Handler >
using ripple::ServerImpl< Handler >::clock_type = std::chrono::system_clock
private

Definition at line 79 of file ServerImpl.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Handler >
anonymous enum
private
Enumerator
historySize 

Definition at line 81 of file ServerImpl.h.

Constructor & Destructor Documentation

◆ ServerImpl()

template<class Handler >
ripple::ServerImpl< Handler >::ServerImpl ( Handler &  handler,
boost::asio::io_service &  io_service,
beast::Journal  journal 
)

Definition at line 138 of file ServerImpl.h.

◆ ~ServerImpl()

template<class Handler >
ripple::ServerImpl< Handler >::~ServerImpl

Definition at line 151 of file ServerImpl.h.

Member Function Documentation

◆ journal()

template<class Handler >
beast::Journal ripple::ServerImpl< Handler >::journal ( )
overridevirtual

Returns the Journal associated with the server.

Implements ripple::Server.

Definition at line 106 of file ServerImpl.h.

◆ ports()

template<class Handler >
Endpoints ripple::ServerImpl< Handler >::ports ( std::vector< Port > const &  v)
overridevirtual

Set the listening port settings.

This may only be called once.

Implements ripple::Server.

Definition at line 161 of file ServerImpl.h.

◆ close()

template<class Handler >
void ripple::ServerImpl< Handler >::close ( )
overridevirtual

Close the server.

The close is performed asynchronously. The handler will be notified when the server has stopped. The server is considered stopped when there are no pending I/O completion handlers and all connections have closed. Thread safety: Safe to call concurrently from any thread.

Implements ripple::Server.

Definition at line 184 of file ServerImpl.h.

◆ ios()

template<class Handler >
io_list& ripple::ServerImpl< Handler >::ios ( )

Definition at line 118 of file ServerImpl.h.

◆ get_io_service()

template<class Handler >
boost::asio::io_service& ripple::ServerImpl< Handler >::get_io_service ( )

Definition at line 124 of file ServerImpl.h.

◆ closed()

template<class Handler >
bool ripple::ServerImpl< Handler >::closed

Definition at line 194 of file ServerImpl.h.

◆ ceil_log2()

template<class Handler >
static int ripple::ServerImpl< Handler >::ceil_log2 ( unsigned long long  x)
staticprivate

Member Data Documentation

◆ handler_

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

Definition at line 83 of file ServerImpl.h.

◆ j_

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

Definition at line 84 of file ServerImpl.h.

◆ io_service_

template<class Handler >
boost::asio::io_service& ripple::ServerImpl< Handler >::io_service_
private

Definition at line 85 of file ServerImpl.h.

◆ strand_

template<class Handler >
boost::asio::io_service::strand ripple::ServerImpl< Handler >::strand_
private

Definition at line 86 of file ServerImpl.h.

◆ work_

template<class Handler >
std::optional<boost::asio::io_service::work> ripple::ServerImpl< Handler >::work_
private

Definition at line 87 of file ServerImpl.h.

◆ m_

template<class Handler >
std::mutex ripple::ServerImpl< Handler >::m_
private

Definition at line 89 of file ServerImpl.h.

◆ ports_

template<class Handler >
std::vector<Port> ripple::ServerImpl< Handler >::ports_
private

Definition at line 90 of file ServerImpl.h.

◆ list_

template<class Handler >
std::vector<std::weak_ptr<Door<Handler> > > ripple::ServerImpl< Handler >::list_
private

Definition at line 91 of file ServerImpl.h.

◆ high_

template<class Handler >
int ripple::ServerImpl< Handler >::high_ = 0
private

Definition at line 92 of file ServerImpl.h.

◆ hist_

template<class Handler >
std::array<std::size_t, 64> ripple::ServerImpl< Handler >::hist_
private

Definition at line 93 of file ServerImpl.h.

◆ ios_

template<class Handler >
io_list ripple::ServerImpl< Handler >::ios_
private

Definition at line 95 of file ServerImpl.h.