1#ifndef XRPL_SERVER_BASEPEER_H_INCLUDED
2#define XRPL_SERVER_BASEPEER_H_INCLUDED
4#include <xrpl/beast/utility/WrappedSink.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/server/Port.h>
7#include <xrpl/server/detail/LowestLayer.h>
8#include <xrpl/server/detail/io_list.h>
10#include <boost/asio.hpp>
19template <
class Handler,
class Impl>
34 boost::asio::executor_work_guard<boost::asio::executor>
work_;
35 boost::asio::strand<boost::asio::executor>
strand_;
41 boost::asio::executor
const& executor,
52 return *
static_cast<Impl*
>(
this);
58template <
class Handler,
class Impl>
62 boost::asio::executor
const& executor,
67 , remote_address_(remote_address)
75 , work_(boost::asio::make_work_guard(executor))
76 , strand_(boost::asio::make_strand(executor))
80template <
class Handler,
class Impl>
84 if (!strand_.running_in_this_thread())
A generic endpoint for log messages.
Wraps a Journal::Sink to prefix its output with a string.
boost::asio::ip::tcp::endpoint endpoint_type
boost::asio::basic_waitable_timer< clock_type > waitable_timer
endpoint_type remote_address_
boost::system::error_code error_code
BasePeer(Port const &port, Handler &handler, boost::asio::executor const &executor, endpoint_type remote_address, beast::Journal journal)
boost::asio::executor_work_guard< boost::asio::executor > work_
boost::asio::strand< boost::asio::executor > strand_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
decltype(auto) get_lowest_layer(T &t) noexcept
Configuration information for a Server listening port.