diff options
Diffstat (limited to 'doc/html/boost_asio/example/cpp03/porthopper/server.cpp')
-rw-r--r-- | doc/html/boost_asio/example/cpp03/porthopper/server.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/html/boost_asio/example/cpp03/porthopper/server.cpp b/doc/html/boost_asio/example/cpp03/porthopper/server.cpp index 0426c365be..e8c9f8af67 100644 --- a/doc/html/boost_asio/example/cpp03/porthopper/server.cpp +++ b/doc/html/boost_asio/example/cpp03/porthopper/server.cpp @@ -2,7 +2,7 @@ // server.cpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2018 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) @@ -22,7 +22,7 @@ using boost::asio::ip::tcp; using boost::asio::ip::udp; typedef boost::shared_ptr<tcp::socket> tcp_socket_ptr; -typedef boost::shared_ptr<boost::asio::deadline_timer> timer_ptr; +typedef boost::shared_ptr<boost::asio::steady_timer> timer_ptr; typedef boost::shared_ptr<control_request> control_request_ptr; class server @@ -43,7 +43,7 @@ public: boost::asio::placeholders::error, new_socket)); // Start the timer used to generate outgoing frames. - timer_.expires_from_now(boost::posix_time::milliseconds(100)); + timer_.expires_after(boost::asio::chrono::milliseconds(100)); timer_.async_wait(boost::bind(&server::handle_timer, this)); } @@ -75,8 +75,8 @@ public: { // Delay handling of the control request to simulate network latency. timer_ptr delay_timer( - new boost::asio::deadline_timer(acceptor_.get_executor().context())); - delay_timer->expires_from_now(boost::posix_time::seconds(2)); + new boost::asio::steady_timer(acceptor_.get_executor().context())); + delay_timer->expires_after(boost::asio::chrono::seconds(2)); delay_timer->async_wait( boost::bind(&server::handle_control_request_timer, this, socket, request, delay_timer)); @@ -142,7 +142,7 @@ public: } // Wait for next timeout. - timer_.expires_from_now(boost::posix_time::milliseconds(100)); + timer_.expires_after(boost::asio::chrono::milliseconds(100)); timer_.async_wait(boost::bind(&server::handle_timer, this)); } @@ -151,7 +151,7 @@ private: tcp::acceptor acceptor_; // The timer used for generating data. - boost::asio::deadline_timer timer_; + boost::asio::steady_timer timer_; // The socket used to send data to subscribers. udp::socket udp_socket_; |