29#include <system_error>
Base interface for all network components.
Unified interface for all protocol server implementations.
virtual auto connection_count() const -> size_t=0
Gets the number of active client connections.
virtual auto set_connection_callback(connection_callback_t callback) -> void=0
Sets the callback for new connections.
virtual auto set_receive_callback(receive_callback_t callback) -> void=0
Sets the callback for received data.
virtual auto stop() -> VoidResult=0
Stops the server and closes all connections.
virtual auto set_disconnection_callback(disconnection_callback_t callback) -> void=0
Sets the callback for disconnections.
std::function< void(std::string_view)> disconnection_callback_t
Callback type for disconnections (session_id)
virtual auto set_error_callback(error_callback_t callback) -> void=0
Sets the callback for errors.
virtual auto start(uint16_t port) -> VoidResult=0
Starts the server and begins listening for connections.
std::function< void(std::string_view, const std::vector< uint8_t > &)> receive_callback_t
Callback type for received data (session_id, data)
std::function< void(std::string_view, std::error_code)> error_callback_t
Callback type for errors (session_id, error)
std::function< void(std::shared_ptr< i_session >)> connection_callback_t
Callback type for new connections.
Base interface for all network components.
Session interface representing an active client-server connection.
Public header for Result<T> error handling types.