20 #ifndef RIPPLE_RPC_SERVERHANDLER_H_INCLUDED
21 #define RIPPLE_RPC_SERVERHANDLER_H_INCLUDED
23 #include <ripple/app/main/CollectorManager.h>
24 #include <ripple/core/JobQueue.h>
25 #include <ripple/json/Output.h>
26 #include <ripple/rpc/RPCHandler.h>
27 #include <ripple/rpc/impl/WSInfoSub.h>
28 #include <ripple/server/Server.h>
29 #include <ripple/server/Session.h>
30 #include <ripple/server/WSSession.h>
31 #include <boost/beast/core/tcp_stream.hpp>
32 #include <boost/beast/ssl/ssl_stream.hpp>
33 #include <boost/utility/string_view.hpp>
52 explicit Setup() =
default;
78 boost::asio::ip::address
ip;
118 boost::asio::io_service&,
129 boost::asio::io_service& io_service,
163 boost::asio::ip::tcp::endpoint
const& remote_address);
169 boost::asio::ip::tcp::endpoint
const& remote_address)
174 std::forward<http_request_type>(request),
212 boost::string_view user);
224 boost::asio::io_service&,
228 CollectorManager& cm);
Provides server functionality for clients.
boost::beast::ssl_stream< socket_type > stream_type
boost::beast::tcp_stream socket_type
Handoff statusResponse(http_request_type const &request) const
A metric for measuring an integral value.
Handoff onHandoff(Session &session, std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
std::string admin_password
Provides the beast::insight::Collector service.
std::map< std::reference_wrapper< Port const >, int > count_
Resource::Manager & m_resourceManager
ServerHandler(ServerHandlerCreator const &, Application &app, boost::asio::io_service &io_service, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
Persistent state information for a connection session.
void processRequest(Port const &port, std::string const &request, beast::IP::Endpoint const &remoteIPAddress, Output &&, std::shared_ptr< JobQueue::Coro > coro, boost::string_view forwardedFor, boost::string_view user)
bool onAccept(Session &session, boost::asio::ip::tcp::endpoint endpoint)
Json::Value processSession(std::shared_ptr< WSSession > const &session, std::shared_ptr< JobQueue::Coro > const &coro, Json::Value const &jv)
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
Handoff onHandoff(Session &session, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
void onClose(Session &session, boost::system::error_code const &)
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_service &io_service, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
bool operator<(CanonicalTXSet::Key const &lhs, CanonicalTXSet::Key const &rhs)
beast::insight::Counter rpc_requests_
beast::insight::Event rpc_size_
boost::string_view forwardedFor(http_request_type const &request)
A metric for reporting event timing.
Setup const & setup() const
A generic endpoint for log messages.
Configuration information for a Server listening port.
std::vector< Port > ports
A pool of threads to perform work.
Tracks load and resource consumption.
friend std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_service &, JobQueue &, NetworkOPs &, Resource::Manager &, CollectorManager &cm)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
NetworkOPs & m_networkOPs
std::condition_variable condition_
ServerHandlerCreator()=default
void onRequest(Session &session)
Used to indicate the result of a server connection handoff.
beast::insight::Event rpc_time_
A version-independent IP address and port combination.
boost::asio::ip::address ip
void onWSMessage(std::shared_ptr< WSSession > session, std::vector< boost::asio::const_buffer > const &buffers)
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
std::unique_ptr< Server > m_server
std::function< void(boost::beast::string_view const &)> Output