|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
Interface for a WebSocket session on the server side. More...
#include <i_websocket_server.h>


Public Member Functions | |
| virtual auto | send_text (std::string &&message) -> VoidResult=0 |
| Sends a text message to the client. | |
| virtual auto | send_binary (std::vector< uint8_t > &&data) -> VoidResult=0 |
| Sends a binary message to the client. | |
| virtual auto | close (uint16_t code, std::string_view reason="") -> void=0 |
| Closes the WebSocket connection gracefully. | |
| virtual auto | path () const -> std::string_view=0 |
| Gets the requested path from the handshake. | |
Public Member Functions inherited from kcenon::network::interfaces::i_session | |
| virtual | ~i_session ()=default |
| Virtual destructor for proper cleanup. | |
| i_session (const i_session &)=delete | |
| i_session & | operator= (const i_session &)=delete |
| i_session (i_session &&)=delete | |
| i_session & | operator= (i_session &&)=delete |
| virtual auto | id () const -> std::string_view=0 |
| Gets the unique identifier for this session. | |
| virtual auto | is_connected () const -> bool=0 |
| Checks if the session is currently connected. | |
| virtual auto | send (std::vector< uint8_t > &&data) -> VoidResult=0 |
| Sends data to the client. | |
| virtual auto | close () -> void=0 |
| Closes the session. | |
Additional Inherited Members | |
Protected Member Functions inherited from kcenon::network::interfaces::i_session | |
| i_session ()=default | |
| Default constructor (only for derived classes) | |
Interface for a WebSocket session on the server side.
This interface extends i_session with WebSocket-specific operations such as sending text/binary messages and closing with status codes.
Definition at line 30 of file i_websocket_server.h.
|
pure virtual |
Closes the WebSocket connection gracefully.
| code | The close status code. |
| reason | Optional human-readable reason. |
Implemented in kcenon::network::core::ws_connection.
|
nodiscardpure virtual |
Gets the requested path from the handshake.
Implemented in kcenon::network::core::ws_connection.
|
nodiscardpure virtual |
Sends a binary message to the client.
| data | The binary data to send. |
Implemented in kcenon::network::core::ws_connection.
|
nodiscardpure virtual |
Sends a text message to the client.
| message | The text message to send. |
Implemented in kcenon::network::core::ws_connection.