3 #include <nexus/udp.hpp>
4 #include <nexus/ssl.hpp>
5 #include <nexus/quic/server.hpp>
10 class server_connection;
17 quic::detail::engine_impl engine;
41 quic::detail::socket_impl impl;
65 template <
typename CompletionToken>
67 CompletionToken&& token) {
68 return impl.async_accept(conn, std::forward<CompletionToken>(token));
86 friend class quic::detail::socket_impl;
87 quic::detail::connection_impl impl;
112 template <
typename CompletionToken>
114 return impl.async_accept<
stream>(s, std::forward<CompletionToken>(token));
an HTTP/3 acceptor that owns a UDP socket and uses it to accept and service incoming connections
Definition: server.hpp:39
udp::endpoint local_endpoint() const
return the socket's locally-bound address/port
executor_type get_executor() const
return the associated io executor
quic::detail::socket_impl::executor_type executor_type
the polymorphic executor type, boost::asio::any_io_executor
Definition: server.hpp:44
void accept(server_connection &conn, error_code &ec)
accept an incoming connection whose TLS handshake has completed successfully
acceptor(server &s, udp::socket &&socket, ssl::context &ctx)
construct the acceptor, taking ownership of a bound UDP socket
void close()
close the socket, along with any related connections
acceptor(server &s, const udp::endpoint &endpoint, ssl::context &ctx)
construct the acceptor and bind a UDP socket to the given endpoint
decltype(auto) async_accept(server_connection &conn, CompletionToken &&token)
accept an incoming connection whose TLS handshake has completed successfully
Definition: server.hpp:66
void accept(server_connection &conn)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void listen(int backlog)
start receiving packets on the socket. incoming connections can be accepted with accept()/async_accep...
an HTTP/3 connection that can accept incoming streams and push associated outgoing streams
Definition: server.hpp:83
executor_type get_executor() const
return the associated io executor
quic::detail::connection_impl::executor_type executor_type
the polymorphic executor type, boost::asio::any_io_executor
Definition: server.hpp:90
void go_away(error_code &ec)
send a GOAWAY frame and stop initiating or accepting new streams
void accept(stream &s, error_code &ec)
This is an overloaded member function, provided for convenience. It differs from the above function o...
quic::connection_id id() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
decltype(auto) async_accept(stream &s, CompletionToken &&token)
accept an incoming stream
Definition: server.hpp:113
udp::endpoint remote_endpoint(error_code &ec) const
return the remote's address/port if open
void close(error_code &ec)
close the connection, along with any related streams
void go_away()
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool is_open() const
determine whether the connection is open
server_connection(acceptor &a)
construct a server-side connection for use with accept()
Definition: server.hpp:93
void close()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void accept(stream &s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
quic::connection_id id(error_code &ec) const
return the connection id if open
udp::endpoint remote_endpoint() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
an HTTP/3 server capable of managing one or more UDP sockets via class acceptor
Definition: server.hpp:15
executor_type get_executor() const
return the associated io executor
server(const executor_type &ex)
construct the server with its associated executor
quic::detail::engine_impl::executor_type executor_type
the polymorphic executor type, boost::asio::any_io_executor
Definition: server.hpp:20
void close()
stop accepting new connections and streams entirely, and mark existing connections as 'going away'....
server(const executor_type &ex, const quic::settings &s)
construct the server with its associated executor and transport settings
a bidirectional HTTP/3 stream that can send and receive HTTP headers, and meets the type requirements...
Definition: stream.hpp:14
an opaque connection id string
Definition: connection_id.hpp:12
HTTP/3 library.
Definition: client.hpp:6
quic transport settings used to initialize a client or server
Definition: settings.hpp:16