Nexus HTTP/3
A QUIC and HTTP/3 library
settings.hpp
1 #pragma once
2 
3 #include <chrono>
4 #include <stdexcept>
5 
6 struct lsquic_engine_settings;
7 
8 namespace nexus::quic {
9 
11 struct bad_setting : std::runtime_error {
12  using runtime_error::runtime_error;
13 };
14 
16 struct settings {
18  std::chrono::seconds handshake_timeout;
19 
21  std::chrono::seconds idle_timeout;
22 
25 
28 
31 
34 };
35 
42 
45 bool check_client_settings(const settings& s, std::string* message);
48 bool check_server_settings(const settings& s, std::string* message);
49 
50 
51 namespace detail {
52 
53 void read_settings(settings& out, const lsquic_engine_settings& in);
54 void write_settings(const settings& in, lsquic_engine_settings& out);
55 
56 } // namespace detail
57 
58 } // namespace nexus::quic
Generic QUIC library.
Definition: client.hpp:8
exception thrown by client/server constructors on unchecked settings
Definition: settings.hpp:11
quic transport settings used to initialize a client or server
Definition: settings.hpp:16
settings default_server_settings()
return default server settings
uint32_t connection_flow_control_window
amount of unread bytes a peer is allowed to send per connection
Definition: settings.hpp:27
uint32_t incoming_stream_flow_control_window
amount of unread bytes a peer is allowed to send on streams they initiate
Definition: settings.hpp:30
uint32_t max_streams_per_connection
number of concurrent streams a peer is allowed to open per connection
Definition: settings.hpp:24
settings default_client_settings()
return default client settings
bool check_client_settings(const settings &s, std::string *message)
check the validity of the client settings
uint32_t outgoing_stream_flow_control_window
amount of unread bytes a peer is allowed to send on streams we initiate
Definition: settings.hpp:33
std::chrono::seconds handshake_timeout
handshake timeout, resulting in connection_error::timed_out
Definition: settings.hpp:18
bool check_server_settings(const settings &s, std::string *message)
check the validity of the server settings
std::chrono::seconds idle_timeout
connection idle timeout, resulting in connection_error::timed_out
Definition: settings.hpp:21