Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85762 - trunk/boost/asio
From: chris_at_[hidden]
Date: 2013-09-17 18:12:07


Author: chris_kohlhoff
Date: 2013-09-17 18:12:07 EDT (Tue, 17 Sep 2013)
New Revision: 85762
URL: http://svn.boost.org/trac/boost/changeset/85762

Log:
Some async operations that missed getting the async_result treatment.

Text files modified:
   trunk/boost/asio/seq_packet_socket_service.hpp | 25 ++++++++++++++++++++-----
   1 files changed, 20 insertions(+), 5 deletions(-)

Modified: trunk/boost/asio/seq_packet_socket_service.hpp
==============================================================================
--- trunk/boost/asio/seq_packet_socket_service.hpp Tue Sep 17 18:08:43 2013 (r85761)
+++ trunk/boost/asio/seq_packet_socket_service.hpp 2013-09-17 18:12:07 EDT (Tue, 17 Sep 2013) (r85762)
@@ -314,13 +314,20 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(implementation_type& impl,
       const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send(impl, buffers, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive some data from the peer.
@@ -335,13 +342,21 @@
 
   /// Start an asynchronous receive.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(implementation_type& impl,
       const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
       socket_base::message_flags& out_flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive_with_flags(impl, buffers, in_flags,
- out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive_with_flags(impl,
+ buffers, in_flags, out_flags, init.handler);
+
+ return init.result.get();
   }
 
 private:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk