27#ifndef QB_IO_TCP_LISTENER_H_
28#define QB_IO_TCP_LISTENER_H_
30namespace qb::io::tcp {
45 constexpr static bool is_secure() noexcept {
return false; }
48 using qb::io::socket::close;
49 using qb::io::socket::get_optval;
50 using qb::io::socket::is_open;
51 using qb::io::socket::local_endpoint;
52 using qb::io::socket::native_handle;
53 using qb::io::socket::peer_endpoint;
54 using qb::io::socket::release_handle;
55 using qb::io::socket::set_nonblocking;
56 using qb::io::socket::set_optval;
57 using qb::io::socket::test_nonblocking;
67 int listen(io::endpoint
const &ep)
noexcept;
85 int listen_v4(uint16_t port, std::string
const &host =
"0.0.0.0") noexcept;
94 int listen_v6(uint16_t port, std::
string const &host =
"::") noexcept;
Class implementing a TCP listener for accepting incoming connections.
Definition listener.h:42
tcp::socket accept() const noexcept
Accept a new incoming TCP connection and return it as a new tcp::socket.
static constexpr bool is_secure() noexcept
Indicates that this socket implementation is not secure.
Definition listener.h:45
int listen_v6(uint16_t port, std::string const &host="::") noexcept
Start listening on a specific IPv6 address and port.
int disconnect() const noexcept
Disconnect the listener socket, stopping it from accepting new connections.
int listen_un(std::string const &path) noexcept
Start listening on a Unix domain socket.
int listen_v4(uint16_t port, std::string const &host="0.0.0.0") noexcept
Start listening on a specific IPv4 address and port.
int listen(io::uri const &uri) noexcept
Start listening on an endpoint specified by a URI.
int listen(io::endpoint const &ep) noexcept
Start listening on a specific local endpoint.
Class implementing TCP socket functionality for reliable, stream-oriented communication.
Definition socket.h:43
Class for parsing, manipulating, and representing URIs.
Definition uri.h:181
Implementation of TCP sockets for the QB IO library.