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


Public Member Functions | |
| 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. | |
Protected Member Functions | |
| i_session ()=default | |
| Default constructor (only for derived classes) | |
Interface for a single client session on the server side.
This interface represents a connection to a single client. It is provided to server callbacks and allows sending data to and managing individual client connections.
Sessions are typically managed via shared_ptr. The session remains valid as long as the connection is active or a reference is held.
All methods must be thread-safe. Send operations are typically queued and executed asynchronously.
Definition at line 48 of file i_session.h.
|
virtualdefault |
Virtual destructor for proper cleanup.
|
delete |
|
delete |
|
protecteddefault |
Default constructor (only for derived classes)
|
pure virtual |
Closes the session.
After calling this method, the session is no longer usable. The disconnection callback will be triggered.
Implemented in kcenon::network::core::ws_connection, kcenon::network::internal::adapters::http_request_session, kcenon::network::internal::adapters::quic_session_wrapper, kcenon::network::internal::adapters::udp_endpoint_session, kcenon::network::internal::adapters::ws_session_wrapper, kcenon::network::session::messaging_session, and kcenon::network::session::quic_session.
|
nodiscardpure virtual |
Gets the unique identifier for this session.
The session ID is unique within the server and remains constant for the lifetime of the session.
Implemented in kcenon::network::core::ws_connection, kcenon::network::internal::adapters::http_request_session, kcenon::network::internal::adapters::quic_session_wrapper, kcenon::network::internal::adapters::udp_endpoint_session, kcenon::network::internal::adapters::ws_session_wrapper, kcenon::network::session::messaging_session, and kcenon::network::session::quic_session.
|
nodiscardpure virtual |
Checks if the session is currently connected.
Implemented in kcenon::network::core::ws_connection, kcenon::network::internal::adapters::http_request_session, kcenon::network::internal::adapters::quic_session_wrapper, kcenon::network::internal::adapters::udp_endpoint_session, kcenon::network::internal::adapters::ws_session_wrapper, kcenon::network::session::messaging_session, and kcenon::network::session::quic_session.
|
nodiscardpure virtual |
Sends data to the client.
| data | The data to send. |
Thread-safe. Multiple sends may be queued.
Implemented in kcenon::network::core::ws_connection, kcenon::network::internal::adapters::http_request_session, kcenon::network::internal::adapters::quic_session_wrapper, kcenon::network::internal::adapters::udp_endpoint_session, kcenon::network::internal::adapters::ws_session_wrapper, kcenon::network::session::messaging_session, and kcenon::network::session::quic_session.