0Pricing
C++ Academy · Lesson

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>

All lessons in this course

  1. BSD Sockets API in C++
  2. Building a TCP Echo Server
  3. Asynchronous IO with epoll and kqueue
  4. Using Boost Asio for Modern Async IO
← Back to C++ Academy