|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
Interface for QUIC client components. More...
#include <i_quic_client.h>


Public Types | |
| using | receive_callback_t = std::function<void(const std::vector<uint8_t>&)> |
| Callback type for received data on default stream. | |
| using | stream_callback_t = std::function<void(uint64_t, const std::vector<uint8_t>&, bool)> |
| Callback type for stream data (stream_id, data, is_fin) | |
| using | connected_callback_t = std::function<void()> |
| Callback type for connection established. | |
| using | disconnected_callback_t = std::function<void()> |
| Callback type for disconnection. | |
| using | error_callback_t = std::function<void(std::error_code)> |
| Callback type for errors. | |
| using | session_ticket_callback_t |
| Callback type for session ticket received (for 0-RTT resumption) | |
| using | early_data_callback_t = std::function<std::vector<uint8_t>()> |
| Callback type for early data production. | |
| using | early_data_accepted_callback_t = std::function<void(bool accepted)> |
| Callback type for early data acceptance notification. | |
Public Member Functions | |
| virtual auto | start (std::string_view host, uint16_t port) -> VoidResult=0 |
| Starts the QUIC client connecting to the specified server. | |
| virtual auto | stop () -> VoidResult=0 |
| Stops the QUIC client. | |
| virtual auto | is_connected () const -> bool=0 |
| Checks if the client is connected. | |
| virtual auto | is_handshake_complete () const -> bool=0 |
| Checks if TLS handshake is complete. | |
| virtual auto | send (std::vector< uint8_t > &&data) -> VoidResult=0 |
| Sends data on the default stream (stream 0). | |
| virtual auto | create_stream () -> Result< uint64_t >=0 |
| Creates a new bidirectional stream. | |
| virtual auto | create_unidirectional_stream () -> Result< uint64_t >=0 |
| Creates a new unidirectional stream. | |
| 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. | |
| virtual auto | close_stream (uint64_t stream_id) -> VoidResult=0 |
| Closes a stream. | |
| virtual auto | set_alpn_protocols (const std::vector< std::string > &protocols) -> void=0 |
| Sets the ALPN protocols for negotiation. | |
| virtual auto | alpn_protocol () const -> std::optional< std::string >=0 |
| Gets the negotiated ALPN protocol. | |
| 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 | set_stream_callback (stream_callback_t callback) -> void=0 |
| Sets the callback for stream data. | |
| virtual auto | set_connected_callback (connected_callback_t callback) -> void=0 |
| Sets the callback for connection established. | |
| virtual auto | set_disconnected_callback (disconnected_callback_t callback) -> void=0 |
| Sets the callback for disconnection. | |
| virtual auto | set_error_callback (error_callback_t callback) -> void=0 |
| Sets the callback for errors. | |
| virtual auto | set_session_ticket_callback (session_ticket_callback_t callback) -> void=0 |
| Sets the callback for session tickets (for 0-RTT). | |
| virtual auto | set_early_data_callback (early_data_callback_t callback) -> void=0 |
| Sets the callback for early data production. | |
| virtual auto | set_early_data_accepted_callback (early_data_accepted_callback_t callback) -> void=0 |
| Sets the callback for early data acceptance notification. | |
Public Member Functions inherited from kcenon::network::interfaces::i_network_component | |
| virtual | ~i_network_component ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| i_network_component (const i_network_component &)=delete | |
| i_network_component & | operator= (const i_network_component &)=delete |
| i_network_component (i_network_component &&)=delete | |
| i_network_component & | operator= (i_network_component &&)=delete |
Additional Inherited Members | |
Protected Member Functions inherited from kcenon::network::interfaces::i_network_component | |
| i_network_component ()=default | |
| Default constructor (only for derived classes) | |
| virtual auto | is_running () const -> bool=0 |
| Checks if the component is currently running. | |
| virtual auto | wait_for_stop () -> void=0 |
| Blocks until the component has stopped. | |
Interface for QUIC client components.
This interface extends i_network_component with QUIC-specific operations such as multi-stream support and 0-RTT session resumption.
Definition at line 41 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::connected_callback_t = std::function<void()> |
Callback type for connection established.
Definition at line 51 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::disconnected_callback_t = std::function<void()> |
Callback type for disconnection.
Definition at line 54 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::early_data_accepted_callback_t = std::function<void(bool accepted)> |
Callback type for early data acceptance notification.
Definition at line 69 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::early_data_callback_t = std::function<std::vector<uint8_t>()> |
Callback type for early data production.
Definition at line 66 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::error_callback_t = std::function<void(std::error_code)> |
Callback type for errors.
Definition at line 57 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::receive_callback_t = std::function<void(const std::vector<uint8_t>&)> |
Callback type for received data on default stream.
Definition at line 45 of file i_quic_client.h.
Callback type for session ticket received (for 0-RTT resumption)
Definition at line 60 of file i_quic_client.h.
| using kcenon::network::interfaces::i_quic_client::stream_callback_t = std::function<void(uint64_t, const std::vector<uint8_t>&, bool)> |
Callback type for stream data (stream_id, data, is_fin)
Definition at line 48 of file i_quic_client.h.
|
nodiscardpure virtual |
Gets the negotiated ALPN protocol.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Closes a stream.
| stream_id | The stream to close. |
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Creates a new bidirectional stream.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Creates a new unidirectional stream.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Checks if the client is connected.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Checks if early data was accepted by the server.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Checks if TLS handshake is complete.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Sends data on the default stream (stream 0).
| data | The data to send. |
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Sends data on a specific stream.
| stream_id | The target stream ID. |
| data | The data to send. |
| fin | True if this is the final data on the stream. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the ALPN protocols for negotiation.
| protocols | List of protocol identifiers (e.g., {"h3", "hq-29"}). |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for connection established.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for disconnection.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for early data acceptance notification.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for early data production.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for errors.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for received data on default stream.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for session tickets (for 0-RTT).
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
pure virtual |
Sets the callback for stream data.
| callback | The callback function. |
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Starts the QUIC client connecting to the specified server.
| host | The server hostname or IP address. |
| port | The server port number. |
Thread-safe. Only one start operation can succeed at a time.
Implemented in kcenon::network::core::messaging_quic_client.
|
nodiscardpure virtual |
Stops the QUIC client.
Thread-safe.
Implemented in kcenon::network::core::messaging_quic_client.