1#ifndef NET_TCPSocket_h__
2#define NET_TCPSocket_h__
65 [[nodiscard]] std::optional<TCPSocket>
accept()
const;
80 [[nodiscard]] std::optional<TCPSocket>
timedAccept(
int timeout)
const;
InternetSocket(AddressFamily family, int type, int protocol)
allows a subclass to create new socket
IOResult receiveAll(void *buffer, size_t len)
receive exactly the requested amount unless the peer disconnects
void listen(int backlog=128)
listen for incoming connections
IOResult sendAll(const void *buffer, size_t len)
send data through a connected socket
ConnectResult finishConnect(int timeout=0)
check if a previously started connected attempt is finished
std::optional< TCPSocket > timedAccept(int timeout) const
wait for another socket to connect
TCPSocket(AddressFamily family=IPv4)
static TCPSocket adoptNativeHandle(int sockfd)
Take ownership of an existing native TCP socket descriptor.
InternetSocket(AddressFamily family, int type, int protocol)
allows a subclass to create new socket
std::optional< TCPSocket > accept() const
wait for another socket to connect
void setNoDelay(bool enable)
Enable or disable TCP_NODELAY.
AddressFamily
used by internet socket types