13#include <condition_variable>
50 std::string_view connection_id);
67 [[nodiscard]]
auto send(std::span<const std::byte> data) ->
VoidResult override;
68 [[nodiscard]]
auto send(std::vector<uint8_t>&& data) ->
VoidResult override;
69 [[nodiscard]]
auto is_connected() const noexcept ->
bool override;
70 [[nodiscard]] auto
id() const noexcept -> std::string_view override;
80 auto
close() noexcept ->
void override;
83 auto
set_timeout(std::chrono::milliseconds timeout) ->
void override;
84 [[nodiscard]] auto
is_connecting() const noexcept ->
bool override;
111 auto
parse_url(std::string_view url) -> std::pair<std::
string, uint16_t>;
Adapter that wraps QUIC connection to implement i_connection.
std::condition_variable stop_cv_
endpoint_info remote_endpoint_
quic_connection_adapter & operator=(const quic_connection_adapter &)=delete
endpoint_info local_endpoint_
quic_connection_adapter(quic_connection_adapter &&)=delete
auto local_endpoint() const noexcept -> endpoint_info override
Gets the local endpoint information.
auto connect(const endpoint_info &endpoint) -> VoidResult override
Connects to a remote endpoint using host/port.
quic_connection_adapter(const quic_connection_adapter &)=delete
protocol::quic::quic_config config_
auto is_connected() const noexcept -> bool override
Checks if the transport is currently connected.
std::string connection_id_
std::mutex callbacks_mutex_
std::deque< std::vector< uint8_t > > send_queue_
std::mutex send_queue_mutex_
auto set_timeout(std::chrono::milliseconds timeout) -> void override
Sets the connection timeout.
auto close() noexcept -> void override
Closes the connection gracefully.
connection_options options_
~quic_connection_adapter() override
Destructor ensures proper cleanup.
auto parse_url(std::string_view url) -> std::pair< std::string, uint16_t >
Parse URL to extract host and port.
auto remote_endpoint() const noexcept -> endpoint_info override
Gets the remote endpoint information.
auto is_connecting() const noexcept -> bool override
Checks if the connection is in the process of connecting.
std::atomic< bool > is_connecting_
std::unique_ptr< protocols::quic::connection > quic_conn_
quic_connection_adapter & operator=(quic_connection_adapter &&)=delete
std::atomic< bool > stop_requested_
auto io_thread_func() -> void
I/O processing thread function.
auto set_options(connection_options options) -> void override
Sets connection options.
std::atomic< bool > running_
auto wait_for_stop() -> void override
Blocks until the component has stopped.
connection_callbacks callbacks_
auto handle_state_change() -> void
Handle connection state changes.
auto process_incoming() -> void
Process incoming packets.
auto process_outgoing() -> void
Process outgoing packets.
auto set_callbacks(connection_callbacks callbacks) -> void override
Sets all connection callbacks at once.
auto send(std::span< const std::byte > data) -> VoidResult override
Sends raw data to the remote endpoint.
std::mutex endpoint_mutex_
quic_connection_adapter(const protocol::quic::quic_config &config, std::string_view connection_id)
Constructs an adapter with QUIC configuration.
std::atomic< bool > is_connected_
Core interface for active network connections.
Core interface for active network connections.
QUIC protocol connection factory and configuration.
Configuration options for QUIC connections.
Callback functions for connection events.
Configuration options for connections.
Network endpoint information (host/port or URL)