14#include <system_error>
61 std::vector<uint8_t> ticket_data,
62 uint32_t lifetime_hint,
63 uint32_t max_early_data)>;
85 [[nodiscard]]
virtual auto start(std::string_view host, uint16_t port) ->
VoidResult = 0;
148 std::vector<uint8_t>&& data,
172 [[nodiscard]] virtual auto
alpn_protocol() const -> std::optional<std::
string> = 0;
Base interface for all network components.
Interface for QUIC client components.
std::function< void(bool accepted)> early_data_accepted_callback_t
Callback type for early data acceptance notification.
virtual auto set_error_callback(error_callback_t callback) -> void=0
Sets the callback for errors.
virtual auto alpn_protocol() const -> std::optional< std::string >=0
Gets the negotiated ALPN protocol.
virtual auto create_stream() -> Result< uint64_t >=0
Creates a new bidirectional stream.
virtual auto set_session_ticket_callback(session_ticket_callback_t callback) -> void=0
Sets the callback for session tickets (for 0-RTT).
virtual auto send_on_stream(uint64_t stream_id, std::vector< uint8_t > &&data, bool fin=false) -> VoidResult=0
Sends data on a specific stream.
std::function< void()> connected_callback_t
Callback type for connection established.
virtual auto is_connected() const -> bool=0
Checks if the client is connected.
virtual auto set_early_data_callback(early_data_callback_t callback) -> void=0
Sets the callback for early data production.
std::function< std::vector< uint8_t >()> early_data_callback_t
Callback type for early data production.
virtual auto is_handshake_complete() const -> bool=0
Checks if TLS handshake is complete.
std::function< void()> disconnected_callback_t
Callback type for disconnection.
std::function< void(const std::vector< uint8_t > &)> receive_callback_t
Callback type for received data on default stream.
std::function< void( std::vector< uint8_t > ticket_data, uint32_t lifetime_hint, uint32_t max_early_data)> session_ticket_callback_t
Callback type for session ticket received (for 0-RTT resumption)
virtual auto set_alpn_protocols(const std::vector< std::string > &protocols) -> void=0
Sets the ALPN protocols for negotiation.
virtual auto set_disconnected_callback(disconnected_callback_t callback) -> void=0
Sets the callback for disconnection.
std::function< void(uint64_t, const std::vector< uint8_t > &, bool)> stream_callback_t
Callback type for stream data (stream_id, data, is_fin)
virtual auto send(std::vector< uint8_t > &&data) -> VoidResult=0
Sends data on the default stream (stream 0).
virtual auto close_stream(uint64_t stream_id) -> VoidResult=0
Closes a stream.
virtual auto start(std::string_view host, uint16_t port) -> VoidResult=0
Starts the QUIC client connecting to the specified server.
virtual auto is_early_data_accepted() const -> bool=0
Checks if early data was accepted by the server.
virtual auto set_receive_callback(receive_callback_t callback) -> void=0
Sets the callback for received data on default stream.
virtual auto stop() -> VoidResult=0
Stops the QUIC client.
virtual auto set_connected_callback(connected_callback_t callback) -> void=0
Sets the callback for connection established.
virtual auto set_stream_callback(stream_callback_t callback) -> void=0
Sets the callback for stream data.
std::function< void(std::error_code)> error_callback_t
Callback type for errors.
virtual auto set_early_data_accepted_callback(early_data_accepted_callback_t callback) -> void=0
Sets the callback for early data acceptance notification.
virtual auto create_unidirectional_stream() -> Result< uint64_t >=0
Creates a new unidirectional stream.
Base interface for all network components.
Network-specific error and result type definitions.