BSD Sockets API in C++
Use socket, bind, listen, accept, connect, send, and recv in C++ programs.
What is the Sockets API?
The BSD sockets API is the de facto standard for network programming. Available on Linux, macOS, BSDs, and (with minor adjustments) Windows via Winsock.
Required Headers
Include the platform headers and use POSIX types.
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>