18 class messaging_quic_client;
93 auto set_client_cert(std::string_view cert_path, std::string_view key_path) -> void;
111 [[nodiscard]]
auto is_running() const ->
bool override;
118 [[nodiscard]] auto
start(std::string_view host, uint16_t port) ->
VoidResult override;
120 [[nodiscard]] auto
send(std::vector<uint8_t>&& data) ->
VoidResult override;
121 [[nodiscard]] auto
is_connected() const ->
bool override;
123 auto
set_observer(std::shared_ptr<interfaces::connection_observer> observer) ->
void override;
137 std::shared_ptr<core::messaging_quic_client>
client_;
148 std::shared_ptr<interfaces::connection_observer>
observer_;
Unified interface for all protocol client implementations.
std::function< void(const std::vector< uint8_t > &)> receive_callback_t
Callback type for received data.
std::function< void()> connected_callback_t
Callback type for connection established.
std::function< void(std::error_code)> error_callback_t
Callback type for errors.
std::function< void()> disconnected_callback_t
Callback type for disconnection.
Adapter that wraps messaging_quic_client to implement i_protocol_client.
auto is_connected() const -> bool override
Checks if the client is connected to the server.
quic_client_adapter & operator=(quic_client_adapter &&)=delete
receive_callback_t receive_callback_
std::shared_ptr< interfaces::connection_observer > observer_
auto set_max_idle_timeout(uint64_t timeout_ms) -> void
Sets max idle timeout in milliseconds.
uint64_t max_idle_timeout_ms_
auto set_connected_callback(connected_callback_t callback) -> void override
Sets the callback for connection established.
auto set_verify_server(bool verify) -> void
Sets whether to verify server certificate.
error_callback_t error_callback_
quic_client_adapter(std::string_view client_id)
Constructs an adapter with a unique client ID.
auto wait_for_stop() -> void override
Blocks until the component has stopped.
auto stop() -> VoidResult override
Stops the client and closes the connection.
quic_client_adapter & operator=(const quic_client_adapter &)=delete
disconnected_callback_t disconnected_callback_
auto set_client_cert(std::string_view cert_path, std::string_view key_path) -> void
Sets client certificate path for mutual TLS.
auto set_receive_callback(receive_callback_t callback) -> void override
Sets the callback for received data.
auto is_running() const -> bool override
Checks if the component is currently running.
auto setup_internal_callbacks() -> void
Sets up internal callbacks to bridge QUIC callbacks to i_protocol_client callbacks.
connected_callback_t connected_callback_
auto set_observer(std::shared_ptr< interfaces::connection_observer > observer) -> void override
Sets the connection observer for unified event handling.
auto set_alpn_protocols(const std::vector< std::string > &protocols) -> void
Sets the ALPN protocols for negotiation.
quic_client_adapter(quic_client_adapter &&)=delete
auto set_disconnected_callback(disconnected_callback_t callback) -> void override
Sets the callback for disconnection.
std::mutex callbacks_mutex_
std::vector< std::string > alpn_protocols_
std::optional< std::string > ca_cert_path_
std::optional< std::string > client_key_path_
quic_client_adapter(const quic_client_adapter &)=delete
std::shared_ptr< core::messaging_quic_client > client_
~quic_client_adapter() override
Destructor ensures proper cleanup.
std::optional< std::string > client_cert_path_
auto set_ca_cert_path(std::string_view path) -> void
Sets CA certificate path for server verification.
auto set_error_callback(error_callback_t callback) -> void override
Sets the callback for errors.
auto start(std::string_view host, uint16_t port) -> VoidResult override
Starts the client and connects to the specified server.
Protocol-specific client interface extending i_client.