54 [[nodiscard]]
auto send(std::span<const std::byte> data) ->
VoidResult override;
55 [[nodiscard]]
auto send(std::vector<uint8_t>&& data) ->
VoidResult override;
56 [[nodiscard]]
auto is_connected() const noexcept ->
bool override;
57 [[nodiscard]] auto
id() const noexcept -> std::string_view override;
67 auto
close() noexcept ->
void override;
70 auto
set_timeout(std::chrono::milliseconds timeout) ->
void override;
71 [[nodiscard]] auto
is_connecting() const noexcept ->
bool override;
81 std::shared_ptr<core::tcp_client>
client_;
Adapter that wraps unified_messaging_client to implement i_connection.
tcp_connection_adapter & operator=(tcp_connection_adapter &&)=delete
std::mutex callbacks_mutex_
endpoint_info local_endpoint_
tcp_connection_adapter & operator=(const tcp_connection_adapter &)=delete
auto set_callbacks(connection_callbacks callbacks) -> void override
Sets all connection callbacks at once.
std::string connection_id_
tcp_connection_adapter(std::string_view connection_id)
Constructs an adapter with a unique connection ID.
auto set_options(connection_options options) -> void override
Sets connection options.
connection_callbacks callbacks_
auto setup_internal_callbacks() -> void
Sets up internal callbacks to bridge to unified callbacks.
auto connect(const endpoint_info &endpoint) -> VoidResult override
Connects to a remote endpoint using host/port.
auto close() noexcept -> void override
Closes the connection gracefully.
auto is_connecting() const noexcept -> bool override
Checks if the connection is in the process of connecting.
tcp_connection_adapter(const tcp_connection_adapter &)=delete
auto is_connected() const noexcept -> bool override
Checks if the transport is currently connected.
connection_options options_
std::atomic< bool > is_connecting_
std::mutex endpoint_mutex_
std::shared_ptr< core::tcp_client > client_
auto send(std::span< const std::byte > data) -> VoidResult override
Sends raw data to the remote endpoint.
endpoint_info remote_endpoint_
auto set_timeout(std::chrono::milliseconds timeout) -> void override
Sets the connection timeout.
~tcp_connection_adapter() override
Destructor ensures proper cleanup.
auto remote_endpoint() const noexcept -> endpoint_info override
Gets the remote endpoint information.
tcp_connection_adapter(tcp_connection_adapter &&)=delete
auto wait_for_stop() -> void override
Blocks until the component has stopped.
auto local_endpoint() const noexcept -> endpoint_info override
Gets the local endpoint information.
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)