Ch11.10.4: Protocol Support in fast_io
Unlike Boost.Asio which focuses primarily on TCP and UDP, fast_io’s socket
API supports a wide range of protocols through the OS’s native socket interface:
- TCP — Reliable, connection-oriented streams (most common)
- UDP — Unreliable, connectionless datagrams (fast, low overhead)
- Unix domain sockets — Local inter-process communication (POSIX)
- Bluetooth — Bluetooth sockets (where supported by OS)
- Raw sockets — Direct access to IP/ICMP/etc. (requires root/admin)
- Other protocols — Any protocol supported by the OS’s socket API
The key difference: fast_io wraps the OS’s socket interface directly, so you
get access to everything the OS supports. You’re not limited to a hardcoded list of
protocols.
For TCP and UDP, fast_io provides convenience functions like
tcp_connect(), tcp_listen(), and DNS resolution. For other protocols,
you can construct socket files directly from the OS’s socket handles.