rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
ripple::ServerImpl< Handler > Class Template Reference

#include <ServerImpl.h>

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_context &io_context, beast::Journal journal)
 
 ~ServerImpl ()
 
beast::Journal journal () override
 Returns the Journal associated with the server.
 
Endpoints ports (std::vector< Port > const &ports) override
 Set the listening port settings.
 
void close () override
 Close the server.
 
io_listios ()
 
boost::asio::io_context & get_io_context ()
 
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_
 
beast::Journal const j_
 
boost::asio::io_context & io_context_
 
boost::asio::strand< boost::asio::io_context::executor_type > strand_
 
std::optional< boost::asio::executor_work_guard< boost::asio::io_context::executor_type > > 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 81 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 84 of file ServerImpl.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Handler >
anonymous enum
private
Enumerator
historySize 

Definition at line 86 of file ServerImpl.h.

Constructor & Destructor Documentation

◆ ServerImpl()

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

Definition at line 145 of file ServerImpl.h.

◆ ~ServerImpl()

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

Definition at line 158 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 113 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 168 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 197 of file ServerImpl.h.

◆ ios()

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

Definition at line 125 of file ServerImpl.h.

◆ get_io_context()

template<class Handler >
boost::asio::io_context & ripple::ServerImpl< Handler >::get_io_context ( )

Definition at line 131 of file ServerImpl.h.

◆ closed()

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

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

◆ j_

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

Definition at line 89 of file ServerImpl.h.

◆ io_context_

template<class Handler >
boost::asio::io_context& ripple::ServerImpl< Handler >::io_context_
private

Definition at line 90 of file ServerImpl.h.

◆ strand_

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

Definition at line 91 of file ServerImpl.h.

◆ work_

template<class Handler >
std::optional<boost::asio::executor_work_guard< boost::asio::io_context::executor_type> > ripple::ServerImpl< Handler >::work_
private

Definition at line 94 of file ServerImpl.h.

◆ m_

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

Definition at line 96 of file ServerImpl.h.

◆ ports_

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

Definition at line 97 of file ServerImpl.h.

◆ list_

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

Definition at line 98 of file ServerImpl.h.

◆ high_

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

Definition at line 99 of file ServerImpl.h.

◆ hist_

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

Definition at line 100 of file ServerImpl.h.

◆ ios_

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

Definition at line 102 of file ServerImpl.h.