From 6b536928060c7c927d4cdb468401f862a92490fb Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 9 Jul 2019 00:22:08 +1000 Subject: [PATCH] Fix doxygen generation in tutorial. --- asio/src/doc/tutorial.qbk | 22 +++++++++++++++++++ .../examples/cpp03/tutorial/daytime_dox.txt | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/asio/src/doc/tutorial.qbk b/asio/src/doc/tutorial.qbk index b51ac48c..fcec2b0e 100644 --- a/asio/src/doc/tutorial.qbk +++ b/asio/src/doc/tutorial.qbk @@ -1640,23 +1640,45 @@ Wait for a client to initiate contact with us. The remote\_endpoint object will + ``''''''`` for (;;) + ``''''''`` { + ``''''''`` boost::array recv_buf; + ``''''''`` udp::endpoint remote_endpoint; + ``''''''`` asio::error_code error; + ``''''''`` socket.receive_from(asio::buffer(recv_buf), remote_endpoint); + Determine what we are going to send back to the client. + ``''''''`` std::string message = make_daytime_string(); + Send the response to the remote\_endpoint. + ``''''''`` asio::error_code ignored_error; + ``''''''`` socket.send_to(asio::buffer(message), + ``''''''`` remote_endpoint, 0, ignored_error); + ``''''''`` } + ``''''''`` } + Finally, handle any exceptions. + ``''''''`` catch (std::exception& e) + ``''''''`` { + ``''''''`` std::cerr << e.what() << std::endl; + ``''''''`` } + + ``''''''`` return 0; + ``''''''``} diff --git a/asio/src/examples/cpp03/tutorial/daytime_dox.txt b/asio/src/examples/cpp03/tutorial/daytime_dox.txt index eb95eb93..800ed831 100644 --- a/asio/src/examples/cpp03/tutorial/daytime_dox.txt +++ b/asio/src/examples/cpp03/tutorial/daytime_dox.txt @@ -326,7 +326,7 @@ Create an asio::ip::udp::socket object to receive requests on UDP port 13. Wait for a client to initiate contact with us. The remote_endpoint object will be populated by asio::ip::udp::socket::receive_from(). -\until throw +\until receive_from Determine what we are going to send back to the client.