Nexus HTTP/3
A QUIC and HTTP/3 library
Public Types | Public Member Functions | List of all members
nexus::h3::acceptor Class Reference

an HTTP/3 acceptor that owns a UDP socket and uses it to accept and service incoming connections More...

#include <nexus/h3/server.hpp>

Public Types

using executor_type = quic::detail::socket_impl::executor_type
 the polymorphic executor type, boost::asio::any_io_executor
 

Public Member Functions

 acceptor (server &s, udp::socket &&socket, ssl::context &ctx)
 construct the acceptor, taking ownership of a bound UDP socket
 
 acceptor (server &s, const udp::endpoint &endpoint, ssl::context &ctx)
 construct the acceptor and bind a UDP socket to the given endpoint
 
executor_type get_executor () const
 return the associated io executor
 
udp::endpoint local_endpoint () const
 return the socket's locally-bound address/port
 
void listen (int backlog)
 start receiving packets on the socket. incoming connections can be accepted with accept()/async_accept(). if the queue of unaccepted connections reaches 'backlog' in size, new connections are rejected
 
template<typename CompletionToken >
decltype(auto) async_accept (server_connection &conn, CompletionToken &&token)
 accept an incoming connection whose TLS handshake has completed successfully
 
void accept (server_connection &conn, error_code &ec)
 accept an incoming connection whose TLS handshake has completed successfully
 
void accept (server_connection &conn)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void close ()
 close the socket, along with any related connections
 

Detailed Description

an HTTP/3 acceptor that owns a UDP socket and uses it to accept and service incoming connections