1#ifndef XRPL_RPC_SERVERHANDLER_H_INCLUDED
2#define XRPL_RPC_SERVERHANDLER_H_INCLUDED
4#include <xrpld/app/main/Application.h>
5#include <xrpld/app/main/CollectorManager.h>
6#include <xrpld/core/JobQueue.h>
7#include <xrpld/rpc/detail/WSInfoSub.h>
9#include <xrpl/json/Output.h>
10#include <xrpl/server/Server.h>
11#include <xrpl/server/Session.h>
12#include <xrpl/server/WSSession.h>
14#include <boost/beast/core/tcp_stream.hpp>
15#include <boost/beast/ssl/ssl_stream.hpp>
16#include <boost/utility/string_view.hpp>
95 boost::asio::io_context&,
106 boost::asio::io_context& io_context,
146 boost::asio::ip::tcp::endpoint
const& remote_address);
152 boost::asio::ip::tcp::endpoint
const& remote_address)
207 boost::asio::io_context&,
211 CollectorManager& cm);
A version-independent IP address and port combination.
A generic endpoint for log messages.
A metric for measuring an integral value.
A metric for reporting event timing.
Provides the beast::insight::Collector service.
A pool of threads to perform work.
Provides server functionality for clients.
Tracks load and resource consumption.
Resource::Manager & m_resourceManager
std::condition_variable condition_
Json::Value processSession(std::shared_ptr< WSSession > const &session, std::shared_ptr< JobQueue::Coro > const &coro, Json::Value const &jv)
void onWSMessage(std::shared_ptr< WSSession > session, std::vector< boost::asio::const_buffer > const &buffers)
std::unique_ptr< Server > m_server
beast::insight::Event rpc_size_
Setup const & setup() const
beast::insight::Counter rpc_requests_
friend std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_context &, JobQueue &, NetworkOPs &, Resource::Manager &, CollectorManager &cm)
Endpoints const & endpoints() const
void onClose(Session &session, boost::system::error_code const &)
Handoff statusResponse(http_request_type const &request) const
boost::beast::tcp_stream socket_type
NetworkOPs & m_networkOPs
beast::insight::Event rpc_time_
bool onAccept(Session &session, boost::asio::ip::tcp::endpoint endpoint)
Handoff onHandoff(Session &session, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
std::map< std::reference_wrapper< Port const >, int > count_
void onRequest(Session &session)
void processRequest(Port const &port, std::string const &request, beast::IP::Endpoint const &remoteIPAddress, Output &&, std::shared_ptr< JobQueue::Coro > coro, std::string_view forwardedFor, std::string_view user)
boost::beast::ssl_stream< socket_type > stream_type
Handoff onHandoff(Session &session, std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
Persistent state information for a connection session.
std::function< void(boost::beast::string_view const &)> Output
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
std::string_view forwardedFor(http_request_type const &request)
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_context &io_context, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
Used to indicate the result of a server connection handoff.
Configuration information for a Server listening port.
ServerHandlerCreator()=default
std::string admin_password
boost::asio::ip::tcp::endpoint overlay
std::vector< Port > ports