Clio develop
The XRP Ledger API server.
|
Base class for all connections. More...
#include <ConnectionBase.hpp>
Public Member Functions | |
ConnectionBase (util::TagDecoratorFactory const &tagFactory, std::string ip) | |
Create a new connection base. | |
virtual void | send (std::string &&msg, http::status status=http::status::ok)=0 |
Send the response to the client. | |
virtual void | send (std::shared_ptr< std::string > msg) |
Send via shared_ptr of string, that enables SubscriptionManager to publish to clients. | |
virtual SubscriptionContextPtr | makeSubscriptionContext (util::TagDecoratorFactory const &factory)=0 |
Get the subscription context for this connection. | |
bool | dead () |
Indicates whether the connection had an error and is considered dead. | |
bool | isAdmin () const |
Indicates whether the connection has admin privileges. | |
![]() | |
Taggable (Taggable &&)=default | |
Taggable & | operator= (Taggable &&)=default |
BaseTagDecorator const & | tag () const |
Getter for tag decorator. | |
Public Attributes | |
std::string const | clientIp |
bool | upgraded = false |
Protected Attributes | |
boost::system::error_code | ec_ |
bool | isAdmin_ = false |
Additional Inherited Members | |
![]() | |
Taggable (util::TagDecoratorFactory const &tagFactory) | |
New Taggable from a specified factory. | |
Base class for all connections.
This class is used to represent a connection in RPC executor and subscription manager.
|
inline |
Create a new connection base.
tagFactory | The factory that generates tags to track sessions and requests |
ip | The IP address of the connected peer |
|
inline |
Indicates whether the connection had an error and is considered dead.
|
inlinenodiscard |
Indicates whether the connection has admin privileges.
|
pure virtual |
Get the subscription context for this connection.
factory | Tag TagDecoratorFactory to use to create the context. |
Implemented in web::impl::HttpBase< Derived, HandlerType >, web::impl::HttpBase< HttpSession, HandlerType >, web::impl::HttpBase< SslHttpSession, HandlerType >, web::impl::WsBase< Derived, HandlerType >, web::impl::WsBase< PlainWsSession, HandlerType >, and web::impl::WsBase< SslWsSession, HandlerType >.
|
inlinevirtual |
Send via shared_ptr of string, that enables SubscriptionManager to publish to clients.
msg | Unused |
std::logic_error | unless the function is overridden by a child class. |
Reimplemented in web::impl::WsBase< Derived, HandlerType >, web::impl::WsBase< PlainWsSession, HandlerType >, and web::impl::WsBase< SslWsSession, HandlerType >.
|
pure virtual |
Send the response to the client.
msg | The message to send |
status | The HTTP status code; defaults to OK |
Implemented in web::impl::HttpBase< Derived, HandlerType >, web::impl::HttpBase< HttpSession, HandlerType >, web::impl::HttpBase< SslHttpSession, HandlerType >, web::impl::WsBase< Derived, HandlerType >, web::impl::WsBase< PlainWsSession, HandlerType >, and web::impl::WsBase< SslWsSession, HandlerType >.