summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp50
1 files changed, 33 insertions, 17 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp
index 5efb24b..10b2f3f 100644
--- a/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp
+++ b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp
@@ -2,7 +2,7 @@
// detail/reactive_descriptor_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2014 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)
@@ -17,11 +17,13 @@
#include <boost/asio/detail/config.hpp>
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) \
+ && !defined(BOOST_ASIO_WINDOWS_RUNTIME) \
+ && !defined(__CYGWIN__)
-#include <boost/utility/addressof.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
#include <boost/asio/detail/bind_handler.hpp>
#include <boost/asio/detail/buffer_sequence_adapter.hpp>
#include <boost/asio/detail/descriptor_ops.hpp>
@@ -186,18 +188,21 @@ public:
// lifetime of the asynchronous operation.
template <typename ConstBufferSequence, typename Handler>
void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
{
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
// Allocate and construct an operation to wrap the handler.
typedef descriptor_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
boost_asio_handler_alloc_helpers::allocate(
sizeof(op), handler), 0 };
p.p = new (p.v) op(impl.descriptor_, buffers, handler);
BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor", &impl, "async_write_some"));
- start_op(impl, reactor::write_op, p.p, true,
+ start_op(impl, reactor::write_op, p.p, is_continuation, true,
buffer_sequence_adapter<boost::asio::const_buffer,
ConstBufferSequence>::all_empty(buffers));
p.v = p.p = 0;
@@ -206,11 +211,14 @@ public:
// Start an asynchronous wait until data can be written without blocking.
template <typename Handler>
void async_write_some(implementation_type& impl,
- const null_buffers&, Handler handler)
+ const null_buffers&, Handler& handler)
{
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
// Allocate and construct an operation to wrap the handler.
typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
boost_asio_handler_alloc_helpers::allocate(
sizeof(op), handler), 0 };
p.p = new (p.v) op(handler);
@@ -218,7 +226,7 @@ public:
BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor",
&impl, "async_write_some(null_buffers)"));
- start_op(impl, reactor::write_op, p.p, false, false);
+ start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
p.v = p.p = 0;
}
@@ -248,18 +256,21 @@ public:
// valid for the lifetime of the asynchronous operation.
template <typename MutableBufferSequence, typename Handler>
void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
{
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
// Allocate and construct an operation to wrap the handler.
typedef descriptor_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
boost_asio_handler_alloc_helpers::allocate(
sizeof(op), handler), 0 };
p.p = new (p.v) op(impl.descriptor_, buffers, handler);
BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor", &impl, "async_read_some"));
- start_op(impl, reactor::read_op, p.p, true,
+ start_op(impl, reactor::read_op, p.p, is_continuation, true,
buffer_sequence_adapter<boost::asio::mutable_buffer,
MutableBufferSequence>::all_empty(buffers));
p.v = p.p = 0;
@@ -268,11 +279,14 @@ public:
// Wait until data can be read without blocking.
template <typename Handler>
void async_read_some(implementation_type& impl,
- const null_buffers&, Handler handler)
+ const null_buffers&, Handler& handler)
{
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
// Allocate and construct an operation to wrap the handler.
typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
boost_asio_handler_alloc_helpers::allocate(
sizeof(op), handler), 0 };
p.p = new (p.v) op(handler);
@@ -280,14 +294,14 @@ public:
BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor",
&impl, "async_read_some(null_buffers)"));
- start_op(impl, reactor::read_op, p.p, false, false);
+ start_op(impl, reactor::read_op, p.p, is_continuation, false, false);
p.v = p.p = 0;
}
private:
// Start the asynchronous operation.
BOOST_ASIO_DECL void start_op(implementation_type& impl, int op_type,
- reactor_op* op, bool is_non_blocking, bool noop);
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop);
// The selector that performs event demultiplexing for the service.
reactor& reactor_;
@@ -303,6 +317,8 @@ private:
# include <boost/asio/detail/impl/reactive_descriptor_service.ipp>
#endif // defined(BOOST_ASIO_HEADER_ONLY)
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS)
+ // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)
+ // && !defined(__CYGWIN__)
#endif // BOOST_ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP