DNS query DNS query The resolver class is used to do DNS query, i.e., convert a host+service to IP +port. Take boost::asio::ip::tcp::resolver as an example: #include <b...
Synchronous read/write operations Synchronous read/write operations Once the connection is established, the client and server can communicate with each other. Like classical UN...
UDP communication UDP communication We have discussed how to communicate through TCP enough, so it is time to switch to UDP now. UDP is a connectionless protocol, and it is ...
Throw exception Throw exception Boost.Asio functions may throw boost::system::system_error exception. Take resolve as an example: results_type resolve ( BOOST_ASIO_STRING...
Socket Socket There are 4 types of socket: (1) basic_stream_socket :This socket provides sequenced, reliable, two-way connection based byte streams. tcp::socket is an instan...