60 [[nodiscard]]
auto send(std::span<const std::byte> data) ->
VoidResult override;
61 [[nodiscard]]
auto send(std::vector<uint8_t>&& data) ->
VoidResult override;
62 [[nodiscard]]
auto is_connected() const noexcept ->
bool override;
63 [[nodiscard]] auto
id() const noexcept -> std::string_view override;
73 auto
close() noexcept ->
void override;
76 auto
set_timeout(std::chrono::milliseconds timeout) ->
void override;
77 [[nodiscard]] auto
is_connecting() const noexcept ->
bool override;
88 auto
set_path(std::string_view path) ->
void;
109 bool& secure) ->
bool;
112 std::shared_ptr<core::messaging_ws_client>
client_;
Adapter that wraps messaging_ws_client to implement i_connection.
static auto parse_websocket_url(std::string_view url, std::string &host, uint16_t &port, std::string &path, bool &secure) -> bool
Parses a WebSocket URL into components.
auto set_timeout(std::chrono::milliseconds timeout) -> void override
Sets the connection timeout.
auto send(std::span< const std::byte > data) -> VoidResult override
Sends raw data to the remote endpoint.
auto set_callbacks(connection_callbacks callbacks) -> void override
Sets all connection callbacks at once.
connection_options options_
auto connect(const endpoint_info &endpoint) -> VoidResult override
Connects to a remote endpoint using host/port.
auto setup_internal_callbacks() -> void
Sets up internal callbacks to bridge to unified callbacks.
auto set_path(std::string_view path) -> void
Sets the WebSocket path for endpoint-based connections.
auto wait_for_stop() -> void override
Blocks until the component has stopped.
std::mutex endpoint_mutex_
ws_connection_adapter(const ws_connection_adapter &)=delete
std::atomic< bool > is_connecting_
endpoint_info remote_endpoint_
auto close() noexcept -> void override
Closes the connection gracefully.
auto set_options(connection_options options) -> void override
Sets connection options.
std::mutex callbacks_mutex_
auto remote_endpoint() const noexcept -> endpoint_info override
Gets the remote endpoint information.
ws_connection_adapter & operator=(ws_connection_adapter &&)=delete
endpoint_info local_endpoint_
ws_connection_adapter(std::string_view connection_id)
Constructs an adapter with a unique connection ID.
std::shared_ptr< core::messaging_ws_client > client_
std::string connection_id_
auto local_endpoint() const noexcept -> endpoint_info override
Gets the local endpoint information.
auto is_connecting() const noexcept -> bool override
Checks if the connection is in the process of connecting.
~ws_connection_adapter() override
Destructor ensures proper cleanup.
ws_connection_adapter(ws_connection_adapter &&)=delete
connection_callbacks callbacks_
ws_connection_adapter & operator=(const ws_connection_adapter &)=delete
auto is_connected() const noexcept -> bool override
Checks if the transport is currently connected.
Core interface for active network connections.
Core interface for active network connections.
Callback functions for connection events.
Configuration options for connections.
Network endpoint information (host/port or URL)