20 #ifndef RIPPLE_SERVER_SERVERIMPL_H_INCLUDED
21 #define RIPPLE_SERVER_SERVERIMPL_H_INCLUDED
23 #include <ripple/basics/chrono.h>
24 #include <ripple/server/Server.h>
25 #include <ripple/server/impl/Door.h>
26 #include <ripple/server/impl/io_list.h>
27 #include <ripple/beast/core/List.h>
28 #include <boost/asio.hpp>
29 #include <boost/optional.hpp>
79 template<
class Handler>
94 boost::optional <boost::asio::io_service::work>
work_;
128 boost::asio::io_service&
143 template<
class Handler>
149 , io_service_(io_service)
150 , strand_(io_service_)
155 template<
class Handler>
165 template<
class Handler>
171 Throw<std::logic_error> (
"ports() on closed Server");
172 ports_.reserve(ports.
size());
175 for(
auto const& port : ports)
177 ports_.push_back(port);
179 io_service_, ports_.back(), j_))
189 template<
class Handler>
198 handler_.onStopped(*
this);
202 template<
class Handler>
207 return ios_.closed();
boost::asio::io_service::strand strand_
virtual ~Server()=default
Destroy the server.
static int ceil_log2(unsigned long long x)
boost::asio::io_service & io_service_
boost::asio::io_service & get_io_service()
ServerImpl(Handler &handler, boost::asio::io_service &io_service, beast::Journal journal)
void close() override
Close the server.
std::array< std::size_t, 64 > hist_
virtual void close()=0
Close the server.
std::vector< Port > ports_
A generic endpoint for log messages.
boost::optional< boost::asio::io_service::work > work_
Endpoints ports(std::vector< Port > const &ports) override
Set the listening port settings.
virtual beast::Journal journal()=0
Returns the Journal associated with the server.
beast::Journal journal() override
Returns the Journal associated with the server.
std::vector< std::weak_ptr< Door< Handler > > > list_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual Endpoints ports(std::vector< Port > const &v)=0
Set the listening port settings.
Manages a set of objects performing asynchronous I/O.