|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58669 - in branches/release: . boost boost/algorithm/string boost/archive boost/asio boost/asio/detail boost/asio/impl boost/asio/posix boost/asio/ssl boost/config boost/filesystem boost/functional/hash boost/fusion boost/graph boost/integer boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/program_options boost/property_tree boost/python boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/system boost/thread boost/tr1 boost/type_traits boost/unordered boost/utility boost/variant boost/wave doc libs libs/asio/example/porthopper libs/asio/test libs/asio/test/ip libs/asio/test/local libs/asio/test/posix libs/asio/test/windows libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/iostreams libs/math libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_tree libs/python libs/regex libs/regex/doc libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/static_assert libs/system libs/thread libs/thread/doc libs/timer libs/tr1 libs/type_traits libs/unordered libs/utility libs/wave more people status tools tools/boostbook tools/build/v2 tools/inspect tools/quickbook tools/regression tools/release tools/wave wiki
From: chris_at_[hidden]
Date: 2010-01-04 06:55:17
Author: chris_kohlhoff
Date: 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
New Revision: 58669
URL: http://svn.boost.org/trac/boost/changeset/58669
Log:
Merge from trunk.
........
r57393 | hkaiser | 2009-11-05 11:26:15 +1100 (Thu, 05 Nov 2009) | 1 line
Asio: disabled VC workaround for VC2010 beta2 compiler. Fixes #3796.
........
r58621 | chris_kohlhoff | 2010-01-02 10:04:35 +1100 (Sat, 02 Jan 2010) | 2 lines
Wrap long line.
........
r58624 | chris_kohlhoff | 2010-01-02 17:09:02 +1100 (Sat, 02 Jan 2010) | 3 lines
Windows needs the OVERLAPPED structure to be valid until both the initiating
function call has returned and the completion packet has been delivered.
........
r58625 | chris_kohlhoff | 2010-01-02 18:16:41 +1100 (Sat, 02 Jan 2010) | 2 lines
Use specific type_traits headers.
........
r58626 | chris_kohlhoff | 2010-01-02 18:18:09 +1100 (Sat, 02 Jan 2010) | 2 lines
Include specific headers in unit tests rather than the convenience header asio.hpp.
........
r58627 | chris_kohlhoff | 2010-01-02 19:24:12 +1100 (Sat, 02 Jan 2010) | 3 lines
Use boost::addressof to get the address of handler objects, rather than
applying operator& directly. Fixes #2977.
........
r58628 | chris_kohlhoff | 2010-01-02 20:48:01 +1100 (Sat, 02 Jan 2010) | 3 lines
Don't block signals while performing system calls, but instead restart the
calls if they are interrupted.
........
r58629 | chris_kohlhoff | 2010-01-02 21:20:12 +1100 (Sat, 02 Jan 2010) | 2 lines
Ensure that kqueue support is enabled for BSD platforms. Fixes #3626.
........
r58630 | chris_kohlhoff | 2010-01-02 21:30:41 +1100 (Sat, 02 Jan 2010) | 2 lines
Add boost_ prefix to extern "C" thread entry point function. Fixes #3809.
........
r58647 | chris_kohlhoff | 2010-01-03 07:36:59 +1100 (Sun, 03 Jan 2010) | 2 lines
Use a pool of strand implementations to make copying of strands cheaper.
........
r58650 | chris_kohlhoff | 2010-01-03 08:35:33 +1100 (Sun, 03 Jan 2010) | 4 lines
In getaddrinfo emulation, only check the socket type (SOCK_STREAM or SOCK_DGRAM)
if a service name has been specified. This should allow the emulation to work
with raw sockets.
........
r58651 | chris_kohlhoff | 2010-01-03 08:37:10 +1100 (Sun, 03 Jan 2010) | 3 lines
Add a workaround for some broken Windows firewalls that make a socket
appear bound to 0.0.0.0 when it is in fact bound to 127.0.0.1.
........
r58652 | chris_kohlhoff | 2010-01-03 08:38:44 +1100 (Sun, 03 Jan 2010) | 2 lines
Only include implementation headers required for each platform.
........
Properties modified:
branches/release/ (props changed)
branches/release/CMakeLists.txt (props changed)
branches/release/INSTALL (props changed)
branches/release/Jamroot (props changed)
branches/release/LICENSE_1_0.txt (props changed)
branches/release/boost/ (props changed)
branches/release/boost-build.jam (props changed)
branches/release/boost.css (props changed)
branches/release/boost.png (props changed)
branches/release/boost/algorithm/string/ (props changed)
branches/release/boost/archive/ (props changed)
branches/release/boost/config/ (props changed)
branches/release/boost/filesystem/ (props changed)
branches/release/boost/functional/hash/ (props changed)
branches/release/boost/fusion/ (props changed)
branches/release/boost/graph/ (props changed)
branches/release/boost/integer/ (props changed)
branches/release/boost/interprocess/ (props changed)
branches/release/boost/intrusive/ (props changed)
branches/release/boost/iostreams/ (props changed)
branches/release/boost/math/ (props changed)
branches/release/boost/numeric/ublas/ (props changed)
branches/release/boost/program_options/ (props changed)
branches/release/boost/property_tree/ (props changed)
branches/release/boost/python/ (props changed)
branches/release/boost/regex/ (props changed)
branches/release/boost/serialization/ (props changed)
branches/release/boost/signals/ (props changed)
branches/release/boost/signals2/ (props changed)
branches/release/boost/spirit/ (props changed)
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/karma/ (props changed)
branches/release/boost/spirit/home/support/attributes.hpp (props changed)
branches/release/boost/system/ (props changed)
branches/release/boost/thread/ (props changed)
branches/release/boost/thread.hpp (props changed)
branches/release/boost/tr1/ (props changed)
branches/release/boost/type_traits/ (props changed)
branches/release/boost/unordered/ (props changed)
branches/release/boost/utility/value_init.hpp (props changed)
branches/release/boost/variant/ (props changed)
branches/release/boost/version.hpp (props changed)
branches/release/boost/wave/ (props changed)
branches/release/bootstrap.bat (props changed)
branches/release/bootstrap.sh (props changed)
branches/release/doc/ (props changed)
branches/release/index.htm (props changed)
branches/release/index.html (props changed)
branches/release/libs/ (props changed)
branches/release/libs/config/ (props changed)
branches/release/libs/filesystem/ (props changed)
branches/release/libs/functional/hash/ (props changed)
branches/release/libs/fusion/ (props changed)
branches/release/libs/graph_parallel/ (props changed)
branches/release/libs/integer/ (props changed)
branches/release/libs/interprocess/ (props changed)
branches/release/libs/intrusive/ (props changed)
branches/release/libs/iostreams/ (props changed)
branches/release/libs/libraries.htm (props changed)
branches/release/libs/maintainers.txt (props changed)
branches/release/libs/math/ (props changed)
branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
branches/release/libs/numeric/ublas/ (props changed)
branches/release/libs/numeric/ublas/doc/ (props changed)
branches/release/libs/program_options/ (props changed)
branches/release/libs/property_tree/ (props changed)
branches/release/libs/python/ (props changed)
branches/release/libs/regex/ (props changed)
branches/release/libs/regex/doc/ (props changed)
branches/release/libs/serialization/ (props changed)
branches/release/libs/signals/ (props changed)
branches/release/libs/signals2/ (props changed)
branches/release/libs/spirit/ (props changed)
branches/release/libs/spirit/classic/example/ (props changed)
branches/release/libs/spirit/doc/ (props changed)
branches/release/libs/spirit/example/ (props changed)
branches/release/libs/spirit/phoenix/ (props changed)
branches/release/libs/spirit/test/ (props changed)
branches/release/libs/spirit/test/qi/optional.cpp (props changed)
branches/release/libs/static_assert/ (props changed)
branches/release/libs/system/ (props changed)
branches/release/libs/thread/ (props changed)
branches/release/libs/thread/doc/ (props changed)
branches/release/libs/timer/ (props changed)
branches/release/libs/tr1/ (props changed)
branches/release/libs/type_traits/ (props changed)
branches/release/libs/unordered/ (props changed)
branches/release/libs/utility/swap.html (props changed)
branches/release/libs/utility/value_init.htm (props changed)
branches/release/libs/utility/value_init_test.cpp (props changed)
branches/release/libs/wave/ (props changed)
branches/release/more/ (props changed)
branches/release/people/ (props changed)
branches/release/rst.css (props changed)
branches/release/status/ (props changed)
branches/release/tools/ (props changed)
branches/release/tools/boostbook/ (props changed)
branches/release/tools/build/v2/ (props changed)
branches/release/tools/inspect/ (props changed)
branches/release/tools/quickbook/ (props changed)
branches/release/tools/regression/ (props changed)
branches/release/tools/release/ (props changed)
branches/release/tools/wave/ (props changed)
branches/release/wiki/ (props changed)
Text files modified:
branches/release/boost/asio/buffer.hpp | 4
branches/release/boost/asio/buffered_read_stream.hpp | 2
branches/release/boost/asio/buffered_write_stream.hpp | 2
branches/release/boost/asio/datagram_socket_service.hpp | 21 +++-
branches/release/boost/asio/deadline_timer_service.hpp | 16 ++
branches/release/boost/asio/detail/bind_handler.hpp | 30 +++---
branches/release/boost/asio/detail/dev_poll_reactor.hpp | 3
branches/release/boost/asio/detail/epoll_reactor.hpp | 3
branches/release/boost/asio/detail/eventfd_select_interrupter.hpp | 39 +++++---
branches/release/boost/asio/detail/handler_alloc_helpers.hpp | 15 +-
branches/release/boost/asio/detail/handler_base_from_member.hpp | 6
branches/release/boost/asio/detail/handler_invoke_helpers.hpp | 5
branches/release/boost/asio/detail/handler_queue.hpp | 2
branches/release/boost/asio/detail/indirect_handler_queue.hpp | 2
branches/release/boost/asio/detail/kqueue_reactor.hpp | 3
branches/release/boost/asio/detail/kqueue_reactor_fwd.hpp | 10 +
branches/release/boost/asio/detail/pipe_select_interrupter.hpp | 17 ++-
branches/release/boost/asio/detail/posix_thread.hpp | 8
branches/release/boost/asio/detail/reactive_descriptor_service.hpp | 52 +++++++----
branches/release/boost/asio/detail/reactive_socket_service.hpp | 181 +++++++++++++++++++++++----------------
branches/release/boost/asio/detail/select_interrupter.hpp | 9 +
branches/release/boost/asio/detail/select_reactor.hpp | 3
branches/release/boost/asio/detail/socket_ops.hpp | 5
branches/release/boost/asio/detail/socket_select_interrupter.hpp | 5 +
branches/release/boost/asio/detail/strand_service.hpp | 169 ++++++++++---------------------------
branches/release/boost/asio/detail/task_io_service.hpp | 2
branches/release/boost/asio/detail/task_io_service_2lock.hpp | 2
branches/release/boost/asio/detail/win_iocp_handle_service.hpp | 60 +++++-------
branches/release/boost/asio/detail/win_iocp_io_service.hpp | 80 ++++++++++++----
branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp | 8 +
branches/release/boost/asio/detail/win_iocp_socket_service.hpp | 130 ++++++++++++----------------
branches/release/boost/asio/detail/wrapped_handler.hpp | 12 +-
branches/release/boost/asio/impl/io_service.ipp | 22 +++-
branches/release/boost/asio/impl/read.ipp | 12 +-
branches/release/boost/asio/impl/read_at.ipp | 12 +-
branches/release/boost/asio/impl/read_until.ipp | 24 ++--
branches/release/boost/asio/impl/write.ipp | 12 +-
branches/release/boost/asio/impl/write_at.ipp | 12 +-
branches/release/boost/asio/posix/stream_descriptor_service.hpp | 18 +++
branches/release/boost/asio/raw_socket_service.hpp | 21 +++-
branches/release/boost/asio/socket_acceptor_service.hpp | 21 +++-
branches/release/boost/asio/ssl/stream.hpp | 2
branches/release/boost/asio/stream_socket_service.hpp | 21 +++-
branches/release/libs/asio/example/porthopper/client.cpp | 12 +-
branches/release/libs/asio/test/buffered_read_stream.cpp | 5
branches/release/libs/asio/test/buffered_stream.cpp | 5
branches/release/libs/asio/test/buffered_write_stream.cpp | 5
branches/release/libs/asio/test/buffers_iterator.cpp | 2
branches/release/libs/asio/test/deadline_timer.cpp | 3
branches/release/libs/asio/test/io_service.cpp | 4
branches/release/libs/asio/test/ip/host_name.cpp | 1
branches/release/libs/asio/test/ip/multicast.cpp | 3
branches/release/libs/asio/test/ip/tcp.cpp | 2
branches/release/libs/asio/test/ip/udp.cpp | 3
branches/release/libs/asio/test/ip/unicast.cpp | 3
branches/release/libs/asio/test/ip/v6_only.cpp | 4
branches/release/libs/asio/test/is_read_buffered.cpp | 5
branches/release/libs/asio/test/is_write_buffered.cpp | 5
branches/release/libs/asio/test/local/connect_pair.cpp | 4
branches/release/libs/asio/test/local/datagram_protocol.cpp | 2
branches/release/libs/asio/test/local/stream_protocol.cpp | 2
branches/release/libs/asio/test/posix/basic_descriptor.cpp | 1
branches/release/libs/asio/test/posix/basic_stream_descriptor.cpp | 1
branches/release/libs/asio/test/posix/descriptor_base.cpp | 1
branches/release/libs/asio/test/posix/stream_descriptor.cpp | 2
branches/release/libs/asio/test/posix/stream_descriptor_service.cpp | 1
branches/release/libs/asio/test/read.cpp | 3
branches/release/libs/asio/test/read_at.cpp | 3
branches/release/libs/asio/test/read_until.cpp | 4
branches/release/libs/asio/test/serial_port.cpp | 2
branches/release/libs/asio/test/serial_port_base.cpp | 3
branches/release/libs/asio/test/socket_base.cpp | 4
branches/release/libs/asio/test/strand.cpp | 5
branches/release/libs/asio/test/windows/overlapped_ptr.cpp | 2
branches/release/libs/asio/test/windows/random_access_handle.cpp | 2
branches/release/libs/asio/test/windows/stream_handle.cpp | 2
branches/release/libs/asio/test/write.cpp | 3
branches/release/libs/asio/test/write_at.cpp | 3
78 files changed, 651 insertions(+), 544 deletions(-)
Modified: branches/release/boost/asio/buffer.hpp
==============================================================================
--- branches/release/boost/asio/buffer.hpp (original)
+++ branches/release/boost/asio/buffer.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -432,12 +432,14 @@
~buffer_debug_check()
{
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) \
+ && BOOST_WORKAROUND(BOOST_MSVC, < 1600)
// MSVC's string iterator checking may crash in a std::string::iterator
// object's destructor when the iterator points to an already-destroyed
// std::string object, unless the iterator is cleared first.
iter_ = Iterator();
#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+ // && BOOST_WORKAROUND(BOOST_MSVC, < 1600)
}
void operator()()
Modified: branches/release/boost/asio/buffered_read_stream.hpp
==============================================================================
--- branches/release/boost/asio/buffered_read_stream.hpp (original)
+++ branches/release/boost/asio/buffered_read_stream.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -21,7 +21,7 @@
#include <cstddef>
#include <cstring>
#include <boost/config.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/remove_reference.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/buffered_read_stream_fwd.hpp>
Modified: branches/release/boost/asio/buffered_write_stream.hpp
==============================================================================
--- branches/release/boost/asio/buffered_write_stream.hpp (original)
+++ branches/release/boost/asio/buffered_write_stream.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -21,7 +21,7 @@
#include <cstddef>
#include <cstring>
#include <boost/config.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/remove_reference.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/buffered_write_stream_fwd.hpp>
Modified: branches/release/boost/asio/datagram_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/datagram_socket_service.hpp (original)
+++ branches/release/boost/asio/datagram_socket_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -24,12 +24,23 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/reactive_socket_service.hpp>
-#include <boost/asio/detail/win_iocp_socket_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/deadline_timer_service.hpp
==============================================================================
--- branches/release/boost/asio/deadline_timer_service.hpp (original)
+++ branches/release/boost/asio/deadline_timer_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -25,11 +25,19 @@
#include <boost/asio/io_service.hpp>
#include <boost/asio/time_traits.hpp>
#include <boost/asio/detail/deadline_timer_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/win_iocp_io_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_io_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/detail/bind_handler.hpp
==============================================================================
--- branches/release/boost/asio/detail/bind_handler.hpp (original)
+++ branches/release/boost/asio/detail/bind_handler.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -54,7 +54,7 @@
binder1<Handler, Arg1>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler, typename Arg1>
@@ -62,7 +62,7 @@
binder1<Handler, Arg1>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1>
@@ -70,7 +70,7 @@
binder1<Handler, Arg1>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
template <typename Handler, typename Arg1>
@@ -112,7 +112,7 @@
binder2<Handler, Arg1, Arg2>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2>
@@ -120,7 +120,7 @@
binder2<Handler, Arg1, Arg2>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1, typename Arg2>
@@ -128,7 +128,7 @@
binder2<Handler, Arg1, Arg2>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2>
@@ -173,7 +173,7 @@
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
@@ -181,7 +181,7 @@
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1, typename Arg2,
@@ -190,7 +190,7 @@
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
@@ -239,7 +239,7 @@
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
@@ -248,7 +248,7 @@
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1, typename Arg2,
@@ -257,7 +257,7 @@
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
@@ -311,7 +311,7 @@
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
@@ -320,7 +320,7 @@
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1, typename Arg2,
@@ -329,7 +329,7 @@
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
Modified: branches/release/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/dev_poll_reactor.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -402,9 +402,6 @@
lock.lock();
wait_in_progress_ = false;
- // Block signals while performing operations.
- boost::asio::detail::signal_blocker sb;
-
// Dispatch the waiting events.
for (int i = 0; i < num_events; ++i)
{
Modified: branches/release/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/epoll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/epoll_reactor.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -472,9 +472,6 @@
lock.lock();
wait_in_progress_ = false;
- // Block signals while performing operations.
- boost::asio::detail::signal_blocker sb;
-
// Dispatch the waiting events.
for (int i = 0; i < num_events; ++i)
{
Modified: branches/release/boost/asio/detail/eventfd_select_interrupter.hpp
==============================================================================
--- branches/release/boost/asio/detail/eventfd_select_interrupter.hpp (original)
+++ branches/release/boost/asio/detail/eventfd_select_interrupter.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -24,14 +24,14 @@
#include <boost/system/system_error.hpp>
#include <boost/asio/detail/pop_options.hpp>
-#if defined(linux)
+#if defined(__linux__)
# if !defined(BOOST_ASIO_DISABLE_EVENTFD)
# include <linux/version.h>
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
# define BOOST_ASIO_HAS_EVENTFD
# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
-#endif // defined(linux)
+#endif // defined(__linux__)
#if defined(BOOST_ASIO_HAS_EVENTFD)
@@ -108,21 +108,32 @@
{
if (write_descriptor_ == read_descriptor_)
{
- // Only perform one read. The kernel maintains an atomic counter.
- uint64_t counter(0);
- int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t));
- bool was_interrupted = (bytes_read > 0);
- return was_interrupted;
+ for (;;)
+ {
+ // Only perform one read. The kernel maintains an atomic counter.
+ uint64_t counter(0);
+ errno = 0;
+ int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t));
+ if (bytes_read < 0 && errno == EINTR)
+ continue;
+ bool was_interrupted = (bytes_read > 0);
+ return was_interrupted;
+ }
}
else
{
- // Clear all data from the pipe.
- char data[1024];
- int bytes_read = ::read(read_descriptor_, data, sizeof(data));
- bool was_interrupted = (bytes_read > 0);
- while (bytes_read == sizeof(data))
- bytes_read = ::read(read_descriptor_, data, sizeof(data));
- return was_interrupted;
+ for (;;)
+ {
+ // Clear all data from the pipe.
+ char data[1024];
+ int bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ if (bytes_read < 0 && errno == EINTR)
+ continue;
+ bool was_interrupted = (bytes_read > 0);
+ while (bytes_read == sizeof(data))
+ bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ return was_interrupted;
+ }
}
}
Modified: branches/release/boost/asio/detail/handler_alloc_helpers.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_alloc_helpers.hpp (original)
+++ branches/release/boost/asio/detail/handler_alloc_helpers.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,6 +19,7 @@
#include <boost/asio/detail/push_options.hpp>
#include <boost/detail/workaround.hpp>
+#include <boost/utility/addressof.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/handler_alloc_hook.hpp>
@@ -30,24 +31,24 @@
namespace boost_asio_handler_alloc_helpers {
template <typename Handler>
-inline void* allocate(std::size_t s, Handler* h)
+inline void* allocate(std::size_t s, Handler& h)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
return ::operator new(s);
#else
using namespace boost::asio;
- return asio_handler_allocate(s, h);
+ return asio_handler_allocate(s, boost::addressof(h));
#endif
}
template <typename Handler>
-inline void deallocate(void* p, std::size_t s, Handler* h)
+inline void deallocate(void* p, std::size_t s, Handler& h)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
::operator delete(p);
#else
using namespace boost::asio;
- asio_handler_deallocate(p, s, h);
+ asio_handler_deallocate(p, s, boost::addressof(h));
#endif
}
@@ -85,7 +86,7 @@
raw_handler_ptr(handler_type& handler)
: handler_(handler),
pointer_(static_cast<pointer_type>(
- boost_asio_handler_alloc_helpers::allocate(value_size, &handler_)))
+ boost_asio_handler_alloc_helpers::allocate(value_size, handler_)))
{
}
@@ -95,7 +96,7 @@
{
if (pointer_)
boost_asio_handler_alloc_helpers::deallocate(
- pointer_, value_size, &handler_);
+ pointer_, value_size, handler_);
}
private:
@@ -239,7 +240,7 @@
{
pointer_->value_type::~value_type();
boost_asio_handler_alloc_helpers::deallocate(
- pointer_, value_size, &handler_);
+ pointer_, value_size, handler_);
pointer_ = 0;
}
}
Modified: branches/release/boost/asio/detail/handler_base_from_member.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_base_from_member.hpp (original)
+++ branches/release/boost/asio/detail/handler_base_from_member.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -50,7 +50,7 @@
handler_base_from_member<Handler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Handler>
@@ -58,7 +58,7 @@
handler_base_from_member<Handler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Handler>
@@ -66,7 +66,7 @@
handler_base_from_member<Handler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/detail/handler_invoke_helpers.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_invoke_helpers.hpp (original)
+++ branches/release/boost/asio/detail/handler_invoke_helpers.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,6 +19,7 @@
#include <boost/asio/detail/push_options.hpp>
#include <boost/detail/workaround.hpp>
+#include <boost/utility/addressof.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/handler_invoke_hook.hpp>
@@ -29,14 +30,14 @@
namespace boost_asio_handler_invoke_helpers {
template <typename Function, typename Context>
-inline void invoke(const Function& function, Context* context)
+inline void invoke(const Function& function, Context& context)
{
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
Function tmp(function);
tmp();
#else
using namespace boost::asio;
- asio_handler_invoke(function, context);
+ asio_handler_invoke(function, boost::addressof(context));
#endif
}
Modified: branches/release/boost/asio/detail/handler_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_queue.hpp (original)
+++ branches/release/boost/asio/detail/handler_queue.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -189,7 +189,7 @@
ptr.reset();
// Make the upcall.
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
}
static void do_destroy(handler* base)
Modified: branches/release/boost/asio/detail/indirect_handler_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/indirect_handler_queue.hpp (original)
+++ branches/release/boost/asio/detail/indirect_handler_queue.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -236,7 +236,7 @@
ptr.reset();
// Make the upcall.
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
}
static void do_destroy(handler* base)
Modified: branches/release/boost/asio/detail/kqueue_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/kqueue_reactor.hpp (original)
+++ branches/release/boost/asio/detail/kqueue_reactor.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -442,9 +442,6 @@
lock.lock();
wait_in_progress_ = false;
- // Block signals while performing operations.
- boost::asio::detail::signal_blocker sb;
-
// Dispatch the waiting events.
for (int i = 0; i < num_events; ++i)
{
Modified: branches/release/boost/asio/detail/kqueue_reactor_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/kqueue_reactor_fwd.hpp (original)
+++ branches/release/boost/asio/detail/kqueue_reactor_fwd.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,9 +19,11 @@
#include <boost/asio/detail/push_options.hpp>
#if !defined(BOOST_ASIO_DISABLE_KQUEUE)
-#if defined(__MACH__) && defined(__APPLE__)
-// Define this to indicate that epoll is supported on the target platform.
+#if (defined(__MACH__) && defined(__APPLE__)) \
+ || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+
+// Define this to indicate that kqueue is supported on the target platform.
#define BOOST_ASIO_HAS_KQUEUE 1
namespace boost {
@@ -35,7 +37,9 @@
} // namespace asio
} // namespace boost
-#endif // defined(__MACH__) && defined(__APPLE__)
+#endif // (defined(__MACH__) && defined(__APPLE__))
+ // || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+
#endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
#include <boost/asio/detail/pop_options.hpp>
Modified: branches/release/boost/asio/detail/pipe_select_interrupter.hpp
==============================================================================
--- branches/release/boost/asio/detail/pipe_select_interrupter.hpp (original)
+++ branches/release/boost/asio/detail/pipe_select_interrupter.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -79,12 +79,17 @@
// Reset the select interrupt. Returns true if the call was interrupted.
bool reset()
{
- char data[1024];
- int bytes_read = ::read(read_descriptor_, data, sizeof(data));
- bool was_interrupted = (bytes_read > 0);
- while (bytes_read == sizeof(data))
- bytes_read = ::read(read_descriptor_, data, sizeof(data));
- return was_interrupted;
+ for (;;)
+ {
+ char data[1024];
+ int bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ if (bytes_read < 0 && errno == EINTR)
+ continue;
+ bool was_interrupted = (bytes_read > 0);
+ while (bytes_read == sizeof(data))
+ bytes_read = ::read(read_descriptor_, data, sizeof(data));
+ return was_interrupted;
+ }
}
// Get the read descriptor to be passed to select.
Modified: branches/release/boost/asio/detail/posix_thread.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_thread.hpp (original)
+++ branches/release/boost/asio/detail/posix_thread.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -37,7 +37,7 @@
namespace asio {
namespace detail {
-extern "C" void* asio_detail_posix_thread_function(void* arg);
+extern "C" void* boost_asio_detail_posix_thread_function(void* arg);
class posix_thread
: private noncopyable
@@ -50,7 +50,7 @@
{
std::auto_ptr<func_base> arg(new func<Function>(f));
int error = ::pthread_create(&thread_, 0,
- asio_detail_posix_thread_function, arg.get());
+ boost_asio_detail_posix_thread_function, arg.get());
if (error != 0)
{
boost::system::system_error e(
@@ -80,7 +80,7 @@
}
private:
- friend void* asio_detail_posix_thread_function(void* arg);
+ friend void* boost_asio_detail_posix_thread_function(void* arg);
class func_base
{
@@ -112,7 +112,7 @@
bool joined_;
};
-inline void* asio_detail_posix_thread_function(void* arg)
+inline void* boost_asio_detail_posix_thread_function(void* arg)
{
std::auto_ptr<posix_thread::func_base> f(
static_cast<posix_thread::func_base*>(arg));
Modified: branches/release/boost/asio/detail/reactive_descriptor_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_descriptor_service.hpp (original)
+++ branches/release/boost/asio/detail/reactive_descriptor_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -348,16 +348,23 @@
boost::asio::buffer_size(buffer));
}
- // Write the data.
- int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec);
+ for (;;)
+ {
+ // Write the data.
+ int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec);
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
@@ -600,18 +607,25 @@
boost::asio::buffer_size(buffer));
}
- // Read some data.
- int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec);
- if (bytes == 0)
- ec = boost::asio::error::eof;
-
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ for (;;)
+ {
+ // Read some data.
+ int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec);
+ if (bytes == 0)
+ ec = boost::asio::error::eof;
+
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
Modified: branches/release/boost/asio/detail/reactive_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_service.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -644,16 +644,23 @@
boost::asio::buffer_size(buffer));
}
- // Send the data.
- int bytes = socket_ops::send(socket_, bufs, i, flags_, ec);
+ for (;;)
+ {
+ // Send the data.
+ int bytes = socket_ops::send(socket_, bufs, i, flags_, ec);
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
+
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
@@ -881,17 +888,24 @@
boost::asio::buffer_size(buffer));
}
- // Send the data.
- int bytes = socket_ops::sendto(socket_, bufs, i, flags_,
- destination_.data(), destination_.size(), ec);
-
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ for (;;)
+ {
+ // Send the data.
+ int bytes = socket_ops::sendto(socket_, bufs, i, flags_,
+ destination_.data(), destination_.size(), ec);
+
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
@@ -1086,18 +1100,25 @@
boost::asio::buffer_size(buffer));
}
- // Receive some data.
- int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec);
- if (bytes == 0 && protocol_type_ == SOCK_STREAM)
- ec = boost::asio::error::eof;
-
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ for (;;)
+ {
+ // Receive some data.
+ int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec);
+ if (bytes == 0 && protocol_type_ == SOCK_STREAM)
+ ec = boost::asio::error::eof;
+
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
@@ -1331,21 +1352,28 @@
boost::asio::buffer_size(buffer));
}
- // Receive some data.
- std::size_t addr_len = sender_endpoint_.capacity();
- int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_,
- sender_endpoint_.data(), &addr_len, ec);
- if (bytes == 0 && protocol_type_ == SOCK_STREAM)
- ec = boost::asio::error::eof;
-
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
+ for (;;)
+ {
+ // Receive some data.
+ std::size_t addr_len = sender_endpoint_.capacity();
+ int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_,
+ sender_endpoint_.data(), &addr_len, ec);
+ if (bytes == 0 && protocol_type_ == SOCK_STREAM)
+ ec = boost::asio::error::eof;
+
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
- sender_endpoint_.resize(addr_len);
- bytes_transferred = (bytes < 0 ? 0 : bytes);
- return true;
+ sender_endpoint_.resize(addr_len);
+ bytes_transferred = (bytes < 0 ? 0 : bytes);
+ return true;
+ }
}
void complete(const boost::system::error_code& ec,
@@ -1535,43 +1563,50 @@
if (ec)
return true;
- // Accept the waiting connection.
- socket_holder new_socket;
- std::size_t addr_len = 0;
- if (peer_endpoint_)
+ for (;;)
{
- addr_len = peer_endpoint_->capacity();
- new_socket.reset(socket_ops::accept(socket_,
- peer_endpoint_->data(), &addr_len, ec));
- }
- else
- {
- new_socket.reset(socket_ops::accept(socket_, 0, 0, ec));
- }
+ // Accept the waiting connection.
+ socket_holder new_socket;
+ std::size_t addr_len = 0;
+ if (peer_endpoint_)
+ {
+ addr_len = peer_endpoint_->capacity();
+ new_socket.reset(socket_ops::accept(socket_,
+ peer_endpoint_->data(), &addr_len, ec));
+ }
+ else
+ {
+ new_socket.reset(socket_ops::accept(socket_, 0, 0, ec));
+ }
- // Check if we need to run the operation again.
- if (ec == boost::asio::error::would_block
- || ec == boost::asio::error::try_again)
- return false;
- if (ec == boost::asio::error::connection_aborted
- && !enable_connection_aborted_)
- return false;
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
+ if (ec == boost::asio::error::connection_aborted
+ && !enable_connection_aborted_)
+ return false;
#if defined(EPROTO)
- if (ec.value() == EPROTO && !enable_connection_aborted_)
- return false;
+ if (ec.value() == EPROTO && !enable_connection_aborted_)
+ return false;
#endif // defined(EPROTO)
- // Transfer ownership of the new socket to the peer object.
- if (!ec)
- {
- if (peer_endpoint_)
- peer_endpoint_->resize(addr_len);
- peer_.assign(protocol_, new_socket.get(), ec);
+ // Transfer ownership of the new socket to the peer object.
if (!ec)
- new_socket.release();
- }
+ {
+ if (peer_endpoint_)
+ peer_endpoint_->resize(addr_len);
+ peer_.assign(protocol_, new_socket.get(), ec);
+ if (!ec)
+ new_socket.release();
+ }
- return true;
+ return true;
+ }
}
void complete(const boost::system::error_code& ec, std::size_t)
Modified: branches/release/boost/asio/detail/select_interrupter.hpp
==============================================================================
--- branches/release/boost/asio/detail/select_interrupter.hpp (original)
+++ branches/release/boost/asio/detail/select_interrupter.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -21,9 +21,12 @@
#include <boost/config.hpp>
#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/detail/eventfd_select_interrupter.hpp>
-#include <boost/asio/detail/pipe_select_interrupter.hpp>
-#include <boost/asio/detail/socket_select_interrupter.hpp>
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# include <boost/asio/detail/socket_select_interrupter.hpp>
+#else
+# include <boost/asio/detail/eventfd_select_interrupter.hpp>
+# include <boost/asio/detail/pipe_select_interrupter.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/detail/select_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/select_reactor.hpp (original)
+++ branches/release/boost/asio/detail/select_reactor.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -369,9 +369,6 @@
lock.lock();
select_in_progress_ = false;
- // Block signals while dispatching operations.
- boost::asio::detail::signal_blocker sb;
-
// Reset the interrupter.
if (retval > 0 && read_fds.is_set(interrupter_.read_descriptor()))
interrupter_.reset();
Modified: branches/release/boost/asio/detail/socket_ops.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_ops.hpp (original)
+++ branches/release/boost/asio/detail/socket_ops.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -1388,8 +1388,9 @@
break;
case AF_INET:
case AF_INET6:
- if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM)
- return EAI_SOCKTYPE;
+ if (service != 0 && service[0] != '\0')
+ if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM)
+ return EAI_SOCKTYPE;
break;
default:
return EAI_FAMILY;
Modified: branches/release/boost/asio/detail/socket_select_interrupter.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_select_interrupter.hpp (original)
+++ branches/release/boost/asio/detail/socket_select_interrupter.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -72,6 +72,11 @@
boost::throw_exception(e);
}
+ // Some broken firewalls on Windows will intermittently cause getsockname to
+ // return 0.0.0.0 when the socket is actually bound to 127.0.0.1. We
+ // explicitly specify the target address here to work around this problem.
+ addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+
if (socket_ops::listen(acceptor.get(),
SOMAXCONN, ec) == socket_error_retval)
{
Modified: branches/release/boost/asio/detail/strand_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/strand_service.hpp (original)
+++ branches/release/boost/asio/detail/strand_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -20,8 +20,8 @@
#include <boost/asio/detail/push_options.hpp>
#include <boost/aligned_storage.hpp>
#include <boost/assert.hpp>
-#include <boost/detail/atomic_count.hpp>
-#include <boost/intrusive_ptr.hpp>
+#include <boost/functional/hash.hpp>
+#include <boost/scoped_ptr.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/io_service.hpp>
@@ -49,20 +49,12 @@
// The underlying implementation of a strand.
class strand_impl
{
-#if defined (__BORLANDC__)
public:
-#else
- private:
-#endif
- void add_ref()
- {
- ++ref_count_;
- }
-
- void release()
+ strand_impl()
+ : current_handler_(0),
+ first_waiter_(0),
+ last_waiter_(0)
{
- if (--ref_count_ == 0)
- delete this;
}
private:
@@ -71,55 +63,9 @@
friend class post_next_waiter_on_exit;
friend class invoke_current_handler;
- strand_impl(strand_service& owner)
- : owner_(owner),
- current_handler_(0),
- first_waiter_(0),
- last_waiter_(0),
- ref_count_(0)
- {
- // Insert implementation into linked list of all implementations.
- boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_);
- next_ = owner_.impl_list_;
- prev_ = 0;
- if (owner_.impl_list_)
- owner_.impl_list_->prev_ = this;
- owner_.impl_list_ = this;
- }
-
- ~strand_impl()
- {
- // Remove implementation from linked list of all implementations.
- boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_);
- if (owner_.impl_list_ == this)
- owner_.impl_list_ = next_;
- if (prev_)
- prev_->next_ = next_;
- if (next_)
- next_->prev_= prev_;
- next_ = 0;
- prev_ = 0;
- lock.unlock();
-
- if (current_handler_)
- {
- current_handler_->destroy();
- }
-
- while (first_waiter_)
- {
- handler_base* next = first_waiter_->next_;
- first_waiter_->destroy();
- first_waiter_ = next;
- }
- }
-
// Mutex to protect access to internal data.
boost::asio::detail::mutex mutex_;
- // The service that owns this implementation.
- strand_service& owner_;
-
// The handler that is ready to execute. If this pointer is non-null then it
// indicates that a handler holds the lock.
handler_base* current_handler_;
@@ -137,30 +83,11 @@
#else
handler_storage_type handler_storage_;
#endif
-
- // Pointers to adjacent socket implementations in linked list.
- strand_impl* next_;
- strand_impl* prev_;
-
- // The reference count on the strand implementation.
- boost::detail::atomic_count ref_count_;
-
-#if !defined(__BORLANDC__)
- friend void intrusive_ptr_add_ref(strand_impl* p)
- {
- p->add_ref();
- }
-
- friend void intrusive_ptr_release(strand_impl* p)
- {
- p->release();
- }
-#endif
};
friend class strand_impl;
- typedef boost::intrusive_ptr<strand_impl> implementation_type;
+ typedef strand_impl* implementation_type;
// Base class for all handler types.
class handler_base
@@ -328,10 +255,10 @@
ptr.reset();
// Indicate that this strand is executing on the current thread.
- call_stack<strand_impl>::context ctx(impl.get());
+ call_stack<strand_impl>::context ctx(impl);
// Make the upcall.
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
}
static void do_destroy(handler_base* base)
@@ -361,7 +288,7 @@
explicit strand_service(boost::asio::io_service& io_service)
: boost::asio::detail::service_base<strand_service>(io_service),
mutex_(),
- impl_list_(0)
+ salt_(0)
{
}
@@ -370,24 +297,25 @@
{
// Construct a list of all handlers to be destroyed.
boost::asio::detail::mutex::scoped_lock lock(mutex_);
- strand_impl* impl = impl_list_;
handler_base* first_handler = 0;
- while (impl)
+ for (std::size_t i = 0; i < num_implementations; ++i)
{
- if (impl->current_handler_)
+ if (strand_impl* impl = implementations_[i].get())
{
- impl->current_handler_->next_ = first_handler;
- first_handler = impl->current_handler_;
- impl->current_handler_ = 0;
- }
- if (impl->first_waiter_)
- {
- impl->last_waiter_->next_ = first_handler;
- first_handler = impl->first_waiter_;
- impl->first_waiter_ = 0;
- impl->last_waiter_ = 0;
+ if (impl->current_handler_)
+ {
+ impl->current_handler_->next_ = first_handler;
+ first_handler = impl->current_handler_;
+ impl->current_handler_ = 0;
+ }
+ if (impl->first_waiter_)
+ {
+ impl->last_waiter_->next_ = first_handler;
+ first_handler = impl->first_waiter_;
+ impl->first_waiter_ = 0;
+ impl->last_waiter_ = 0;
+ }
}
- impl = impl->next_;
}
// Destroy all handlers without holding the lock.
@@ -403,22 +331,30 @@
// Construct a new strand implementation.
void construct(implementation_type& impl)
{
- impl = implementation_type(new strand_impl(*this));
+ std::size_t index = boost::hash_value(&impl);
+ boost::hash_combine(index, salt_++);
+ index = index % num_implementations;
+
+ boost::asio::detail::mutex::scoped_lock lock(mutex_);
+
+ if (!implementations_[index])
+ implementations_[index].reset(new strand_impl);
+ impl = implementations_[index].get();
}
// Destroy a strand implementation.
void destroy(implementation_type& impl)
{
- implementation_type().swap(impl);
+ impl = 0;
}
// Request the io_service to invoke the given handler.
template <typename Handler>
void dispatch(implementation_type& impl, Handler handler)
{
- if (call_stack<strand_impl>::contains(impl.get()))
+ if (call_stack<strand_impl>::contains(impl))
{
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
}
else
{
@@ -496,37 +432,24 @@
}
private:
- // Mutex to protect access to the linked list of implementations.
+ // Mutex to protect access to the array of implementations.
boost::asio::detail::mutex mutex_;
+ // Number of implementations shared between all strand objects.
+ enum { num_implementations = 193 };
+
// The head of a linked list of all implementations.
- strand_impl* impl_list_;
+ boost::scoped_ptr<strand_impl> implementations_[num_implementations];
+
+ // Extra value used when hashing to prevent recycled memory locations from
+ // getting the same strand implementation.
+ std::size_t salt_;
};
} // namespace detail
} // namespace asio
} // namespace boost
-#if defined(__BORLANDC__)
-
-namespace boost {
-
-inline void intrusive_ptr_add_ref(
- boost::asio::detail::strand_service::strand_impl* p)
-{
- p->add_ref();
-}
-
-inline void intrusive_ptr_release(
- boost::asio::detail::strand_service::strand_impl* p)
-{
- p->release();
-}
-
-} // namespace boost
-
-#endif // defined(__BORLANDC__)
-
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_DETAIL_STRAND_SERVICE_HPP
Modified: branches/release/boost/asio/detail/task_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service.hpp (original)
+++ branches/release/boost/asio/detail/task_io_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -177,7 +177,7 @@
void dispatch(Handler handler)
{
if (call_stack<task_io_service>::contains(this))
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
else
post(handler);
}
Modified: branches/release/boost/asio/detail/task_io_service_2lock.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service_2lock.hpp (original)
+++ branches/release/boost/asio/detail/task_io_service_2lock.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -207,7 +207,7 @@
void dispatch(Handler handler)
{
if (call_stack<task_io_service>::contains(this))
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
else
post(handler);
}
Modified: branches/release/boost/asio/detail/win_iocp_handle_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_handle_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_handle_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -415,7 +415,7 @@
boost::system::error_code ec(last_error,
boost::asio::error::get_system_category());
boost_asio_handler_invoke_helpers::invoke(
- bind_handler(handler, ec, bytes_transferred), &handler);
+ bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -457,13 +457,6 @@
void async_write_some_at(implementation_type& impl, boost::uint64_t offset,
const ConstBufferSequence& buffers, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId();
@@ -476,6 +469,13 @@
raw_handler_ptr<alloc_traits> raw_ptr(handler);
handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Find first buffer of non-zero length.
boost::asio::const_buffer buffer;
typename ConstBufferSequence::const_iterator iter = buffers.begin();
@@ -490,10 +490,8 @@
// A request to write 0 bytes on a handle is a no-op.
if (boost::asio::buffer_size(buffer) == 0)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code error;
- iocp_service_.post(bind_handler(handler, error, 0));
+ ptr.get()->on_immediate_completion(0, 0);
+ ptr.release();
return;
}
@@ -510,14 +508,12 @@
// Check if the operation completed immediately.
if (!ok && last_error != ERROR_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -671,7 +667,7 @@
// Call the handler.
boost_asio_handler_invoke_helpers::invoke(
- bind_handler(handler, ec, bytes_transferred), &handler);
+ bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -716,13 +712,6 @@
void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
const MutableBufferSequence& buffers, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId();
@@ -735,6 +724,13 @@
raw_handler_ptr<alloc_traits> raw_ptr(handler);
handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Find first buffer of non-zero length.
boost::asio::mutable_buffer buffer;
typename MutableBufferSequence::const_iterator iter = buffers.begin();
@@ -749,10 +745,8 @@
// A request to receive 0 bytes on a stream handle is a no-op.
if (boost::asio::buffer_size(buffer) == 0)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code error;
- iocp_service_.post(bind_handler(handler, error, 0));
+ ptr.get()->on_immediate_completion(0, 0);
+ ptr.release();
return;
}
@@ -767,14 +761,12 @@
DWORD last_error = ::GetLastError();
if (!ok && last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
Modified: branches/release/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_io_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -50,6 +50,8 @@
// This class inherits from OVERLAPPED so that we can downcast to get back to
// the operation pointer from the LPOVERLAPPED out parameter of
// GetQueuedCompletionStatus.
+ class operation;
+ friend class operation;
class operation
: public OVERLAPPED
{
@@ -59,7 +61,10 @@
operation(win_iocp_io_service& iocp_service,
invoke_func_type invoke_func, destroy_func_type destroy_func)
- : outstanding_operations_(&iocp_service.outstanding_operations_),
+ : iocp_service_(iocp_service),
+ ready_(0),
+ last_error_(~DWORD(0)),
+ bytes_transferred_(0),
invoke_func_(invoke_func),
destroy_func_(destroy_func)
{
@@ -69,12 +74,48 @@
OffsetHigh = 0;
hEvent = 0;
- ::InterlockedIncrement(outstanding_operations_);
+ ::InterlockedIncrement(&iocp_service_.outstanding_operations_);
+ }
+
+ void reset()
+ {
+ Internal = 0;
+ InternalHigh = 0;
+ Offset = 0;
+ OffsetHigh = 0;
+ hEvent = 0;
+ ready_ = 0;
+ last_error_ = ~DWORD(0);
+ bytes_transferred_ = 0;
+ }
+
+ void on_pending()
+ {
+ if (::InterlockedCompareExchange(&ready_, 1, 0) == 1)
+ iocp_service_.post_completion(this, last_error_, bytes_transferred_);
}
- void do_completion(DWORD last_error, size_t bytes_transferred)
+ void on_immediate_completion(DWORD last_error, size_t bytes_transferred)
{
- invoke_func_(this, last_error, bytes_transferred);
+ ready_ = 1;
+ iocp_service_.post_completion(this, last_error, bytes_transferred);
+ }
+
+ bool on_completion(DWORD last_error, size_t bytes_transferred)
+ {
+ if (last_error_ == ~DWORD(0))
+ {
+ last_error_ = last_error;
+ bytes_transferred_ = bytes_transferred;
+ }
+
+ if (::InterlockedCompareExchange(&ready_, 1, 0) == 1)
+ {
+ invoke_func_(this, last_error_, bytes_transferred_);
+ return true;
+ }
+
+ return false;
}
void destroy()
@@ -86,16 +127,18 @@
// Prevent deletion through this type.
~operation()
{
- ::InterlockedDecrement(outstanding_operations_);
+ ::InterlockedDecrement(&iocp_service_.outstanding_operations_);
}
private:
- long* outstanding_operations_;
+ win_iocp_io_service& iocp_service_;
+ long ready_;
+ DWORD last_error_;
+ std::size_t bytes_transferred_;
invoke_func_type invoke_func_;
destroy_func_type destroy_func_;
};
-
// Constructor.
win_iocp_io_service(boost::asio::io_service& io_service)
: boost::asio::detail::service_base<win_iocp_io_service>(io_service),
@@ -276,7 +319,7 @@
void dispatch(Handler handler)
{
if (call_stack<win_iocp_io_service>::contains(this))
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
else
post(handler);
}
@@ -296,15 +339,7 @@
handler_ptr<alloc_traits> ptr(raw_ptr, *this, handler);
// Enqueue the operation on the I/O completion port.
- if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, ptr.get()))
- {
- DWORD last_error = ::GetLastError();
- boost::system::system_error e(
- boost::system::error_code(last_error,
- boost::asio::error::get_system_category()),
- "pqcs");
- boost::throw_exception(e);
- }
+ ptr.get()->on_immediate_completion(0, 0);
// Operation has been successfully posted.
ptr.release();
@@ -507,10 +542,11 @@
// Dispatch the operation.
operation* op = static_cast<operation*>(overlapped);
- op->do_completion(last_error, bytes_transferred);
-
- ec = boost::system::error_code();
- return 1;
+ if (op->on_completion(last_error, bytes_transferred))
+ {
+ ec = boost::system::error_code();
+ return 1;
+ }
}
else if (completion_key == transfer_timer_dispatching)
{
@@ -648,7 +684,7 @@
ptr.reset();
// Make the upcall.
- boost_asio_handler_invoke_helpers::invoke(handler, &handler);
+ boost_asio_handler_invoke_helpers::invoke(handler, handler);
}
static void destroy_impl(operation* op)
Modified: branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -92,6 +92,9 @@
// Release ownership of the OVERLAPPED object.
OVERLAPPED* release()
{
+ if (ptr_)
+ ptr_->on_pending();
+
OVERLAPPED* tmp = ptr_;
ptr_ = 0;
return tmp;
@@ -104,8 +107,7 @@
if (ptr_)
{
ptr_->ec_ = ec;
- ptr_->io_service_.post_completion(ptr_, 0,
- static_cast<DWORD>(bytes_transferred));
+ ptr_->on_immediate_completion(0, static_cast<DWORD>(bytes_transferred));
ptr_ = 0;
}
}
@@ -171,7 +173,7 @@
// Make the upcall.
boost_asio_handler_invoke_helpers::invoke(
- bind_handler(handler, ec, bytes_transferred), &handler);
+ bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(win_iocp_io_service::operation* op)
Modified: branches/release/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -789,7 +789,7 @@
// Call the handler.
boost_asio_handler_invoke_helpers::invoke(
- detail::bind_handler(handler, ec, bytes_transferred), &handler);
+ detail::bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -823,13 +823,6 @@
void async_send(implementation_type& impl, const ConstBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
#if defined(BOOST_ASIO_ENABLE_CANCELIO)
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
@@ -845,6 +838,13 @@
handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_,
impl.cancel_token_, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Copy buffers into WSABUF array.
::WSABUF bufs[max_buffers];
typename ConstBufferSequence::const_iterator iter = buffers.begin();
@@ -863,10 +863,8 @@
// A request to receive 0 bytes on a stream socket is a no-op.
if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code error;
- iocp_service_.post(bind_handler(handler, error, 0));
+ ptr.get()->on_immediate_completion(0, 0);
+ ptr.release();
return;
}
@@ -879,14 +877,12 @@
// Check if the operation completed immediately.
if (result != 0 && last_error != WSA_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -1068,7 +1064,7 @@
// Call the handler.
boost_asio_handler_invoke_helpers::invoke(
- detail::bind_handler(handler, ec, bytes_transferred), &handler);
+ detail::bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -1102,13 +1098,6 @@
const ConstBufferSequence& buffers, const endpoint_type& destination,
socket_base::message_flags flags, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
#if defined(BOOST_ASIO_ENABLE_CANCELIO)
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
@@ -1123,6 +1112,13 @@
raw_handler_ptr<alloc_traits> raw_ptr(handler);
handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Copy buffers into WSABUF array.
::WSABUF bufs[max_buffers];
typename ConstBufferSequence::const_iterator iter = buffers.begin();
@@ -1145,14 +1141,12 @@
// Check if the operation completed immediately.
if (result != 0 && last_error != WSA_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -1339,7 +1333,7 @@
// Call the handler.
boost_asio_handler_invoke_helpers::invoke(
- detail::bind_handler(handler, ec, bytes_transferred), &handler);
+ detail::bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -1375,13 +1369,6 @@
const MutableBufferSequence& buffers,
socket_base::message_flags flags, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
#if defined(BOOST_ASIO_ENABLE_CANCELIO)
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
@@ -1398,6 +1385,13 @@
handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type,
iocp_service_, impl.cancel_token_, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Copy buffers into WSABUF array.
::WSABUF bufs[max_buffers];
typename MutableBufferSequence::const_iterator iter = buffers.begin();
@@ -1415,10 +1409,8 @@
// A request to receive 0 bytes on a stream socket is a no-op.
if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code error;
- iocp_service_.post(bind_handler(handler, error, 0));
+ ptr.get()->on_immediate_completion(0, 0);
+ ptr.release();
return;
}
@@ -1430,14 +1422,12 @@
DWORD last_error = ::WSAGetLastError();
if (result != 0 && last_error != WSA_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -1482,14 +1472,12 @@
DWORD last_error = ::WSAGetLastError();
if (result != 0 && last_error != WSA_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -1672,7 +1660,7 @@
// Call the handler.
boost_asio_handler_invoke_helpers::invoke(
- detail::bind_handler(handler, ec, bytes_transferred), &handler);
+ detail::bind_handler(handler, ec, bytes_transferred), handler);
}
static void destroy_impl(operation* op)
@@ -1710,13 +1698,6 @@
const MutableBufferSequence& buffers, endpoint_type& sender_endp,
socket_base::message_flags flags, Handler handler)
{
- if (!is_open(impl))
- {
- this->get_io_service().post(bind_handler(handler,
- boost::asio::error::bad_descriptor, 0));
- return;
- }
-
#if defined(BOOST_ASIO_ENABLE_CANCELIO)
// Update the ID of the thread from which cancellation is safe.
if (impl.safe_cancellation_thread_id_ == 0)
@@ -1733,6 +1714,13 @@
handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type,
iocp_service_, sender_endp, buffers, handler);
+ if (!is_open(impl))
+ {
+ ptr.get()->on_immediate_completion(WSAEBADF, 0);
+ ptr.release();
+ return;
+ }
+
// Copy buffers into WSABUF array.
::WSABUF bufs[max_buffers];
typename MutableBufferSequence::const_iterator iter = buffers.begin();
@@ -1754,14 +1742,12 @@
DWORD last_error = ::WSAGetLastError();
if (result != 0 && last_error != WSA_IO_PENDING)
{
- boost::asio::io_service::work work(this->get_io_service());
- ptr.reset();
- boost::system::error_code ec(last_error,
- boost::asio::error::get_system_category());
- iocp_service_.post(bind_handler(handler, ec, bytes_transferred));
+ ptr.get()->on_immediate_completion(last_error, bytes_transferred);
+ ptr.release();
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
@@ -1925,11 +1911,7 @@
&& !ptr.get()->enable_connection_aborted_)
{
// Reset OVERLAPPED structure.
- ptr.get()->Internal = 0;
- ptr.get()->InternalHigh = 0;
- ptr.get()->Offset = 0;
- ptr.get()->OffsetHigh = 0;
- ptr.get()->hEvent = 0;
+ ptr.get()->reset();
// Create a new socket for the next connection, since the AcceptEx call
// fails with WSAEINVAL if we try to reuse the same socket.
@@ -1954,7 +1936,7 @@
|| last_error == WSAECONNABORTED)
{
// Post this handler so that operation will be restarted again.
- ptr.get()->io_service_.post_completion(ptr.get(), last_error, 0);
+ ptr.get()->on_immediate_completion(last_error, 0);
ptr.release();
return;
}
@@ -1966,6 +1948,7 @@
else
{
// Asynchronous operation has been successfully restarted.
+ ptr.get()->on_pending();
ptr.release();
return;
}
@@ -2038,7 +2021,7 @@
boost::system::error_code ec(last_error,
boost::asio::error::get_system_category());
boost_asio_handler_invoke_helpers::invoke(
- detail::bind_handler(handler, ec), &handler);
+ detail::bind_handler(handler, ec), handler);
}
static void destroy_impl(operation* op)
@@ -2141,7 +2124,7 @@
// Post handler so that operation will be restarted again. We do not
// perform the AcceptEx again here to avoid the possibility of starving
// other handlers.
- iocp_service_.post_completion(ptr.get(), last_error, 0);
+ ptr.get()->on_immediate_completion(last_error, 0);
ptr.release();
}
else
@@ -2155,6 +2138,7 @@
}
else
{
+ ptr.get()->on_pending();
ptr.release();
}
}
Modified: branches/release/boost/asio/detail/wrapped_handler.hpp
==============================================================================
--- branches/release/boost/asio/detail/wrapped_handler.hpp (original)
+++ branches/release/boost/asio/detail/wrapped_handler.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,7 @@
#include <boost/asio/detail/push_options.hpp>
#include <boost/asio/detail/push_options.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/add_reference.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/detail/bind_handler.hpp>
@@ -158,7 +158,7 @@
wrapped_handler<Dispatcher, Handler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename Dispatcher, typename Handler>
@@ -166,7 +166,7 @@
wrapped_handler<Dispatcher, Handler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename Dispatcher, typename Handler>
@@ -183,7 +183,7 @@
rewrapped_handler<Handler, Context>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->context_);
+ size, this_handler->context_);
}
template <typename Handler, typename Context>
@@ -191,7 +191,7 @@
rewrapped_handler<Handler, Context>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->context_);
+ pointer, size, this_handler->context_);
}
template <typename Function, typename Handler, typename Context>
@@ -199,7 +199,7 @@
rewrapped_handler<Handler, Context>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->context_);
+ function, this_handler->context_);
}
} // namespace detail
Modified: branches/release/boost/asio/impl/io_service.ipp
==============================================================================
--- branches/release/boost/asio/impl/io_service.ipp (original)
+++ branches/release/boost/asio/impl/io_service.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -21,14 +21,24 @@
#include <limits>
#include <boost/asio/detail/pop_options.hpp>
-#include <boost/asio/detail/dev_poll_reactor.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_registry.hpp>
-#include <boost/asio/detail/task_io_service.hpp>
#include <boost/asio/detail/throw_error.hpp>
-#include <boost/asio/detail/win_iocp_io_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_io_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/task_io_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/task_io_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/task_io_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/task_io_service.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/impl/read.ipp
==============================================================================
--- branches/release/boost/asio/impl/read.ipp (original)
+++ branches/release/boost/asio/impl/read.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -174,7 +174,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename MutableBufferSequence,
@@ -184,7 +184,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream,
@@ -195,7 +195,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -285,7 +285,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename Allocator,
@@ -295,7 +295,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream,
@@ -305,7 +305,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/impl/read_at.ipp
==============================================================================
--- branches/release/boost/asio/impl/read_at.ipp (original)
+++ branches/release/boost/asio/impl/read_at.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -184,7 +184,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice,
@@ -195,7 +195,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
@@ -206,7 +206,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -301,7 +301,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncRandomAccessReadDevice, typename Allocator,
@@ -311,7 +311,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessReadDevice,
@@ -321,7 +321,7 @@
CompletionCondition, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/impl/read_until.ipp
==============================================================================
--- branches/release/boost/asio/impl/read_until.ipp (original)
+++ branches/release/boost/asio/impl/read_until.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -404,7 +404,7 @@
Allocator, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
@@ -413,7 +413,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream, typename Allocator,
@@ -423,7 +423,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -560,7 +560,7 @@
Allocator, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
@@ -569,7 +569,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream,
@@ -579,7 +579,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -733,7 +733,7 @@
Allocator, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
@@ -742,7 +742,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream, typename Allocator,
@@ -752,7 +752,7 @@
Allocator, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -903,7 +903,7 @@
Allocator, MatchCondition, ReadHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncReadStream, typename Allocator,
@@ -913,7 +913,7 @@
Allocator, MatchCondition, ReadHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncReadStream, typename Allocator,
@@ -923,7 +923,7 @@
Allocator, MatchCondition, ReadHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/impl/write.ipp
==============================================================================
--- branches/release/boost/asio/impl/write.ipp (original)
+++ branches/release/boost/asio/impl/write.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -155,7 +155,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncWriteStream, typename ConstBufferSequence,
@@ -165,7 +165,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncWriteStream,
@@ -176,7 +176,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -246,7 +246,7 @@
Allocator, WriteHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncWriteStream, typename Allocator,
@@ -256,7 +256,7 @@
Allocator, WriteHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncWriteStream, typename Allocator,
@@ -266,7 +266,7 @@
Allocator, WriteHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/impl/write_at.ipp
==============================================================================
--- branches/release/boost/asio/impl/write_at.ipp (original)
+++ branches/release/boost/asio/impl/write_at.ipp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -167,7 +167,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
@@ -177,7 +177,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessWriteDevice,
@@ -188,7 +188,7 @@
CompletionCondition, WriteHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
@@ -261,7 +261,7 @@
Allocator, WriteHandler>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
- size, &this_handler->handler_);
+ size, this_handler->handler_);
}
template <typename AsyncRandomAccessWriteDevice, typename Allocator,
@@ -271,7 +271,7 @@
Allocator, WriteHandler>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
- pointer, size, &this_handler->handler_);
+ pointer, size, this_handler->handler_);
}
template <typename Function, typename AsyncRandomAccessWriteDevice,
@@ -281,7 +281,7 @@
Allocator, WriteHandler>* this_handler)
{
boost_asio_handler_invoke_helpers::invoke(
- function, &this_handler->handler_);
+ function, this_handler->handler_);
}
} // namespace detail
Modified: branches/release/boost/asio/posix/stream_descriptor_service.hpp
==============================================================================
--- branches/release/boost/asio/posix/stream_descriptor_service.hpp (original)
+++ branches/release/boost/asio/posix/stream_descriptor_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -24,11 +24,7 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/reactive_descriptor_service.hpp>
#if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
@@ -39,6 +35,20 @@
#if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \
|| defined(GENERATING_DOCUMENTATION)
+#if defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/reactive_descriptor_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/reactive_descriptor_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/reactive_descriptor_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/reactive_descriptor_service.hpp>
+#endif
+
namespace boost {
namespace asio {
namespace posix {
Modified: branches/release/boost/asio/raw_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/raw_socket_service.hpp (original)
+++ branches/release/boost/asio/raw_socket_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -24,12 +24,23 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/reactive_socket_service.hpp>
-#include <boost/asio/detail/win_iocp_socket_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/socket_acceptor_service.hpp
==============================================================================
--- branches/release/boost/asio/socket_acceptor_service.hpp (original)
+++ branches/release/boost/asio/socket_acceptor_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -20,12 +20,23 @@
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/reactive_socket_service.hpp>
-#include <boost/asio/detail/win_iocp_socket_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/boost/asio/ssl/stream.hpp
==============================================================================
--- branches/release/boost/asio/ssl/stream.hpp (original)
+++ branches/release/boost/asio/ssl/stream.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -22,7 +22,7 @@
#include <cstddef>
#include <boost/config.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/remove_reference.hpp>
#include <boost/asio/detail/pop_options.hpp>
#include <boost/asio/error.hpp>
Modified: branches/release/boost/asio/stream_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/stream_socket_service.hpp (original)
+++ branches/release/boost/asio/stream_socket_service.hpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -24,12 +24,23 @@
#include <boost/asio/error.hpp>
#include <boost/asio/io_service.hpp>
-#include <boost/asio/detail/epoll_reactor.hpp>
-#include <boost/asio/detail/kqueue_reactor.hpp>
-#include <boost/asio/detail/select_reactor.hpp>
#include <boost/asio/detail/service_base.hpp>
-#include <boost/asio/detail/win_iocp_socket_service.hpp>
-#include <boost/asio/detail/reactive_socket_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_EPOLL)
+# include <boost/asio/detail/epoll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_KQUEUE)
+# include <boost/asio/detail/kqueue_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#elif defined(BOOST_ASIO_HAS_DEV_POLL)
+# include <boost/asio/detail/dev_poll_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#else
+# include <boost/asio/detail/select_reactor.hpp>
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#endif
namespace boost {
namespace asio {
Modified: branches/release/libs/asio/example/porthopper/client.cpp
==============================================================================
--- branches/release/libs/asio/example/porthopper/client.cpp (original)
+++ branches/release/libs/asio/example/porthopper/client.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -92,9 +92,9 @@
data_endpoint.port(), new_data_endpoint.port());
boost::system::error_code control_result;
boost::asio::async_write(control_socket, change.to_buffers(),
- lambda::unlambda((
+ (
lambda::var(control_result) = lambda::_1
- )));
+ ));
// Try to receive a frame from the server on the new data socket. If we
// successfully receive a frame on this new data socket we can consider
@@ -104,7 +104,7 @@
frame f1;
boost::system::error_code new_data_socket_result;
new_data_socket->async_receive(f1.to_buffers(),
- lambda::unlambda((
+ (
// Note: lambda::_1 is the first argument to the callback handler,
// which in this case is the error code for the operation.
lambda::var(new_data_socket_result) = lambda::_1,
@@ -115,7 +115,7 @@
// outstanding receive operation on the old data socket.
lambda::var(data_socket) = shared_ptr<udp::socket>()
]
- )));
+ ));
// This loop will continue until we have successfully completed the
// renegotiation (i.e. received a frame on the new data socket), or some
@@ -134,7 +134,7 @@
if (data_socket) // Might have been closed by new_data_socket's handler.
{
data_socket->async_receive(f2.to_buffers(), 0,
- lambda::unlambda((
+ (
lambda::if_(!lambda::_1)
[
// We have successfully received a frame on the old data
@@ -142,7 +142,7 @@
lambda::bind(&boost::asio::io_service::stop, &io_service),
lambda::var(done) = false
]
- )));
+ ));
}
// Run the operations in parallel. This will block until all operations
Modified: branches/release/libs/asio/test/buffered_read_stream.cpp
==============================================================================
--- branches/release/libs/asio/test/buffered_read_stream.cpp (original)
+++ branches/release/libs/asio/test/buffered_read_stream.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,10 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
typedef boost::asio::buffered_read_stream<
Modified: branches/release/libs/asio/test/buffered_stream.cpp
==============================================================================
--- branches/release/libs/asio/test/buffered_stream.cpp (original)
+++ branches/release/libs/asio/test/buffered_stream.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,10 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
typedef boost::asio::buffered_stream<
Modified: branches/release/libs/asio/test/buffered_write_stream.cpp
==============================================================================
--- branches/release/libs/asio/test/buffered_write_stream.cpp (original)
+++ branches/release/libs/asio/test/buffered_write_stream.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,10 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/buffer.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
typedef boost::asio::buffered_write_stream<
Modified: branches/release/libs/asio/test/buffers_iterator.cpp
==============================================================================
--- branches/release/libs/asio/test/buffers_iterator.cpp (original)
+++ branches/release/libs/asio/test/buffers_iterator.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,7 @@
// Test that header file is self-contained.
#include <boost/asio/buffers_iterator.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/buffer.hpp>
#include "unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/deadline_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/deadline_timer.cpp (original)
+++ branches/release/libs/asio/test/deadline_timer.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -17,7 +17,8 @@
#include <boost/asio/deadline_timer.hpp>
#include <boost/bind.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
using namespace boost::posix_time;
Modified: branches/release/libs/asio/test/io_service.cpp
==============================================================================
--- branches/release/libs/asio/test/io_service.cpp (original)
+++ branches/release/libs/asio/test/io_service.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -17,9 +17,9 @@
#include <boost/asio/io_service.hpp>
#include <sstream>
-#include <boost/bind.hpp>
-#include <boost/asio.hpp>
#include <boost/thread.hpp>
+#include <boost/bind.hpp>
+#include <boost/asio/deadline_timer.hpp>
#include "unit_test.hpp"
using namespace boost::asio;
Modified: branches/release/libs/asio/test/ip/host_name.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/host_name.cpp (original)
+++ branches/release/libs/asio/test/ip/host_name.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,6 @@
// Test that header file is self-contained.
#include <boost/asio/ip/host_name.hpp>
-#include <boost/asio.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/ip/multicast.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/multicast.cpp (original)
+++ branches/release/libs/asio/test/ip/multicast.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,8 @@
// Test that header file is self-contained.
#include <boost/asio/ip/multicast.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/ip/tcp.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/tcp.cpp (original)
+++ branches/release/libs/asio/test/ip/tcp.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,7 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
#include "../archetypes/io_control_command.hpp"
Modified: branches/release/libs/asio/test/ip/udp.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/udp.cpp (original)
+++ branches/release/libs/asio/test/ip/udp.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,8 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "../unit_test.hpp"
#include "../archetypes/io_control_command.hpp"
Modified: branches/release/libs/asio/test/ip/unicast.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/unicast.cpp (original)
+++ branches/release/libs/asio/test/ip/unicast.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,8 @@
// Test that header file is self-contained.
#include <boost/asio/ip/unicast.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/ip/v6_only.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/v6_only.cpp (original)
+++ branches/release/libs/asio/test/ip/v6_only.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include <boost/asio/ip/v6_only.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ip/udp.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/is_read_buffered.cpp
==============================================================================
--- branches/release/libs/asio/test/is_read_buffered.cpp (original)
+++ branches/release/libs/asio/test/is_read_buffered.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,10 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/buffered_read_stream.hpp>
+#include <boost/asio/buffered_write_stream.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
Modified: branches/release/libs/asio/test/is_write_buffered.cpp
==============================================================================
--- branches/release/libs/asio/test/is_write_buffered.cpp (original)
+++ branches/release/libs/asio/test/is_write_buffered.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,10 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/buffered_read_stream.hpp>
+#include <boost/asio/buffered_write_stream.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
Modified: branches/release/libs/asio/test/local/connect_pair.cpp
==============================================================================
--- branches/release/libs/asio/test/local/connect_pair.cpp (original)
+++ branches/release/libs/asio/test/local/connect_pair.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include <boost/asio/local/connect_pair.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/local/datagram_protocol.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/local/datagram_protocol.cpp
==============================================================================
--- branches/release/libs/asio/test/local/datagram_protocol.cpp (original)
+++ branches/release/libs/asio/test/local/datagram_protocol.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,7 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/local/stream_protocol.cpp
==============================================================================
--- branches/release/libs/asio/test/local/stream_protocol.cpp (original)
+++ branches/release/libs/asio/test/local/stream_protocol.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -18,7 +18,7 @@
#include <boost/bind.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/posix/basic_descriptor.cpp
==============================================================================
--- branches/release/libs/asio/test/posix/basic_descriptor.cpp (original)
+++ branches/release/libs/asio/test/posix/basic_descriptor.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,6 @@
// Test that header file is self-contained.
#include <boost/asio/posix/basic_descriptor.hpp>
-#include <boost/asio.hpp>
#include "../unit_test.hpp"
test_suite* init_unit_test_suite(int, char*[])
Modified: branches/release/libs/asio/test/posix/basic_stream_descriptor.cpp
==============================================================================
--- branches/release/libs/asio/test/posix/basic_stream_descriptor.cpp (original)
+++ branches/release/libs/asio/test/posix/basic_stream_descriptor.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,6 @@
// Test that header file is self-contained.
#include <boost/asio/posix/basic_stream_descriptor.hpp>
-#include <boost/asio.hpp>
#include "../unit_test.hpp"
test_suite* init_unit_test_suite(int, char*[])
Modified: branches/release/libs/asio/test/posix/descriptor_base.cpp
==============================================================================
--- branches/release/libs/asio/test/posix/descriptor_base.cpp (original)
+++ branches/release/libs/asio/test/posix/descriptor_base.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,6 @@
// Test that header file is self-contained.
#include <boost/asio/posix/descriptor_base.hpp>
-#include <boost/asio.hpp>
#include "../unit_test.hpp"
test_suite* init_unit_test_suite(int, char*[])
Modified: branches/release/libs/asio/test/posix/stream_descriptor.cpp
==============================================================================
--- branches/release/libs/asio/test/posix/stream_descriptor.cpp (original)
+++ branches/release/libs/asio/test/posix/stream_descriptor.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,7 @@
// Test that header file is self-contained.
#include <boost/asio/posix/stream_descriptor.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/posix/stream_descriptor_service.cpp
==============================================================================
--- branches/release/libs/asio/test/posix/stream_descriptor_service.cpp (original)
+++ branches/release/libs/asio/test/posix/stream_descriptor_service.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,6 @@
// Test that header file is self-contained.
#include <boost/asio/posix/stream_descriptor_service.hpp>
-#include <boost/asio.hpp>
#include "../unit_test.hpp"
test_suite* init_unit_test_suite(int, char*[])
Modified: branches/release/libs/asio/test/read.cpp
==============================================================================
--- branches/release/libs/asio/test/read.cpp (original)
+++ branches/release/libs/asio/test/read.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,8 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
Modified: branches/release/libs/asio/test/read_at.cpp
==============================================================================
--- branches/release/libs/asio/test/read_at.cpp (original)
+++ branches/release/libs/asio/test/read_at.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,8 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
Modified: branches/release/libs/asio/test/read_until.cpp
==============================================================================
--- branches/release/libs/asio/test/read_until.cpp (original)
+++ branches/release/libs/asio/test/read_until.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,9 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/streambuf.hpp>
#include "unit_test.hpp"
class test_stream
Modified: branches/release/libs/asio/test/serial_port.cpp
==============================================================================
--- branches/release/libs/asio/test/serial_port.cpp (original)
+++ branches/release/libs/asio/test/serial_port.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -17,7 +17,7 @@
// Test that header file is self-contained.
#include <boost/asio/serial_port.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/serial_port_base.cpp
==============================================================================
--- branches/release/libs/asio/test/serial_port_base.cpp (original)
+++ branches/release/libs/asio/test/serial_port_base.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -17,7 +17,8 @@
// Test that header file is self-contained.
#include <boost/asio/serial_port_base.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/serial_port.hpp>
#include "unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/socket_base.cpp
==============================================================================
--- branches/release/libs/asio/test/socket_base.cpp (original)
+++ branches/release/libs/asio/test/socket_base.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include <boost/asio/socket_base.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/ip/udp.hpp>
#include "unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/strand.cpp
==============================================================================
--- branches/release/libs/asio/test/strand.cpp (original)
+++ branches/release/libs/asio/test/strand.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -17,9 +17,10 @@
#include <boost/asio/strand.hpp>
#include <sstream>
-#include <boost/bind.hpp>
-#include <boost/asio.hpp>
#include <boost/thread.hpp>
+#include <boost/bind.hpp>
+#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/io_service.hpp>
#include "unit_test.hpp"
using namespace boost::asio;
Modified: branches/release/libs/asio/test/windows/overlapped_ptr.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/overlapped_ptr.cpp (original)
+++ branches/release/libs/asio/test/windows/overlapped_ptr.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,7 @@
// Test that header file is self-contained.
#include <boost/asio/windows/overlapped_ptr.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/windows/random_access_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/random_access_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/random_access_handle.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,7 @@
// Test that header file is self-contained.
#include <boost/asio/windows/random_access_handle.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/windows/stream_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/stream_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/stream_handle.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -16,7 +16,7 @@
// Test that header file is self-contained.
#include <boost/asio/windows/stream_handle.hpp>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
Modified: branches/release/libs/asio/test/write.cpp
==============================================================================
--- branches/release/libs/asio/test/write.cpp (original)
+++ branches/release/libs/asio/test/write.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,8 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
Modified: branches/release/libs/asio/test/write_at.cpp
==============================================================================
--- branches/release/libs/asio/test/write_at.cpp (original)
+++ branches/release/libs/asio/test/write_at.cpp 2010-01-04 06:55:09 EST (Mon, 04 Jan 2010)
@@ -19,7 +19,8 @@
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <cstring>
-#include <boost/asio.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
#include "unit_test.hpp"
using namespace std; // For memcmp, memcpy and memset.
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