19#include <idfxx/net/endpoint>
20#include <idfxx/net/error>
22#include <idfxx/net/netconn/stream_channel>
60 static constexpr int default_backlog = 5;
64#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
79#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
101#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
155#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
175#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
213 : base_channel(conn,
fam) {}
Address/port pair identifying a transport endpoint.
stream_channel accept()
Accepts an incoming TCP connection.
listener(port_number port, int backlog=default_backlog)
Creates a TCP listening netconn bound to all local interfaces on port.
static result< listener > make(address_family fam)
Creates an unbound TCP listening netconn for the given address family.
result< stream_channel > try_accept()
Accepts an incoming TCP connection.
accepted_channel accept_with_peer()
Accepts an incoming TCP connection and reports the peer's endpoint.
listener(const endpoint &bind_addr, int backlog=default_backlog)
Creates a TCP listening netconn bound to bind_addr and listening.
listener()
Creates an unbound TCP listening netconn with default address family (IPv4).
static result< listener > make()
Creates an unbound TCP listening netconn (IPv4).
static result< listener > make(port_number port, int backlog=default_backlog)
Creates a TCP listening netconn bound to all local interfaces on port.
result< accepted_channel > try_accept_with_peer()
Accepts an incoming TCP connection and reports the peer's endpoint.
result< void > try_listen(int backlog=default_backlog)
Marks the netconn as listening.
static result< listener > make(const endpoint &bind_addr, int backlog=default_backlog)
Creates a TCP listening netconn bound to bind_addr and listening.
listener(address_family fam)
Creates an unbound TCP listening netconn for the given address family.
void listen(int backlog=default_backlog)
Marks the netconn as listening.
address_family
Address family.
uint16_t port_number
Port number type for transport endpoints.
T unwrap(result< T > result)
Throws a std::system_error if the result is an error.
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Result of accept_with_peer / try_accept_with_peer — a newly accepted channel together with the peer's...
stream_channel channel
The connected channel.
endpoint peer
The peer's address and port.