|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
Simplified facade for creating WebSocket clients and servers. More...
#include <websocket_facade.h>

Classes | |
| struct | client_config |
| Configuration for creating a WebSocket client. More... | |
| struct | server_config |
| Configuration for creating a WebSocket server. More... | |
Public Member Functions | |
| auto | create_client (const client_config &config) const -> Result< std::shared_ptr< interfaces::i_protocol_client > > |
| Creates a WebSocket client with the specified configuration. | |
| auto | create_server (const server_config &config) const -> Result< std::shared_ptr< interfaces::i_protocol_server > > |
| Creates a WebSocket server with the specified configuration. | |
Static Private Member Functions | |
| static auto | generate_client_id () -> std::string |
| Generates a unique client ID. | |
| static auto | generate_server_id () -> std::string |
| Generates a unique server ID. | |
| static auto | validate_client_config (const client_config &config) -> VoidResult |
| Validates client configuration. | |
| static auto | validate_server_config (const server_config &config) -> VoidResult |
| Validates server configuration. | |
Simplified facade for creating WebSocket clients and servers.
This facade provides a simple, unified API for creating WebSocket protocol clients and servers, hiding the complexity of underlying implementation from the user.
All methods are thread-safe and can be called concurrently.
Definition at line 76 of file websocket_facade.h.
|
nodiscard |
Creates a WebSocket client with the specified configuration.
| config | Client configuration. |
Definition at line 68 of file websocket_facade.cpp.
References config, kcenon::network::error, and kcenon::network::ok().
Referenced by run_client().


|
nodiscard |
Creates a WebSocket server with the specified configuration.
| config | Server configuration. |
Definition at line 87 of file websocket_facade.cpp.
References config, kcenon::network::error, and kcenon::network::ok().
Referenced by run_server().


|
staticnodiscardprivate |
Generates a unique client ID.
Definition at line 27 of file websocket_facade.cpp.
|
staticnodiscardprivate |
Generates a unique server ID.
Definition at line 35 of file websocket_facade.cpp.
|
staticprivate |
Validates client configuration.
Definition at line 43 of file websocket_facade.cpp.
References config, kcenon::network::error_void(), and kcenon::network::ok().

|
staticprivate |
Validates server configuration.
Definition at line 53 of file websocket_facade.cpp.
References config, kcenon::network::error_void(), and kcenon::network::ok().
