|
| VoidResult | kcenon::network::initialize () |
| | Initialize the network system with default production configuration.
|
| |
| VoidResult | kcenon::network::shutdown () |
| | Shutdown the network system.
|
| |
| bool | kcenon::network::is_initialized () |
| | Check if network system is initialized.
|
| |
| constexpr const char * | kcenon::network::version () noexcept |
| | Get the network system version string.
|
| |
| | messaging_client (std::string_view client_id) |
| | Construct a client with a given client_id.
|
| |
| virtual | ~messaging_client () noexcept |
| | Destructor - automatically stops the client if running.
|
| |
| | messaging_client (const messaging_client &)=delete |
| |
| messaging_client & | operator= (const messaging_client &)=delete |
| |
| | messaging_client (messaging_client &&) noexcept |
| |
| messaging_client & | operator= (messaging_client &&) noexcept |
| |
| bool | start_client (std::string_view host, uint16_t port) |
| | Start the client and connect to a remote host.
|
| |
| void | stop_client () |
| | Stop the client and disconnect.
|
| |
| bool | wait_for_stop (std::chrono::milliseconds timeout=std::chrono::milliseconds(5000)) |
| | Wait for the client to stop.
|
| |
| bool | send_packet (std::span< const uint8_t > data) |
| | Send data to the connected server.
|
| |
| bool | send_packet (std::string_view data) |
| | Send string data to the connected server.
|
| |
| bool | is_connected () const noexcept |
| | Check if the client is connected.
|
| |
| bool | is_running () const noexcept |
| | Check if the client is running.
|
| |
| connection_state | get_state () const noexcept |
| | Get the current connection state.
|
| |
| std::string_view | client_id () const noexcept |
| | Get the client identifier.
|
| |
| void | set_connection_callback (connection_callback callback) |
| | Set connection callback.
|
| |
| void | set_disconnection_callback (disconnection_callback callback) |
| | Set disconnection callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| void | set_data_callback (data_callback callback) |
| | Set data received callback.
|
| |
| void | set_auto_reconnect (bool enable, std::chrono::seconds delay=std::chrono::seconds(5)) |
| | Enable automatic reconnection.
|
| |
| void | set_heartbeat (bool enable, std::chrono::seconds interval=std::chrono::seconds(30)) |
| | Enable heartbeat mechanism.
|
| |
| | messaging_server (std::string_view server_id) |
| | Construct a server with a given server_id.
|
| |
| virtual | ~messaging_server () noexcept |
| | Destructor - automatically stops the server if running.
|
| |
| | messaging_server (const messaging_server &)=delete |
| |
| messaging_server & | operator= (const messaging_server &)=delete |
| |
| | messaging_server (messaging_server &&) noexcept |
| |
| messaging_server & | operator= (messaging_server &&) noexcept |
| |
| bool | start_server (uint16_t port, int backlog=128) |
| | Start the server on a specified port.
|
| |
| bool | start_server (std::string_view address, uint16_t port, int backlog=128) |
| | Start the server on a specific interface.
|
| |
| void | stop_server () |
| | Stop the server and disconnect all clients.
|
| |
| bool | wait_for_stop (std::chrono::milliseconds timeout=std::chrono::milliseconds(5000)) |
| | Wait for the server to stop.
|
| |
| bool | send_to (std::string_view session_id, std::span< const uint8_t > data) |
| | Send data to a specific client.
|
| |
| bool | send_to (std::string_view session_id, std::string_view data) |
| | Send data to a specific client.
|
| |
| void | broadcast (std::span< const uint8_t > data) |
| | Broadcast data to all connected clients.
|
| |
| void | broadcast (std::string_view data) |
| | Broadcast string data to all connected clients.
|
| |
| void | disconnect (std::string_view session_id) |
| | Disconnect a specific client.
|
| |
| bool | is_running () const noexcept |
| | Check if the server is running.
|
| |
| size_t | client_count () const noexcept |
| | Get the number of connected clients.
|
| |
| std::string_view | server_id () const noexcept |
| | Get the server identifier.
|
| |
| void | set_client_connected_callback (client_connected_callback callback) |
| | Set client connected callback.
|
| |
| void | set_client_disconnected_callback (client_disconnected_callback callback) |
| | Set client disconnected callback.
|
| |
| void | set_client_data_callback (client_data_callback callback) |
| | Set client data callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| | messaging_session (std::string session_id) |
| | Construct a session with a unique ID.
|
| |
| virtual | ~messaging_session () noexcept |
| | Destructor.
|
| |
| const std::string & | session_id () const noexcept |
| | Get the session ID.
|
| |
| bool | is_active () const noexcept |
| | Check if the session is active.
|
| |
| std::string | remote_address () const |
| | Get the remote endpoint address.
|
| |
| uint16_t | remote_port () const |
| | Get the remote endpoint port.
|
| |
| bool | send (std::span< const uint8_t > data) |
| | Send data to the client.
|
| |
| void | close () |
| | Close the session.
|
| |
| | messaging_udp_client (std::string_view client_id) |
| | Construct a UDP client with a given client_id.
|
| |
| virtual | ~messaging_udp_client () noexcept |
| | Destructor - automatically stops the client if running.
|
| |
| | messaging_udp_client (const messaging_udp_client &)=delete |
| |
| messaging_udp_client & | operator= (const messaging_udp_client &)=delete |
| |
| | messaging_udp_client (messaging_udp_client &&) noexcept |
| |
| messaging_udp_client & | operator= (messaging_udp_client &&) noexcept |
| |
| bool | start_client (std::string_view remote_host, uint16_t remote_port, uint16_t local_port=0) |
| | Start the client and bind to an endpoint.
|
| |
| void | stop_client () |
| | Stop the client.
|
| |
| bool | send_packet (std::span< const uint8_t > data) |
| | Send a datagram to the configured remote endpoint.
|
| |
| bool | send_packet (std::string_view data) |
| | Send a string datagram to the configured remote endpoint.
|
| |
| bool | send_to (std::span< const uint8_t > data, std::string_view host, uint16_t port) |
| | Send a datagram to a specific endpoint.
|
| |
| bool | is_running () const noexcept |
| | Check if the client is running.
|
| |
| std::string_view | client_id () const noexcept |
| | Get the client identifier.
|
| |
| void | set_data_callback (udp_data_callback callback) |
| | Set data received callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| bool | join_multicast_group (std::string_view multicast_address) |
| | Enable multicast reception.
|
| |
| bool | leave_multicast_group (std::string_view multicast_address) |
| | Leave multicast group.
|
| |
| | messaging_udp_server (std::string_view server_id) |
| | Construct a UDP server with a given server_id.
|
| |
| virtual | ~messaging_udp_server () noexcept |
| | Destructor - automatically stops the server if running.
|
| |
| | messaging_udp_server (const messaging_udp_server &)=delete |
| |
| messaging_udp_server & | operator= (const messaging_udp_server &)=delete |
| |
| | messaging_udp_server (messaging_udp_server &&) noexcept |
| |
| messaging_udp_server & | operator= (messaging_udp_server &&) noexcept |
| |
| bool | start_server (uint16_t port) |
| | Start the server on a specified port.
|
| |
| bool | start_server (std::string_view address, uint16_t port) |
| | Start the server on a specific interface.
|
| |
| void | stop_server () |
| | Stop the server.
|
| |
| bool | send_to (std::span< const uint8_t > data, std::string_view host, uint16_t port) |
| | Send a datagram to a specific endpoint.
|
| |
| bool | send_to (std::string_view data, std::string_view host, uint16_t port) |
| | Send a string datagram to a specific endpoint.
|
| |
| bool | broadcast (std::span< const uint8_t > data, uint16_t port) |
| | Broadcast data to all endpoints on the network.
|
| |
| bool | is_running () const noexcept |
| | Check if the server is running.
|
| |
| std::string_view | server_id () const noexcept |
| | Get the server identifier.
|
| |
| void | set_data_callback (udp_data_callback callback) |
| | Set data received callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| bool | join_multicast_group (std::string_view multicast_address) |
| | Enable multicast reception.
|
| |
| | reliable_udp_client (std::string_view client_id) |
| | Construct a reliable UDP client.
|
| |
| virtual | ~reliable_udp_client () noexcept |
| | Destructor.
|
| |
| | reliable_udp_client (const reliable_udp_client &)=delete |
| |
| reliable_udp_client & | operator= (const reliable_udp_client &)=delete |
| |
| | reliable_udp_client (reliable_udp_client &&) noexcept |
| |
| reliable_udp_client & | operator= (reliable_udp_client &&) noexcept |
| |
| bool | start_client (std::string_view remote_host, uint16_t remote_port) |
| | Start the client.
|
| |
| void | stop_client () |
| | Stop the client.
|
| |
| bool | send_reliable (std::span< const uint8_t > data) |
| | Send data with reliable delivery.
|
| |
| bool | send_unreliable (std::span< const uint8_t > data) |
| | Send data unreliably (fire and forget)
|
| |
| bool | is_connected () const noexcept |
| | Check if the client is connected.
|
| |
| bool | is_running () const noexcept |
| | Check if the client is running.
|
| |
| std::string_view | client_id () const noexcept |
| | Get the client identifier.
|
| |
| void | set_connection_callback (connection_callback callback) |
| | Set connection callback.
|
| |
| void | set_disconnection_callback (disconnection_callback callback) |
| | Set disconnection callback.
|
| |
| void | set_data_callback (data_callback callback) |
| | Set data received callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| void | set_retransmit_timeout (std::chrono::milliseconds timeout) |
| | Set retransmission timeout.
|
| |
| void | set_max_retransmit_attempts (size_t max_attempts) |
| | Set maximum retransmission attempts.
|
| |
| std::chrono::milliseconds | get_rtt () const noexcept |
| | Get current round-trip time estimate.
|
| |
| double | get_packet_loss_rate () const noexcept |
| | Get packet loss rate.
|
| |
| virtual | ~thread_pool_interface ()=default |
| |
| virtual void | submit (std::function< void()> task)=0 |
| | Submit a task to the thread pool.
|
| |
| virtual size_t | worker_count () const =0 |
| | Get the number of worker threads.
|
| |
| virtual bool | is_running () const =0 |
| | Check if the thread pool is running.
|
| |
| virtual | ~logger_interface ()=default |
| |
| virtual void | info (std::string_view message)=0 |
| | Log an informational message.
|
| |
| virtual void | warning (std::string_view message)=0 |
| | Log a warning message.
|
| |
| virtual void | error (std::string_view message)=0 |
| | Log an error message.
|
| |
| virtual void | debug (std::string_view message)=0 |
| | Log a debug message.
|
| |
| virtual | ~monitoring_interface ()=default |
| |
| virtual void | record_counter (std::string_view name, int64_t value)=0 |
| | Record a counter metric.
|
| |
| virtual void | record_gauge (std::string_view name, double value)=0 |
| | Record a gauge metric.
|
| |
| virtual void | record_histogram (std::string_view name, double value)=0 |
| | Record a histogram metric.
|
| |
| | io_context_thread_manager (size_t worker_count=0) |
| | Construct a manager with specified worker count.
|
| |
| | ~io_context_thread_manager () |
| | Destructor - stops the manager if running.
|
| |
| | io_context_thread_manager (const io_context_thread_manager &)=delete |
| |
| io_context_thread_manager & | operator= (const io_context_thread_manager &)=delete |
| |
| | io_context_thread_manager (io_context_thread_manager &&) noexcept |
| |
| io_context_thread_manager & | operator= (io_context_thread_manager &&) noexcept |
| |
| bool | start () |
| | Start the io_context worker threads.
|
| |
| void | stop () |
| | Stop the io_context and join worker threads.
|
| |
| bool | is_running () const noexcept |
| | Check if the manager is running.
|
| |
| asio::io_context & | get_io_context () noexcept |
| | Get the managed io_context.
|
| |
| size_t | worker_count () const noexcept |
| | Get the number of worker threads.
|
| |
| static network_context & | instance () |
| | Get the singleton instance.
|
| |
| void | set_thread_pool (std::shared_ptr< integration::thread_pool_interface > pool) |
| | Set custom thread pool.
|
| |
| std::shared_ptr< integration::thread_pool_interface > | get_thread_pool () |
| | Get current thread pool.
|
| |
| void | set_logger (std::shared_ptr< integration::logger_interface > logger) |
| | Set custom logger.
|
| |
| std::shared_ptr< integration::logger_interface > | get_logger () |
| | Get current logger.
|
| |
| void | set_monitoring (std::shared_ptr< integration::monitoring_interface > monitoring) |
| | Set custom monitoring system.
|
| |
| std::shared_ptr< integration::monitoring_interface > | get_monitoring () |
| | Get current monitoring system.
|
| |
| integration::io_context_thread_manager & | get_io_context_manager () |
| | Get the io_context thread manager.
|
| |
| void | reset () |
| | Reset all resources to defaults.
|
| |
| | network_context () |
| |
| | ~network_context ()=default |
| |
| | network_context (const network_context &)=delete |
| |
| network_context & | operator= (const network_context &)=delete |
| |
| | connection_pool (size_t max_connections=10, std::chrono::seconds idle_timeout=std::chrono::seconds(60)) |
| | Construct a connection pool.
|
| |
| | ~connection_pool () |
| | Destructor - closes all pooled connections.
|
| |
| | connection_pool (const connection_pool &)=delete |
| |
| connection_pool & | operator= (const connection_pool &)=delete |
| |
| size_t | size () const noexcept |
| | Get current pool size.
|
| |
| size_t | max_size () const noexcept |
| | Get maximum pool size.
|
| |
| void | clear () |
| | Clear all pooled connections.
|
| |
| constexpr std::string_view | kcenon::network::core::to_string (connection_state state) noexcept |
| | Convert connection state to string.
|
| |
| | secure_messaging_client (std::string_view client_id, const ssl_config &config={}) |
| | Construct a secure client with SSL configuration.
|
| |
| virtual | ~secure_messaging_client () noexcept |
| | Destructor.
|
| |
| | secure_messaging_client (const secure_messaging_client &)=delete |
| |
| secure_messaging_client & | operator= (const secure_messaging_client &)=delete |
| |
| | secure_messaging_client (secure_messaging_client &&) noexcept |
| |
| secure_messaging_client & | operator= (secure_messaging_client &&) noexcept |
| |
| bool | start_client (std::string_view host, uint16_t port) |
| | Start the client and connect securely.
|
| |
| void | stop_client () |
| | Stop the client.
|
| |
| bool | wait_for_stop (std::chrono::milliseconds timeout=std::chrono::milliseconds(5000)) |
| | Wait for the client to stop.
|
| |
| bool | send_packet (std::span< const uint8_t > data) |
| | Send encrypted data.
|
| |
| bool | send_packet (std::string_view data) |
| | Send encrypted string data.
|
| |
| bool | is_connected () const noexcept |
| | Check if the client is connected and TLS handshake completed.
|
| |
| bool | is_running () const noexcept |
| | Check if the client is running.
|
| |
| connection_state | get_state () const noexcept |
| | Get the current connection state.
|
| |
| std::string_view | client_id () const noexcept |
| | Get the client identifier.
|
| |
| void | set_connection_callback (connection_callback callback) |
| | Set connection callback (called after TLS handshake)
|
| |
| void | set_disconnection_callback (disconnection_callback callback) |
| | Set disconnection callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| void | set_data_callback (data_callback callback) |
| | Set data received callback.
|
| |
| std::optional< std::string > | get_peer_certificate_subject () const |
| | Get peer certificate information.
|
| |
| std::string | get_protocol_version () const |
| | Get the negotiated TLS protocol version.
|
| |
| std::string | get_cipher_suite () const |
| | Get the negotiated cipher suite.
|
| |
| | secure_messaging_server (std::string_view server_id, const ssl_config &config) |
| | Construct a secure server with SSL configuration.
|
| |
| virtual | ~secure_messaging_server () noexcept |
| | Destructor.
|
| |
| | secure_messaging_server (const secure_messaging_server &)=delete |
| |
| secure_messaging_server & | operator= (const secure_messaging_server &)=delete |
| |
| | secure_messaging_server (secure_messaging_server &&) noexcept |
| |
| secure_messaging_server & | operator= (secure_messaging_server &&) noexcept |
| |
| bool | start_server (uint16_t port, int backlog=128) |
| | Start the secure server.
|
| |
| bool | start_server (std::string_view address, uint16_t port, int backlog=128) |
| | Start the secure server on a specific interface.
|
| |
| void | stop_server () |
| | Stop the server.
|
| |
| bool | wait_for_stop (std::chrono::milliseconds timeout=std::chrono::milliseconds(5000)) |
| | Wait for the server to stop.
|
| |
| bool | send_to (std::string_view session_id, std::span< const uint8_t > data) |
| | Send encrypted data to a specific client.
|
| |
| void | broadcast (std::span< const uint8_t > data) |
| | Broadcast encrypted data to all connected clients.
|
| |
| void | disconnect (std::string_view session_id) |
| | Disconnect a specific client.
|
| |
| bool | is_running () const noexcept |
| | Check if the server is running.
|
| |
| size_t | client_count () const noexcept |
| | Get the number of connected clients.
|
| |
| std::string_view | server_id () const noexcept |
| | Get the server identifier.
|
| |
| void | set_client_connected_callback (client_connected_callback callback) |
| | Set client connected callback.
|
| |
| void | set_client_disconnected_callback (client_disconnected_callback callback) |
| | Set client disconnected callback.
|
| |
| void | set_client_data_callback (client_data_callback callback) |
| | Set client data callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| std::optional< std::string > | get_peer_certificate_subject (std::string_view session_id) const |
| | Get peer certificate for a session.
|
| |
| | secure_messaging_udp_client (std::string_view client_id, const ssl_config &config={}) |
| | Construct a secure UDP client with DTLS configuration.
|
| |
| virtual | ~secure_messaging_udp_client () noexcept |
| | Destructor.
|
| |
| | secure_messaging_udp_client (const secure_messaging_udp_client &)=delete |
| |
| secure_messaging_udp_client & | operator= (const secure_messaging_udp_client &)=delete |
| |
| | secure_messaging_udp_client (secure_messaging_udp_client &&) noexcept |
| |
| secure_messaging_udp_client & | operator= (secure_messaging_udp_client &&) noexcept |
| |
| bool | start_client (std::string_view remote_host, uint16_t remote_port) |
| | Start the client and perform DTLS handshake.
|
| |
| void | stop_client () |
| | Stop the client.
|
| |
| bool | send_packet (std::span< const uint8_t > data) |
| | Send encrypted datagram.
|
| |
| bool | is_connected () const noexcept |
| | Check if the client is connected and DTLS handshake completed.
|
| |
| bool | is_running () const noexcept |
| | Check if the client is running.
|
| |
| std::string_view | client_id () const noexcept |
| | Get the client identifier.
|
| |
| void | set_connection_callback (connection_callback callback) |
| | Set connection callback (called after DTLS handshake)
|
| |
| void | set_disconnection_callback (disconnection_callback callback) |
| | Set disconnection callback.
|
| |
| void | set_data_callback (data_callback callback) |
| | Set data received callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |
| | secure_messaging_udp_server (std::string_view server_id, const ssl_config &config) |
| | Construct a secure UDP server with DTLS configuration.
|
| |
| virtual | ~secure_messaging_udp_server () noexcept |
| | Destructor.
|
| |
| | secure_messaging_udp_server (const secure_messaging_udp_server &)=delete |
| |
| secure_messaging_udp_server & | operator= (const secure_messaging_udp_server &)=delete |
| |
| | secure_messaging_udp_server (secure_messaging_udp_server &&) noexcept |
| |
| secure_messaging_udp_server & | operator= (secure_messaging_udp_server &&) noexcept |
| |
| bool | start_server (uint16_t port) |
| | Start the secure UDP server.
|
| |
| bool | start_server (std::string_view address, uint16_t port) |
| | Start the secure UDP server on a specific interface.
|
| |
| void | stop_server () |
| | Stop the server.
|
| |
| bool | send_to (std::string_view session_id, std::span< const uint8_t > data) |
| | Send encrypted datagram to a specific session.
|
| |
| bool | is_running () const noexcept |
| | Check if the server is running.
|
| |
| size_t | session_count () const noexcept |
| | Get the number of active DTLS sessions.
|
| |
| std::string_view | server_id () const noexcept |
| | Get the server identifier.
|
| |
| void | set_session_connected_callback (std::function< void(const std::string &)> callback) |
| | Set session connected callback.
|
| |
| void | set_session_disconnected_callback (std::function< void(const std::string &)> callback) |
| | Set session disconnected callback.
|
| |
| void | set_data_callback (dtls_data_callback callback) |
| | Set data received callback.
|
| |
| void | set_error_callback (error_callback callback) |
| | Set error callback.
|
| |