Represents an active WebSocket connection.
More...
#include <WebSocketConnection.hpp>
|
| | WebSocketConnection (server::Connection &underlying_connection, bool enable_deflate=false) |
| |
| | ~WebSocketConnection () |
| |
| void | on_message (std::function< void(const std::string &)> handler) |
| | Registers a callback to be called when a message is received.
|
| |
| void | on_close (std::function< void()> handler) |
| | Registers a callback to be called when the connection is closed.
|
| |
| void | send (const std::string &message) |
| | Sends a text message over the WebSocket connection.
|
| |
| void | close () |
| | Closes the WebSocket connection gracefully.
|
| |
| void | process_raw_data (std::vector< char > &buffer) |
| |
◆ WebSocketConnection()
| http::websocket::WebSocketConnection::WebSocketConnection |
( |
server::Connection & |
underlying_connection, |
|
|
bool |
enable_deflate = false |
|
) |
| |
|
explicit |
◆ ~WebSocketConnection()
| http::websocket::WebSocketConnection::~WebSocketConnection |
( |
| ) |
|
◆ close()
| void http::websocket::WebSocketConnection::close |
( |
| ) |
|
Closes the WebSocket connection gracefully.
◆ on_close()
| void http::websocket::WebSocketConnection::on_close |
( |
std::function< void()> |
handler | ) |
|
Registers a callback to be called when the connection is closed.
- Parameters
-
| handler | The callback function. |
◆ on_message()
| void http::websocket::WebSocketConnection::on_message |
( |
std::function< void(const std::string &)> |
handler | ) |
|
Registers a callback to be called when a message is received.
- Parameters
-
| handler | The callback function. |
◆ process_raw_data()
| void http::websocket::WebSocketConnection::process_raw_data |
( |
std::vector< char > & |
buffer | ) |
|
◆ send()
| void http::websocket::WebSocketConnection::send |
( |
const std::string & |
message | ) |
|
The documentation for this class was generated from the following files: