Network I/O using Asio
We want to use Asio to build scalable network services that perform I/O over the network. Such services receive requests from clients running on remote machines and send them information over the network. The data transfer between processes across machine boundaries, happening over the wire, is done using certain protocols of network communication. The most ubiquitous of these protocols is IP or the Internet Protocol and a suite of protocols layered above it. Boost Asio supports TCP, UDP, and ICMP, the three popular protocols in the IP protocol suite. We do not cover ICMP in this book.
UDP and TCP
User Datagram Protocol or UDP is used to transmit datagrams or message units from one host to another over an IP network. UDP is a very basic protocol built over IP and is stateless in the sense that no context is maintained across multiple network I/O operations. The reliability of data transfer using UDP depends on the reliability of the underlying network, and UDP transfers...