Listens for incoming network connections.
Definition Listener.hpp:13
void close()
Closes the listening socket, so new connections are refused instead of queueing in the backlog (used ...
void start()
Binds and starts listening.
uint16_t port() const
The port actually bound (useful when constructed with port 0).
int backlog_
Definition Listener.hpp:63
Listener(std::string host, uint16_t port, int backlog=0)
Constructs a Listener on a specific address.
uint16_t port_
Definition Listener.hpp:62
std::optional< network::Socket > accept_connection()
Accepts a new incoming connection.
network::Socket socket_
Definition Listener.hpp:64
Listener(uint16_t port)
Constructs a Listener on the specified port, on all IPv4 interfaces.
std::string host_
Definition Listener.hpp:61
int fd() const
Gets the underlying file descriptor for epoll registration.
constexpr socket_t INVALID_SOCKET_FD
Definition PlatformSocket.hpp:40
Definition Http2Session.hpp:18