#include <ws_session.hpp>
|
| void | stop () |
| | stops session More...
|
| |
| void | stop (boost::beast::websocket::close_code code) |
| | stops session specifying the reason More...
|
| |
| void | handleRequest (std::string_view data) |
| | process received websocket frame, compose and execute response More...
|
| |
| void | asyncRead () |
| | asynchronously read More...
|
| |
| void | asyncWrite () |
| | asynchronously write More...
|
| |
| void | onRun () |
| | connected callback More...
|
| |
| void | onAccept (boost::system::error_code ec) |
| | handshake completion callback More...
|
| |
| void | onRead (boost::system::error_code ec, std::size_t size) |
| | read completion callback More...
|
| |
| void | onWrite (boost::system::error_code ec, std::size_t bytes_transferred) |
| | write completion callback More...
|
| |
| void | reportError (boost::system::error_code ec, std::string_view message) |
| | reports error code and message More...
|
| |
Definition at line 24 of file ws_session.hpp.
| kagome::api::WsSession::~WsSession |
( |
| ) |
|
|
overridedefault |
constructor
- Parameters
-
| socket | socket instance |
| config | session configuration |
| id | session id |
Definition at line 15 of file ws_session.cpp.
| void kagome::api::WsSession::asyncRead |
( |
| ) |
|
|
private |
| void kagome::api::WsSession::asyncWrite |
( |
| ) |
|
|
private |
connects on websocket close callback. Used to maintain the maximum number of simultaneous sessions
- Parameters
-
| handler | on close event handler |
Definition at line 59 of file ws_session.cpp.
| void kagome::api::WsSession::handleRequest |
( |
std::string_view |
data | ) |
|
|
private |
process received websocket frame, compose and execute response
- Template Parameters
-
- Parameters
-
Definition at line 64 of file ws_session.cpp.
| void kagome::api::WsSession::onAccept |
( |
boost::system::error_code |
ec | ) |
|
|
private |
| void kagome::api::WsSession::onRead |
( |
boost::system::error_code |
ec, |
|
|
std::size_t |
size |
|
) |
| |
|
private |
| void kagome::api::WsSession::onRun |
( |
| ) |
|
|
private |
| void kagome::api::WsSession::onWrite |
( |
boost::system::error_code |
ec, |
|
|
std::size_t |
bytes_transferred |
|
) |
| |
|
private |
| void kagome::api::WsSession::reject |
( |
| ) |
|
Closes the incoming connection with "try again later" response.
Definition at line 29 of file ws_session.cpp.
| void kagome::api::WsSession::reportError |
( |
boost::system::error_code |
ec, |
|
|
std::string_view |
message |
|
) |
| |
|
private |
reports error code and message
- Parameters
-
| ec | error code |
| message | error message |
Definition at line 188 of file ws_session.cpp.
| void kagome::api::WsSession::respond |
( |
std::string_view |
response | ) |
|
|
overridevirtual |
| Socket& kagome::api::WsSession::socket |
( |
| ) |
|
|
inlineoverridevirtual |
| void kagome::api::WsSession::start |
( |
| ) |
|
|
overridevirtual |
| void kagome::api::WsSession::stop |
( |
| ) |
|
|
private |
| void kagome::api::WsSession::stop |
( |
boost::beast::websocket::close_code |
code | ) |
|
|
private |
stops session specifying the reason
- Parameters
-
Definition at line 39 of file ws_session.cpp.
| std::mutex kagome::api::WsSession::cs_ |
|
private |
| std::queue<std::string> kagome::api::WsSession::pending_responses_ |
|
private |
| boost::beast::flat_buffer kagome::api::WsSession::rbuffer_ |
|
private |
| boost::asio::ip::tcp::socket kagome::api::WsSession::socket_ |
|
private |
| std::atomic_bool kagome::api::WsSession::stopped_ = false |
|
private |
| boost::asio::strand<boost::asio::io_context::executor_type> kagome::api::WsSession::strand_ |
|
private |
Strand to ensure the connection's handlers are not called concurrently.
Definition at line 146 of file ws_session.hpp.
| boost::beast::websocket::stream<boost::asio::ip::tcp::socket &> kagome::api::WsSession::stream_ |
|
private |
| boost::beast::flat_buffer kagome::api::WsSession::wbuffer_ |
|
private |
| std::atomic_bool kagome::api::WsSession::writing_in_progress_ = false |
|
private |
The documentation for this class was generated from the following files: