[Boost-bugs] [Boost C++ Libraries] #4023: Read handler has EOF error_code

Subject: [Boost-bugs] [Boost C++ Libraries] #4023: Read handler has EOF error_code
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-17 15:51:10


#4023: Read handler has EOF error_code
----------------------------------+-----------------------------------------
 Reporter: olafvdspek@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: asio
  Version: Boost 1.42.0 | Severity: Showstopper
 Keywords: |
----------------------------------+-----------------------------------------
 Hi,

 I've got the following code in a project. This used to work fine in the
 past. Now, error_code is EOF while Wireshark doesn't show any end of the
 TCP stream. With the returns commented, the app works fine.

 {{{
 void connection::start()
 {
         asio::async_read(socket_, asio::buffer(buffer_.begin(), 8),
 boost::bind(&connection::handle_read0, shared_from_this(),
 asio::placeholders::error));
 }

 void connection::handle_read0(const boost::system::error_code& e)
 {
         if (e)
         {
                 std::cerr << e.message() << std::endl;
                 // return;
         }
         asio::async_read(socket_, asio::buffer(&buffer_[8], read_int(2,
 &buffer_[4]) + buffer_[6]), boost::bind(&connection::handle_read1,
 shared_from_this(), asio::placeholders::error));
 }

 void connection::handle_read1(const boost::system::error_code& e)
 {
         if (e)
         {
                 std::cerr << e.message() << std::endl;
                 // return;
         }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4023>
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:02 UTC