Re: [Boost-bugs] [Boost C++ Libraries] #9023: asio::io_service::wrap() docs need an example

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9023: asio::io_service::wrap() docs need an example
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-05 08:48:14


#9023: asio::io_service::wrap() docs need an example
-------------------------------+----------------------------
  Reporter: vinnie.falco@… | Owner: chris_kohlhoff
      Type: Feature Requests | Status: closed
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.54.0 | Severity: Cosmetic
Resolution: invalid | Keywords:
-------------------------------+----------------------------
Changes (by chris_kohlhoff):

 * status: new => closed
 * resolution: => invalid

Comment:

 This is not intended as a valid use case for wrap(). The wrap() function
 is documented to use dispatch(), but the
 [http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/asynchronous_operations.html
 requirements on asynchronous operations] state that an operation must
 behave as if implemented using post().

 Regarding your specific example, a better approach is to '''still''' call
 the m_next_layer.async_read_some() function inside your if-block, but with
 a zero-length buffer. The AsyncReadStream type requirements say that this
 shall complete immediately, so you can use it as a replacement for post(),
 but with the added benefit of reducing the number of template
 instantiations.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9023#comment:1>
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:16 UTC