]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp03/tutorial/daytime5/server.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / tutorial / daytime5 / server.cpp
index a6e653b885e59df197362f6195a883be5f3e5791..6dc7816a7ed169168d4b199f50b29996a1c9a61e 100644 (file)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -27,20 +27,16 @@ int main()
 {
   try
   {
-    boost::asio::io_service io_service;
+    boost::asio::io_context io_context;
 
-    udp::socket socket(io_service, udp::endpoint(udp::v4(), 13));
+    udp::socket socket(io_context, udp::endpoint(udp::v4(), 13));
 
     for (;;)
     {
       boost::array<char, 1> recv_buf;
       udp::endpoint remote_endpoint;
       boost::system::error_code error;
-      socket.receive_from(boost::asio::buffer(recv_buf),
-          remote_endpoint, 0, error);
-
-      if (error && error != boost::asio::error::message_size)
-        throw boost::system::system_error(error);
+      socket.receive_from(boost::asio::buffer(recv_buf), remote_endpoint);
 
       std::string message = make_daytime_string();