dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
23 #ifndef network_socket_hpp
24 #define network_socket_hpp
26 #include <arpa/inet.h>
31 #include <sys/socket.h>
Socket()
Default constructor creates an invalid socket.
Socket(int socket)
Construct from a socket descriptor.
Generic network Address, supporting ipv4 and ipv6 transparently.
virtual common::SystemError receive(void *buf, ssize_t request, ssize_t &received)
Receive bytes.
Socket(bool blocking)
Construct with default SocketParams.
static Socket SocketInvalid
An invalid SocketInvalid for comparison convenience - initialized to a Socket with socket fd=-1.
Socket parameters - the family (domain), socket type and protocol triplet.
virtual common::SystemError sendTo(const Address &address, const void *buf, ssize_t len)
Send raw packets to the given Address.
Interface for network communication.
virtual ~Socket()
Destructs this Socket, but does not call close().
Socket(bool blocking, SocketParams params)
Construct from SocketParams.
virtual Socket * accept()
Accepts a connection request and return a pointer to a new Socket for the new connection,...
Linux system error primitive to provide a consistent interface to Linux error codes.
Interface to and common implementation of concrete sockets (Socket, TLSSocket).
virtual common::SystemError send(const void *buf, ssize_t len, bool more=false)
Send len bytes as a bytestream.