Http3Impl class final
#include <src/microserve/http3.cppm>
HTTP/3 listener: one UDP socket, many QUIC connections.
Connections are keyed by every active SCID so path/CID migration still resolves the same session.
Base classes
- struct ServerImpl
- Abstract server backend.
Constructors, destructors, conversion operators
- Http3Impl(net::io_context& ioc, const std::string& address, const unsigned short port, std::string cert_file = "certs/server.crt", std::string key_file = "certs/server.key", const int verbosity = 0)
- Construct an HTTP/3 listener on
addressandport. - ~Http3Impl() override
- Stop the listener and release QUIC connections and TLS state.
Public functions
- void set_handler(Handler handler) override
- Install the request handler used by all accepted sessions.
- void start_server() override
- Start receiving QUIC packets on the configured endpoint.
- void stop_server() override
- Stop receiving packets, close the UDP socket, and drop connections.
Function documentation
microserve:: Http3Impl:: Http3Impl(net::io_context& ioc,
const std::string& address,
const unsigned short port,
std::string cert_file = "certs/server.crt",
std::string key_file = "certs/server.key",
const int verbosity = 0)
Construct an HTTP/3 listener on address and port.
| Parameters | |
|---|---|
| ioc | Asio I/O context that drives the UDP socket and sessions. |
| address | Bind address (for example "0.0.0.0" or "::"). |
| port | UDP port to listen on. |
| cert_file | Path to the PEM server certificate. |
| key_file | Path to the PEM private key. |
| verbosity | Log verbosity (0 is quiet). |
| Exceptions | |
| std::runtime_error | if TLS initialization fails. |
void microserve:: Http3Impl:: set_handler(Handler handler) override
Install the request handler used by all accepted sessions.
| Parameters | |
|---|---|
| handler | Callback invoked for each incoming request. |
Must be called before start_