Public Member Functions | List of all members
WsSession Class Referencefinal

Manages the handling of WebSocket messages in a WebSocket connection. More...

#include <WsSession.hpp>

Inherits enable_shared_from_this< WsSession >.

Public Member Functions

 WsSession (std::shared_ptr< HttpServerConfiguration > serverConfiguration_, TCP::socket &&socket_, std::string path_)
 Create a WebSocket session object with the supplied data. More...
 
HttpServerConfigurationconfiguration () const
 Get the shared state of the http server. More...
 
void onAccept (boost::system::error_code ec)
 
void onRead (boost::system::error_code ec, std::size_t bytes_transferred)
 
void onWrite (boost::system::error_code ec, std::size_t bytes_transferred)
 

Detailed Description

Manages the handling of WebSocket messages in a WebSocket connection.

Holds a pointer to the private session information object for the client.

Constructor & Destructor Documentation

◆ WsSession()

WsSession ( std::shared_ptr< HttpServerConfiguration serverConfiguration_,
TCP::socket &&  socket_,
std::string  path_ 
)
inline

Create a WebSocket session object with the supplied data.

Parameters
clientSession_the client session associated with the WebSocket session
serverConfiguration_the configuration of the HTTP server that created this session
socket_the session socket

TODO A single WebSocket web application will handle all the session. TODO This can be selected from the routing trie in advance.

Member Function Documentation

◆ configuration()

HttpServerConfiguration& configuration ( ) const
inline

Get the shared state of the http server.

Called by handler implementations.

◆ onAccept()

void onAccept ( boost::system::error_code  ec)
inline
Exceptions
NetworkExceptionif there was an issue accepting

◆ onRead()

void onRead ( boost::system::error_code  ec,
std::size_t  bytes_transferred 
)
inline
Exceptions
NetworkExceptionif there was an issue reading

◆ onWrite()

void onWrite ( boost::system::error_code  ec,
std::size_t  bytes_transferred 
)
inline
Exceptions
NetworkExceptionif there was an issue writing

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