Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::interfaces::i_quic_server Interface Referenceabstract

Interface for QUIC server components. More...

#include <i_quic_server.h>

Inheritance diagram for kcenon::network::interfaces::i_quic_server:
Inheritance graph
Collaboration diagram for kcenon::network::interfaces::i_quic_server:
Collaboration graph

Public Types

using connection_callback_t = std::function<void(std::shared_ptr<i_quic_session>)>
 Callback type for new connections.
 
using disconnection_callback_t = std::function<void(std::string_view)>
 Callback type for disconnections (session_id)
 
using receive_callback_t = std::function<void(std::string_view, const std::vector<uint8_t>&)>
 Callback type for default stream data (session_id, data)
 
using stream_callback_t
 Callback type for stream data (session_id, stream_id, data, is_fin)
 
using error_callback_t = std::function<void(std::string_view, std::error_code)>
 Callback type for errors (session_id, error)
 

Public Member Functions

virtual auto start (uint16_t port) -> VoidResult=0
 Starts the QUIC server on the specified port.
 
virtual auto stop () -> VoidResult=0
 Stops the QUIC server.
 
virtual auto connection_count () const -> size_t=0
 Gets the number of active QUIC connections.
 
virtual auto set_connection_callback (connection_callback_t callback) -> void=0
 Sets the callback for new connections.
 
virtual auto set_disconnection_callback (disconnection_callback_t callback) -> void=0
 Sets the callback for disconnections.
 
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_error_callback (error_callback_t callback) -> void=0
 Sets the callback for errors.
 
- 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_componentoperator= (const i_network_component &)=delete
 
 i_network_component (i_network_component &&)=delete
 
i_network_componentoperator= (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.
 

Detailed Description

Interface for QUIC server components.

This interface extends i_network_component with QUIC server-specific operations such as multi-stream support and session management.

Key Features

  • Multiple concurrent streams per connection
  • Built-in TLS 1.3 integration
  • 0-RTT early data support

Thread Safety

  • All public methods must be thread-safe
  • Callbacks may be invoked from I/O threads
See also
i_server

Definition at line 84 of file i_quic_server.h.

Member Typedef Documentation

◆ connection_callback_t

Callback type for new connections.

Definition at line 88 of file i_quic_server.h.

◆ disconnection_callback_t

using kcenon::network::interfaces::i_quic_server::disconnection_callback_t = std::function<void(std::string_view)>

Callback type for disconnections (session_id)

Definition at line 91 of file i_quic_server.h.

◆ error_callback_t

using kcenon::network::interfaces::i_quic_server::error_callback_t = std::function<void(std::string_view, std::error_code)>

Callback type for errors (session_id, error)

Definition at line 104 of file i_quic_server.h.

◆ receive_callback_t

using kcenon::network::interfaces::i_quic_server::receive_callback_t = std::function<void(std::string_view, const std::vector<uint8_t>&)>

Callback type for default stream data (session_id, data)

Definition at line 94 of file i_quic_server.h.

◆ stream_callback_t

Initial value:
std::function<void(
std::string_view,
uint64_t,
const std::vector<uint8_t>&,
bool)>

Callback type for stream data (session_id, stream_id, data, is_fin)

Definition at line 97 of file i_quic_server.h.

Member Function Documentation

◆ connection_count()

virtual auto kcenon::network::interfaces::i_quic_server::connection_count ( ) const -> size_t
nodiscardpure virtual

Gets the number of active QUIC connections.

Returns
The count of currently connected clients.

Implemented in kcenon::network::core::messaging_quic_server.

◆ set_connection_callback()

virtual auto kcenon::network::interfaces::i_quic_server::set_connection_callback ( connection_callback_t callback) -> void
pure virtual

Sets the callback for new connections.

Parameters
callbackThe callback function.

Implemented in kcenon::network::core::messaging_quic_server.

◆ set_disconnection_callback()

virtual auto kcenon::network::interfaces::i_quic_server::set_disconnection_callback ( disconnection_callback_t callback) -> void
pure virtual

Sets the callback for disconnections.

Parameters
callbackThe callback function.

Implemented in kcenon::network::core::messaging_quic_server.

◆ set_error_callback()

virtual auto kcenon::network::interfaces::i_quic_server::set_error_callback ( error_callback_t callback) -> void
pure virtual

Sets the callback for errors.

Parameters
callbackThe callback function.

Implemented in kcenon::network::core::messaging_quic_server.

◆ set_receive_callback()

virtual auto kcenon::network::interfaces::i_quic_server::set_receive_callback ( receive_callback_t callback) -> void
pure virtual

Sets the callback for received data on default stream.

Parameters
callbackThe callback function.

Implemented in kcenon::network::core::messaging_quic_server.

◆ set_stream_callback()

virtual auto kcenon::network::interfaces::i_quic_server::set_stream_callback ( stream_callback_t callback) -> void
pure virtual

Sets the callback for stream data.

Parameters
callbackThe callback function.

Implemented in kcenon::network::core::messaging_quic_server.

◆ start()

virtual auto kcenon::network::interfaces::i_quic_server::start ( uint16_t port) -> VoidResult
nodiscardpure virtual

Starts the QUIC server on the specified port.

Parameters
portThe port number to listen on.
Returns
VoidResult indicating success or failure.

Behavior

  • Binds to the specified port (UDP)
  • Begins accepting QUIC connections

Thread Safety

Thread-safe. Only one start operation can succeed at a time.

Implemented in kcenon::network::core::messaging_quic_server.

◆ stop()

virtual auto kcenon::network::interfaces::i_quic_server::stop ( ) -> VoidResult
nodiscardpure virtual

Stops the QUIC server.

Returns
VoidResult indicating success or failure.

Behavior

  • Stops accepting new connections
  • Closes all active sessions

Implemented in kcenon::network::core::messaging_quic_server.


The documentation for this interface was generated from the following file: