Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::SslWsSession< HandlerType > Class Template Reference

Represents a secure websocket session. More...

#include <SslWsSession.hpp>

Inheritance diagram for web::SslWsSession< HandlerType >:
Collaboration diagram for web::SslWsSession< HandlerType >:

Public Member Functions

 SslWsSession (boost::beast::ssl_stream< boost::beast::tcp_stream > &&stream, std::string ip, std::reference_wrapper< util::TagDecoratorFactory const > tagFactory, std::reference_wrapper< dosguard::DOSGuardInterface > dosGuard, std::shared_ptr< HandlerType > const &handler, boost::beast::flat_buffer &&buffer, bool isAdmin, std::uint32_t maxWsSendingQueueSize)
 Create a new non-secure websocket session.
 
StreamType & ws ()
 
- Public Member Functions inherited from web::impl::WsBase< SslWsSession, HandlerType >
 WsBase (std::string ip, std::reference_wrapper< util::TagDecoratorFactory const > tagFactory, std::reference_wrapper< dosguard::DOSGuardInterface > dosGuard, std::shared_ptr< HandlerType > const &handler, boost::beast::flat_buffer &&buffer, std::uint32_t maxSendingQueueSize)
 
SslWsSession< HandlerType > & derived ()
 
void doWrite ()
 
void onWrite (boost::system::error_code ec, std::size_t)
 
void maybeSendNext ()
 
void send (std::shared_ptr< std::string > msg) override
 Send a message to the client.
 
void send (std::string &&msg, http::status) override
 Send a message to the client.
 
SubscriptionContextPtr makeSubscriptionContext (util::TagDecoratorFactory const &factory) override
 Get the subscription context for this connection.
 
void run (http::request< http::string_body > req)
 Accept the session asynchroniously.
 
void onAccept (boost::beast::error_code ec)
 
void doRead ()
 
void onRead (boost::beast::error_code ec, std::size_t bytesTransferred)
 
- Public Member Functions inherited from web::ConnectionBase
 ConnectionBase (util::TagDecoratorFactory const &tagFactory, std::string ip)
 Create a new connection base.
 
bool dead ()
 Indicates whether the connection had an error and is considered dead.
 
bool isAdmin () const
 Indicates whether the connection has admin privileges.
 
- Public Member Functions inherited from util::Taggable
 Taggable (Taggable &&)=default
 
Taggableoperator= (Taggable &&)=default
 
BaseTagDecorator const & tag () const
 Getter for tag decorator.
 

Additional Inherited Members

- Public Attributes inherited from web::ConnectionBase
std::string const clientIp
 
bool upgraded = false
 
- Protected Member Functions inherited from web::impl::WsBase< SslWsSession, HandlerType >
void wsFail (boost::beast::error_code ec, char const *what)
 
- Protected Member Functions inherited from util::Taggable
 Taggable (util::TagDecoratorFactory const &tagFactory)
 New Taggable from a specified factory.
 
- Protected Attributes inherited from web::impl::WsBase< SslWsSession, HandlerType >
util::Logger log_
 
util::Logger perfLog_
 
- Protected Attributes inherited from web::ConnectionBase
boost::system::error_code ec_
 
bool isAdmin_ = false
 

Detailed Description

template<SomeServerHandler HandlerType>
class web::SslWsSession< HandlerType >

Represents a secure websocket session.

Majority of the operations are handled by the base class.

Constructor & Destructor Documentation

◆ SslWsSession()

template<SomeServerHandler HandlerType>
web::SslWsSession< HandlerType >::SslWsSession ( boost::beast::ssl_stream< boost::beast::tcp_stream > && stream,
std::string ip,
std::reference_wrapper< util::TagDecoratorFactory const > tagFactory,
std::reference_wrapper< dosguard::DOSGuardInterface > dosGuard,
std::shared_ptr< HandlerType > const & handler,
boost::beast::flat_buffer && buffer,
bool isAdmin,
std::uint32_t maxWsSendingQueueSize )
inlineexplicit

Create a new non-secure websocket session.

Parameters
streamThe SSL stream. Ownership is transferred
ipClient's IP address
tagFactoryA factory that is used to generate tags to track requests and sessions
dosGuardThe denial of service guard to use
handlerThe server handler to use
bufferBuffer with initial data received from the peer
isAdminWhether the connection has admin privileges
maxWsSendingQueueSizeThe maximum size of the sending queue for websocket

Member Function Documentation

◆ ws()

template<SomeServerHandler HandlerType>
StreamType & web::SslWsSession< HandlerType >::ws ( )
inline
Returns
The secure websocket stream.

The documentation for this class was generated from the following file: