6#ifndef OPENCBDC_TX_SRC_NETWORK_TCP_LISTENER_H_
7#define OPENCBDC_TX_SRC_NETWORK_TCP_LISTENER_H_
Generic superclass for network sockets.
Listens for incoming TCP connections on a given endpoint.
tcp_listener()=default
Constructs a new tcp_listener.
auto listen(const ip_address &local_address, port_number_t local_port) -> bool
Starts the listener on the given local port and address.
tcp_listener(const tcp_listener &)=delete
tcp_listener(tcp_listener &&)=delete
auto operator=(const tcp_listener &) -> tcp_listener &=delete
void close()
Stops the listener and unblocks any blocking calls associated with this listener.
auto accept(tcp_socket &sock) -> bool
Blocks until an incoming connection is ready and populates the given socket.
auto operator=(tcp_listener &&) -> tcp_listener &=delete
Wrapper for a TCP socket.
std::string ip_address
An IP addresses.
unsigned short port_number_t
Port number.