Minimalistic and easy-to-use C++ socket and address library.
So you want to have network communication in your little program but boost seems just too much? And how hard can this socket stuff be anyhow, eh? - After being there more than once, I write this library with the hope that it spares me from future coding of half-assed single-use sockets.
Configure and build library/examples/demo/tests using CMake.
The CMake install target prepares a CMake-based demo project suitable as a starting point for own applications.
The Address
class represents localhost or remote UDP/TCP addresses and is used to create local and send/connect to remote sockets.
The socket classes Socket*
, Socket*Buffered
and Socket*Async
provide different levels of convenience around the raw OS socket representation:
SocketUdp
and SocketTcp
allow basic functions like connect, send and receive, while Acceptor
listens for incoming TCP connectionsSocketUdpBuffered
and SocketTcpBuffered
add an internal receive buffer poolSocketUdpAsync
and SocketTcpAsync
as well as AcceptorAsync
are run by a Driver
(i.e. a thread) providing asynchronous operation to one or multiple socketsIf built with TLS support, all TCP socket classes can be instantiated with an SSL certificate and private key file to run encrypted connections.
The ToDo
class is used for scheduling tasks to be run by a Driver
at a given point in time, e.g. periodic heartbeat packet transmissions or reconnect attempts.