Wrapper around IPv4 addresses and DNS operations.
void close()
Close the underlying file descriptor.
size_t write(const char *str, const bool write_all=true)
Write a string, possibly blocking until all is written.
std::string read(const size_t limit=std::numeric_limits< size_t >::max())
Read up to limit bytes.
void connect(const Address &address)
Connect a socket to a specified peer address with connect(2).
void bind(const Address &address)
Bind a socket to a specified address with bind(2), usually for listen/accept.
A wrapper around TCP sockets.
TCPSocket accept()
Accept a new incoming connection.
void listen(const int backlog=16)
Mark a socket as listening for incoming connections.