[Boost-bugs] [Boost C++ Libraries] #12151: Example UDP async server stops on error...

Subject: [Boost-bugs] [Boost C++ Libraries] #12151: Example UDP async server stops on error...
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-04-23 15:19:12


#12151: Example UDP async server stops on error...
-----------------------------------------+---------------------------
 Reporter: Micah Quinn <micah.quinn@…> | Owner: matias
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Documentation
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
-----------------------------------------+---------------------------
 In the boost::asio UDP async server example, if a recv_from error occurs,
 the server stops receiving completely. The code in question is in the
 "start_receive()" function:

 {{{
 void handle_receive(const boost::system::error_code& error,
       std::size_t /*bytes_transferred*/)
   {
     if (!error || error == boost::asio::error::message_size)
     {
 ....
       start_receive();
     }
   }
 }}}

 Should instead be (with start_receive() moved outside the error check):

 {{{
 void handle_receive(const boost::system::error_code& error,
       std::size_t /*bytes_transferred*/)
   {
     if (!error || error == boost::asio::error::message_size)
     {
 ....
     }
     start_receive();
   }
 }}}

 http://www.boost.org/doc/libs/1_60_0/doc/html/boost_asio/tutorial/tutdaytime6/src.html

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12151>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC