Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84388 - in branches/release: boost boost/asio boost/asio/detail boost/asio/detail/impl boost/asio/generic boost/asio/generic/detail boost/asio/generic/detail/impl boost/asio/impl boost/asio/ip boost/asio/ip/detail boost/asio/ip/detail/impl boost/asio/ip/impl boost/asio/local boost/asio/local/detail boost/asio/local/detail/impl boost/asio/posix boost/asio/ssl boost/asio/ssl/detail boost/asio/ssl/detail/impl boost/asio/ssl/impl boost/asio/ssl/old boost/asio/ssl/old/detail boost/asio/windows libs/asio/doc libs/asio/doc/overview libs/asio/doc/requirements libs/asio/example/allocation libs/asio/example/buffers libs/asio/example/chat libs/asio/example/cpp03 libs/asio/example/cpp03/allocation libs/asio/example/cpp03/buffers libs/asio/example/cpp03/chat libs/asio/example/cpp03/echo libs/asio/example/cpp03/fork libs/asio/example/cpp03/http libs/asio/example/cpp03/http/client libs/asio/example/cpp03/http/doc_root libs/asio/example/cpp03/http/server libs/asio/example/cpp03/http/server2 libs/asio/example/cpp03/http/server3 libs/asio/example/cpp03/http/server4 libs/asio/example/cpp03/icmp libs/asio/example/cpp03/invocation libs/asio/example/cpp03/iostreams libs/asio/example/cpp03/local libs/asio/example/cpp03/multicast libs/asio/example/cpp03/nonblocking libs/asio/example/cpp03/porthopper libs/asio/example/cpp03/serialization libs/asio/example/cpp03/services libs/asio/example/cpp03/socks4 libs/asio/example/cpp03/spawn libs/asio/example/cpp03/ssl libs/asio/example/cpp03/timeouts libs/asio/example/cpp03/timers libs/asio/example/cpp03/tutorial libs/asio/example/cpp03/tutorial/daytime1 libs/asio/example/cpp03/tutorial/daytime2 libs/asio/example/cpp03/tutorial/daytime3 libs/asio/example/cpp03/tutorial/daytime4 libs/asio/example/cpp03/tutorial/daytime5 libs/asio/example/cpp03/tutorial/daytime6 libs/asio/example/cpp03/tutorial/daytime7 libs/asio/example/cpp03/tutorial/timer1 libs/asio/example/cpp03/tutorial/timer2 libs/asio/example/cpp03/tutorial/timer3 libs/asio/example/cpp03/tutorial/timer4 libs/asio/example/cpp03/tutorial/timer5 libs/asio/example/cpp03/windows libs/asio/example/cpp11 libs/asio/example/cpp11/allocation libs/asio/example/cpp11/buffers libs/asio/example/cpp11/chat libs/asio/example/cpp11/echo libs/asio/example/cpp11/futures libs/asio/example/cpp11/http libs/asio/example/cpp11/http/server libs/asio/example/cpp11/spawn libs/asio/example/echo libs/asio/example/fork libs/asio/example/http libs/asio/example/icmp libs/asio/example/invocation libs/asio/example/iostreams libs/asio/example/local libs/asio/example/multicast libs/asio/example/nonblocking libs/asio/example/porthopper libs/asio/example/serialization libs/asio/example/services libs/asio/example/socks4 libs/asio/example/ssl libs/asio/example/timeouts libs/asio/example/timers libs/asio/example/tutorial libs/asio/example/windows libs/asio/test libs/asio/test/archetypes libs/asio/test/generic libs/asio/test/ip libs/asio/test/latency libs/asio/test/local libs/asio/test/posix libs/asio/test/ssl libs/asio/test/windows
From: chris_at_[hidden]
Date: 2013-05-20 08:33:36


Author: chris_kohlhoff
Date: 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
New Revision: 84388
URL: http://svn.boost.org/trac/boost/changeset/84388

Log:
Merge from trunk.

------------------------------------------------------------------------
r84301 | chris_kohlhoff | 2013-05-17 07:34:54 +1000 (Fri, 17 May 2013) | 2 lines

Enable handler type requirements static_assert on clang.

------------------------------------------------------------------------
r84308 | chris_kohlhoff | 2013-05-17 09:26:04 +1000 (Fri, 17 May 2013) | 3 lines

Add new traits classes, handler_type and async_result, that allow
the customisation of the return type of an initiating function.

------------------------------------------------------------------------
r84311 | chris_kohlhoff | 2013-05-17 11:38:47 +1000 (Fri, 17 May 2013) | 81 lines

Add the asio::spawn() function, a high-level wrapper for running
stackful coroutines. It is based on the Boost.Coroutine library.

Here is an example of its use:

  asio::spawn(my_strand, do_echo);

  // ...

  void do_echo(asio::yield_context yield)
  {
    try
    {
      char data[128];
      for (;;)
      {
        std::size_t length =
          my_socket.async_read_some(
            asio::buffer(data), yield);

        asio::async_write(my_socket,
            asio::buffer(data, length), yield);
      }
    }
    catch (std::exception& e)
    {
      // ...
    }
  }

The first argument to asio::spawn() may be a strand, io_service or
completion handler. This argument determines the context in which the
coroutine is permitted to execute. For example, a server's per-client
object may consist of multiple coroutines; they should all run on the
same strand so that no explicit synchronisation is required.

The second argument is a function object with signature (**):

  void coroutine(asio::yield_context yield);

that specifies the code to be run as part of the coroutine. The
parameter yield may be passed to an asynchronous operation in place of
the completion handler, as in:

  std::size_t length =
    my_socket.async_read_some(
      asio::buffer(data), yield);

This starts the asynchronous operation and suspends the coroutine. The
coroutine will be resumed automatically when the asynchronous operation
completes.

Where a completion handler signature has the form:

  void handler(error_code ec, result_type result);

the initiating function returns the result_type. In the async_read_some
example above, this is std::size_t. If the asynchronous operation fails,
the error_code is converted into a system_error exception and thrown.

Where a completion handler signature has the form:

  void handler(error_code ec);

the initiating function returns void. As above, an error is passed back
to the coroutine as a system_error exception.

To collect the error_code from an operation, rather than have it throw
an exception, associate the output variable with the yield_context as
follows:

  error_code ec;
  std::size_t length =
    my_socket.async_read_some(
      asio::buffer(data), yield[ec]);

**Note: if asio::spawn() is used with a custom completion handler of
type Handler, the function object signature is actually:
  
  void coroutine(asio::basic_yield_context<Handler> yield);

------------------------------------------------------------------------
r84312 | chris_kohlhoff | 2013-05-17 12:25:10 +1000 (Fri, 17 May 2013) | 4 lines

Move existing examples into a C++03-specific directory, and add a new
directory for C++11-specific examples. A limited subset of the C++03
examples have been converted to their C++11 equivalents.

------------------------------------------------------------------------
r84313 | chris_kohlhoff | 2013-05-17 12:35:08 +1000 (Fri, 17 May 2013) | 26 lines

Add the asio::use_future special value, which adds first-class support
for returning a C++11 std::future from an asynchronous operation's
initiating function.

To use asio::use_future, pass it to an asynchronous operation instead of
a normal completion handler. For example:

  std::future<std::size_t> length =
    my_socket.async_read_some(my_buffer, asio::use_future);

Where a completion handler signature has the form:

  void handler(error_code ec, result_type result);

the initiating function returns a std::future templated on result_type.
In the above example, this is std::size_t. If the asynchronous operation
fails, the error_code is converted into a system_error exception and
passed back to the caller through the future.

Where a completion handler signature has the form:

  void handler(error_code ec);

the initiating function returns std::future<void>. As above, an error
is passed back in the future as a system_error exception.

------------------------------------------------------------------------
r84314 | chris_kohlhoff | 2013-05-17 13:07:51 +1000 (Fri, 17 May 2013) | 27 lines

Add a new handler hook called asio_handler_is_continuation.

Asynchronous operations may represent a continuation of the asynchronous
control flow associated with the current handler. Asio's implementation
can use this knowledge to optimise scheduling of the handler.

The asio_handler_is_continuation hook returns true to indicate whether a
completion handler represents a continuation of the current call
context. The default implementation of the hook returns false, and
applications may customise the hook when necessary. The hook has already
been customised within Asio to return true for the following cases:

- Handlers returned by strand.wrap(), when the corresponding
  asynchronous operation is being initiated from within the strand.

- The internal handlers used to implement the asio::spawn() function's
  stackful coroutines.

- When an intermediate handler of a composed operation (e.g.
  asio::async_read(), asio::async_write(), asio::async_connect(),
  ssl::stream<>, etc.) starts a new asynchronous operation due to the
  composed operation not being complete.

To support this optimisation, a new running_in_this_thread() member
function has been added to the io_service::strand class. This function
returns true when called from within a strand.

------------------------------------------------------------------------
r84315 | chris_kohlhoff | 2013-05-17 20:06:50 +1000 (Fri, 17 May 2013) | 3 lines

Partially decouple Asio from other boost components via an extra level
of indirection.

------------------------------------------------------------------------
r84316 | chris_kohlhoff | 2013-05-17 20:15:21 +1000 (Fri, 17 May 2013) | 2 lines

Minor cleanup.

------------------------------------------------------------------------
r84319 | chris_kohlhoff | 2013-05-17 20:52:08 +1000 (Fri, 17 May 2013) | 9 lines

Support handshake with re-use of data already read from the wire.

Add new overloads of the SSL stream's handshake() and async_handshake()
functions, that accepts a ConstBufferSequence to be used as initial
input to the ssl engine for the handshake procedure.

Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is partially based.

------------------------------------------------------------------------
r84320 | chris_kohlhoff | 2013-05-17 20:57:02 +1000 (Fri, 17 May 2013) | 6 lines

Support for creation of TLSv1.1 and TLSv1.2 contexts.

Thanks go to Alvin Cheung <alvin dot cheung at alumni dot ust dot hk>
and Nick Jones <nick dot fa dot jones at gmail dot com>, on whose work
this is based.

------------------------------------------------------------------------
r84322 | chris_kohlhoff | 2013-05-17 21:00:49 +1000 (Fri, 17 May 2013) | 5 lines

Add set_verify_depth function to SSL context and stream.

Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is based.

------------------------------------------------------------------------
r84325 | chris_kohlhoff | 2013-05-17 21:04:11 +1000 (Fri, 17 May 2013) | 9 lines

Allow loading of SSL certificate and key data from memory buffers.

Added new buffer-based interfaces:
add_certificate_authority, use_certificate, use_certificate_chain,
use_private_key, use_rsa_private_key, use_tmp_dh.

Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is based.

------------------------------------------------------------------------
r84345 | chris_kohlhoff | 2013-05-18 21:24:59 +1000 (Sat, 18 May 2013) | 2 lines

Update copyright notices.

------------------------------------------------------------------------
r84346 | chris_kohlhoff | 2013-05-18 21:54:59 +1000 (Sat, 18 May 2013) | 3 lines

Remove the stackless coroutine class and macros from the HTTP server 4
example, and instead make them a part of Asio's documented interface.

------------------------------------------------------------------------
r84347 | chris_kohlhoff | 2013-05-18 22:01:59 +1000 (Sat, 18 May 2013) | 4 lines

Fix basic_waitable_timer's underlying implementation so that it can
handle any time_point value without overflowing the intermediate
duration objects.

------------------------------------------------------------------------
r84348 | chris_kohlhoff | 2013-05-18 22:07:00 +1000 (Sat, 18 May 2013) | 3 lines

Fix a problem with lost thread wakeups that can occur when making
concurrent calls to run() and poll() on the same io_service object.

------------------------------------------------------------------------
r84349 | chris_kohlhoff | 2013-05-18 22:13:17 +1000 (Sat, 18 May 2013) | 3 lines

Fix implementation of asynchronous connect operation so that it can cope
with spurious readiness notifications from the reactor.

------------------------------------------------------------------------
r84361 | chris_kohlhoff | 2013-05-19 07:56:31 +1000 (Sun, 19 May 2013) | 1 line

Remove some trailing spaces and fix another copyright notice.

------------------------------------------------------------------------
r84363 | chris_kohlhoff | 2013-05-19 14:55:11 +1000 (Sun, 19 May 2013) | 53 lines

Add generic socket protocols and converting move constructors.

Four new protocol classes have been added:

- asio::generic::datagram_protocol
- asio::generic::raw_protocol
- asio::generic::seq_packet_protocol
- asio::generic::stream_protocol

These classes implement the Protocol type requirements, but allow the
user to specify the address family (e.g. AF_INET) and protocol type
(e.g. IPPROTO_TCP) at runtime.

A new endpoint class template, asio::generic::basic_endpoint, has been
added to support these new protocol classes. This endpoint can hold any
other endpoint type, provided its native representation fits into a
sockaddr_storage object.

When using C++11, it is now possible to perform move construction from a
socket (or acceptor) object to convert to the more generic protocol's
socket (or acceptor) type. If the protocol conversion is valid:

  Protocol1 p1 = ...;
  Protocol2 p2(p1);

then the corresponding socket conversion is allowed:

  Protocol1::socket socket1(io_service);
  ...
  Protocol2::socket socket2(std::move(socket1));

For example, one possible conversion is from a TCP socket to a generic
stream-oriented socket:

  asio::ip::tcp::socket socket1(io_service);
  ...
  asio::generic::stream_protocol::socket socket2(std::move(socket1));

The conversion is also available for move-assignment. Note that these
conversions are not limited to the newly added generic protocol classes.
User-defined protocols may take advantage of this feature by similarly
ensuring the conversion from Protocol1 to Protocol2 is valid, as above.

As a convenience, the socket acceptor's accept() and async_accept()
functions have been changed so that they can directly accept into a
different protocol's socket type, provided the protocol conversion is
valid. For example, the following is now possible:

  asio::ip::tcp::acceptor acceptor(io_service);
  ...
  asio::generic::stream_protocol::socket socket1(io_service);
  acceptor.accept(socket1);

Added:
   branches/release/boost/asio/async_result.hpp (contents, props changed)
   branches/release/boost/asio/coroutine.hpp (contents, props changed)
   branches/release/boost/asio/detail/addressof.hpp (contents, props changed)
   branches/release/boost/asio/detail/assert.hpp (contents, props changed)
   branches/release/boost/asio/detail/cstdint.hpp (contents, props changed)
   branches/release/boost/asio/detail/function.hpp (contents, props changed)
   branches/release/boost/asio/detail/handler_cont_helpers.hpp (contents, props changed)
   branches/release/boost/asio/detail/limits.hpp (contents, props changed)
   branches/release/boost/asio/detail/throw_exception.hpp (contents, props changed)
   branches/release/boost/asio/detail/type_traits.hpp (contents, props changed)
   branches/release/boost/asio/generic/
   branches/release/boost/asio/generic/basic_endpoint.hpp (contents, props changed)
   branches/release/boost/asio/generic/datagram_protocol.hpp (contents, props changed)
   branches/release/boost/asio/generic/detail/
   branches/release/boost/asio/generic/detail/endpoint.hpp (contents, props changed)
   branches/release/boost/asio/generic/detail/impl/
   branches/release/boost/asio/generic/detail/impl/endpoint.ipp (contents, props changed)
   branches/release/boost/asio/generic/raw_protocol.hpp (contents, props changed)
   branches/release/boost/asio/generic/seq_packet_protocol.hpp (contents, props changed)
   branches/release/boost/asio/generic/stream_protocol.hpp (contents, props changed)
   branches/release/boost/asio/handler_continuation_hook.hpp (contents, props changed)
   branches/release/boost/asio/handler_type.hpp (contents, props changed)
   branches/release/boost/asio/impl/spawn.hpp (contents, props changed)
   branches/release/boost/asio/impl/use_future.hpp (contents, props changed)
   branches/release/boost/asio/spawn.hpp (contents, props changed)
   branches/release/boost/asio/ssl/detail/buffered_handshake_op.hpp (contents, props changed)
   branches/release/boost/asio/unyield.hpp (contents, props changed)
   branches/release/boost/asio/use_future.hpp (contents, props changed)
   branches/release/boost/asio/yield.hpp (contents, props changed)
   branches/release/libs/asio/doc/requirements/BufferedHandshakeHandler.qbk (contents, props changed)
   branches/release/libs/asio/example/cpp03/
   branches/release/libs/asio/example/cpp03/allocation/
      - copied from r84379, /branches/release/libs/asio/example/allocation/
   branches/release/libs/asio/example/cpp03/buffers/
      - copied from r84379, /branches/release/libs/asio/example/buffers/
   branches/release/libs/asio/example/cpp03/chat/
      - copied from r84379, /branches/release/libs/asio/example/chat/
   branches/release/libs/asio/example/cpp03/echo/
      - copied from r84379, /branches/release/libs/asio/example/echo/
   branches/release/libs/asio/example/cpp03/fork/
      - copied from r84379, /branches/release/libs/asio/example/fork/
   branches/release/libs/asio/example/cpp03/http/
      - copied from r84379, /branches/release/libs/asio/example/http/
   branches/release/libs/asio/example/cpp03/icmp/
      - copied from r84379, /branches/release/libs/asio/example/icmp/
   branches/release/libs/asio/example/cpp03/invocation/
      - copied from r84379, /branches/release/libs/asio/example/invocation/
   branches/release/libs/asio/example/cpp03/iostreams/
      - copied from r84379, /branches/release/libs/asio/example/iostreams/
   branches/release/libs/asio/example/cpp03/local/
      - copied from r84379, /branches/release/libs/asio/example/local/
   branches/release/libs/asio/example/cpp03/multicast/
      - copied from r84379, /branches/release/libs/asio/example/multicast/
   branches/release/libs/asio/example/cpp03/nonblocking/
      - copied from r84379, /branches/release/libs/asio/example/nonblocking/
   branches/release/libs/asio/example/cpp03/porthopper/
      - copied from r84379, /branches/release/libs/asio/example/porthopper/
   branches/release/libs/asio/example/cpp03/serialization/
      - copied from r84379, /branches/release/libs/asio/example/serialization/
   branches/release/libs/asio/example/cpp03/services/
      - copied from r84379, /branches/release/libs/asio/example/services/
   branches/release/libs/asio/example/cpp03/socks4/
      - copied from r84379, /branches/release/libs/asio/example/socks4/
   branches/release/libs/asio/example/cpp03/spawn/
   branches/release/libs/asio/example/cpp03/spawn/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp03/spawn/echo_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp03/ssl/
      - copied from r84379, /branches/release/libs/asio/example/ssl/
   branches/release/libs/asio/example/cpp03/timeouts/
      - copied from r84379, /branches/release/libs/asio/example/timeouts/
   branches/release/libs/asio/example/cpp03/timers/
      - copied from r84379, /branches/release/libs/asio/example/timers/
   branches/release/libs/asio/example/cpp03/tutorial/
      - copied from r84379, /branches/release/libs/asio/example/tutorial/
   branches/release/libs/asio/example/cpp03/windows/
      - copied from r84379, /branches/release/libs/asio/example/windows/
   branches/release/libs/asio/example/cpp11/
   branches/release/libs/asio/example/cpp11/allocation/
   branches/release/libs/asio/example/cpp11/allocation/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/allocation/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/allocation/server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/buffers/
   branches/release/libs/asio/example/cpp11/buffers/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/buffers/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/buffers/reference_counted.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/chat/
   branches/release/libs/asio/example/cpp11/chat/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/chat/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/chat/chat_client.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/chat/chat_message.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/chat/chat_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/
   branches/release/libs/asio/example/cpp11/echo/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/async_tcp_echo_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/async_udp_echo_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_client.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_client.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/futures/
   branches/release/libs/asio/example/cpp11/futures/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/futures/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/futures/daytime_client.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/
   branches/release/libs/asio/example/cpp11/http/server/
   branches/release/libs/asio/example/cpp11/http/server/Jamfile (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/connection.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/connection.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/connection_manager.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/connection_manager.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/header.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/main.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/mime_types.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/mime_types.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/reply.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/reply.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/request.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/request_handler.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/request_handler.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/request_parser.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/request_parser.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/server.cpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/http/server/server.hpp (contents, props changed)
   branches/release/libs/asio/example/cpp11/spawn/
   branches/release/libs/asio/example/cpp11/spawn/Jamfile.v2 (contents, props changed)
   branches/release/libs/asio/example/cpp11/spawn/echo_server.cpp (contents, props changed)
   branches/release/libs/asio/test/archetypes/async_result.hpp (contents, props changed)
   branches/release/libs/asio/test/coroutine.cpp (contents, props changed)
   branches/release/libs/asio/test/generic/
   branches/release/libs/asio/test/generic/basic_endpoint.cpp (contents, props changed)
   branches/release/libs/asio/test/generic/datagram_protocol.cpp (contents, props changed)
   branches/release/libs/asio/test/generic/raw_protocol.cpp (contents, props changed)
   branches/release/libs/asio/test/generic/seq_packet_protocol.cpp (contents, props changed)
   branches/release/libs/asio/test/generic/stream_protocol.cpp (contents, props changed)
   branches/release/libs/asio/test/ip/icmp.cpp (contents, props changed)
Removed:
   branches/release/libs/asio/example/allocation/
   branches/release/libs/asio/example/buffers/
   branches/release/libs/asio/example/chat/
   branches/release/libs/asio/example/echo/
   branches/release/libs/asio/example/fork/
   branches/release/libs/asio/example/http/
   branches/release/libs/asio/example/icmp/
   branches/release/libs/asio/example/invocation/
   branches/release/libs/asio/example/iostreams/
   branches/release/libs/asio/example/local/
   branches/release/libs/asio/example/multicast/
   branches/release/libs/asio/example/nonblocking/
   branches/release/libs/asio/example/porthopper/
   branches/release/libs/asio/example/serialization/
   branches/release/libs/asio/example/services/
   branches/release/libs/asio/example/socks4/
   branches/release/libs/asio/example/ssl/
   branches/release/libs/asio/example/timeouts/
   branches/release/libs/asio/example/timers/
   branches/release/libs/asio/example/tutorial/
   branches/release/libs/asio/example/windows/
Text files modified:
   branches/release/boost/asio.hpp | 11
   branches/release/boost/asio/basic_datagram_socket.hpp | 107
   branches/release/boost/asio/basic_deadline_timer.hpp | 15
   branches/release/boost/asio/basic_io_object.hpp | 2
   branches/release/boost/asio/basic_raw_socket.hpp | 102
   branches/release/boost/asio/basic_seq_packet_socket.hpp | 71
   branches/release/boost/asio/basic_serial_port.hpp | 14
   branches/release/boost/asio/basic_signal_set.hpp | 8
   branches/release/boost/asio/basic_socket.hpp | 70
   branches/release/boost/asio/basic_socket_acceptor.hpp | 89
   branches/release/boost/asio/basic_socket_iostream.hpp | 83
   branches/release/boost/asio/basic_socket_streambuf.hpp | 63
   branches/release/boost/asio/basic_stream_socket.hpp | 83
   branches/release/boost/asio/basic_streambuf.hpp | 12
   branches/release/boost/asio/basic_streambuf_fwd.hpp | 6
   branches/release/boost/asio/basic_waitable_timer.hpp | 8
   branches/release/boost/asio/buffer.hpp | 53
   branches/release/boost/asio/buffered_read_stream.hpp | 8
   branches/release/boost/asio/buffered_read_stream_fwd.hpp | 2
   branches/release/boost/asio/buffered_stream.hpp | 4
   branches/release/boost/asio/buffered_stream_fwd.hpp | 2
   branches/release/boost/asio/buffered_write_stream.hpp | 8
   branches/release/boost/asio/buffered_write_stream_fwd.hpp | 2
   branches/release/boost/asio/buffers_iterator.hpp | 35
   branches/release/boost/asio/completion_condition.hpp | 2
   branches/release/boost/asio/connect.hpp | 19
   branches/release/boost/asio/datagram_socket_service.hpp | 74
   branches/release/boost/asio/deadline_timer.hpp | 9
   branches/release/boost/asio/deadline_timer_service.hpp | 22
   branches/release/boost/asio/detail/array.hpp | 2
   branches/release/boost/asio/detail/array_fwd.hpp | 2
   branches/release/boost/asio/detail/atomic_count.hpp | 6
   branches/release/boost/asio/detail/base_from_completion_cond.hpp | 2
   branches/release/boost/asio/detail/bind_handler.hpp | 45
   branches/release/boost/asio/detail/buffer_resize_guard.hpp | 10
   branches/release/boost/asio/detail/buffer_sequence_adapter.hpp | 8
   branches/release/boost/asio/detail/buffered_stream_storage.hpp | 8
   branches/release/boost/asio/detail/call_stack.hpp | 2
   branches/release/boost/asio/detail/chrono_time_traits.hpp | 72
   branches/release/boost/asio/detail/completion_handler.hpp | 7
   branches/release/boost/asio/detail/config.hpp | 700 +++-
   branches/release/boost/asio/detail/consuming_buffers.hpp | 22
   branches/release/boost/asio/detail/date_time_fwd.hpp | 2
   branches/release/boost/asio/detail/deadline_timer_service.hpp | 7
   branches/release/boost/asio/detail/dependent_type.hpp | 2
   branches/release/boost/asio/detail/descriptor_ops.hpp | 6
   branches/release/boost/asio/detail/descriptor_read_op.hpp | 12
   branches/release/boost/asio/detail/descriptor_write_op.hpp | 12
   branches/release/boost/asio/detail/dev_poll_reactor.hpp | 11
   branches/release/boost/asio/detail/dev_poll_reactor_fwd.hpp | 2
   branches/release/boost/asio/detail/epoll_reactor.hpp | 13
   branches/release/boost/asio/detail/epoll_reactor_fwd.hpp | 2
   branches/release/boost/asio/detail/event.hpp | 14
   branches/release/boost/asio/detail/eventfd_select_interrupter.hpp | 2
   branches/release/boost/asio/detail/fd_set_adapter.hpp | 4
   branches/release/boost/asio/detail/fenced_block.hpp | 12
   branches/release/boost/asio/detail/gcc_arm_fenced_block.hpp | 2
   branches/release/boost/asio/detail/gcc_hppa_fenced_block.hpp | 2
   branches/release/boost/asio/detail/gcc_sync_fenced_block.hpp | 2
   branches/release/boost/asio/detail/gcc_x86_fenced_block.hpp | 2
   branches/release/boost/asio/detail/handler_alloc_helpers.hpp | 15
   branches/release/boost/asio/detail/handler_invoke_helpers.hpp | 15
   branches/release/boost/asio/detail/handler_tracking.hpp | 8
   branches/release/boost/asio/detail/handler_type_requirements.hpp | 220 +
   branches/release/boost/asio/detail/hash_map.hpp | 14
   branches/release/boost/asio/detail/impl/descriptor_ops.ipp | 6
   branches/release/boost/asio/detail/impl/dev_poll_reactor.hpp | 4
   branches/release/boost/asio/detail/impl/dev_poll_reactor.ipp | 14
   branches/release/boost/asio/detail/impl/epoll_reactor.hpp | 4
   branches/release/boost/asio/detail/impl/epoll_reactor.ipp | 14
   branches/release/boost/asio/detail/impl/eventfd_select_interrupter.ipp | 3
   branches/release/boost/asio/detail/impl/handler_tracking.ipp | 182
   branches/release/boost/asio/detail/impl/kqueue_reactor.hpp | 4
   branches/release/boost/asio/detail/impl/kqueue_reactor.ipp | 12
   branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp | 6
   branches/release/boost/asio/detail/impl/posix_event.ipp | 6
   branches/release/boost/asio/detail/impl/posix_mutex.ipp | 6
   branches/release/boost/asio/detail/impl/posix_thread.ipp | 6
   branches/release/boost/asio/detail/impl/posix_tss_ptr.ipp | 6
   branches/release/boost/asio/detail/impl/reactive_descriptor_service.ipp | 13
   branches/release/boost/asio/detail/impl/reactive_serial_port_service.ipp | 6
   branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp | 24
   branches/release/boost/asio/detail/impl/resolver_service_base.ipp | 4
   branches/release/boost/asio/detail/impl/select_reactor.hpp | 4
   branches/release/boost/asio/detail/impl/select_reactor.ipp | 15
   branches/release/boost/asio/detail/impl/service_registry.hpp | 2
   branches/release/boost/asio/detail/impl/service_registry.ipp | 8
   branches/release/boost/asio/detail/impl/signal_set_service.ipp | 68
   branches/release/boost/asio/detail/impl/socket_ops.ipp | 218
   branches/release/boost/asio/detail/impl/socket_select_interrupter.ipp | 6
   branches/release/boost/asio/detail/impl/strand_service.hpp | 18
   branches/release/boost/asio/detail/impl/strand_service.ipp | 17
   branches/release/boost/asio/detail/impl/task_io_service.hpp | 19
   branches/release/boost/asio/detail/impl/task_io_service.ipp | 67
   branches/release/boost/asio/detail/impl/throw_error.ipp | 8
   branches/release/boost/asio/detail/impl/timer_queue_ptime.ipp | 6
   branches/release/boost/asio/detail/impl/timer_queue_set.ipp | 2
   branches/release/boost/asio/detail/impl/win_event.ipp | 6
   branches/release/boost/asio/detail/impl/win_iocp_handle_service.ipp | 10
   branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp | 17
   branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp | 4
   branches/release/boost/asio/detail/impl/win_iocp_serial_port_service.ipp | 2
   branches/release/boost/asio/detail/impl/win_iocp_socket_service_base.ipp | 10
   branches/release/boost/asio/detail/impl/win_mutex.ipp | 6
   branches/release/boost/asio/detail/impl/win_object_handle_service.ipp | 2
   branches/release/boost/asio/detail/impl/win_static_mutex.ipp | 12
   branches/release/boost/asio/detail/impl/win_thread.ipp | 6
   branches/release/boost/asio/detail/impl/win_tss_ptr.ipp | 6
   branches/release/boost/asio/detail/impl/winsock_init.ipp | 6
   branches/release/boost/asio/detail/io_control.hpp | 3
   branches/release/boost/asio/detail/keyword_tss_ptr.hpp | 2
   branches/release/boost/asio/detail/kqueue_reactor.hpp | 12
   branches/release/boost/asio/detail/kqueue_reactor_fwd.hpp | 2
   branches/release/boost/asio/detail/local_free_on_block_exit.hpp | 6
   branches/release/boost/asio/detail/macos_fenced_block.hpp | 2
   branches/release/boost/asio/detail/mutex.hpp | 14
   branches/release/boost/asio/detail/noncopyable.hpp | 12
   branches/release/boost/asio/detail/null_event.hpp | 6
   branches/release/boost/asio/detail/null_fenced_block.hpp | 2
   branches/release/boost/asio/detail/null_mutex.hpp | 6
   branches/release/boost/asio/detail/null_signal_blocker.hpp | 12
   branches/release/boost/asio/detail/null_static_mutex.hpp | 6
   branches/release/boost/asio/detail/null_thread.hpp | 6
   branches/release/boost/asio/detail/null_tss_ptr.hpp | 6
   branches/release/boost/asio/detail/object_pool.hpp | 2
   branches/release/boost/asio/detail/old_win_sdk_compat.hpp | 6
   branches/release/boost/asio/detail/op_queue.hpp | 2
   branches/release/boost/asio/detail/operation.hpp | 2
   branches/release/boost/asio/detail/pipe_select_interrupter.hpp | 6
   branches/release/boost/asio/detail/pop_options.hpp | 2
   branches/release/boost/asio/detail/posix_event.hpp | 16
   branches/release/boost/asio/detail/posix_fd_set_adapter.hpp | 6
   branches/release/boost/asio/detail/posix_mutex.hpp | 6
   branches/release/boost/asio/detail/posix_signal_blocker.hpp | 6
   branches/release/boost/asio/detail/posix_static_mutex.hpp | 6
   branches/release/boost/asio/detail/posix_thread.hpp | 6
   branches/release/boost/asio/detail/posix_tss_ptr.hpp | 6
   branches/release/boost/asio/detail/push_options.hpp | 2
   branches/release/boost/asio/detail/reactive_descriptor_service.hpp | 46
   branches/release/boost/asio/detail/reactive_null_buffers_op.hpp | 8
   branches/release/boost/asio/detail/reactive_serial_port_service.hpp | 10
   branches/release/boost/asio/detail/reactive_socket_accept_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_connect_op.hpp | 29
   branches/release/boost/asio/detail/reactive_socket_recv_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_recvfrom_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_recvmsg_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_send_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_sendto_op.hpp | 8
   branches/release/boost/asio/detail/reactive_socket_service.hpp | 75
   branches/release/boost/asio/detail/reactive_socket_service_base.hpp | 55
   branches/release/boost/asio/detail/reactor.hpp | 2
   branches/release/boost/asio/detail/reactor_fwd.hpp | 2
   branches/release/boost/asio/detail/reactor_op.hpp | 2
   branches/release/boost/asio/detail/reactor_op_queue.hpp | 2
   branches/release/boost/asio/detail/regex_fwd.hpp | 6
   branches/release/boost/asio/detail/resolve_endpoint_op.hpp | 8
   branches/release/boost/asio/detail/resolve_op.hpp | 8
   branches/release/boost/asio/detail/resolver_service.hpp | 11
   branches/release/boost/asio/detail/resolver_service_base.hpp | 2
   branches/release/boost/asio/detail/scoped_lock.hpp | 2
   branches/release/boost/asio/detail/scoped_ptr.hpp | 2
   branches/release/boost/asio/detail/select_interrupter.hpp | 6
   branches/release/boost/asio/detail/select_reactor.hpp | 16
   branches/release/boost/asio/detail/select_reactor_fwd.hpp | 2
   branches/release/boost/asio/detail/service_registry.hpp | 8
   branches/release/boost/asio/detail/service_registry_fwd.hpp | 2
   branches/release/boost/asio/detail/shared_ptr.hpp | 2
   branches/release/boost/asio/detail/signal_blocker.hpp | 14
   branches/release/boost/asio/detail/signal_handler.hpp | 7
   branches/release/boost/asio/detail/signal_init.hpp | 6
   branches/release/boost/asio/detail/signal_op.hpp | 2
   branches/release/boost/asio/detail/signal_set_service.hpp | 15
   branches/release/boost/asio/detail/socket_holder.hpp | 2
   branches/release/boost/asio/detail/socket_ops.hpp | 13
   branches/release/boost/asio/detail/socket_option.hpp | 17
   branches/release/boost/asio/detail/socket_select_interrupter.hpp | 6
   branches/release/boost/asio/detail/socket_types.hpp | 6
   branches/release/boost/asio/detail/solaris_fenced_block.hpp | 2
   branches/release/boost/asio/detail/static_mutex.hpp | 14
   branches/release/boost/asio/detail/strand_service.hpp | 13
   branches/release/boost/asio/detail/task_io_service.hpp | 31
   branches/release/boost/asio/detail/task_io_service_fwd.hpp | 2
   branches/release/boost/asio/detail/task_io_service_operation.hpp | 2
   branches/release/boost/asio/detail/task_io_service_thread_info.hpp | 2
   branches/release/boost/asio/detail/thread.hpp | 14
   branches/release/boost/asio/detail/thread_info_base.hpp | 2
   branches/release/boost/asio/detail/throw_error.hpp | 2
   branches/release/boost/asio/detail/timer_queue.hpp | 11
   branches/release/boost/asio/detail/timer_queue_base.hpp | 2
   branches/release/boost/asio/detail/timer_queue_fwd.hpp | 2
   branches/release/boost/asio/detail/timer_queue_ptime.hpp | 6
   branches/release/boost/asio/detail/timer_queue_set.hpp | 2
   branches/release/boost/asio/detail/timer_scheduler.hpp | 2
   branches/release/boost/asio/detail/timer_scheduler_fwd.hpp | 2
   branches/release/boost/asio/detail/tss_ptr.hpp | 20
   branches/release/boost/asio/detail/wait_handler.hpp | 7
   branches/release/boost/asio/detail/wait_op.hpp | 2
   branches/release/boost/asio/detail/weak_ptr.hpp | 2
   branches/release/boost/asio/detail/win_event.hpp | 16
   branches/release/boost/asio/detail/win_fd_set_adapter.hpp | 6
   branches/release/boost/asio/detail/win_fenced_block.hpp | 12
   branches/release/boost/asio/detail/win_iocp_handle_read_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_handle_service.hpp | 53
   branches/release/boost/asio/detail/win_iocp_handle_write_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_io_service.hpp | 12
   branches/release/boost/asio/detail/win_iocp_io_service_fwd.hpp | 2
   branches/release/boost/asio/detail/win_iocp_null_buffers_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_operation.hpp | 2
   branches/release/boost/asio/detail/win_iocp_overlapped_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_overlapped_ptr.hpp | 6
   branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp | 6
   branches/release/boost/asio/detail/win_iocp_socket_accept_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_socket_recv_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_socket_send_op.hpp | 8
   branches/release/boost/asio/detail/win_iocp_socket_service.hpp | 32
   branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp | 17
   branches/release/boost/asio/detail/win_iocp_thread_info.hpp | 2
   branches/release/boost/asio/detail/win_mutex.hpp | 6
   branches/release/boost/asio/detail/win_object_handle_service.hpp | 6
   branches/release/boost/asio/detail/win_static_mutex.hpp | 6
   branches/release/boost/asio/detail/win_thread.hpp | 6
   branches/release/boost/asio/detail/win_tss_ptr.hpp | 6
   branches/release/boost/asio/detail/wince_thread.hpp | 6
   branches/release/boost/asio/detail/winsock_init.hpp | 6
   branches/release/boost/asio/detail/wrapped_handler.hpp | 57
   branches/release/boost/asio/error.hpp | 12
   branches/release/boost/asio/handler_alloc_hook.hpp | 2
   branches/release/boost/asio/handler_invoke_hook.hpp | 2
   branches/release/boost/asio/high_resolution_timer.hpp | 2
   branches/release/boost/asio/impl/connect.hpp | 107
   branches/release/boost/asio/impl/error.ipp | 6
   branches/release/boost/asio/impl/handler_alloc_hook.ipp | 2
   branches/release/boost/asio/impl/io_service.hpp | 25
   branches/release/boost/asio/impl/io_service.ipp | 4
   branches/release/boost/asio/impl/read.hpp | 159
   branches/release/boost/asio/impl/read_at.hpp | 199
   branches/release/boost/asio/impl/read_until.hpp | 201
   branches/release/boost/asio/impl/serial_port_base.hpp | 2
   branches/release/boost/asio/impl/serial_port_base.ipp | 34
   branches/release/boost/asio/impl/src.cpp | 2
   branches/release/boost/asio/impl/src.hpp | 3
   branches/release/boost/asio/impl/write.hpp | 146
   branches/release/boost/asio/impl/write_at.hpp | 174
   branches/release/boost/asio/io_service.hpp | 13
   branches/release/boost/asio/ip/address.hpp | 10
   branches/release/boost/asio/ip/address_v4.hpp | 10
   branches/release/boost/asio/ip/address_v6.hpp | 10
   branches/release/boost/asio/ip/basic_endpoint.hpp | 10
   branches/release/boost/asio/ip/basic_resolver.hpp | 10
   branches/release/boost/asio/ip/basic_resolver_entry.hpp | 2
   branches/release/boost/asio/ip/basic_resolver_iterator.hpp | 2
   branches/release/boost/asio/ip/basic_resolver_query.hpp | 2
   branches/release/boost/asio/ip/detail/endpoint.hpp | 6
   branches/release/boost/asio/ip/detail/impl/endpoint.ipp | 10
   branches/release/boost/asio/ip/detail/socket_option.hpp | 20
   branches/release/boost/asio/ip/host_name.hpp | 2
   branches/release/boost/asio/ip/icmp.hpp | 2
   branches/release/boost/asio/ip/impl/address.hpp | 6
   branches/release/boost/asio/ip/impl/address.ipp | 8
   branches/release/boost/asio/ip/impl/address_v4.hpp | 6
   branches/release/boost/asio/ip/impl/address_v4.ipp | 8
   branches/release/boost/asio/ip/impl/address_v6.hpp | 6
   branches/release/boost/asio/ip/impl/address_v6.ipp | 8
   branches/release/boost/asio/ip/impl/basic_endpoint.hpp | 6
   branches/release/boost/asio/ip/impl/host_name.ipp | 2
   branches/release/boost/asio/ip/multicast.hpp | 2
   branches/release/boost/asio/ip/resolver_query_base.hpp | 9
   branches/release/boost/asio/ip/resolver_service.hpp | 25
   branches/release/boost/asio/ip/tcp.hpp | 6
   branches/release/boost/asio/ip/udp.hpp | 2
   branches/release/boost/asio/ip/unicast.hpp | 2
   branches/release/boost/asio/ip/v6_only.hpp | 2
   branches/release/boost/asio/is_read_buffered.hpp | 4
   branches/release/boost/asio/is_write_buffered.hpp | 4
   branches/release/boost/asio/local/basic_endpoint.hpp | 6
   branches/release/boost/asio/local/connect_pair.hpp | 2
   branches/release/boost/asio/local/datagram_protocol.hpp | 2
   branches/release/boost/asio/local/detail/endpoint.hpp | 2
   branches/release/boost/asio/local/detail/impl/endpoint.ipp | 2
   branches/release/boost/asio/local/stream_protocol.hpp | 6
   branches/release/boost/asio/placeholders.hpp | 21
   branches/release/boost/asio/posix/basic_descriptor.hpp | 2
   branches/release/boost/asio/posix/basic_stream_descriptor.hpp | 14
   branches/release/boost/asio/posix/descriptor_base.hpp | 2
   branches/release/boost/asio/posix/stream_descriptor.hpp | 2
   branches/release/boost/asio/posix/stream_descriptor_service.hpp | 25
   branches/release/boost/asio/raw_socket_service.hpp | 74
   branches/release/boost/asio/read.hpp | 27
   branches/release/boost/asio/read_at.hpp | 49
   branches/release/boost/asio/read_until.hpp | 49
   branches/release/boost/asio/seq_packet_socket_service.hpp | 28
   branches/release/boost/asio/serial_port.hpp | 2
   branches/release/boost/asio/serial_port_base.hpp | 15
   branches/release/boost/asio/serial_port_service.hpp | 25
   branches/release/boost/asio/signal_set.hpp | 2
   branches/release/boost/asio/signal_set_service.hpp | 14
   branches/release/boost/asio/socket_acceptor_service.hpp | 41
   branches/release/boost/asio/socket_base.hpp | 19
   branches/release/boost/asio/ssl.hpp | 2
   branches/release/boost/asio/ssl/basic_context.hpp | 2
   branches/release/boost/asio/ssl/context.hpp | 229 +
   branches/release/boost/asio/ssl/context_base.hpp | 47
   branches/release/boost/asio/ssl/context_service.hpp | 2
   branches/release/boost/asio/ssl/detail/engine.hpp | 6
   branches/release/boost/asio/ssl/detail/handshake_op.hpp | 2
   branches/release/boost/asio/ssl/detail/impl/engine.ipp | 11
   branches/release/boost/asio/ssl/detail/impl/openssl_init.ipp | 16
   branches/release/boost/asio/ssl/detail/io.hpp | 32
   branches/release/boost/asio/ssl/detail/openssl_init.hpp | 2
   branches/release/boost/asio/ssl/detail/openssl_types.hpp | 2
   branches/release/boost/asio/ssl/detail/password_callback.hpp | 2
   branches/release/boost/asio/ssl/detail/read_op.hpp | 2
   branches/release/boost/asio/ssl/detail/shutdown_op.hpp | 2
   branches/release/boost/asio/ssl/detail/stream_core.hpp | 50
   branches/release/boost/asio/ssl/detail/verify_callback.hpp | 2
   branches/release/boost/asio/ssl/detail/write_op.hpp | 2
   branches/release/boost/asio/ssl/error.hpp | 2
   branches/release/boost/asio/ssl/impl/context.hpp | 2
   branches/release/boost/asio/ssl/impl/context.ipp | 416 ++
   branches/release/boost/asio/ssl/impl/error.ipp | 2
   branches/release/boost/asio/ssl/impl/rfc2818_verification.ipp | 2
   branches/release/boost/asio/ssl/impl/src.hpp | 2
   branches/release/boost/asio/ssl/old/basic_context.hpp | 2
   branches/release/boost/asio/ssl/old/context_service.hpp | 2
   branches/release/boost/asio/ssl/old/detail/openssl_context_service.hpp | 2
   branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp | 6
   branches/release/boost/asio/ssl/old/detail/openssl_stream_service.hpp | 2
   branches/release/boost/asio/ssl/old/stream.hpp | 6
   branches/release/boost/asio/ssl/old/stream_service.hpp | 2
   branches/release/boost/asio/ssl/rfc2818_verification.hpp | 2
   branches/release/boost/asio/ssl/stream.hpp | 178 +
   branches/release/boost/asio/ssl/stream_base.hpp | 9
   branches/release/boost/asio/ssl/stream_service.hpp | 2
   branches/release/boost/asio/ssl/verify_context.hpp | 2
   branches/release/boost/asio/ssl/verify_mode.hpp | 2
   branches/release/boost/asio/steady_timer.hpp | 2
   branches/release/boost/asio/strand.hpp | 41
   branches/release/boost/asio/stream_socket_service.hpp | 50
   branches/release/boost/asio/streambuf.hpp | 6
   branches/release/boost/asio/system_timer.hpp | 2
   branches/release/boost/asio/time_traits.hpp | 8
   branches/release/boost/asio/version.hpp | 2
   branches/release/boost/asio/wait_traits.hpp | 2
   branches/release/boost/asio/waitable_timer_service.hpp | 15
   branches/release/boost/asio/windows/basic_handle.hpp | 2
   branches/release/boost/asio/windows/basic_object_handle.hpp | 9
   branches/release/boost/asio/windows/basic_random_access_handle.hpp | 22
   branches/release/boost/asio/windows/basic_stream_handle.hpp | 14
   branches/release/boost/asio/windows/object_handle.hpp | 2
   branches/release/boost/asio/windows/object_handle_service.hpp | 15
   branches/release/boost/asio/windows/overlapped_ptr.hpp | 2
   branches/release/boost/asio/windows/random_access_handle.hpp | 2
   branches/release/boost/asio/windows/random_access_handle_service.hpp | 35
   branches/release/boost/asio/windows/stream_handle.hpp | 2
   branches/release/boost/asio/windows/stream_handle_service.hpp | 25
   branches/release/boost/asio/write.hpp | 27
   branches/release/boost/asio/write_at.hpp | 47
   branches/release/libs/asio/doc/Jamfile.v2 | 13
   branches/release/libs/asio/doc/asio.qbk | 4
   branches/release/libs/asio/doc/doxy2qbk.pl | 2
   branches/release/libs/asio/doc/examples.qbk | 348 +
   branches/release/libs/asio/doc/history.qbk | 2
   branches/release/libs/asio/doc/index.xml | 2
   branches/release/libs/asio/doc/noncopyable_dox.txt | 2
   branches/release/libs/asio/doc/overview.qbk | 2
   branches/release/libs/asio/doc/overview/allocation.qbk | 5
   branches/release/libs/asio/doc/overview/async.qbk | 2
   branches/release/libs/asio/doc/overview/basics.qbk | 2
   branches/release/libs/asio/doc/overview/bsd_sockets.qbk | 2
   branches/release/libs/asio/doc/overview/buffers.qbk | 5
   branches/release/libs/asio/doc/overview/cpp2011.qbk | 2
   branches/release/libs/asio/doc/overview/handler_tracking.qbk | 2
   branches/release/libs/asio/doc/overview/implementation.qbk | 2
   branches/release/libs/asio/doc/overview/iostreams.qbk | 4
   branches/release/libs/asio/doc/overview/line_based.qbk | 4
   branches/release/libs/asio/doc/overview/posix.qbk | 9
   branches/release/libs/asio/doc/overview/protocols.qbk | 4
   branches/release/libs/asio/doc/overview/rationale.qbk | 2
   branches/release/libs/asio/doc/overview/reactor.qbk | 4
   branches/release/libs/asio/doc/overview/serial_ports.qbk | 2
   branches/release/libs/asio/doc/overview/signals.qbk | 5
   branches/release/libs/asio/doc/overview/ssl.qbk | 4
   branches/release/libs/asio/doc/overview/strands.qbk | 4
   branches/release/libs/asio/doc/overview/streams.qbk | 2
   branches/release/libs/asio/doc/overview/threads.qbk | 2
   branches/release/libs/asio/doc/overview/timers.qbk | 2
   branches/release/libs/asio/doc/overview/windows.qbk | 2
   branches/release/libs/asio/doc/quickref.xml | 2
   branches/release/libs/asio/doc/reference.dox | 5
   branches/release/libs/asio/doc/reference.qbk | 2
   branches/release/libs/asio/doc/reference.xsl | 53
   branches/release/libs/asio/doc/requirements.qbk | 2
   branches/release/libs/asio/doc/requirements/AcceptHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/AsyncRandomAccessReadDevice.qbk | 2
   branches/release/libs/asio/doc/requirements/AsyncRandomAccessWriteDevice.qbk | 2
   branches/release/libs/asio/doc/requirements/AsyncReadStream.qbk | 2
   branches/release/libs/asio/doc/requirements/AsyncWriteStream.qbk | 2
   branches/release/libs/asio/doc/requirements/CompletionHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/ComposedConnectHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/ConnectHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/ConstBufferSequence.qbk | 2
   branches/release/libs/asio/doc/requirements/ConvertibleToConstBuffer.qbk | 2
   branches/release/libs/asio/doc/requirements/ConvertibleToMutableBuffer.qbk | 2
   branches/release/libs/asio/doc/requirements/DatagramSocketService.qbk | 2
   branches/release/libs/asio/doc/requirements/DescriptorService.qbk | 2
   branches/release/libs/asio/doc/requirements/Endpoint.qbk | 2
   branches/release/libs/asio/doc/requirements/GettableSerialPortOption.qbk | 2
   branches/release/libs/asio/doc/requirements/GettableSocketOption.qbk | 2
   branches/release/libs/asio/doc/requirements/HandleService.qbk | 2
   branches/release/libs/asio/doc/requirements/Handler.qbk | 2
   branches/release/libs/asio/doc/requirements/HandshakeHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/InternetProtocol.qbk | 2
   branches/release/libs/asio/doc/requirements/IoControlCommand.qbk | 2
   branches/release/libs/asio/doc/requirements/IoObjectService.qbk | 2
   branches/release/libs/asio/doc/requirements/MutableBufferSequence.qbk | 2
   branches/release/libs/asio/doc/requirements/ObjectHandleService.qbk | 2
   branches/release/libs/asio/doc/requirements/Protocol.qbk | 2
   branches/release/libs/asio/doc/requirements/RandomAccessHandleService.qbk | 2
   branches/release/libs/asio/doc/requirements/RawSocketService.qbk | 2
   branches/release/libs/asio/doc/requirements/ReadHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/ResolveHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/ResolverService.qbk | 2
   branches/release/libs/asio/doc/requirements/SeqPacketSocketService.qbk | 2
   branches/release/libs/asio/doc/requirements/SerialPortService.qbk | 2
   branches/release/libs/asio/doc/requirements/Service.qbk | 2
   branches/release/libs/asio/doc/requirements/SettableSerialPortOption.qbk | 2
   branches/release/libs/asio/doc/requirements/SettableSocketOption.qbk | 2
   branches/release/libs/asio/doc/requirements/ShutdownHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/SignalHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/SignalSetService.qbk | 2
   branches/release/libs/asio/doc/requirements/SocketAcceptorService.qbk | 2
   branches/release/libs/asio/doc/requirements/SocketService.qbk | 2
   branches/release/libs/asio/doc/requirements/StreamDescriptorService.qbk | 2
   branches/release/libs/asio/doc/requirements/StreamHandleService.qbk | 2
   branches/release/libs/asio/doc/requirements/StreamSocketService.qbk | 2
   branches/release/libs/asio/doc/requirements/SyncRandomAccessReadDevice.qbk | 2
   branches/release/libs/asio/doc/requirements/SyncRandomAccessWriteDevice.qbk | 2
   branches/release/libs/asio/doc/requirements/SyncReadStream.qbk | 2
   branches/release/libs/asio/doc/requirements/SyncWriteStream.qbk | 2
   branches/release/libs/asio/doc/requirements/TimeTraits.qbk | 2
   branches/release/libs/asio/doc/requirements/TimerService.qbk | 2
   branches/release/libs/asio/doc/requirements/WaitHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/WaitTraits.qbk | 2
   branches/release/libs/asio/doc/requirements/WaitableTimerService.qbk | 2
   branches/release/libs/asio/doc/requirements/WriteHandler.qbk | 2
   branches/release/libs/asio/doc/requirements/asynchronous_operations.qbk | 6
   branches/release/libs/asio/doc/std_exception_dox.txt | 2
   branches/release/libs/asio/doc/tutorial.qbk | 26
   branches/release/libs/asio/doc/tutorial.xsl | 4
   branches/release/libs/asio/doc/using.qbk | 2
   branches/release/libs/asio/example/cpp03/allocation/Jamfile | 2
   branches/release/libs/asio/example/cpp03/allocation/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/allocation/server.cpp | 2
   branches/release/libs/asio/example/cpp03/buffers/Jamfile | 2
   branches/release/libs/asio/example/cpp03/buffers/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/buffers/reference_counted.cpp | 2
   branches/release/libs/asio/example/cpp03/chat/Jamfile | 2
   branches/release/libs/asio/example/cpp03/chat/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/chat/chat_client.cpp | 2
   branches/release/libs/asio/example/cpp03/chat/chat_message.hpp | 2
   branches/release/libs/asio/example/cpp03/chat/chat_server.cpp | 2
   branches/release/libs/asio/example/cpp03/chat/posix_chat_client.cpp | 2
   branches/release/libs/asio/example/cpp03/echo/Jamfile | 2
   branches/release/libs/asio/example/cpp03/echo/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/echo/async_tcp_echo_server.cpp | 2
   branches/release/libs/asio/example/cpp03/echo/async_udp_echo_server.cpp | 2
   branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_client.cpp | 2
   branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_server.cpp | 4
   branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_client.cpp | 2
   branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_server.cpp | 4
   branches/release/libs/asio/example/cpp03/fork/Jamfile | 2
   branches/release/libs/asio/example/cpp03/fork/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/fork/daemon.cpp | 2
   branches/release/libs/asio/example/cpp03/fork/process_per_connection.cpp | 2
   branches/release/libs/asio/example/cpp03/http/client/Jamfile | 2
   branches/release/libs/asio/example/cpp03/http/client/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/http/client/async_client.cpp | 2
   branches/release/libs/asio/example/cpp03/http/client/sync_client.cpp | 2
   branches/release/libs/asio/example/cpp03/http/doc_root/data_1K.html | 2
   branches/release/libs/asio/example/cpp03/http/doc_root/data_2K.html | 2
   branches/release/libs/asio/example/cpp03/http/doc_root/data_4K.html | 2
   branches/release/libs/asio/example/cpp03/http/doc_root/data_8K.html | 2
   branches/release/libs/asio/example/cpp03/http/server/Jamfile | 2
   branches/release/libs/asio/example/cpp03/http/server/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/http/server/connection.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/connection.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/connection_manager.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/connection_manager.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/header.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/main.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/mime_types.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/mime_types.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/reply.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/reply.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/request.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/request_handler.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/request_handler.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/request_parser.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/request_parser.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server/server.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server/server.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/Jamfile | 2
   branches/release/libs/asio/example/cpp03/http/server2/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/http/server2/connection.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/connection.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/header.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/main.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/mime_types.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/mime_types.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/reply.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/reply.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/request.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/request_handler.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/request_handler.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/request_parser.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/request_parser.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/server.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server2/server.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/Jamfile | 2
   branches/release/libs/asio/example/cpp03/http/server3/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/http/server3/connection.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/connection.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/header.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/main.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/mime_types.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/mime_types.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/reply.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/reply.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/request.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/request_handler.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/request_handler.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/request_parser.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/request_parser.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/server.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server3/server.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/Jamfile | 2
   branches/release/libs/asio/example/cpp03/http/server4/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/http/server4/file_handler.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/file_handler.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/header.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/main.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/mime_types.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/mime_types.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/reply.cpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/reply.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/request.hpp | 2
   branches/release/libs/asio/example/cpp03/http/server4/request_parser.cpp | 8
   branches/release/libs/asio/example/cpp03/http/server4/request_parser.hpp | 6
   branches/release/libs/asio/example/cpp03/http/server4/server.cpp | 8
   branches/release/libs/asio/example/cpp03/http/server4/server.hpp | 5
   branches/release/libs/asio/example/cpp03/icmp/Jamfile | 2
   branches/release/libs/asio/example/cpp03/icmp/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/icmp/icmp_header.hpp | 2
   branches/release/libs/asio/example/cpp03/icmp/ipv4_header.hpp | 2
   branches/release/libs/asio/example/cpp03/icmp/ping.cpp | 6
   branches/release/libs/asio/example/cpp03/invocation/Jamfile | 2
   branches/release/libs/asio/example/cpp03/invocation/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/invocation/prioritised_handlers.cpp | 2
   branches/release/libs/asio/example/cpp03/iostreams/Jamfile | 2
   branches/release/libs/asio/example/cpp03/iostreams/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/iostreams/daytime_client.cpp | 2
   branches/release/libs/asio/example/cpp03/iostreams/daytime_server.cpp | 2
   branches/release/libs/asio/example/cpp03/iostreams/http_client.cpp | 2
   branches/release/libs/asio/example/cpp03/local/Jamfile | 2
   branches/release/libs/asio/example/cpp03/local/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/local/connect_pair.cpp | 2
   branches/release/libs/asio/example/cpp03/local/iostream_client.cpp | 2
   branches/release/libs/asio/example/cpp03/local/stream_client.cpp | 2
   branches/release/libs/asio/example/cpp03/local/stream_server.cpp | 2
   branches/release/libs/asio/example/cpp03/multicast/Jamfile | 2
   branches/release/libs/asio/example/cpp03/multicast/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/multicast/receiver.cpp | 2
   branches/release/libs/asio/example/cpp03/multicast/sender.cpp | 2
   branches/release/libs/asio/example/cpp03/nonblocking/Jamfile | 2
   branches/release/libs/asio/example/cpp03/nonblocking/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/nonblocking/third_party_lib.cpp | 2
   branches/release/libs/asio/example/cpp03/porthopper/Jamfile | 2
   branches/release/libs/asio/example/cpp03/porthopper/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/porthopper/client.cpp | 2
   branches/release/libs/asio/example/cpp03/porthopper/protocol.hpp | 2
   branches/release/libs/asio/example/cpp03/porthopper/server.cpp | 2
   branches/release/libs/asio/example/cpp03/serialization/Jamfile | 2
   branches/release/libs/asio/example/cpp03/serialization/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/serialization/client.cpp | 2
   branches/release/libs/asio/example/cpp03/serialization/connection.hpp | 2
   branches/release/libs/asio/example/cpp03/serialization/server.cpp | 2
   branches/release/libs/asio/example/cpp03/serialization/stock.hpp | 2
   branches/release/libs/asio/example/cpp03/services/Jamfile | 2
   branches/release/libs/asio/example/cpp03/services/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/services/basic_logger.hpp | 2
   branches/release/libs/asio/example/cpp03/services/daytime_client.cpp | 2
   branches/release/libs/asio/example/cpp03/services/logger.hpp | 2
   branches/release/libs/asio/example/cpp03/services/logger_service.cpp | 2
   branches/release/libs/asio/example/cpp03/services/logger_service.hpp | 2
   branches/release/libs/asio/example/cpp03/services/stream_socket_service.hpp | 2
   branches/release/libs/asio/example/cpp03/socks4/Jamfile | 2
   branches/release/libs/asio/example/cpp03/socks4/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/socks4/socks4.hpp | 2
   branches/release/libs/asio/example/cpp03/socks4/sync_client.cpp | 2
   branches/release/libs/asio/example/cpp03/ssl/Jamfile | 2
   branches/release/libs/asio/example/cpp03/ssl/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/ssl/README | 2
   branches/release/libs/asio/example/cpp03/ssl/client.cpp | 2
   branches/release/libs/asio/example/cpp03/ssl/server.cpp | 2
   branches/release/libs/asio/example/cpp03/timeouts/Jamfile | 2
   branches/release/libs/asio/example/cpp03/timeouts/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/timeouts/async_tcp_client.cpp | 2
   branches/release/libs/asio/example/cpp03/timeouts/blocking_tcp_client.cpp | 2
   branches/release/libs/asio/example/cpp03/timeouts/blocking_udp_client.cpp | 2
   branches/release/libs/asio/example/cpp03/timeouts/server.cpp | 2
   branches/release/libs/asio/example/cpp03/timers/Jamfile | 2
   branches/release/libs/asio/example/cpp03/timers/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/timers/tick_count_timer.cpp | 2
   branches/release/libs/asio/example/cpp03/timers/time_t_timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/Jamfile | 2
   branches/release/libs/asio/example/cpp03/tutorial/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime1/client.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime2/server.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime3/server.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime4/client.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime5/server.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime6/server.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime7/server.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/daytime_dox.txt | 2
   branches/release/libs/asio/example/cpp03/tutorial/index_dox.txt | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer1/timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer2/timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer3/timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer4/timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer5/timer.cpp | 2
   branches/release/libs/asio/example/cpp03/tutorial/timer_dox.txt | 2
   branches/release/libs/asio/example/cpp03/windows/Jamfile | 2
   branches/release/libs/asio/example/cpp03/windows/Jamfile.v2 | 2
   branches/release/libs/asio/example/cpp03/windows/transmit_file.cpp | 2
   branches/release/libs/asio/test/archetypes/gettable_socket_option.hpp | 2
   branches/release/libs/asio/test/archetypes/io_control_command.hpp | 2
   branches/release/libs/asio/test/archetypes/settable_socket_option.hpp | 2
   branches/release/libs/asio/test/basic_datagram_socket.cpp | 13
   branches/release/libs/asio/test/basic_deadline_timer.cpp | 13
   branches/release/libs/asio/test/basic_raw_socket.cpp | 13
   branches/release/libs/asio/test/basic_seq_packet_socket.cpp | 13
   branches/release/libs/asio/test/basic_serial_port.cpp | 13
   branches/release/libs/asio/test/basic_signal_set.cpp | 13
   branches/release/libs/asio/test/basic_socket_acceptor.cpp | 13
   branches/release/libs/asio/test/basic_stream_socket.cpp | 13
   branches/release/libs/asio/test/basic_streambuf.cpp | 13
   branches/release/libs/asio/test/basic_waitable_timer.cpp | 13
   branches/release/libs/asio/test/buffer.cpp | 26
   branches/release/libs/asio/test/buffered_read_stream.cpp | 81
   branches/release/libs/asio/test/buffered_stream.cpp | 87
   branches/release/libs/asio/test/buffered_write_stream.cpp | 87
   branches/release/libs/asio/test/buffers_iterator.cpp | 26
   branches/release/libs/asio/test/completion_condition.cpp | 13
   branches/release/libs/asio/test/connect.cpp | 13
   branches/release/libs/asio/test/datagram_socket_service.cpp | 13
   branches/release/libs/asio/test/deadline_timer.cpp | 91
   branches/release/libs/asio/test/deadline_timer_service.cpp | 13
   branches/release/libs/asio/test/error.cpp | 29
   branches/release/libs/asio/test/high_resolution_timer.cpp | 13
   branches/release/libs/asio/test/io_service.cpp | 198
   branches/release/libs/asio/test/ip/address.cpp | 14
   branches/release/libs/asio/test/ip/address_v4.cpp | 207
   branches/release/libs/asio/test/ip/address_v6.cpp | 344 +-
   branches/release/libs/asio/test/ip/basic_endpoint.cpp | 13
   branches/release/libs/asio/test/ip/basic_resolver.cpp | 13
   branches/release/libs/asio/test/ip/basic_resolver_entry.cpp | 13
   branches/release/libs/asio/test/ip/basic_resolver_iterator.cpp | 13
   branches/release/libs/asio/test/ip/basic_resolver_query.cpp | 13
   branches/release/libs/asio/test/ip/host_name.cpp | 13
   branches/release/libs/asio/test/ip/multicast.cpp | 167
   branches/release/libs/asio/test/ip/resolver_query_base.cpp | 13
   branches/release/libs/asio/test/ip/resolver_service.cpp | 13
   branches/release/libs/asio/test/ip/tcp.cpp | 245 +
   branches/release/libs/asio/test/ip/udp.cpp | 135
   branches/release/libs/asio/test/ip/unicast.cpp | 81
   branches/release/libs/asio/test/ip/v6_only.cpp | 49
   branches/release/libs/asio/test/is_read_buffered.cpp | 32
   branches/release/libs/asio/test/is_write_buffered.cpp | 32
   branches/release/libs/asio/test/latency/allocator.hpp | 2
   branches/release/libs/asio/test/latency/coroutine.hpp | 2
   branches/release/libs/asio/test/latency/high_res_clock.hpp | 4
   branches/release/libs/asio/test/latency/tcp_client.cpp | 2
   branches/release/libs/asio/test/latency/tcp_server.cpp | 2
   branches/release/libs/asio/test/latency/udp_client.cpp | 2
   branches/release/libs/asio/test/latency/udp_server.cpp | 2
   branches/release/libs/asio/test/latency/unyield.hpp | 2
   branches/release/libs/asio/test/latency/yield.hpp | 2
   branches/release/libs/asio/test/local/basic_endpoint.cpp | 13
   branches/release/libs/asio/test/local/connect_pair.cpp | 13
   branches/release/libs/asio/test/local/datagram_protocol.cpp | 14
   branches/release/libs/asio/test/local/stream_protocol.cpp | 14
   branches/release/libs/asio/test/placeholders.cpp | 13
   branches/release/libs/asio/test/posix/basic_descriptor.cpp | 13
   branches/release/libs/asio/test/posix/basic_stream_descriptor.cpp | 13
   branches/release/libs/asio/test/posix/descriptor_base.cpp | 13
   branches/release/libs/asio/test/posix/stream_descriptor.cpp | 26
   branches/release/libs/asio/test/posix/stream_descriptor_service.cpp | 13
   branches/release/libs/asio/test/raw_socket_service.cpp | 13
   branches/release/libs/asio/test/read.cpp | 2853 +++++++++---------
   branches/release/libs/asio/test/read_at.cpp | 5427 ++++++++++++++++-------------------
   branches/release/libs/asio/test/read_until.cpp | 484 +-
   branches/release/libs/asio/test/seq_packet_socket_service.cpp | 13
   branches/release/libs/asio/test/serial_port.cpp | 21
   branches/release/libs/asio/test/serial_port_base.cpp | 13
   branches/release/libs/asio/test/serial_port_service.cpp | 13
   branches/release/libs/asio/test/signal_set.cpp | 17
   branches/release/libs/asio/test/signal_set_service.cpp | 13
   branches/release/libs/asio/test/socket_acceptor_service.cpp | 13
   branches/release/libs/asio/test/socket_base.cpp | 433 +-
   branches/release/libs/asio/test/ssl/basic_context.cpp | 13
   branches/release/libs/asio/test/ssl/context.cpp | 13
   branches/release/libs/asio/test/ssl/context_base.cpp | 13
   branches/release/libs/asio/test/ssl/context_service.cpp | 13
   branches/release/libs/asio/test/ssl/rfc2818_verification.cpp | 13
   branches/release/libs/asio/test/ssl/stream.cpp | 72
   branches/release/libs/asio/test/ssl/stream_base.cpp | 13
   branches/release/libs/asio/test/ssl/stream_service.cpp | 13
   branches/release/libs/asio/test/steady_timer.cpp | 13
   branches/release/libs/asio/test/strand.cpp | 122
   branches/release/libs/asio/test/stream_socket_service.cpp | 13
   branches/release/libs/asio/test/streambuf.cpp | 27
   branches/release/libs/asio/test/system_timer.cpp | 338 ++
   branches/release/libs/asio/test/time_traits.cpp | 13
   branches/release/libs/asio/test/unit_test.hpp | 67
   branches/release/libs/asio/test/wait_traits.cpp | 13
   branches/release/libs/asio/test/waitable_timer_service.cpp | 13
   branches/release/libs/asio/test/windows/basic_handle.cpp | 13
   branches/release/libs/asio/test/windows/basic_object_handle.cpp | 13
   branches/release/libs/asio/test/windows/basic_random_access_handle.cpp | 13
   branches/release/libs/asio/test/windows/basic_stream_handle.cpp | 13
   branches/release/libs/asio/test/windows/object_handle.cpp | 18
   branches/release/libs/asio/test/windows/object_handle_service.cpp | 13
   branches/release/libs/asio/test/windows/overlapped_ptr.cpp | 14
   branches/release/libs/asio/test/windows/random_access_handle.cpp | 25
   branches/release/libs/asio/test/windows/random_access_handle_service.cpp | 13
   branches/release/libs/asio/test/windows/stream_handle.cpp | 22
   branches/release/libs/asio/test/windows/stream_handle_service.cpp | 13
   branches/release/libs/asio/test/write.cpp | 3095 +++++++++++---------
   branches/release/libs/asio/test/write_at.cpp | 5978 +++++++++++++++++++++------------------
   743 files changed, 16973 insertions(+), 13146 deletions(-)

Modified: branches/release/boost/asio.hpp
==============================================================================
--- branches/release/boost/asio.hpp (original)
+++ branches/release/boost/asio.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // asio.hpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_datagram_socket.hpp>
 #include <boost/asio/basic_deadline_timer.hpp>
 #include <boost/asio/basic_io_object.hpp>
@@ -40,12 +41,20 @@
 #include <boost/asio/buffers_iterator.hpp>
 #include <boost/asio/completion_condition.hpp>
 #include <boost/asio/connect.hpp>
+#include <boost/asio/coroutine.hpp>
 #include <boost/asio/datagram_socket_service.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
 #include <boost/asio/deadline_timer.hpp>
 #include <boost/asio/error.hpp>
+#include <boost/asio/generic/basic_endpoint.hpp>
+#include <boost/asio/generic/datagram_protocol.hpp>
+#include <boost/asio/generic/raw_protocol.hpp>
+#include <boost/asio/generic/seq_packet_protocol.hpp>
+#include <boost/asio/generic/stream_protocol.hpp>
 #include <boost/asio/handler_alloc_hook.hpp>
+#include <boost/asio/handler_continuation_hook.hpp>
 #include <boost/asio/handler_invoke_hook.hpp>
+#include <boost/asio/handler_type.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/address.hpp>
 #include <boost/asio/ip/address_v4.hpp>

Added: branches/release/boost/asio/async_result.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/async_result.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,96 @@
+//
+// async_result.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_ASYNC_RESULT_HPP
+#define BOOST_ASIO_ASYNC_RESULT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/handler_type.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// An interface for customising the behaviour of an initiating function.
+/**
+ * This template may be specialised for user-defined handler types.
+ */
+template <typename Handler>
+class async_result
+{
+public:
+ /// The return type of the initiating function.
+ typedef void type;
+
+ /// Construct an async result from a given handler.
+ /**
+ * When using a specalised async_result, the constructor has an opportunity
+ * to initialise some state associated with the handler, which is then
+ * returned from the initiating function.
+ */
+ explicit async_result(Handler&)
+ {
+ }
+
+ /// Obtain the value to be returned from the initiating function.
+ type get()
+ {
+ }
+};
+
+namespace detail {
+
+// Helper template to deduce the true type of a handler, capture a local copy
+// of the handler, and then create an async_result for the handler.
+template <typename Handler, typename Signature>
+struct async_result_init
+{
+ explicit async_result_init(BOOST_ASIO_MOVE_ARG(Handler) orig_handler)
+ : handler(BOOST_ASIO_MOVE_CAST(Handler)(orig_handler)),
+ result(handler)
+ {
+ }
+
+ typename handler_type<Handler, Signature>::type handler;
+ async_result<typename handler_type<Handler, Signature>::type> result;
+};
+
+template <typename Handler, typename Signature>
+struct async_result_type_helper
+{
+ typedef typename async_result<
+ typename handler_type<Handler, Signature>::type
+ >::type type;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#if defined(GENERATING_DOCUMENTATION)
+# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
+ void_or_deduced
+#elif defined(_MSC_VER) && (_MSC_VER < 1500)
+# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
+ typename ::boost::asio::detail::async_result_type_helper<h, sig>::type
+#else
+# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
+ typename ::boost::asio::async_result< \
+ typename ::boost::asio::handler_type<h, sig>::type>::type
+#endif
+
+#endif // BOOST_ASIO_ASYNC_RESULT_HPP

Modified: branches/release/boost/asio/basic_datagram_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_datagram_socket.hpp (original)
+++ branches/release/boost/asio/basic_datagram_socket.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_datagram_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,6 +21,7 @@
 #include <boost/asio/datagram_socket_service.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -166,6 +167,50 @@
         BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other));
     return *this;
   }
+
+ /// Move-construct a basic_datagram_socket from a socket of another protocol
+ /// type.
+ /**
+ * This constructor moves a datagram socket from one object to another.
+ *
+ * @param other The other basic_datagram_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_datagram_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename DatagramSocketService1>
+ basic_datagram_socket(
+ basic_datagram_socket<Protocol1, DatagramSocketService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_socket<Protocol, DatagramSocketService>(
+ BOOST_ASIO_MOVE_CAST2(basic_datagram_socket<
+ Protocol1, DatagramSocketService1>)(other))
+ {
+ }
+
+ /// Move-assign a basic_datagram_socket from a socket of another protocol
+ /// type.
+ /**
+ * This assignment operator moves a datagram socket from one object to
+ * another.
+ *
+ * @param other The other basic_datagram_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_datagram_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename DatagramSocketService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_datagram_socket>::type& operator=(
+ basic_datagram_socket<Protocol1, DatagramSocketService1>&& other)
+ {
+ basic_socket<Protocol, DatagramSocketService>::operator=(
+ BOOST_ASIO_MOVE_CAST2(basic_datagram_socket<
+ Protocol1, DatagramSocketService1>)(other));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Send some data on a connected socket.
@@ -290,14 +335,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -331,7 +378,9 @@
    * socket.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -339,7 +388,7 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -469,7 +518,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -477,8 +528,9 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send_to(this->get_implementation(), buffers,
- destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+ return this->get_service().async_send_to(
+ this->get_implementation(), buffers, destination, 0,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send.
@@ -509,7 +561,9 @@
    * boost::asio::io_service::post().
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -517,8 +571,9 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send_to(this->get_implementation(), buffers,
- destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+ return this->get_service().async_send_to(
+ this->get_implementation(), buffers, destination, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Receive some data on a connected socket.
@@ -647,14 +702,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -687,7 +744,9 @@
    * datagram socket.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -695,7 +754,7 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -825,7 +884,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -833,8 +894,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive_from(this->get_implementation(), buffers,
- sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive_from(
+ this->get_implementation(), buffers, sender_endpoint, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -867,7 +929,9 @@
    * boost::asio::io_service::post().
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -875,8 +939,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive_from(this->get_implementation(), buffers,
- sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive_from(
+ this->get_implementation(), buffers, sender_endpoint, flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: branches/release/boost/asio/basic_deadline_timer.hpp
==============================================================================
--- branches/release/boost/asio/basic_deadline_timer.hpp (original)
+++ branches/release/boost/asio/basic_deadline_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_deadline_timer.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <cstddef>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
@@ -492,13 +496,15 @@
    * boost::asio::io_service::post().
    */
   template <typename WaitHandler>
- void async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WaitHandler.
     BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
 
- this->service.async_wait(this->implementation,
+ return this->service.async_wait(this->implementation,
         BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
   }
 };
@@ -508,4 +514,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP

Modified: branches/release/boost/asio/basic_io_object.hpp
==============================================================================
--- branches/release/boost/asio/basic_io_object.hpp (original)
+++ branches/release/boost/asio/basic_io_object.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_io_object.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/basic_raw_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_raw_socket.hpp (original)
+++ branches/release/boost/asio/basic_raw_socket.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_raw_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,6 +20,7 @@
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/raw_socket_service.hpp>
 
@@ -165,6 +166,46 @@
         BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other));
     return *this;
   }
+
+ /// Move-construct a basic_raw_socket from a socket of another protocol type.
+ /**
+ * This constructor moves a raw socket from one object to another.
+ *
+ * @param other The other basic_raw_socket object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_raw_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename RawSocketService1>
+ basic_raw_socket(basic_raw_socket<Protocol1, RawSocketService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_socket<Protocol, RawSocketService>(
+ BOOST_ASIO_MOVE_CAST2(basic_raw_socket<
+ Protocol1, RawSocketService1>)(other))
+ {
+ }
+
+ /// Move-assign a basic_raw_socket from a socket of another protocol type.
+ /**
+ * This assignment operator moves a raw socket from one object to another.
+ *
+ * @param other The other basic_raw_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_raw_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename RawSocketService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_raw_socket>::type& operator=(
+ basic_raw_socket<Protocol1, RawSocketService1>&& other)
+ {
+ basic_socket<Protocol, RawSocketService>::operator=(
+ BOOST_ASIO_MOVE_CAST2(basic_raw_socket<
+ Protocol1, RawSocketService1>)(other));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Send some data on a connected socket.
@@ -285,14 +326,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -325,7 +368,9 @@
    * socket.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -333,7 +378,7 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -463,7 +508,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -471,8 +518,8 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send_to(this->get_implementation(), buffers,
- destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+ return this->get_service().async_send_to(this->get_implementation(),
+ buffers, destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send.
@@ -503,7 +550,9 @@
    * boost::asio::io_service::post().
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -511,8 +560,9 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send_to(this->get_implementation(), buffers,
- destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+ return this->get_service().async_send_to(
+ this->get_implementation(), buffers, destination, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Receive some data on a connected socket.
@@ -641,14 +691,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -681,7 +733,9 @@
    * raw socket.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -689,7 +743,7 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -819,7 +873,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -827,8 +883,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive_from(this->get_implementation(), buffers,
- sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive_from(
+ this->get_implementation(), buffers, sender_endpoint, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -861,7 +918,9 @@
    * boost::asio::io_service::post().
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -869,8 +928,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive_from(this->get_implementation(), buffers,
- sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive_from(
+ this->get_implementation(), buffers, sender_endpoint, flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: branches/release/boost/asio/basic_seq_packet_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_seq_packet_socket.hpp (original)
+++ branches/release/boost/asio/basic_seq_packet_socket.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_seq_packet_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -171,6 +171,51 @@
         BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other));
     return *this;
   }
+
+ /// Move-construct a basic_seq_packet_socket from a socket of another protocol
+ /// type.
+ /**
+ * This constructor moves a sequenced packet socket from one object to
+ * another.
+ *
+ * @param other The other basic_seq_packet_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_seq_packet_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SeqPacketSocketService1>
+ basic_seq_packet_socket(
+ basic_seq_packet_socket<Protocol1, SeqPacketSocketService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_socket<Protocol, SeqPacketSocketService>(
+ BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket<
+ Protocol1, SeqPacketSocketService1>)(other))
+ {
+ }
+
+ /// Move-assign a basic_seq_packet_socket from a socket of another protocol
+ /// type.
+ /**
+ * This assignment operator moves a sequenced packet socket from one object to
+ * another.
+ *
+ * @param other The other basic_seq_packet_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_seq_packet_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SeqPacketSocketService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_seq_packet_socket>::type& operator=(
+ basic_seq_packet_socket<Protocol1, SeqPacketSocketService1>&& other)
+ {
+ basic_socket<Protocol, SeqPacketSocketService>::operator=(
+ BOOST_ASIO_MOVE_CAST2(basic_seq_packet_socket<
+ Protocol1, SeqPacketSocketService1>)(other));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Send some data on the socket.
@@ -267,7 +312,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -275,7 +322,7 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -437,7 +484,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags& out_flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -445,8 +494,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(), buffers,
- 0, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive(
+ this->get_implementation(), buffers, 0, out_flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -492,7 +542,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags in_flags,
       socket_base::message_flags& out_flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
@@ -501,8 +553,9 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(), buffers,
- in_flags, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ return this->get_service().async_receive(
+ this->get_implementation(), buffers, in_flags, out_flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: branches/release/boost/asio/basic_serial_port.hpp
==============================================================================
--- branches/release/boost/asio/basic_serial_port.hpp (original)
+++ branches/release/boost/asio/basic_serial_port.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_serial_port.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -559,14 +559,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_write_some(this->get_implementation(),
+ return this->get_service().async_write_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -670,14 +672,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_read_some(this->get_implementation(),
+ return this->get_service().async_read_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/basic_signal_set.hpp
==============================================================================
--- branches/release/boost/asio/basic_signal_set.hpp (original)
+++ branches/release/boost/asio/basic_signal_set.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_signal_set.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -365,13 +365,15 @@
    * boost::asio::io_service::post().
    */
   template <typename SignalHandler>
- void async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler,
+ void (boost::system::error_code, int))
+ async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a SignalHandler.
     BOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check;
 
- this->service.async_wait(this->implementation,
+ return this->service.async_wait(this->implementation,
         BOOST_ASIO_MOVE_CAST(SignalHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/basic_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_socket.hpp (original)
+++ branches/release/boost/asio/basic_socket.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_socket.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,9 +16,11 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/socket_base.hpp>
 
@@ -173,6 +175,51 @@
         BOOST_ASIO_MOVE_CAST(basic_socket)(other));
     return *this;
   }
+
+ // All sockets have access to each other's implementations.
+ template <typename Protocol1, typename SocketService1>
+ friend class basic_socket;
+
+ /// Move-construct a basic_socket from a socket of another protocol type.
+ /**
+ * This constructor moves a socket from one object to another.
+ *
+ * @param other The other basic_socket object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SocketService1>
+ basic_socket(basic_socket<Protocol1, SocketService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_io_object<SocketService>(other.get_io_service())
+ {
+ this->get_service().template converting_move_construct<Protocol1>(
+ this->get_implementation(), other.get_implementation());
+ }
+
+ /// Move-assign a basic_socket from a socket of another protocol type.
+ /**
+ * This assignment operator moves a socket from one object to another.
+ *
+ * @param other The other basic_socket object from which the move will
+ * occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SocketService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_socket>::type& operator=(
+ basic_socket<Protocol1, SocketService1>&& other)
+ {
+ basic_socket tmp(BOOST_ASIO_MOVE_CAST2(basic_socket<
+ Protocol1, SocketService1>)(other));
+ basic_io_object<SocketService>::operator=(
+ BOOST_ASIO_MOVE_CAST(basic_socket)(tmp));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Get a reference to the lowest layer.
@@ -395,7 +442,7 @@
    * CancelIoEx function is always used. This function does not have the
    * problems described above.
    */
-#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
   && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
   && !defined(BOOST_ASIO_ENABLE_CANCELIO)
   __declspec(deprecated("By default, this function always fails with "
@@ -443,7 +490,7 @@
    * CancelIoEx function is always used. This function does not have the
    * problems described above.
    */
-#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) \
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
   && (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
   && !defined(BOOST_ASIO_ENABLE_CANCELIO)
   __declspec(deprecated("By default, this function always fails with "
@@ -698,7 +745,9 @@
    * @endcode
    */
   template <typename ConnectHandler>
- void async_connect(const endpoint_type& peer_endpoint,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
+ void (boost::system::error_code))
+ async_connect(const endpoint_type& peer_endpoint,
       BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
@@ -711,14 +760,21 @@
       const protocol_type protocol = peer_endpoint.protocol();
       if (this->get_service().open(this->get_implementation(), protocol, ec))
       {
+ detail::async_result_init<
+ ConnectHandler, void (boost::system::error_code)> init(
+ BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+
         this->get_io_service().post(
             boost::asio::detail::bind_handler(
- BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler), ec));
- return;
+ BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(
+ ConnectHandler, void (boost::system::error_code)))(
+ init.handler), ec));
+
+ return init.result.get();
       }
     }
 
- this->get_service().async_connect(this->get_implementation(),
+ return this->get_service().async_connect(this->get_implementation(),
         peer_endpoint, BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
   }
 

Modified: branches/release/boost/asio/basic_socket_acceptor.hpp
==============================================================================
--- branches/release/boost/asio/basic_socket_acceptor.hpp (original)
+++ branches/release/boost/asio/basic_socket_acceptor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_socket_acceptor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,6 +20,7 @@
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/socket_acceptor_service.hpp>
 #include <boost/asio/socket_base.hpp>
@@ -211,6 +212,54 @@
         BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(other));
     return *this;
   }
+
+ // All socket acceptors have access to each other's implementations.
+ template <typename Protocol1, typename SocketAcceptorService1>
+ friend class basic_socket_acceptor;
+
+ /// Move-construct a basic_socket_acceptor from an acceptor of another
+ /// protocol type.
+ /**
+ * This constructor moves an acceptor from one object to another.
+ *
+ * @param other The other basic_socket_acceptor object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SocketAcceptorService1>
+ basic_socket_acceptor(
+ basic_socket_acceptor<Protocol1, SocketAcceptorService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_io_object<SocketAcceptorService>(other.get_io_service())
+ {
+ this->get_service().template converting_move_construct<Protocol1>(
+ this->get_implementation(), other.get_implementation());
+ }
+
+ /// Move-assign a basic_socket_acceptor from an acceptor of another protocol
+ /// type.
+ /**
+ * This assignment operator moves an acceptor from one object to another.
+ *
+ * @param other The other basic_socket_acceptor object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename SocketAcceptorService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_socket_acceptor>::type& operator=(
+ basic_socket_acceptor<Protocol1, SocketAcceptorService1>&& other)
+ {
+ basic_socket_acceptor tmp(BOOST_ASIO_MOVE_CAST2(basic_socket_acceptor<
+ Protocol1, SocketAcceptorService1>)(other));
+ basic_io_object<SocketAcceptorService>::operator=(
+ BOOST_ASIO_MOVE_CAST(basic_socket_acceptor)(tmp));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Open the acceptor using the specified protocol.
@@ -871,11 +920,13 @@
    * acceptor.accept(socket);
    * @endcode
    */
- template <typename SocketService>
- void accept(basic_socket<protocol_type, SocketService>& peer)
+ template <typename Protocol1, typename SocketService>
+ void accept(basic_socket<Protocol1, SocketService>& peer,
+ typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0)
   {
     boost::system::error_code ec;
- this->get_service().accept(this->get_implementation(), peer, 0, ec);
+ this->get_service().accept(this->get_implementation(),
+ peer, static_cast<endpoint_type*>(0), ec);
     boost::asio::detail::throw_error(ec, "accept");
   }
 
@@ -902,12 +953,14 @@
    * }
    * @endcode
    */
- template <typename SocketService>
+ template <typename Protocol1, typename SocketService>
   boost::system::error_code accept(
- basic_socket<protocol_type, SocketService>& peer,
- boost::system::error_code& ec)
+ basic_socket<Protocol1, SocketService>& peer,
+ boost::system::error_code& ec,
+ typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0)
   {
- return this->get_service().accept(this->get_implementation(), peer, 0, ec);
+ return this->get_service().accept(this->get_implementation(),
+ peer, static_cast<endpoint_type*>(0), ec);
   }
 
   /// Start an asynchronous accept.
@@ -948,16 +1001,20 @@
    * acceptor.async_accept(socket, accept_handler);
    * @endcode
    */
- template <typename SocketService, typename AcceptHandler>
- void async_accept(basic_socket<protocol_type, SocketService>& peer,
- BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
+ template <typename Protocol1, typename SocketService, typename AcceptHandler>
+ BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler,
+ void (boost::system::error_code))
+ async_accept(basic_socket<Protocol1, SocketService>& peer,
+ BOOST_ASIO_MOVE_ARG(AcceptHandler) handler,
+ typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a AcceptHandler.
     BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check;
 
- this->get_service().async_accept(this->get_implementation(),
- peer, 0, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
+ return this->get_service().async_accept(this->get_implementation(),
+ peer, static_cast<endpoint_type*>(0),
+ BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
   }
 
   /// Accept a new connection and obtain the endpoint of the peer
@@ -1057,14 +1114,16 @@
    * boost::asio::io_service::post().
    */
   template <typename SocketService, typename AcceptHandler>
- void async_accept(basic_socket<protocol_type, SocketService>& peer,
+ BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler,
+ void (boost::system::error_code))
+ async_accept(basic_socket<protocol_type, SocketService>& peer,
       endpoint_type& peer_endpoint, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a AcceptHandler.
     BOOST_ASIO_ACCEPT_HANDLER_CHECK(AcceptHandler, handler) type_check;
 
- this->get_service().async_accept(this->get_implementation(), peer,
+ return this->get_service().async_accept(this->get_implementation(), peer,
         &peer_endpoint, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/basic_socket_iostream.hpp
==============================================================================
--- branches/release/boost/asio/basic_socket_iostream.hpp (original)
+++ branches/release/boost/asio/basic_socket_iostream.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_socket_iostream.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
-#include <boost/utility/base_from_member.hpp>
+#include <istream>
+#include <ostream>
 #include <boost/asio/basic_socket_streambuf.hpp>
 #include <boost/asio/stream_socket_service.hpp>
 
@@ -37,9 +38,10 @@
 // A macro that should expand to:
 // template <typename T1, ..., typename Tn>
 // explicit basic_socket_iostream(T1 x1, ..., Tn xn)
-// : basic_iostream<char>(&this->boost::base_from_member<
-// basic_socket_streambuf<Protocol, StreamSocketService,
-// Time, TimeTraits, TimerService> >::member)
+// : std::basic_iostream<char>(
+// &this->detail::socket_iostream_base<
+// Protocol, StreamSocketService, Time,
+// TimeTraits, TimerService>::streambuf_)
 // {
 // if (rdbuf()->connect(x1, ..., xn) == 0)
 // this->setstate(std::ios_base::failbit);
@@ -49,9 +51,10 @@
 # define BOOST_ASIO_PRIVATE_CTR_DEF(z, n, data) \
   template <BOOST_PP_ENUM_PARAMS(n, typename T)> \
   explicit basic_socket_iostream(BOOST_PP_ENUM_BINARY_PARAMS(n, T, x)) \
- : std::basic_iostream<char>(&this->boost::base_from_member< \
- basic_socket_streambuf<Protocol, StreamSocketService, \
- Time, TimeTraits, TimerService> >::member) \
+ : std::basic_iostream<char>( \
+ &this->detail::socket_iostream_base< \
+ Protocol, StreamSocketService, Time, \
+ TimeTraits, TimerService>::streambuf_) \
   { \
     this->setf(std::ios_base::unitbuf); \
     if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \
@@ -83,34 +86,69 @@
 
 namespace boost {
 namespace asio {
+namespace detail {
+
+// A separate base class is used to ensure that the streambuf is initialised
+// prior to the basic_socket_iostream's basic_iostream base class.
+template <typename Protocol, typename StreamSocketService,
+ typename Time, typename TimeTraits, typename TimerService>
+class socket_iostream_base
+{
+protected:
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService> streambuf_;
+};
+
+}
 
 /// Iostream interface for a socket.
 template <typename Protocol,
     typename StreamSocketService = stream_socket_service<Protocol>,
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
     typename Time = boost::posix_time::ptime,
     typename TimeTraits = boost::asio::time_traits<Time>,
     typename TimerService = deadline_timer_service<Time, TimeTraits> >
+#else
+ typename Time = steady_timer::clock_type,
+ typename TimeTraits = steady_timer::traits_type,
+ typename TimerService = steady_timer::service_type>
+#endif
 class basic_socket_iostream
- : public boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >,
+ : private detail::socket_iostream_base<Protocol,
+ StreamSocketService, Time, TimeTraits, TimerService>,
     public std::basic_iostream<char>
 {
+private:
+ // These typedefs are intended keep this class's implementation independent
+ // of whether it's using Boost.DateTime, Boost.Chrono or std::chrono.
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ typedef TimeTraits traits_helper;
+#else
+ typedef detail::chrono_time_traits<Time, TimeTraits> traits_helper;
+#endif
+
 public:
   /// The endpoint type.
   typedef typename Protocol::endpoint endpoint_type;
 
+#if defined(GENERATING_DOCUMENTATION)
   /// The time type.
   typedef typename TimeTraits::time_type time_type;
 
   /// The duration type.
   typedef typename TimeTraits::duration_type duration_type;
+#else
+ typedef typename traits_helper::time_type time_type;
+ typedef typename traits_helper::duration_type duration_type;
+#endif
 
   /// Construct a basic_socket_iostream without establishing a connection.
   basic_socket_iostream()
- : std::basic_iostream<char>(&this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member)
+ : std::basic_iostream<char>(
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_)
   {
     this->setf(std::ios_base::unitbuf);
   }
@@ -127,9 +165,10 @@
 #elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
   template <typename... T>
   explicit basic_socket_iostream(T... x)
- : std::basic_iostream<char>(&this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member)
+ : std::basic_iostream<char>(
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_)
   {
     this->setf(std::ios_base::unitbuf);
     if (rdbuf()->connect(x...) == 0)
@@ -176,9 +215,9 @@
   {
     return const_cast<basic_socket_streambuf<Protocol, StreamSocketService,
       Time, TimeTraits, TimerService>*>(
- &this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService,
- Time, TimeTraits, TimerService> >::member);
+ &this->detail::socket_iostream_base<
+ Protocol, StreamSocketService, Time,
+ TimeTraits, TimerService>::streambuf_);
   }
 
   /// Get the last error associated with the stream.
@@ -255,6 +294,6 @@
 # undef BOOST_ASIO_PRIVATE_CONNECT_DEF
 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
-#endif // defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP

Modified: branches/release/boost/asio/basic_socket_streambuf.hpp
==============================================================================
--- branches/release/boost/asio/basic_socket_streambuf.hpp (original)
+++ branches/release/boost/asio/basic_socket_streambuf.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_socket_streambuf.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,21 +17,21 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <streambuf>
-#include <boost/utility/base_from_member.hpp>
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
 #include <boost/asio/detail/array.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/stream_socket_service.hpp>
-#include <boost/asio/time_traits.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else
+# include <boost/asio/steady_timer.hpp>
+#endif
 
 #if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
@@ -82,32 +82,64 @@
 
 namespace boost {
 namespace asio {
+namespace detail {
+
+// A separate base class is used to ensure that the io_service is initialised
+// prior to the basic_socket_streambuf's basic_socket base class.
+class socket_streambuf_base
+{
+protected:
+ io_service io_service_;
+};
+
+} // namespace detail
 
 /// Iostream streambuf for a socket.
 template <typename Protocol,
     typename StreamSocketService = stream_socket_service<Protocol>,
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
     typename Time = boost::posix_time::ptime,
     typename TimeTraits = boost::asio::time_traits<Time>,
     typename TimerService = deadline_timer_service<Time, TimeTraits> >
+#else
+ typename Time = steady_timer::clock_type,
+ typename TimeTraits = steady_timer::traits_type,
+ typename TimerService = steady_timer::service_type>
+#endif
 class basic_socket_streambuf
   : public std::streambuf,
- private boost::base_from_member<io_service>,
+ private detail::socket_streambuf_base,
     public basic_socket<Protocol, StreamSocketService>
 {
+private:
+ // These typedefs are intended keep this class's implementation independent
+ // of whether it's using Boost.DateTime, Boost.Chrono or std::chrono.
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ typedef TimeTraits traits_helper;
+#else
+ typedef detail::chrono_time_traits<Time, TimeTraits> traits_helper;
+#endif
+
 public:
   /// The endpoint type.
   typedef typename Protocol::endpoint endpoint_type;
 
+#if defined(GENERATING_DOCUMENTATION)
   /// The time type.
   typedef typename TimeTraits::time_type time_type;
 
   /// The duration type.
   typedef typename TimeTraits::duration_type duration_type;
+#else
+ typedef typename traits_helper::time_type time_type;
+ typedef typename traits_helper::duration_type duration_type;
+#endif
 
   /// Construct a basic_socket_streambuf without establishing a connection.
   basic_socket_streambuf()
     : basic_socket<Protocol, StreamSocketService>(
- boost::base_from_member<boost::asio::io_service>::member),
+ this->detail::socket_streambuf_base::io_service_),
       unbuffered_(false),
       timer_service_(0),
       timer_state_(no_timer)
@@ -252,7 +284,7 @@
    */
   duration_type expires_from_now() const
   {
- return TimeTraits::subtract(expires_at(), TimeTraits::now());
+ return traits_helper::subtract(expires_at(), traits_helper::now());
   }
 
   /// Set the stream buffer's expiry time relative to now.
@@ -424,8 +456,7 @@
   {
     typedef typename Protocol::resolver resolver_type;
     typedef typename resolver_type::iterator iterator_type;
- resolver_type resolver(
- boost::base_from_member<boost::asio::io_service>::member);
+ resolver_type resolver(detail::socket_streambuf_base::io_service_);
     iterator_type i = resolver.resolve(query, ec_);
     if (!ec_)
     {
@@ -477,12 +508,12 @@
 
     void operator()(const boost::system::error_code&)
     {
- time_type now = TimeTraits::now();
+ time_type now = traits_helper::now();
 
       time_type expiry_time = this_->timer_service_->expires_at(
             this_->timer_implementation_);
 
- if (TimeTraits::less_than(now, expiry_time))
+ if (traits_helper::less_than(now, expiry_time))
       {
         this_->timer_state_ = timer_is_pending;
         this_->timer_service_->async_wait(this_->timer_implementation_, *this);
@@ -501,7 +532,7 @@
     if (timer_service_ == 0)
     {
       TimerService& timer_service = use_service<TimerService>(
- boost::base_from_member<boost::asio::io_service>::member);
+ detail::socket_streambuf_base::io_service_);
       timer_service.construct(timer_implementation_);
       timer_service_ = &timer_service;
     }
@@ -543,6 +574,6 @@
 # undef BOOST_ASIO_PRIVATE_CONNECT_DEF
 #endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_SOCKET_STREAMBUF_HPP

Modified: branches/release/boost/asio/basic_stream_socket.hpp
==============================================================================
--- branches/release/boost/asio/basic_stream_socket.hpp (original)
+++ branches/release/boost/asio/basic_stream_socket.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_stream_socket.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -166,6 +167,48 @@
         BOOST_ASIO_MOVE_CAST(basic_stream_socket)(other));
     return *this;
   }
+
+ /// Move-construct a basic_stream_socket from a socket of another protocol
+ /// type.
+ /**
+ * This constructor moves a stream socket from one object to another.
+ *
+ * @param other The other basic_stream_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename StreamSocketService1>
+ basic_stream_socket(
+ basic_stream_socket<Protocol1, StreamSocketService1>&& other,
+ typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+ : basic_socket<Protocol, StreamSocketService>(
+ BOOST_ASIO_MOVE_CAST2(basic_stream_socket<
+ Protocol1, StreamSocketService1>)(other))
+ {
+ }
+
+ /// Move-assign a basic_stream_socket from a socket of another protocol type.
+ /**
+ * This assignment operator moves a stream socket from one object to another.
+ *
+ * @param other The other basic_stream_socket object from which the move
+ * will occur.
+ *
+ * @note Following the move, the moved-from object is in the same state as if
+ * constructed using the @c basic_stream_socket(io_service&) constructor.
+ */
+ template <typename Protocol1, typename StreamSocketService1>
+ typename enable_if<is_convertible<Protocol1, Protocol>::value,
+ basic_stream_socket>::type& operator=(
+ basic_stream_socket<Protocol1, StreamSocketService1>&& other)
+ {
+ basic_socket<Protocol, StreamSocketService>::operator=(
+ BOOST_ASIO_MOVE_CAST2(basic_stream_socket<
+ Protocol1, StreamSocketService1>)(other));
+ return *this;
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Send some data on the socket.
@@ -303,14 +346,17 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(), buffers, 0,
+ return this->get_service().async_send(
+ this->get_implementation(), buffers, 0,
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -352,7 +398,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -360,7 +408,8 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(), buffers, flags,
+ return this->get_service().async_send(
+ this->get_implementation(), buffers, flags,
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -507,14 +556,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -558,7 +609,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -566,7 +619,7 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
@@ -666,14 +719,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_send(this->get_implementation(),
+ return this->get_service().async_send(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -777,14 +832,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_receive(this->get_implementation(),
+ return this->get_service().async_receive(this->get_implementation(),
         buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/basic_streambuf.hpp
==============================================================================
--- branches/release/boost/asio/basic_streambuf.hpp (original)
+++ branches/release/boost/asio/basic_streambuf.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_streambuf.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,18 +17,18 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <algorithm>
 #include <cstring>
 #include <stdexcept>
 #include <streambuf>
 #include <vector>
-#include <boost/limits.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -327,7 +327,7 @@
       else
       {
         std::length_error ex("boost::asio::streambuf too long");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
     }
 
@@ -365,6 +365,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_STREAMBUF_HPP

Modified: branches/release/boost/asio/basic_streambuf_fwd.hpp
==============================================================================
--- branches/release/boost/asio/basic_streambuf_fwd.hpp (original)
+++ branches/release/boost/asio/basic_streambuf_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_streambuf_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <memory>
 
@@ -30,6 +30,6 @@
 } // namespace asio
 } // namespace boost
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_BASIC_STREAMBUF_FWD_HPP

Modified: branches/release/boost/asio/basic_waitable_timer.hpp
==============================================================================
--- branches/release/boost/asio/basic_waitable_timer.hpp (original)
+++ branches/release/boost/asio/basic_waitable_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_waitable_timer.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -499,13 +499,15 @@
    * boost::asio::io_service::post().
    */
   template <typename WaitHandler>
- void async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WaitHandler.
     BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
 
- this->service.async_wait(this->implementation,
+ return this->service.async_wait(this->implementation,
         BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/buffer.hpp
==============================================================================
--- branches/release/boost/asio/buffer.hpp (original)
+++ branches/release/boost/asio/buffer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffer.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,16 +20,15 @@
 #include <cstring>
 #include <string>
 #include <vector>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/array_fwd.hpp>
 
-#if defined(BOOST_MSVC)
+#if defined(BOOST_ASIO_MSVC)
 # if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
 # if !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
 # define BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 # endif // !defined(BOOST_ASIO_DISABLE_BUFFER_DEBUGGING)
 # endif // defined(_HAS_ITERATOR_DEBUGGING)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
 
 #if defined(__GNUC__)
 # if defined(_GLIBCXX_DEBUG)
@@ -40,14 +39,21 @@
 #endif // defined(__GNUC__)
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
-# include <boost/function.hpp>
+# include <boost/asio/detail/function.hpp>
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
- || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
-# include <boost/type_traits/is_const.hpp>
-#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#if defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+# include <boost/detail/workaround.hpp>
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
+ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+# define BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND
+# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#endif // defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+
+#if defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
+# include <boost/asio/detail/type_traits.hpp>
+#endif // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -102,14 +108,14 @@
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
   mutable_buffer(void* data, std::size_t size,
- boost::function<void()> debug_check)
+ boost::asio::detail::function<void()> debug_check)
     : data_(data),
       size_(size),
       debug_check_(debug_check)
   {
   }
 
- const boost::function<void()>& get_debug_check() const
+ const boost::asio::detail::function<void()>& get_debug_check() const
   {
     return debug_check_;
   }
@@ -125,7 +131,7 @@
   std::size_t size_;
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- boost::function<void()> debug_check_;
+ boost::asio::detail::function<void()> debug_check_;
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 };
 
@@ -232,14 +238,14 @@
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
   const_buffer(const void* data, std::size_t size,
- boost::function<void()> debug_check)
+ boost::asio::detail::function<void()> debug_check)
     : data_(data),
       size_(size),
       debug_check_(debug_check)
   {
   }
 
- const boost::function<void()>& get_debug_check() const
+ const boost::asio::detail::function<void()>& get_debug_check() const
   {
     return debug_check_;
   }
@@ -255,7 +261,7 @@
   std::size_t size_;
 
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- boost::function<void()> debug_check_;
+ boost::asio::detail::function<void()> debug_check_;
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
 };
 
@@ -512,12 +518,12 @@
 
   ~buffer_debug_check()
   {
-#if BOOST_WORKAROUND(BOOST_MSVC, == 1400)
+#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC == 1400)
     // MSVC 8'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)
+#endif // defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC == 1400)
   }
 
   void operator()()
@@ -828,8 +834,7 @@
         ? N * sizeof(PodType) : max_size_in_bytes));
 }
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) \
- || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#if defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 // Borland C++ and Sun Studio think the overloads:
 //
@@ -864,7 +869,7 @@
 
 template <typename PodType>
 struct buffer_types
- : public buffer_types_base<boost::is_const<PodType>::value>
+ : public buffer_types_base<is_const<PodType>::value>
 {
 };
 
@@ -896,8 +901,7 @@
         ? data.size() * sizeof(PodType) : max_size_in_bytes));
 }
 
-#else // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#else // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 /// Create a new modifiable buffer that represents the given POD array.
 /**
@@ -961,8 +965,7 @@
         ? data.size() * sizeof(PodType) : max_size_in_bytes));
 }
 
-#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- // || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+#endif // defined(BOOST_ASIO_ENABLE_ARRAY_BUFFER_WORKAROUND)
 
 /// Create a new non-modifiable buffer that represents the given POD array.
 /**

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_read_stream.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_read_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_resize_guard.hpp>
 #include <boost/asio/detail/buffered_stream_storage.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -50,7 +50,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -59,7 +59,7 @@
   /// The default buffer size.
   static const std::size_t default_buffer_size = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
+ BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
 #endif
 
   /// Construct, passing the specified argument to initialise the next layer.

Modified: branches/release/boost/asio/buffered_read_stream_fwd.hpp
==============================================================================
--- branches/release/boost/asio/buffered_read_stream_fwd.hpp (original)
+++ branches/release/boost/asio/buffered_read_stream_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_read_stream_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/buffered_stream.hpp
==============================================================================
--- branches/release/boost/asio/buffered_stream.hpp (original)
+++ branches/release/boost/asio/buffered_stream.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_stream.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -47,7 +47,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;

Modified: branches/release/boost/asio/buffered_stream_fwd.hpp
==============================================================================
--- branches/release/boost/asio/buffered_stream_fwd.hpp (original)
+++ branches/release/boost/asio/buffered_stream_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_stream_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_write_stream.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_write_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/completion_condition.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffered_stream_storage.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/write.hpp>
@@ -51,7 +51,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -60,7 +60,7 @@
   /// The default buffer size.
   static const std::size_t default_buffer_size = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
+ BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024);
 #endif
 
   /// Construct, passing the specified argument to initialise the next layer.

Modified: branches/release/boost/asio/buffered_write_stream_fwd.hpp
==============================================================================
--- branches/release/boost/asio/buffered_write_stream_fwd.hpp (original)
+++ branches/release/boost/asio/buffered_write_stream_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_write_stream_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/buffers_iterator.hpp
==============================================================================
--- branches/release/boost/asio/buffers_iterator.hpp (original)
+++ branches/release/boost/asio/buffers_iterator.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffers_iterator.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,11 +18,9 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <iterator>
-#include <boost/assert.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/add_const.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/assert.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -41,7 +39,7 @@
     template <typename ByteType>
     struct byte_type
     {
- typedef typename boost::add_const<ByteType>::type type;
+ typedef typename add_const<ByteType>::type type;
     };
   };
 
@@ -61,8 +59,9 @@
   {
     enum
     {
- is_mutable = boost::is_convertible<
- typename BufferSequence::value_type, mutable_buffer>::value
+ is_mutable = is_convertible<
+ typename BufferSequence::value_type,
+ mutable_buffer>::value
     };
     typedef buffers_iterator_types_helper<is_mutable> helper;
     typedef typename helper::buffer_type buffer_type;
@@ -127,9 +126,9 @@
 
   /// Construct an iterator representing the beginning of the buffers' data.
   static buffers_iterator begin(const BufferSequence& buffers)
-#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
     __attribute__ ((__noinline__))
-#endif
+#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
   {
     buffers_iterator new_iter;
     new_iter.begin_ = buffers.begin();
@@ -147,9 +146,9 @@
 
   /// Construct an iterator representing the end of the buffers' data.
   static buffers_iterator end(const BufferSequence& buffers)
-#if BOOST_WORKAROUND(__GNUC__, == 4) && BOOST_WORKAROUND(__GNUC_MINOR__, == 3)
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
     __attribute__ ((__noinline__))
-#endif
+#endif // defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
   {
     buffers_iterator new_iter;
     new_iter.begin_ = buffers.begin();
@@ -314,7 +313,7 @@
   // Increment the iterator.
   void increment()
   {
- BOOST_ASSERT(current_ != end_ && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(current_ != end_ && "iterator out of bounds");
     ++position_;
 
     // Check if the increment can be satisfied by the current buffer.
@@ -337,7 +336,7 @@
   // Decrement the iterator.
   void decrement()
   {
- BOOST_ASSERT(position_ > 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(position_ > 0 && "iterator out of bounds");
     --position_;
 
     // Check if the decrement can be satisfied by the current buffer.
@@ -369,7 +368,7 @@
   {
     if (n > 0)
     {
- BOOST_ASSERT(current_ != end_ && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(current_ != end_ && "iterator out of bounds");
       for (;;)
       {
         std::ptrdiff_t current_buffer_balance
@@ -392,7 +391,7 @@
         // next iteration of this loop.
         if (++current_ == end_)
         {
- BOOST_ASSERT(n == 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(n == 0 && "iterator out of bounds");
           current_buffer_ = buffer_type();
           current_buffer_position_ = 0;
           return;
@@ -404,7 +403,7 @@
     else if (n < 0)
     {
       std::size_t abs_n = -n;
- BOOST_ASSERT(position_ >= abs_n && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(position_ >= abs_n && "iterator out of bounds");
       for (;;)
       {
         // Check if the advance can be satisfied by the current buffer.
@@ -422,7 +421,7 @@
         // Check if we've reached the beginning of the buffers.
         if (current_ == begin_)
         {
- BOOST_ASSERT(abs_n == 0 && "iterator out of bounds");
+ BOOST_ASIO_ASSERT(abs_n == 0 && "iterator out of bounds");
           current_buffer_position_ = 0;
           return;
         }

Modified: branches/release/boost/asio/completion_condition.hpp
==============================================================================
--- branches/release/boost/asio/completion_condition.hpp (original)
+++ branches/release/boost/asio/completion_condition.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // completion_condition.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/connect.hpp
==============================================================================
--- branches/release/boost/asio/connect.hpp (original)
+++ branches/release/boost/asio/connect.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connect.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_socket.hpp>
 #include <boost/asio/error.hpp>
 
@@ -516,7 +517,9 @@
  */
 template <typename Protocol, typename SocketService,
     typename Iterator, typename ComposedConnectHandler>
-void async_connect(basic_socket<Protocol, SocketService>& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler);
 
 /// Asynchronously establishes a socket connection by trying each endpoint in a
@@ -585,7 +588,9 @@
  */
 template <typename Protocol, typename SocketService,
     typename Iterator, typename ComposedConnectHandler>
-void async_connect(basic_socket<Protocol, SocketService>& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, Iterator end,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler);
 
@@ -693,7 +698,9 @@
  */
 template <typename Protocol, typename SocketService, typename Iterator,
     typename ConnectCondition, typename ComposedConnectHandler>
-void async_connect(basic_socket<Protocol, SocketService>& s, Iterator begin,
+BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s, Iterator begin,
     ConnectCondition connect_condition,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler);
 
@@ -800,7 +807,9 @@
  */
 template <typename Protocol, typename SocketService, typename Iterator,
     typename ConnectCondition, typename ComposedConnectHandler>
-void async_connect(basic_socket<Protocol, SocketService>& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, Iterator end, ConnectCondition connect_condition,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler);
 

Added: branches/release/boost/asio/coroutine.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/coroutine.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,330 @@
+//
+// coroutine.hpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_COROUTINE_HPP
+#define BOOST_ASIO_COROUTINE_HPP
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+class coroutine_ref;
+
+} // namespace detail
+
+/// Provides support for implementing stackless coroutines.
+/**
+ * The @c coroutine class may be used to implement stackless coroutines. The
+ * class itself is used to store the current state of the coroutine.
+ *
+ * Coroutines are copy-constructible and assignable, and the space overhead is
+ * a single int. They can be used as a base class:
+ *
+ * @code class session : coroutine
+ * {
+ * ...
+ * }; @endcode
+ *
+ * or as a data member:
+ *
+ * @code class session
+ * {
+ * ...
+ * coroutine coro_;
+ * }; @endcode
+ *
+ * or even bound in as a function argument using lambdas or @c bind(). The
+ * important thing is that as the application maintains a copy of the object
+ * for as long as the coroutine must be kept alive.
+ *
+ * @par Pseudo-keywords
+ *
+ * A coroutine is used in conjunction with certain "pseudo-keywords", which
+ * are implemented as macros. These macros are defined by a header file:
+ *
+ * @code #include <boost/asio/yield.hpp>@endcode
+ *
+ * and may conversely be undefined as follows:
+ *
+ * @code #include <boost/asio/unyield.hpp>@endcode
+ *
+ * <b>reenter</b>
+ *
+ * The @c reenter macro is used to define the body of a coroutine. It takes a
+ * single argument: a pointer or reference to a coroutine object. For example,
+ * if the base class is a coroutine object you may write:
+ *
+ * @code reenter (this)
+ * {
+ * ... coroutine body ...
+ * } @endcode
+ *
+ * and if a data member or other variable you can write:
+ *
+ * @code reenter (coro_)
+ * {
+ * ... coroutine body ...
+ * } @endcode
+ *
+ * When @c reenter is executed at runtime, control jumps to the location of the
+ * last @c yield or @c fork.
+ *
+ * The coroutine body may also be a single statement, such as:
+ *
+ * @code reenter (this) for (;;)
+ * {
+ * ...
+ * } @endcode
+ *
+ * @b Limitation: The @c reenter macro is implemented using a switch. This
+ * means that you must take care when using local variables within the
+ * coroutine body. The local variable is not allowed in a position where
+ * reentering the coroutine could bypass the variable definition.
+ *
+ * <b>yield <em>statement</em></b>
+ *
+ * This form of the @c yield keyword is often used with asynchronous operations:
+ *
+ * @code yield socket_->async_read_some(buffer(*buffer_), *this); @endcode
+ *
+ * This divides into four logical steps:
+ *
+ * @li @c yield saves the current state of the coroutine.
+ * @li The statement initiates the asynchronous operation.
+ * @li The resume point is defined immediately following the statement.
+ * @li Control is transferred to the end of the coroutine body.
+ *
+ * When the asynchronous operation completes, the function object is invoked
+ * and @c reenter causes control to transfer to the resume point. It is
+ * important to remember to carry the coroutine state forward with the
+ * asynchronous operation. In the above snippet, the current class is a
+ * function object object with a coroutine object as base class or data member.
+ *
+ * The statement may also be a compound statement, and this permits us to
+ * define local variables with limited scope:
+ *
+ * @code yield
+ * {
+ * mutable_buffers_1 b = buffer(*buffer_);
+ * socket_->async_read_some(b, *this);
+ * } @endcode
+ *
+ * <b>yield return <em>expression</em> ;</b>
+ *
+ * This form of @c yield is often used in generators or coroutine-based parsers.
+ * For example, the function object:
+ *
+ * @code struct interleave : coroutine
+ * {
+ * istream& is1;
+ * istream& is2;
+ * char operator()(char c)
+ * {
+ * reenter (this) for (;;)
+ * {
+ * yield return is1.get();
+ * yield return is2.get();
+ * }
+ * }
+ * }; @endcode
+ *
+ * defines a trivial coroutine that interleaves the characters from two input
+ * streams.
+ *
+ * This type of @c yield divides into three logical steps:
+ *
+ * @li @c yield saves the current state of the coroutine.
+ * @li The resume point is defined immediately following the semicolon.
+ * @li The value of the expression is returned from the function.
+ *
+ * <b>yield ;</b>
+ *
+ * This form of @c yield is equivalent to the following steps:
+ *
+ * @li @c yield saves the current state of the coroutine.
+ * @li The resume point is defined immediately following the semicolon.
+ * @li Control is transferred to the end of the coroutine body.
+ *
+ * This form might be applied when coroutines are used for cooperative
+ * threading and scheduling is explicitly managed. For example:
+ *
+ * @code struct task : coroutine
+ * {
+ * ...
+ * void operator()()
+ * {
+ * reenter (this)
+ * {
+ * while (... not finished ...)
+ * {
+ * ... do something ...
+ * yield;
+ * ... do some more ...
+ * yield;
+ * }
+ * }
+ * }
+ * ...
+ * };
+ * ...
+ * task t1, t2;
+ * for (;;)
+ * {
+ * t1();
+ * t2();
+ * } @endcode
+ *
+ * <b>yield break ;</b>
+ *
+ * The final form of @c yield is used to explicitly terminate the coroutine.
+ * This form is comprised of two steps:
+ *
+ * @li @c yield sets the coroutine state to indicate termination.
+ * @li Control is transferred to the end of the coroutine body.
+ *
+ * Once terminated, calls to is_complete() return true and the coroutine cannot
+ * be reentered.
+ *
+ * Note that a coroutine may also be implicitly terminated if the coroutine
+ * body is exited without a yield, e.g. by return, throw or by running to the
+ * end of the body.
+ *
+ * <b>fork <em>statement</em></b>
+ *
+ * The @c fork pseudo-keyword is used when "forking" a coroutine, i.e. splitting
+ * it into two (or more) copies. One use of @c fork is in a server, where a new
+ * coroutine is created to handle each client connection:
+ *
+ * @code reenter (this)
+ * {
+ * do
+ * {
+ * socket_.reset(new tcp::socket(io_service_));
+ * yield acceptor->async_accept(*socket_, *this);
+ * fork server(*this)();
+ * } while (is_parent());
+ * ... client-specific handling follows ...
+ * } @endcode
+ *
+ * The logical steps involved in a @c fork are:
+ *
+ * @li @c fork saves the current state of the coroutine.
+ * @li The statement creates a copy of the coroutine and either executes it
+ * immediately or schedules it for later execution.
+ * @li The resume point is defined immediately following the semicolon.
+ * @li For the "parent", control immediately continues from the next line.
+ *
+ * The functions is_parent() and is_child() can be used to differentiate
+ * between parent and child. You would use these functions to alter subsequent
+ * control flow.
+ *
+ * Note that @c fork doesn't do the actual forking by itself. It is the
+ * application's responsibility to create a clone of the coroutine and call it.
+ * The clone can be called immediately, as above, or scheduled for delayed
+ * execution using something like io_service::post().
+ *
+ * @par Alternate macro names
+ *
+ * If preferred, an application can use macro names that follow a more typical
+ * naming convention, rather than the pseudo-keywords. These are:
+ *
+ * @li @c BOOST_ASIO_CORO_REENTER instead of @c reenter
+ * @li @c BOOST_ASIO_CORO_YIELD instead of @c yield
+ * @li @c BOOST_ASIO_CORO_FORK instead of @c fork
+ */
+class coroutine
+{
+public:
+ /// Constructs a coroutine in its initial state.
+ coroutine() : value_(0) {}
+
+ /// Returns true if the coroutine is the child of a fork.
+ bool is_child() const { return value_ < 0; }
+
+ /// Returns true if the coroutine is the parent of a fork.
+ bool is_parent() const { return !is_child(); }
+
+ /// Returns true if the coroutine has reached its terminal state.
+ bool is_complete() const { return value_ == -1; }
+
+private:
+ friend class detail::coroutine_ref;
+ int value_;
+};
+
+
+namespace detail {
+
+class coroutine_ref
+{
+public:
+ coroutine_ref(coroutine& c) : value_(c.value_), modified_(false) {}
+ coroutine_ref(coroutine* c) : value_(c->value_), modified_(false) {}
+ ~coroutine_ref() { if (!modified_) value_ = -1; }
+ operator int() const { return value_; }
+ int& operator=(int v) { modified_ = true; return value_ = v; }
+private:
+ void operator=(const coroutine_ref&);
+ int& value_;
+ bool modified_;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#define BOOST_ASIO_CORO_REENTER(c) \
+ switch (::boost::asio::detail::coroutine_ref _coro_value = c) \
+ case -1: if (_coro_value) \
+ { \
+ goto terminate_coroutine; \
+ terminate_coroutine: \
+ _coro_value = -1; \
+ goto bail_out_of_coroutine; \
+ bail_out_of_coroutine: \
+ break; \
+ } \
+ else case 0:
+
+#define BOOST_ASIO_CORO_YIELD_IMPL(n) \
+ for (_coro_value = (n);;) \
+ if (_coro_value == 0) \
+ { \
+ case (n): ; \
+ break; \
+ } \
+ else \
+ switch (_coro_value ? 0 : 1) \
+ for (;;) \
+ case -1: if (_coro_value) \
+ goto terminate_coroutine; \
+ else for (;;) \
+ case 1: if (_coro_value) \
+ goto bail_out_of_coroutine; \
+ else case 0:
+
+#define BOOST_ASIO_CORO_FORK_IMPL(n) \
+ for (_coro_value = -(n);; _coro_value = (n)) \
+ if (_coro_value == (n)) \
+ { \
+ case -(n): ; \
+ break; \
+ } \
+ else
+
+#if defined(_MSC_VER)
+# define BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD_IMPL(__COUNTER__ + 1)
+# define BOOST_ASIO_CORO_FORK BOOST_ASIO_CORO_FORK_IMPL(__COUNTER__ + 1)
+#else // defined(_MSC_VER)
+# define BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD_IMPL(__LINE__)
+# define BOOST_ASIO_CORO_FORK BOOST_ASIO_CORO_FORK_IMPL(__LINE__)
+#endif // defined(_MSC_VER)
+
+#endif // BOOST_ASIO_COROUTINE_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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // datagram_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -111,6 +113,19 @@
   {
     service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
   }
+
+ /// Move-construct a new datagram socket implementation from another protocol
+ /// type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename datagram_socket_service<
+ Protocol1>::implementation_type& other_impl,
+ typename enable_if<is_convertible<
+ Protocol1, Protocol>::value>::type* = 0)
+ {
+ service_impl_.template converting_move_construct<Protocol1>(
+ impl, other_impl);
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Destroy a datagram socket implementation.
@@ -200,12 +215,19 @@
 
   /// Start an asynchronous connect.
   template <typename ConnectHandler>
- void async_connect(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
+ void (boost::system::error_code))
+ async_connect(implementation_type& impl,
       const endpoint_type& peer_endpoint,
       BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
   {
- service_impl_.async_connect(impl, peer_endpoint,
+ detail::async_result_init<
+ ConnectHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+
+ service_impl_.async_connect(impl, peer_endpoint, init.handler);
+
+ return init.result.get();
   }
 
   /// Set a socket option.
@@ -290,12 +312,19 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(implementation_type& impl, const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(implementation_type& impl, const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send(impl, buffers, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Send a datagram to the specified endpoint.
@@ -309,13 +338,21 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(implementation_type& impl,
       const ConstBufferSequence& buffers, const endpoint_type& destination,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send_to(impl, buffers, destination, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send_to(impl, buffers,
+ destination, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive some data from the peer.
@@ -329,13 +366,20 @@
 
   /// Start an asynchronous receive.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(implementation_type& impl,
       const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive(impl, buffers, flags,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive a datagram with the endpoint of the sender.
@@ -350,13 +394,21 @@
 
   /// Start an asynchronous receive that will get the endpoint of the sender.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(implementation_type& impl,
       const MutableBufferSequence& buffers, endpoint_type& sender_endpoint,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive_from(impl, buffers, sender_endpoint, flags,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive_from(impl, buffers,
+ sender_endpoint, flags, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/deadline_timer.hpp
==============================================================================
--- branches/release/boost/asio/deadline_timer.hpp (original)
+++ branches/release/boost/asio/deadline_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // deadline_timer.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <boost/asio/detail/socket_types.hpp> // Must come before posix_time.
 #include <boost/asio/basic_deadline_timer.hpp>
 
@@ -32,4 +36,7 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_DEADLINE_TIMER_HPP

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // deadline_timer_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,12 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/deadline_timer_service.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/time_traits.hpp>
@@ -132,10 +137,18 @@
 
   // Start an asynchronous wait on the timer.
   template <typename WaitHandler>
- void async_wait(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(implementation_type& impl,
       BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
- service_impl_.async_wait(impl, BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+ detail::async_result_init<
+ WaitHandler, void (boost::system::error_code)> init(
+ BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+
+ service_impl_.async_wait(impl, init.handler);
+
+ return init.result.get();
   }
 
 private:
@@ -154,4 +167,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_DEADLINE_TIMER_SERVICE_HPP

Added: branches/release/boost/asio/detail/addressof.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/addressof.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,40 @@
+//
+// detail/addressof.hpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_ADDRESSOF_HPP
+#define BOOST_ASIO_DETAIL_ADDRESSOF_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# include <memory>
+#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# include <boost/utility/addressof.hpp>
+#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using std::addressof;
+#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+using boost::addressof;
+#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_ADDRESSOF_HPP

Modified: branches/release/boost/asio/detail/array.hpp
==============================================================================
--- branches/release/boost/asio/detail/array.hpp (original)
+++ branches/release/boost/asio/detail/array.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/array.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/array_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/array_fwd.hpp (original)
+++ branches/release/boost/asio/detail/array_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/array_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/boost/asio/detail/assert.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/assert.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,32 @@
+//
+// detail/assert.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_ASSERT_HPP
+#define BOOST_ASIO_DETAIL_ASSERT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# include <boost/assert.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# include <cassert>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# define BOOST_ASIO_ASSERT(expr) BOOST_ASSERT(expr)
+#else // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# define BOOST_ASIO_ASSERT(expr) assert(expr)
+#endif // defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+#endif // BOOST_ASIO_DETAIL_ASSERT_HPP

Modified: branches/release/boost/asio/detail/atomic_count.hpp
==============================================================================
--- branches/release/boost/asio/detail/atomic_count.hpp (original)
+++ branches/release/boost/asio/detail/atomic_count.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/atomic_count.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 // Nothing to include.
 #elif defined(BOOST_ASIO_HAS_STD_ATOMIC)
 # include <atomic>
@@ -29,7 +29,7 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef long atomic_count;
 inline void increment(atomic_count& a, long b) { a += b; }
 #elif defined(BOOST_ASIO_HAS_STD_ATOMIC)

Modified: branches/release/boost/asio/detail/base_from_completion_cond.hpp
==============================================================================
--- branches/release/boost/asio/detail/base_from_completion_cond.hpp (original)
+++ branches/release/boost/asio/detail/base_from_completion_cond.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/base_from_completion_cond.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/bind_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -72,6 +73,14 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Handler, typename Arg1>
+inline bool asio_handler_is_continuation(
+ binder1<Handler, Arg1>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Arg1>
 inline void asio_handler_invoke(Function& function,
     binder1<Handler, Arg1>* this_handler)
@@ -146,6 +155,14 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Handler, typename Arg1, typename Arg2>
+inline bool asio_handler_is_continuation(
+ binder2<Handler, Arg1, Arg2>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Arg1, typename Arg2>
 inline void asio_handler_invoke(Function& function,
     binder2<Handler, Arg1, Arg2>* this_handler)
@@ -226,6 +243,14 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
+inline bool asio_handler_is_continuation(
+ binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Arg1, typename Arg2,
     typename Arg3>
 inline void asio_handler_invoke(Function& function,
@@ -315,6 +340,15 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
+ typename Arg4>
+inline bool asio_handler_is_continuation(
+ binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Arg1, typename Arg2,
     typename Arg3, typename Arg4>
 inline void asio_handler_invoke(Function& function,
@@ -411,6 +445,15 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
+ typename Arg4, typename Arg5>
+inline bool asio_handler_is_continuation(
+ binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Arg1, typename Arg2,
     typename Arg3, typename Arg4, typename Arg5>
 inline void asio_handler_invoke(Function& function,

Modified: branches/release/boost/asio/detail/buffer_resize_guard.hpp
==============================================================================
--- branches/release/boost/asio/detail/buffer_resize_guard.hpp (original)
+++ branches/release/boost/asio/detail/buffer_resize_guard.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/buffer_resize_guard.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/limits.hpp>
+#include <boost/asio/detail/limits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -39,8 +39,7 @@
   // Destructor rolls back the buffer resize unless commit was called.
   ~buffer_resize_guard()
   {
- if (old_size_
- != std::numeric_limits<size_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION())
+ if (old_size_ != (std::numeric_limits<size_t>::max)())
     {
       buffer_.resize(old_size_);
     }
@@ -49,8 +48,7 @@
   // Commit the resize transaction.
   void commit()
   {
- old_size_
- = std::numeric_limits<size_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION();
+ old_size_ = (std::numeric_limits<size_t>::max)();
   }
 
 private:

Modified: branches/release/boost/asio/detail/buffer_sequence_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/buffer_sequence_adapter.hpp (original)
+++ branches/release/boost/asio/detail/buffer_sequence_adapter.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/buffer_sequence_adapter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -29,7 +29,7 @@
 class buffer_sequence_adapter_base
 {
 protected:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   typedef WSABUF native_buffer_type;
 
   static void init_native_buffer(WSABUF& buf,
@@ -45,7 +45,7 @@
     buf.buf = const_cast<char*>(boost::asio::buffer_cast<const char*>(buffer));
     buf.len = static_cast<ULONG>(boost::asio::buffer_size(buffer));
   }
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   typedef iovec native_buffer_type;
 
   static void init_iov_base(void*& base, void* addr)
@@ -73,7 +73,7 @@
           boost::asio::buffer_cast<const void*>(buffer)));
     iov.iov_len = boost::asio::buffer_size(buffer);
   }
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 };
 
 // Helper class to translate buffers into the native buffer representation.

Modified: branches/release/boost/asio/detail/buffered_stream_storage.hpp
==============================================================================
--- branches/release/boost/asio/detail/buffered_stream_storage.hpp (original)
+++ branches/release/boost/asio/detail/buffered_stream_storage.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/buffered_stream_storage.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/buffer.hpp>
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <cstddef>
 #include <cstring>
 #include <vector>
@@ -79,7 +79,7 @@
   // Resize the buffer to the specified length.
   void resize(size_type length)
   {
- BOOST_ASSERT(length <= capacity());
+ BOOST_ASIO_ASSERT(length <= capacity());
     if (begin_offset_ + length <= capacity())
     {
       end_offset_ = begin_offset_ + length;
@@ -102,7 +102,7 @@
   // Consume multiple bytes from the beginning of the buffer.
   void consume(size_type count)
   {
- BOOST_ASSERT(begin_offset_ + count <= end_offset_);
+ BOOST_ASIO_ASSERT(begin_offset_ + count <= end_offset_);
     begin_offset_ += count;
     if (empty())
       clear();

Modified: branches/release/boost/asio/detail/call_stack.hpp
==============================================================================
--- branches/release/boost/asio/detail/call_stack.hpp (original)
+++ branches/release/boost/asio/detail/call_stack.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/call_stack.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/chrono_time_traits.hpp
==============================================================================
--- branches/release/boost/asio/detail/chrono_time_traits.hpp (original)
+++ branches/release/boost/asio/detail/chrono_time_traits.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/chrono_time_traits.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#include <boost/cstdint.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -48,13 +48,63 @@
   // Add a duration to a time.
   static time_type add(const time_type& t, const duration_type& d)
   {
+ const time_type epoch;
+ if (t >= epoch)
+ {
+ if ((time_type::max)() - t < d)
+ return (time_type::max)();
+ }
+ else // t < epoch
+ {
+ if (-(t - (time_type::min)()) > d)
+ return (time_type::min)();
+ }
+
     return t + d;
   }
 
   // Subtract one time from another.
   static duration_type subtract(const time_type& t1, const time_type& t2)
   {
- return t1 - t2;
+ const time_type epoch;
+ if (t1 >= epoch)
+ {
+ if (t2 >= epoch)
+ {
+ return t1 - t2;
+ }
+ else if (t2 == (time_type::min)())
+ {
+ return (duration_type::max)();
+ }
+ else if ((time_type::max)() - t1 < epoch - t2)
+ {
+ return (duration_type::max)();
+ }
+ else
+ {
+ return t1 - t2;
+ }
+ }
+ else // t1 < epoch
+ {
+ if (t2 < epoch)
+ {
+ return t1 - t2;
+ }
+ else if (t1 == (time_type::min)())
+ {
+ return (duration_type::min)();
+ }
+ else if ((time_type::max)() - t2 < epoch - t1)
+ {
+ return (duration_type::min)();
+ }
+ else
+ {
+ return -(t2 - t1);
+ }
+ }
   }
 
   // Test whether one time is less than another.
@@ -73,32 +123,32 @@
     {
     }
 
- boost::int64_t ticks() const
+ int64_t ticks() const
     {
       return d_.count();
     }
 
- boost::int64_t total_seconds() const
+ int64_t total_seconds() const
     {
       return duration_cast<1, 1>();
     }
 
- boost::int64_t total_milliseconds() const
+ int64_t total_milliseconds() const
     {
       return duration_cast<1, 1000>();
     }
 
- boost::int64_t total_microseconds() const
+ int64_t total_microseconds() const
     {
       return duration_cast<1, 1000000>();
     }
 
   private:
- template <boost::int64_t Num, boost::int64_t Den>
- boost::int64_t duration_cast() const
+ template <int64_t Num, int64_t Den>
+ int64_t duration_cast() const
     {
- const boost::int64_t num = period_type::num * Den;
- const boost::int64_t den = period_type::den * Num;
+ const int64_t num = period_type::num * Den;
+ const int64_t den = period_type::den * Num;
 
       if (num == 1 && den == 1)
         return ticks();

Modified: branches/release/boost/asio/detail/completion_handler.hpp
==============================================================================
--- branches/release/boost/asio/detail/completion_handler.hpp (original)
+++ branches/release/boost/asio/detail/completion_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/completion_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -45,7 +46,7 @@
   {
     // Take ownership of the handler object.
     completion_handler* h(static_cast<completion_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -56,7 +57,7 @@
     // to ensure that any owning sub-object remains valid until after we have
     // deallocated the memory here.
     Handler handler(BOOST_ASIO_MOVE_CAST(Handler)(h->handler_));
- p.h = boost::addressof(handler);
+ p.h = boost::asio::detail::addressof(handler);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/config.hpp
==============================================================================
--- branches/release/boost/asio/detail/config.hpp (original)
+++ branches/release/boost/asio/detail/config.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/config.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -11,8 +11,22 @@
 #ifndef BOOST_ASIO_DETAIL_CONFIG_HPP
 #define BOOST_ASIO_DETAIL_CONFIG_HPP
 
-#include <boost/config.hpp>
-#include <boost/version.hpp>
+#if defined(BOOST_ASIO_STANDALONE)
+# define BOOST_ASIO_DISABLE_BOOST_ARRAY 1
+# define BOOST_ASIO_DISABLE_BOOST_ASSERT 1
+# define BOOST_ASIO_DISABLE_BOOST_BIND 1
+# define BOOST_ASIO_DISABLE_BOOST_CHRONO 1
+# define BOOST_ASIO_DISABLE_BOOST_DATE_TIME 1
+# define BOOST_ASIO_DISABLE_BOOST_LIMITS 1
+# define BOOST_ASIO_DISABLE_BOOST_REGEX 1
+# define BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT 1
+# define BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION 1
+# define BOOST_ASIO_DISABLE_BOOST_WORKAROUND 1
+#else // defined(BOOST_ASIO_STANDALONE)
+# include <boost/config.hpp>
+# include <boost/version.hpp>
+# define BOOST_ASIO_HAS_BOOST_CONFIG 1
+#endif // defined(BOOST_ASIO_STANDALONE)
 
 // Default to a header-only implementation. The user must specifically request
 // separate compilation by defining either BOOST_ASIO_SEPARATE_COMPILATION or
@@ -20,7 +34,7 @@
 #if !defined(BOOST_ASIO_HEADER_ONLY)
 # if !defined(BOOST_ASIO_SEPARATE_COMPILATION)
 # if !defined(BOOST_ASIO_DYN_LINK)
-# define BOOST_ASIO_HEADER_ONLY
+# define BOOST_ASIO_HEADER_ONLY 1
 # endif // !defined(BOOST_ASIO_DYN_LINK)
 # endif // !defined(BOOST_ASIO_SEPARATE_COMPILATION)
 #endif // !defined(BOOST_ASIO_HEADER_ONLY)
@@ -28,7 +42,7 @@
 #if defined(BOOST_ASIO_HEADER_ONLY)
 # define BOOST_ASIO_DECL inline
 #else // defined(BOOST_ASIO_HEADER_ONLY)
-# if defined(BOOST_HAS_DECLSPEC)
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
 // We need to import/export our code only if the user has specifically asked
 // for it by defining BOOST_ASIO_DYN_LINK.
 # if defined(BOOST_ASIO_DYN_LINK)
@@ -39,7 +53,7 @@
 # define BOOST_ASIO_DECL __declspec(dllimport)
 # endif // defined(BOOST_ASIO_SOURCE)
 # endif // defined(BOOST_ASIO_DYN_LINK)
-# endif // defined(BOOST_HAS_DECLSPEC)
+# endif // defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
 // If BOOST_ASIO_DECL isn't defined yet define it now.
@@ -47,16 +61,44 @@
 # define BOOST_ASIO_DECL
 #endif // !defined(BOOST_ASIO_DECL)
 
+// Microsoft Visual C++ detection.
+#if !defined(BOOST_ASIO_MSVC)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
+# define BOOST_ASIO_MSVC BOOST_MSVC
+# elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
+# define BOOST_ASIO_MSVC _MSC_VER
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
+
+// Clang / libc++ detection.
+#if defined(__clang__)
+# if (__cplusplus >= 201103)
+# if __has_include(<__config>)
+# include <__config>
+# if defined(_LIBCPP_VERSION)
+# define BOOST_ASIO_HAS_CLANG_LIBCXX 1
+# endif // defined(_LIBCPP_VERSION)
+# endif // __has_include(<__config>)
+# endif // (__cplusplus >= 201103)
+#endif // defined(__clang__)
+
 // Support move construction and assignment on compilers known to allow it.
-#if !defined(BOOST_ASIO_DISABLE_MOVE)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_MOVE
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_MOVE)
+#if !defined(BOOST_ASIO_HAS_MOVE)
+# if !defined(BOOST_ASIO_DISABLE_MOVE)
+# if defined(__clang__)
+# if __has_feature(__cxx_rvalue_references__)
+# define BOOST_ASIO_HAS_MOVE 1
+# endif // __has_feature(__cxx_rvalue_references__)
+# endif // defined(__clang__)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_MOVE 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_MOVE)
+#endif // !defined(BOOST_ASIO_HAS_MOVE)
 
 // If BOOST_ASIO_MOVE_CAST isn't defined, and move support is available, define
 // BOOST_ASIO_MOVE_ARG and BOOST_ASIO_MOVE_CAST to take advantage of rvalue
@@ -64,6 +106,7 @@
 #if defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
 # define BOOST_ASIO_MOVE_ARG(type) type&&
 # define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
+# define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<type1, type2&&>
 #endif // defined(BOOST_ASIO_HAS_MOVE) && !defined(BOOST_ASIO_MOVE_CAST)
 
 // If BOOST_ASIO_MOVE_CAST still isn't defined, default to a C++03-compatible
@@ -78,7 +121,7 @@
 # else // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
 # define BOOST_ASIO_MOVE_ARG(type) type
 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
-# elif defined(BOOST_MSVC)
+# elif defined(BOOST_ASIO_MSVC)
 # if (_MSC_VER >= 1400)
 # define BOOST_ASIO_MOVE_ARG(type) const type&
 # else // (_MSC_VER >= 1400)
@@ -88,34 +131,49 @@
 # define BOOST_ASIO_MOVE_ARG(type) type
 # endif
 # define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
-#endif // !defined_BOOST_ASIO_MOVE_CAST
+# define BOOST_ASIO_MOVE_CAST2(type1, type2) static_cast<const type1, type2&>
+#endif // !defined(BOOST_ASIO_MOVE_CAST)
 
 // Support variadic templates on compilers known to allow it.
-#if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+#if !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
+# if !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+# if defined(__clang__)
+# if __has_feature(__cxx_variadic_templates__)
+# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
+# endif // __has_feature(__cxx_variadic_templates__)
+# endif // defined(__clang__)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_VARIADIC_TEMPLATES 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_VARIADIC_TEMPLATES)
+#endif // !defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
 
 // Standard library support for system errors.
-#if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+# if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
 
 // Compliant C++11 compilers put noexcept specifiers on error_category members.
 #if !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
 # if (BOOST_VERSION >= 105300)
 # define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
+# elif defined(__clang__)
+# if __has_feature(__cxx_noexcept__)
+# define BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
+# endif // __has_feature(__cxx_noexcept__)
 # elif defined(__GNUC__)
 # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
@@ -129,73 +187,175 @@
 #endif // !defined(BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT)
 
 // Standard library support for arrays.
-#if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_ARRAY
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
-# if (_MSC_VER >= 1600)
-# define BOOST_ASIO_HAS_STD_ARRAY
-# endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+#if !defined(BOOST_ASIO_HAS_STD_ARRAY)
+# if !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_HAS_STD_ARRAY 1
+# endif // (_MSC_VER >= 1600)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ARRAY)
+#endif // !defined(BOOST_ASIO_HAS_STD_ARRAY)
 
 // Standard library support for shared_ptr and weak_ptr.
-#if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_SHARED_PTR
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
-# if (_MSC_VER >= 1600)
-# define BOOST_ASIO_HAS_STD_SHARED_PTR
-# endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+#if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
+# if !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_ASIO_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_HAS_STD_SHARED_PTR 1
+# endif // (_MSC_VER >= 1600)
+# endif // defined(BOOST_ASIO_MSVC)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_SHARED_PTR)
+#endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
 
 // Standard library support for atomic operations.
-#if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_ATOMIC
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+#if !defined(BOOST_ASIO_HAS_STD_ATOMIC)
+# if !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ATOMIC 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ATOMIC 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ATOMIC)
+#endif // !defined(BOOST_ASIO_HAS_STD_ATOMIC)
 
 // Standard library support for chrono. Some standard libraries (such as the
 // libstdc++ shipped with gcc 4.6) provide monotonic_clock as per early C++0x
 // drafts, rather than the eventually standardised name of steady_clock.
-#if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
-# if defined(__GNUC__)
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define BOOST_ASIO_HAS_STD_CHRONO
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
-# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
-# endif // defined(__GNUC__)
-#endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+#if !defined(BOOST_ASIO_HAS_STD_CHRONO)
+# if !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_CHRONO 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_CHRONO 1
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+# define BOOST_ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK 1
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_CHRONO)
+#endif // !defined(BOOST_ASIO_HAS_STD_CHRONO)
 
 // Boost support for chrono.
-#if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
-# if (BOOST_VERSION >= 104700)
-# define BOOST_ASIO_HAS_BOOST_CHRONO
-# endif // (BOOST_VERSION >= 104700)
-#endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+#if !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+# if (BOOST_VERSION >= 104700)
+# define BOOST_ASIO_HAS_BOOST_CHRONO 1
+# endif // (BOOST_VERSION >= 104700)
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_CHRONO)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+
+// Boost support for the DateTime library.
+#if !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
+# define BOOST_ASIO_HAS_BOOST_DATE_TIME 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_DATE_TIME)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+// Standard library support for addressof.
+#if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+# if !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_ADDRESSOF 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_ADDRESSOF 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_ADDRESSOF)
+#endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
+
+// Standard library support for the function class.
+#if !defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# if !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_FUNCTION 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_FUNCTION 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_FUNCTION)
+#endif // !defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+// Standard library support for type traits.
+#if !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+# if !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_TYPE_TRAITS 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_STD_TYPE_TRAITS)
+#endif // !defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+
+// Standard library support for the cstdint header.
+#if !defined(BOOST_ASIO_HAS_CSTDINT)
+# if !defined(BOOST_ASIO_DISABLE_CSTDINT)
+# if defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# define BOOST_ASIO_HAS_CSTDINT 1
+# endif // defined(BOOST_ASIO_HAS_CLANG_LIBCXX)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_CSTDINT 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# endif // !defined(BOOST_ASIO_DISABLE_CSTDINT)
+#endif // !defined(BOOST_ASIO_HAS_CSTDINT)
+
+// Windows target.
+#if !defined(BOOST_ASIO_WINDOWS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
+# define BOOST_ASIO_WINDOWS 1
+# elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+# define BOOST_ASIO_WINDOWS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 // Windows: target OS version.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)
 # if defined(_MSC_VER) || defined(__BORLANDC__)
 # pragma message( \
@@ -233,55 +393,63 @@
 # error You must add -D__USE_W32_SOCKETS to your compiler options.
 # endif // !defined(__USE_W32_SOCKETS)
 # endif // defined(__CYGWIN__)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: minimise header inclusion.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
 # if !defined(WIN32_LEAN_AND_MEAN)
 # define WIN32_LEAN_AND_MEAN
 # endif // !defined(WIN32_LEAN_AND_MEAN)
 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: suppress definition of "min" and "max" macros.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if !defined(BOOST_ASIO_NO_NOMINMAX)
 # if !defined(NOMINMAX)
 # define NOMINMAX 1
 # endif // !defined(NOMINMAX)
 # endif // !defined(BOOST_ASIO_NO_NOMINMAX)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Windows: IO Completion Ports.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
-# if !defined(UNDER_CE)
-# if !defined(BOOST_ASIO_DISABLE_IOCP)
-# define BOOST_ASIO_HAS_IOCP 1
-# endif // !defined(BOOST_ASIO_DISABLE_IOCP)
-# endif // !defined(UNDER_CE)
-# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_HAS_IOCP)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
+# if !defined(UNDER_CE)
+# if !defined(BOOST_ASIO_DISABLE_IOCP)
+# define BOOST_ASIO_HAS_IOCP 1
+# endif // !defined(BOOST_ASIO_DISABLE_IOCP)
+# endif // !defined(UNDER_CE)
+# endif // defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0400)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_HAS_IOCP)
 
 // Linux: epoll, eventfd and timerfd.
 #if defined(__linux__)
 # include <linux/version.h>
-# if !defined(BOOST_ASIO_DISABLE_EPOLL)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
-# define BOOST_ASIO_HAS_EPOLL 1
-# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
-# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
-# define BOOST_ASIO_HAS_EVENTFD 1
-# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
-# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
-# if defined(BOOST_ASIO_HAS_EPOLL)
-# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
-# define BOOST_ASIO_HAS_TIMERFD 1
-# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
-# endif // defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_DISABLE_EPOLL)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
+# define BOOST_ASIO_HAS_EPOLL 1
+# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,45)
+# endif // !defined(BOOST_ASIO_DISABLE_EPOLL)
+# endif // !defined(BOOST_ASIO_HAS_EPOLL)
+# if !defined(BOOST_ASIO_HAS_EVENTFD)
+# if !defined(BOOST_ASIO_DISABLE_EVENTFD)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+# define BOOST_ASIO_HAS_EVENTFD 1
+# endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+# endif // !defined(BOOST_ASIO_DISABLE_EVENTFD)
+# endif // !defined(BOOST_ASIO_HAS_EVENTFD)
+# if !defined(BOOST_ASIO_HAS_TIMERFD)
+# if defined(BOOST_ASIO_HAS_EPOLL)
+# if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
+# define BOOST_ASIO_HAS_TIMERFD 1
+# endif // (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8)
+# endif // defined(BOOST_ASIO_HAS_EPOLL)
+# endif // !defined(BOOST_ASIO_HAS_TIMERFD)
 #endif // defined(__linux__)
 
 // Mac OS X, FreeBSD, NetBSD, OpenBSD: kqueue.
@@ -289,9 +457,11 @@
   || defined(__FreeBSD__) \
   || defined(__NetBSD__) \
   || defined(__OpenBSD__)
-# if !defined(BOOST_ASIO_DISABLE_KQUEUE)
-# define BOOST_ASIO_HAS_KQUEUE 1
-# endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# if !defined(BOOST_ASIO_HAS_KQUEUE)
+# if !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# define BOOST_ASIO_HAS_KQUEUE 1
+# endif // !defined(BOOST_ASIO_DISABLE_KQUEUE)
+# endif // !defined(BOOST_ASIO_HAS_KQUEUE)
 #endif // (defined(__MACH__) && defined(__APPLE__))
        // || defined(__FreeBSD__)
        // || defined(__NetBSD__)
@@ -299,79 +469,257 @@
 
 // Solaris: /dev/poll.
 #if defined(__sun)
-# if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
-# define BOOST_ASIO_HAS_DEV_POLL 1
-# endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# if !defined(BOOST_ASIO_HAS_DEV_POLL)
+# if !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# define BOOST_ASIO_HAS_DEV_POLL 1
+# endif // !defined(BOOST_ASIO_DISABLE_DEV_POLL)
+# endif // !defined(BOOST_ASIO_HAS_DEV_POLL)
 #endif // defined(__sun)
 
 // Serial ports.
-#if defined(BOOST_ASIO_HAS_IOCP) \
- || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# if !defined(__SYMBIAN32__)
-# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# define BOOST_ASIO_HAS_SERIAL_PORT 1
-# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# endif // !defined(__SYMBIAN32__)
-#endif // defined(BOOST_ASIO_HAS_IOCP)
- // || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_HAS_SERIAL_PORT)
+# if defined(BOOST_ASIO_HAS_IOCP) \
+ || !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# if !defined(__SYMBIAN32__)
+# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# define BOOST_ASIO_HAS_SERIAL_PORT 1
+# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# endif // !defined(__SYMBIAN32__)
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+ // || !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 // Windows: stream handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_STREAM_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_STREAM_HANDLE)
 
 // Windows: random access handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_RANDOM_ACCESS_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
 
 // Windows: object handles.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-# if !defined(UNDER_CE)
-# define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
-# endif // !defined(UNDER_CE)
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# if !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE 1
+# endif // !defined(UNDER_CE)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OBJECT_HANDLE)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
 
 // Windows: OVERLAPPED wrapper.
-#if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
-# if defined(BOOST_ASIO_HAS_IOCP)
-# define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+#if !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
+# if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+# if defined(BOOST_ASIO_HAS_IOCP)
+# define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+# endif // !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
+#endif // !defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
 
 // POSIX: stream-oriented file descriptors.
-#if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+#if !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
+# if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR)
+#endif // !defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR)
 
 // UNIX domain sockets.
-#if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+#if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
+# if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
+#endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
 
 // Can use sigaction() instead of signal().
-#if !defined(BOOST_ASIO_DISABLE_SIGACTION)
-# if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_SIGACTION 1
-# endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-#endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
+#if !defined(BOOST_ASIO_HAS_SIGACTION)
+# if !defined(BOOST_ASIO_DISABLE_SIGACTION)
+# if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_SIGACTION 1
+# endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
+# endif // !defined(BOOST_ASIO_DISABLE_SIGACTION)
+#endif // !defined(BOOST_ASIO_HAS_SIGACTION)
 
 // Can use signal().
-#if !defined(BOOST_ASIO_DISABLE_SIGNAL)
-# if !defined(UNDER_CE)
-# define BOOST_ASIO_HAS_SIGNAL 1
-# endif // !defined(UNDER_CE)
-#endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
+#if !defined(BOOST_ASIO_HAS_SIGNAL)
+# if !defined(BOOST_ASIO_DISABLE_SIGNAL)
+# if !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_SIGNAL 1
+# endif // !defined(UNDER_CE)
+# endif // !defined(BOOST_ASIO_DISABLE_SIGNAL)
+#endif // !defined(BOOST_ASIO_HAS_SIGNAL)
+
+// Whether standard iostreams are disabled.
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_IOSTREAM)
+# define BOOST_ASIO_NO_IOSTREAM 1
+# endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
+
+// Whether exception handling is disabled.
+#if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_EXCEPTIONS)
+# define BOOST_ASIO_NO_EXCEPTIONS 1
+# endif // !defined(BOOST_NO_EXCEPTIONS)
+#endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
+
+// Whether the typeid operator is supported.
+#if !defined(BOOST_ASIO_NO_TYPEID)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_NO_TYPEID)
+# define BOOST_ASIO_NO_TYPEID 1
+# endif // !defined(BOOST_NO_TYPEID)
+#endif // !defined(BOOST_ASIO_NO_TYPEID)
+
+// On POSIX (and POSIX-like) platforms we need to include unistd.h in order to
+// get access to the various platform feature macros, e.g. to be able to test
+// for threads support.
+#if !defined(BOOST_ASIO_HAS_UNISTD_H)
+# if !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+# if defined(unix) \
+ || defined(__unix) \
+ || defined(_XOPEN_SOURCE) \
+ || defined(_POSIX_SOURCE) \
+ || (defined(__MACH__) && defined(__APPLE__)) \
+ || defined(__FreeBSD__) \
+ || defined(__NetBSD__) \
+ || defined(__OpenBSD__) \
+ || defined(__linux__)
+# define BOOST_ASIO_HAS_UNISTD_H 1
+# endif
+# endif // !defined(BOOST_ASIO_HAS_BOOST_CONFIG)
+#endif // !defined(BOOST_ASIO_HAS_UNISTD_H)
+#if defined(BOOST_ASIO_HAS_UNISTD_H)
+# include <unistd.h>
+#endif // defined(BOOST_ASIO_HAS_UNISTD_H)
+
+// Threads.
+#if !defined(BOOST_ASIO_HAS_THREADS)
+# if !defined(BOOST_ASIO_DISABLE_THREADS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(_MSC_VER) && defined(_MT)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(__BORLANDC__) && defined(__MT__)
+# define BOOST_ASIO_HAS_THREADS 1
+# elif defined(_POSIX_THREADS)
+# define BOOST_ASIO_HAS_THREADS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_THREADS)
+# endif // !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
+
+// POSIX threads.
+#if !defined(BOOST_ASIO_HAS_PTHREADS)
+# if defined(BOOST_ASIO_HAS_THREADS)
+# if defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
+# define BOOST_ASIO_HAS_PTHREADS 1
+# elif defined(_POSIX_THREADS)
+# define BOOST_ASIO_HAS_PTHREADS 1
+# endif // defined(BOOST_ASIO_HAS_BOOST_CONFIG) && defined(BOOST_HAS_PTHREADS)
+# endif // defined(BOOST_ASIO_HAS_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_PTHREADS)
+
+// Helper to prevent macro expansion.
+#define BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION
+
+// Helper to define in-class constants.
+#if !defined(BOOST_ASIO_STATIC_CONSTANT)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+# define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
+ BOOST_STATIC_CONSTANT(type, assignment)
+# else // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+# define BOOST_ASIO_STATIC_CONSTANT(type, assignment) \
+ static const type assignment
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_STATIC_CONSTANT)
+#endif // !defined(BOOST_ASIO_STATIC_CONSTANT)
+
+// Boost array library.
+#if !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
+# define BOOST_ASIO_HAS_BOOST_ARRAY 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_ARRAY)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+// Boost assert macro.
+#if !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
+# define BOOST_ASIO_HAS_BOOST_ASSERT 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_ASSERT)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_ASSERT)
+
+// Boost limits header.
+#if !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
+# define BOOST_ASIO_HAS_BOOST_LIMITS 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_LIMITS)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+
+// Boost throw_exception function.
+#if !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
+# define BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_THROW_EXCEPTION)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+// Boost regex library.
+#if !defined(BOOST_ASIO_HAS_BOOST_REGEX)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
+# define BOOST_ASIO_HAS_BOOST_REGEX 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_REGEX)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
+// Boost bind function.
+#if !defined(BOOST_ASIO_HAS_BOOST_BIND)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
+# define BOOST_ASIO_HAS_BOOST_BIND 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_BIND)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+// Boost's BOOST_WORKAROUND macro.
+#if !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+# if !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
+# define BOOST_ASIO_HAS_BOOST_WORKAROUND 1
+# endif // !defined(BOOST_ASIO_DISABLE_BOOST_WORKAROUND)
+#endif // !defined(BOOST_ASIO_HAS_BOOST_WORKAROUND)
+
+// Microsoft Visual C++'s secure C runtime library.
+#if !defined(BOOST_ASIO_HAS_SECURE_RTL)
+# if !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
+# if defined(BOOST_ASIO_MSVC) \
+ && (BOOST_ASIO_MSVC >= 1400) \
+ && !defined(UNDER_CE)
+# define BOOST_ASIO_HAS_SECURE_RTL 1
+# endif // defined(BOOST_ASIO_MSVC)
+ // && (BOOST_ASIO_MSVC >= 1400)
+ // && !defined(UNDER_CE)
+# endif // !defined(BOOST_ASIO_DISABLE_SECURE_RTL)
+#endif // !defined(BOOST_ASIO_HAS_SECURE_RTL)
+
+// Handler hooking. Disabled for ancient Borland C++ and gcc compilers.
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
+# if !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
+# if defined(__GNUC__)
+# if (__GNUC__ >= 3)
+# define BOOST_ASIO_HAS_HANDLER_HOOKS 1
+# endif // (__GNUC__ >= 3)
+# elif !defined(__BORLANDC__)
+# define BOOST_ASIO_HAS_HANDLER_HOOKS 1
+# endif // !defined(__BORLANDC__)
+# endif // !defined(BOOST_ASIO_DISABLE_HANDLER_HOOKS)
+#endif // !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
 
 // Support for the __thread keyword extension.
 #if !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION)

Modified: branches/release/boost/asio/detail/consuming_buffers.hpp
==============================================================================
--- branches/release/boost/asio/detail/consuming_buffers.hpp (original)
+++ branches/release/boost/asio/detail/consuming_buffers.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/consuming_buffers.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/iterator.hpp>
-#include <boost/limits.hpp>
+#include <iterator>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/limits.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -30,9 +30,23 @@
 // A proxy iterator for a sub-range in a list of buffers.
 template <typename Buffer, typename Buffer_Iterator>
 class consuming_buffers_iterator
- : public boost::iterator<std::forward_iterator_tag, const Buffer>
 {
 public:
+ /// The type used for the distance between two iterators.
+ typedef std::ptrdiff_t difference_type;
+
+ /// The type of the value pointed to by the iterator.
+ typedef Buffer value_type;
+
+ /// The type of the result of applying operator->() to the iterator.
+ typedef const Buffer* pointer;
+
+ /// The type of the result of applying operator*() to the iterator.
+ typedef const Buffer& reference;
+
+ /// The iterator category.
+ typedef std::forward_iterator_tag iterator_category;
+
   // Default constructor creates an end iterator.
   consuming_buffers_iterator()
     : at_end_(true)

Added: branches/release/boost/asio/detail/cstdint.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/cstdint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,48 @@
+//
+// detail/cstdint.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_CSTDINT_HPP
+#define BOOST_ASIO_DETAIL_CSTDINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_CSTDINT)
+# include <cstdint>
+#else // defined(BOOST_ASIO_HAS_CSTDINT)
+# include <boost/cstdint.hpp>
+#endif // defined(BOOST_ASIO_HAS_CSTDINT)
+
+namespace boost {
+namespace asio {
+
+#if defined(BOOST_ASIO_HAS_CSTDINT)
+using std::int16_t;
+using std::uint16_t;
+using std::int32_t;
+using std::uint32_t;
+using std::int64_t;
+using std::uint64_t;
+#else // defined(BOOST_ASIO_HAS_CSTDINT)
+using boost::int16_t;
+using boost::uint16_t;
+using boost::int32_t;
+using boost::uint32_t;
+using boost::int64_t;
+using boost::uint64_t;
+#endif // defined(BOOST_ASIO_HAS_CSTDINT)
+
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_CSTDINT_HPP

Modified: branches/release/boost/asio/detail/date_time_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/date_time_fwd.hpp (original)
+++ branches/release/boost/asio/detail/date_time_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/date_time_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/deadline_timer_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/deadline_timer_service.hpp (original)
+++ branches/release/boost/asio/detail/deadline_timer_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/deadline_timer_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,6 +19,7 @@
 #include <cstddef>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -170,11 +171,11 @@
 
   // Start an asynchronous wait on the timer.
   template <typename Handler>
- void async_wait(implementation_type& impl, Handler handler)
+ void async_wait(implementation_type& impl, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef wait_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: branches/release/boost/asio/detail/dependent_type.hpp
==============================================================================
--- branches/release/boost/asio/detail/dependent_type.hpp (original)
+++ branches/release/boost/asio/detail/dependent_type.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/dependent_type.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/descriptor_ops.hpp
==============================================================================
--- branches/release/boost/asio/detail/descriptor_ops.hpp (original)
+++ branches/release/boost/asio/detail/descriptor_ops.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/descriptor_ops.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstddef>
 #include <boost/system/error_code.hpp>
@@ -110,6 +110,6 @@
 # include <boost/asio/detail/impl/descriptor_ops.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_OPS_HPP

Modified: branches/release/boost/asio/detail/descriptor_read_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/descriptor_read_op.hpp (original)
+++ branches/release/boost/asio/detail/descriptor_read_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/descriptor_read_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -81,7 +81,7 @@
   {
     // Take ownership of the handler object.
     descriptor_read_op* o(static_cast<descriptor_read_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.
@@ -116,6 +116,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_READ_OP_HPP

Modified: branches/release/boost/asio/detail/descriptor_write_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/descriptor_write_op.hpp (original)
+++ branches/release/boost/asio/detail/descriptor_write_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/descriptor_write_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -81,7 +81,7 @@
   {
     // Take ownership of the handler object.
     descriptor_write_op* o(static_cast<descriptor_write_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.
@@ -116,6 +116,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_DESCRIPTOR_WRITE_OP_HPP

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/dev_poll_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,12 +19,12 @@
 
 #if defined(BOOST_ASIO_HAS_DEV_POLL)
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <vector>
 #include <sys/devpoll.h>
 #include <boost/asio/detail/dev_poll_reactor_fwd.hpp>
 #include <boost/asio/detail/hash_map.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/reactor_op.hpp>
@@ -87,15 +87,16 @@
       per_descriptor_data& source_descriptor_data);
 
   // Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op)
+ void post_immediate_completion(reactor_op* op, bool is_continuation)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
   }
 
   // Start a new operation. The reactor operation will be performed when the
   // given descriptor is flagged as ready, or an error has occurred.
   BOOST_ASIO_DECL void start_op(int op_type, socket_type descriptor,
- per_descriptor_data&, reactor_op* op, bool allow_speculative);
+ per_descriptor_data&, reactor_op* op,
+ bool is_continuation, bool allow_speculative);
 
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the

Modified: branches/release/boost/asio/detail/dev_poll_reactor_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/dev_poll_reactor_fwd.hpp (original)
+++ branches/release/boost/asio/detail/dev_poll_reactor_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/dev_poll_reactor_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/epoll_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,11 +19,10 @@
 
 #if defined(BOOST_ASIO_HAS_EPOLL)
 
-#include <boost/cstdint.hpp>
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/atomic_count.hpp>
 #include <boost/asio/detail/epoll_reactor_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/object_pool.hpp>
 #include <boost/asio/detail/op_queue.hpp>
@@ -60,7 +59,7 @@
     mutex mutex_;
     epoll_reactor* reactor_;
     int descriptor_;
- boost::uint32_t registered_events_;
+ uint32_t registered_events_;
     op_queue<reactor_op> op_queue_[max_ops];
     bool shutdown_;
 
@@ -108,16 +107,16 @@
       per_descriptor_data& source_descriptor_data);
 
   // Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op)
+ void post_immediate_completion(reactor_op* op, bool is_continuation)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
   }
 
   // Start a new operation. The reactor operation will be performed when the
   // given descriptor is flagged as ready, or an error has occurred.
   BOOST_ASIO_DECL void start_op(int op_type, socket_type descriptor,
       per_descriptor_data& descriptor_data, reactor_op* op,
- bool allow_speculative);
+ bool is_continuation, bool allow_speculative);
 
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the

Modified: branches/release/boost/asio/detail/epoll_reactor_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/epoll_reactor_fwd.hpp (original)
+++ branches/release/boost/asio/detail/epoll_reactor_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/epoll_reactor_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/event.hpp
==============================================================================
--- branches/release/boost/asio/detail/event.hpp (original)
+++ branches/release/boost/asio/detail/event.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/event.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_event.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_event.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_event.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,11 +31,11 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_event event;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_event event;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_event event;
 #endif
 

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/eventfd_select_interrupter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/detail/fd_set_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/fd_set_adapter.hpp (original)
+++ branches/release/boost/asio/detail/fd_set_adapter.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/fd_set_adapter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,7 +23,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef win_fd_set_adapter fd_set_adapter;
 #else
 typedef posix_fd_set_adapter fd_set_adapter;

Modified: branches/release/boost/asio/detail/fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,8 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
   || defined(BOOST_ASIO_DISABLE_FENCED_BLOCK)
 # include <boost/asio/detail/null_fenced_block.hpp>
 #elif defined(__MACH__) && defined(__APPLE__)
@@ -37,7 +36,7 @@
   && !defined(__INTEL_COMPILER) && !defined(__ICL) \
   && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
 # include <boost/asio/detail/gcc_sync_fenced_block.hpp>
-#elif defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#elif defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 # include <boost/asio/detail/win_fenced_block.hpp>
 #else
 # include <boost/asio/detail/null_fenced_block.hpp>
@@ -47,8 +46,7 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
   || defined(BOOST_ASIO_DISABLE_FENCED_BLOCK)
 typedef null_fenced_block fenced_block;
 #elif defined(__MACH__) && defined(__APPLE__)
@@ -67,7 +65,7 @@
   && !defined(__INTEL_COMPILER) && !defined(__ICL) \
   && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__)
 typedef gcc_sync_fenced_block fenced_block;
-#elif defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#elif defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 typedef win_fenced_block fenced_block;
 #else
 typedef null_fenced_block fenced_block;

Added: branches/release/boost/asio/detail/function.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/function.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,40 @@
+//
+// detail/function.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_FUNCTION_HPP
+#define BOOST_ASIO_DETAIL_FUNCTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# include <functional>
+#else // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+# include <boost/function.hpp>
+#endif // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_STD_FUNCTION)
+using std::function;
+#else // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+using boost::function;
+#endif // defined(BOOST_ASIO_HAS_STD_FUNCTION)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_FUNCTION_HPP

Modified: branches/release/boost/asio/detail/gcc_arm_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/gcc_arm_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/gcc_arm_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/gcc_arm_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/gcc_hppa_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/gcc_hppa_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/gcc_hppa_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/gcc_hppa_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/gcc_sync_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/gcc_sync_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/gcc_sync_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/gcc_sync_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/gcc_x86_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/gcc_x86_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/gcc_x86_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/gcc_x86_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/handler_alloc_helpers.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/handler_alloc_hook.hpp>
 
@@ -31,24 +30,22 @@
 template <typename Handler>
 inline void* allocate(std::size_t s, Handler& h)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   return ::operator new(s);
 #else
   using boost::asio::asio_handler_allocate;
- return asio_handler_allocate(s, boost::addressof(h));
+ return asio_handler_allocate(s, boost::asio::detail::addressof(h));
 #endif
 }
 
 template <typename Handler>
 inline void deallocate(void* p, std::size_t s, Handler& h)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   ::operator delete(p);
 #else
   using boost::asio::asio_handler_deallocate;
- asio_handler_deallocate(p, s, boost::addressof(h));
+ asio_handler_deallocate(p, s, boost::asio::detail::addressof(h));
 #endif
 }
 

Added: branches/release/boost/asio/detail/handler_cont_helpers.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/handler_cont_helpers.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,45 @@
+//
+// detail/handler_cont_helpers.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP
+#define BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/addressof.hpp>
+#include <boost/asio/handler_continuation_hook.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+// Calls to asio_handler_is_continuation must be made from a namespace that
+// does not contain overloads of this function. This namespace is defined here
+// for that purpose.
+namespace boost_asio_handler_cont_helpers {
+
+template <typename Context>
+inline bool is_continuation(Context& context)
+{
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
+ return false;
+#else
+ using boost::asio::asio_handler_is_continuation;
+ return asio_handler_is_continuation(
+ boost::asio::detail::addressof(context));
+#endif
+}
+
+} // namespace boost_asio_handler_cont_helpers
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/handler_invoke_helpers.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/handler_invoke_hook.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -30,26 +29,24 @@
 template <typename Function, typename Context>
 inline void invoke(Function& function, Context& context)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   Function tmp(function);
   tmp();
 #else
   using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, boost::addressof(context));
+ asio_handler_invoke(function, boost::asio::detail::addressof(context));
 #endif
 }
 
 template <typename Function, typename Context>
 inline void invoke(const Function& function, Context& context)
 {
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
+#if !defined(BOOST_ASIO_HAS_HANDLER_HOOKS)
   Function tmp(function);
   tmp();
 #else
   using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, boost::addressof(context));
+ asio_handler_invoke(function, boost::asio::detail::addressof(context));
 #endif
 }
 

Modified: branches/release/boost/asio/detail/handler_tracking.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_tracking.hpp (original)
+++ branches/release/boost/asio/detail/handler_tracking.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/handler_tracking.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,8 +18,8 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
-# include <boost/cstdint.hpp>
 # include <boost/system/error_code.hpp>
+# include <boost/asio/detail/cstdint.hpp>
 # include <boost/asio/detail/static_mutex.hpp>
 # include <boost/asio/detail/tss_ptr.hpp>
 #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TRACKING)
@@ -44,7 +44,7 @@
     // Only the handler_tracking class will have access to the id.
     friend class handler_tracking;
     friend class completion;
- boost::uint64_t id_;
+ uint64_t id_;
 
   protected:
     // Constructor initialises with no id.
@@ -94,7 +94,7 @@
 
   private:
     friend class handler_tracking;
- boost::uint64_t id_;
+ uint64_t id_;
     bool invoked_;
     completion* next_;
   };

Modified: branches/release/boost/asio/detail/handler_type_requirements.hpp
==============================================================================
--- branches/release/boost/asio/detail/handler_type_requirements.hpp (original)
+++ branches/release/boost/asio/detail/handler_type_requirements.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/handler_type_requirements.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -37,13 +37,22 @@
 # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
 # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
 # endif // defined(__GNUC__)
-# if defined(BOOST_MSVC)
+# if defined(BOOST_ASIO_MSVC)
 # if (_MSC_VER >= 1600)
 # define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
 # endif // (_MSC_VER >= 1600)
-# endif // defined(BOOST_MSVC)
+# endif // defined(BOOST_ASIO_MSVC)
+# if defined(__clang__)
+# if __has_feature(__cxx_static_assert__)
+# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
+# endif // __has_feature(cxx_static_assert)
+# endif // defined(__clang__)
 #endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
 
+#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
+# include <boost/asio/handler_type.hpp>
+#endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -93,6 +102,7 @@
 
 template <typename T> T& lvref();
 template <typename T> T& lvref(T);
+template <typename T> const T& clvref();
 template <typename T> const T& clvref(T);
 template <typename T> char argbyv(T);
 
@@ -104,25 +114,36 @@
 #define BOOST_ASIO_COMPLETION_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void()) asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::zero_arg_handler_test( \
- handler, 0)) == 1, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), 0)) == 1, \
       "CompletionHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)(), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()(), \
         char(0))>
 
 #define BOOST_ASIO_READ_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, std::size_t)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::two_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0), \
           static_cast<const std::size_t*>(0))) == 1, \
       "ReadHandler type requirements not met") \
@@ -130,19 +151,27 @@
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>(), \
- boost::asio::detail::lvref<const std::size_t>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const std::size_t>()), \
         char(0))>
 
+
 #define BOOST_ASIO_WRITE_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, std::size_t)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::two_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0), \
           static_cast<const std::size_t*>(0))) == 1, \
       "WriteHandler type requirements not met") \
@@ -150,55 +179,76 @@
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>(), \
- boost::asio::detail::lvref<const std::size_t>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const std::size_t>()), \
         char(0))>
 
 #define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::one_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0))) == 1, \
       "AcceptHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
         char(0))>
 
 #define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::one_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0))) == 1, \
       "ConnectHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
         char(0))>
 
 #define BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, iter_type)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::two_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0), \
           static_cast<const iter_type*>(0))) == 1, \
       "ComposedConnectHandler type requirements not met") \
@@ -206,19 +256,26 @@
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>(), \
- boost::asio::detail::lvref<const iter_type>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const iter_type>()), \
         char(0))>
 
 #define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, iter_type)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::two_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0), \
           static_cast<const iter_type*>(0))) == 1, \
       "ResolveHandler type requirements not met") \
@@ -226,37 +283,51 @@
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>(), \
- boost::asio::detail::lvref<const iter_type>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const iter_type>()), \
         char(0))>
 
 #define BOOST_ASIO_WAIT_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::one_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0))) == 1, \
       "WaitHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
         char(0))>
 
 #define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, int)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::two_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0), \
           static_cast<const int*>(0))) == 1, \
       "SignalHandler type requirements not met") \
@@ -264,47 +335,90 @@
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>(), \
- boost::asio::detail::lvref<const int>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const int>()), \
         char(0))>
 
 #define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::one_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0))) == 1, \
       "HandshakeHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
+ char(0))>
+
+#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
+ handler_type, handler) \
+ \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code, std::size_t)) \
+ asio_true_handler_type; \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::two_arg_handler_test( \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
+ static_cast<const boost::system::error_code*>(0), \
+ static_cast<const std::size_t*>(0))) == 1, \
+ "BufferedHandshakeHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ boost::asio::detail::argbyv( \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
+ sizeof( \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>(), \
+ boost::asio::detail::lvref<const std::size_t>()), \
         char(0))>
 
 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
     handler_type, handler) \
   \
+ typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
+ void(boost::system::error_code)) \
+ asio_true_handler_type; \
+ \
   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
       sizeof(boost::asio::detail::one_arg_handler_test( \
- handler, \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>(), \
           static_cast<const boost::system::error_code*>(0))) == 1, \
       "ShutdownHandler type requirements not met") \
   \
   typedef boost::asio::detail::handler_type_requirements< \
       sizeof( \
         boost::asio::detail::argbyv( \
- boost::asio::detail::clvref(handler))) + \
+ boost::asio::detail::clvref< \
+ asio_true_handler_type>())) + \
       sizeof( \
- boost::asio::detail::lvref(handler)( \
- boost::asio::detail::lvref<const boost::system::error_code>()), \
+ boost::asio::detail::lvref< \
+ asio_true_handler_type>()( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
         char(0))>
 
 #else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
@@ -349,6 +463,10 @@
     handler_type, handler) \
   typedef int
 
+#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
     handler_type, handler) \
   typedef int

Modified: branches/release/boost/asio/detail/hash_map.hpp
==============================================================================
--- branches/release/boost/asio/detail/hash_map.hpp (original)
+++ branches/release/boost/asio/detail/hash_map.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/hash_map.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,14 +16,14 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/assert.hpp>
 #include <list>
 #include <utility>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <boost/asio/detail/socket_types.hpp>
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -42,12 +42,12 @@
     + (reinterpret_cast<std::size_t>(p) >> 3);
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 inline std::size_t calculate_hash_value(SOCKET s)
 {
   return static_cast<std::size_t>(s);
 }
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Note: assumes K and V are POD types.
 template <typename K, typename V>
@@ -180,7 +180,7 @@
   // Erase an entry from the map.
   void erase(iterator it)
   {
- BOOST_ASSERT(it != values_.end());
+ BOOST_ASIO_ASSERT(it != values_.end());
 
     size_t bucket = calculate_hash_value(it->first) % num_buckets_;
     bool is_first = (it == buckets_[bucket].first);

Modified: branches/release/boost/asio/detail/impl/descriptor_ops.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/descriptor_ops.ipp (original)
+++ branches/release/boost/asio/detail/impl/descriptor_ops.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/descriptor_ops.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,7 +20,7 @@
 #include <boost/asio/detail/descriptor_ops.hpp>
 #include <boost/asio/error.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -444,6 +444,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_DESCRIPTOR_OPS_IPP

Modified: branches/release/boost/asio/detail/impl/dev_poll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/dev_poll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/impl/dev_poll_reactor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/dev_poll_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -46,7 +46,7 @@
 
   if (shutdown_)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, false);
     return;
   }
 

Modified: branches/release/boost/asio/detail/impl/dev_poll_reactor.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/dev_poll_reactor.ipp (original)
+++ branches/release/boost/asio/detail/impl/dev_poll_reactor.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/dev_poll_reactor.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,8 +19,8 @@
 
 #if defined(BOOST_ASIO_HAS_DEV_POLL)
 
-#include <boost/assert.hpp>
 #include <boost/asio/detail/dev_poll_reactor.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 
@@ -122,7 +122,7 @@
 
     // The ops op_queue will always be empty because the fork_helper's set()
     // member function never returns false.
- BOOST_ASSERT(ops.empty());
+ BOOST_ASIO_ASSERT(ops.empty());
   }
 }
 
@@ -163,14 +163,14 @@
 }
 
 void dev_poll_reactor::start_op(int op_type, socket_type descriptor,
- dev_poll_reactor::per_descriptor_data&,
- reactor_op* op, bool allow_speculative)
+ dev_poll_reactor::per_descriptor_data&, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
 
   if (shutdown_)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -183,7 +183,7 @@
         if (op->perform())
         {
           lock.unlock();
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
           return;
         }
       }

Modified: branches/release/boost/asio/detail/impl/epoll_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/epoll_reactor.hpp (original)
+++ branches/release/boost/asio/detail/impl/epoll_reactor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/epoll_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -44,7 +44,7 @@
 
   if (shutdown_)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, false);
     return;
   }
 

Modified: branches/release/boost/asio/detail/impl/epoll_reactor.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/epoll_reactor.ipp (original)
+++ branches/release/boost/asio/detail/impl/epoll_reactor.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/epoll_reactor.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -204,13 +204,13 @@
 }
 
 void epoll_reactor::start_op(int op_type, socket_type descriptor,
- epoll_reactor::per_descriptor_data& descriptor_data,
- reactor_op* op, bool allow_speculative)
+ epoll_reactor::per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
 {
   if (!descriptor_data)
   {
     op->ec_ = boost::asio::error::bad_descriptor;
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -218,7 +218,7 @@
 
   if (descriptor_data->shutdown_)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -231,7 +231,7 @@
       if (op->perform())
       {
         descriptor_lock.unlock();
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
         return;
       }
 
@@ -250,7 +250,7 @@
           {
             op->ec_ = boost::system::error_code(errno,
                 boost::asio::error::get_system_category());
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
             return;
           }
         }

Modified: branches/release/boost/asio/detail/impl/eventfd_select_interrupter.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/eventfd_select_interrupter.ipp (original)
+++ branches/release/boost/asio/detail/impl/eventfd_select_interrupter.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/eventfd_select_interrupter.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -28,6 +28,7 @@
 #else // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
 # include <sys/eventfd.h>
 #endif // __GLIBC__ == 2 && __GLIBC_MINOR__ < 8
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/eventfd_select_interrupter.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>

Modified: branches/release/boost/asio/detail/impl/handler_tracking.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/handler_tracking.ipp (original)
+++ branches/release/boost/asio/detail/impl/handler_tracking.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/handler_tracking.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,13 +23,21 @@
 #include <cstdio>
 #include <boost/asio/detail/handler_tracking.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/time_traits.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# if defined(BOOST_ASIO_HAS_STD_CHRONO)
+# include <chrono>
+# elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+# include <boost/chrono/system_clocks.hpp>
+# endif
+# include <boost/asio/detail/chrono_time_traits.hpp>
+# include <boost/asio/wait_traits.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 # include <unistd.h>
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -37,10 +45,37 @@
 namespace asio {
 namespace detail {
 
+struct handler_tracking_timestamp
+{
+ uint64_t seconds;
+ uint64_t microseconds;
+
+ handler_tracking_timestamp()
+ {
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
+ boost::posix_time::time_duration now =
+ boost::posix_time::microsec_clock::universal_time() - epoch;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+ typedef chrono_time_traits<std::chrono::system_clock,
+ boost::asio::wait_traits<std::chrono::system_clock> > traits_helper;
+ traits_helper::posix_time_duration now(
+ std::chrono::system_clock::now().time_since_epoch());
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+ typedef chrono_time_traits<boost::chrono::system_clock,
+ boost::asio::wait_traits<boost::chrono::system_clock> > traits_helper;
+ traits_helper::posix_time_duration now(
+ boost::chrono::system_clock::now().time_since_epoch());
+#endif
+ seconds = static_cast<uint64_t>(now.total_seconds());
+ microseconds = static_cast<uint64_t>(now.total_microseconds() % 1000000);
+ }
+};
+
 struct handler_tracking::tracking_state
 {
   static_mutex mutex_;
- boost::uint64_t next_id_;
+ uint64_t next_id_;
   tss_ptr<completion>* current_completion_;
 };
 
@@ -70,22 +105,19 @@
   h->id_ = state->next_id_++;
   lock.unlock();
 
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
- boost::uint64_t current_id = 0;
+ uint64_t current_id = 0;
   if (completion* current_completion = *state->current_completion_)
     current_id = current_completion->id_;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|%I64u*%I64u|%.20s@%p.%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|%llu*%llu|%.20s@%p.%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       current_id, h->id_, object_type, object, op_name);
 }
 
@@ -101,18 +133,15 @@
 {
   if (id_)
   {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
     write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
         "@asio|%I64u.%06I64u|%c%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
         "@asio|%llu.%06llu|%c%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
         invoked_ ? '!' : '~', id_);
   }
 
@@ -121,18 +150,15 @@
 
 void handler_tracking::completion::invocation_begin()
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000), id_);
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds);
 
   invoked_ = true;
 }
@@ -140,18 +166,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value());
 
   invoked_ = true;
@@ -160,20 +183,17 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, std::size_t bytes_transferred)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,bytes_transferred=%I64u\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,bytes_transferred=%llu\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(),
- static_cast<boost::uint64_t>(bytes_transferred));
+ static_cast<uint64_t>(bytes_transferred));
 
   invoked_ = true;
 }
@@ -181,18 +201,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, int signal_number)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,signal_number=%d\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,signal_number=%d\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(), signal_number);
 
   invoked_ = true;
@@ -201,18 +218,15 @@
 void handler_tracking::completion::invocation_begin(
     const boost::system::error_code& ec, const char* arg)
 {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|>%I64u|ec=%.20s:%d,%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|>%llu|ec=%.20s:%d,%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       id_, ec.category().name(), ec.value(), arg);
 
   invoked_ = true;
@@ -222,18 +236,15 @@
 {
   if (id_)
   {
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
     write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
         "@asio|%I64u.%06I64u|<%I64u|\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
         "@asio|%llu.%06llu|<%llu|\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000), id_);
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds);
 
     id_ = 0;
   }
@@ -244,22 +255,19 @@
 {
   static tracking_state* state = get_state();
 
- boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
- boost::posix_time::time_duration now =
- boost::posix_time::microsec_clock::universal_time() - epoch;
+ handler_tracking_timestamp timestamp;
 
   unsigned long long current_id = 0;
   if (completion* current_completion = *state->current_completion_)
     current_id = current_completion->id_;
 
   write_line(
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
       "@asio|%I64u.%06I64u|%I64u|%.20s@%p.%.50s\n",
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       "@asio|%llu.%06llu|%llu|%.20s@%p.%.50s\n",
-#endif // defined(BOOST_WINDOWS)
- static_cast<boost::uint64_t>(now.total_seconds()),
- static_cast<boost::uint64_t>(now.total_microseconds() % 1000000),
+#endif // defined(BOOST_ASIO_WINDOWS)
+ timestamp.seconds, timestamp.microseconds,
       current_id, object_type, object, op_name);
 }
 
@@ -271,21 +279,21 @@
   va_start(args, format);
 
   char line[256] = "";
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   int length = vsprintf_s(line, sizeof(line), format, args);
-#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   int length = vsprintf(line, format, args);
-#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 
   va_end(args);
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
   HANDLE stderr_handle = ::GetStdHandle(STD_ERROR_HANDLE);
   DWORD bytes_written = 0;
   ::WriteFile(stderr_handle, line, length, &bytes_written, 0);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
   ::write(STDERR_FILENO, line, length);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 }
 
 } // namespace detail

Modified: branches/release/boost/asio/detail/impl/kqueue_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/kqueue_reactor.hpp (original)
+++ branches/release/boost/asio/detail/impl/kqueue_reactor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/kqueue_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -48,7 +48,7 @@
 
   if (shutdown_)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, false);
     return;
   }
 

Modified: branches/release/boost/asio/detail/impl/kqueue_reactor.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/kqueue_reactor.ipp (original)
+++ branches/release/boost/asio/detail/impl/kqueue_reactor.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/kqueue_reactor.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -178,13 +178,13 @@
 }
 
 void kqueue_reactor::start_op(int op_type, socket_type descriptor,
- kqueue_reactor::per_descriptor_data& descriptor_data,
- reactor_op* op, bool allow_speculative)
+ kqueue_reactor::per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative)
 {
   if (!descriptor_data)
   {
     op->ec_ = boost::asio::error::bad_descriptor;
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -192,7 +192,7 @@
 
   if (descriptor_data->shutdown_)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -206,7 +206,7 @@
         if (op->perform())
         {
           descriptor_lock.unlock();
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
           return;
         }
       }

Modified: branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp (original)
+++ branches/release/boost/asio/detail/impl/pipe_select_interrupter.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/pipe_select_interrupter.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 #if !defined(__CYGWIN__)
 #if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
@@ -119,6 +119,6 @@
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
 #endif // !defined(__SYMBIAN32__)
 #endif // !defined(__CYGWIN__)
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP

Modified: branches/release/boost/asio/detail/impl/posix_event.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/posix_event.ipp (original)
+++ branches/release/boost/asio/detail/impl/posix_event.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/posix_event.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_event.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -44,6 +44,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_EVENT_IPP

Modified: branches/release/boost/asio/detail/impl/posix_mutex.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/posix_mutex.ipp (original)
+++ branches/release/boost/asio/detail/impl/posix_mutex.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/posix_mutex.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_mutex.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -43,6 +43,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP

Modified: branches/release/boost/asio/detail/impl/posix_thread.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/posix_thread.ipp (original)
+++ branches/release/boost/asio/detail/impl/posix_thread.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/posix_thread.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_thread.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -71,6 +71,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_THREAD_IPP

Modified: branches/release/boost/asio/detail/impl/posix_tss_ptr.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/posix_tss_ptr.ipp (original)
+++ branches/release/boost/asio/detail/impl/posix_tss_ptr.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/posix_tss_ptr.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <boost/asio/detail/posix_tss_ptr.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -43,6 +43,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP

Modified: branches/release/boost/asio/detail/impl/reactive_descriptor_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/reactive_descriptor_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/reactive_descriptor_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/reactive_descriptor_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/detail/reactive_descriptor_service.hpp>
@@ -177,7 +177,8 @@
 
 void reactive_descriptor_service::start_op(
     reactive_descriptor_service::implementation_type& impl,
- int op_type, reactor_op* op, bool is_non_blocking, bool noop)
+ int op_type, reactor_op* op, bool is_continuation,
+ bool is_non_blocking, bool noop)
 {
   if (!noop)
   {
@@ -186,12 +187,12 @@
           impl.descriptor_, impl.state_, true, op->ec_))
     {
       reactor_.start_op(op_type, impl.descriptor_,
- impl.reactor_data_, op, is_non_blocking);
+ impl.reactor_data_, op, is_continuation, is_non_blocking);
       return;
     }
   }
 
- reactor_.post_immediate_completion(op);
+ reactor_.post_immediate_completion(op, is_continuation);
 }
 
 } // namespace detail
@@ -200,6 +201,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_DESCRIPTOR_SERVICE_IPP

Modified: branches/release/boost/asio/detail/impl/reactive_serial_port_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/reactive_serial_port_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/reactive_serial_port_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/reactive_serial_port_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -19,7 +19,7 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstring>
 #include <boost/asio/detail/reactive_serial_port_service.hpp>
@@ -147,7 +147,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 #endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_SERIAL_PORT_SERVICE_IPP

Modified: branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp (original)
+++ branches/release/boost/asio/detail/impl/reactive_socket_service_base.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_service_base.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -200,7 +200,8 @@
 
 void reactive_socket_service_base::start_op(
     reactive_socket_service_base::base_implementation_type& impl,
- int op_type, reactor_op* op, bool is_non_blocking, bool noop)
+ int op_type, reactor_op* op, bool is_continuation,
+ bool is_non_blocking, bool noop)
 {
   if (!noop)
   {
@@ -209,30 +210,31 @@
           impl.socket_, impl.state_, true, op->ec_))
     {
       reactor_.start_op(op_type, impl.socket_,
- impl.reactor_data_, op, is_non_blocking);
+ impl.reactor_data_, op, is_continuation, is_non_blocking);
       return;
     }
   }
 
- reactor_.post_immediate_completion(op);
+ reactor_.post_immediate_completion(op, is_continuation);
 }
 
 void reactive_socket_service_base::start_accept_op(
     reactive_socket_service_base::base_implementation_type& impl,
- reactor_op* op, bool peer_is_open)
+ reactor_op* op, bool is_continuation, bool peer_is_open)
 {
   if (!peer_is_open)
- start_op(impl, reactor::read_op, op, true, false);
+ start_op(impl, reactor::read_op, op, true, is_continuation, false);
   else
   {
     op->ec_ = boost::asio::error::already_open;
- reactor_.post_immediate_completion(op);
+ reactor_.post_immediate_completion(op, is_continuation);
   }
 }
 
 void reactive_socket_service_base::start_connect_op(
     reactive_socket_service_base::base_implementation_type& impl,
- reactor_op* op, const socket_addr_type* addr, size_t addrlen)
+ reactor_op* op, bool is_continuation,
+ const socket_addr_type* addr, size_t addrlen)
 {
   if ((impl.state_ & socket_ops::non_blocking)
       || socket_ops::set_internal_non_blocking(
@@ -244,14 +246,14 @@
           || op->ec_ == boost::asio::error::would_block)
       {
         op->ec_ = boost::system::error_code();
- reactor_.start_op(reactor::connect_op,
- impl.socket_, impl.reactor_data_, op, false);
+ reactor_.start_op(reactor::connect_op, impl.socket_,
+ impl.reactor_data_, op, is_continuation, false);
         return;
       }
     }
   }
 
- reactor_.post_immediate_completion(op);
+ reactor_.post_immediate_completion(op, is_continuation);
 }
 
 } // namespace detail

Modified: branches/release/boost/asio/detail/impl/resolver_service_base.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/resolver_service_base.ipp (original)
+++ branches/release/boost/asio/detail/impl/resolver_service_base.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/resolver_service_base.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -110,7 +110,7 @@
 {
   start_work_thread();
   io_service_impl_.work_started();
- work_io_service_impl_.post_immediate_completion(op);
+ work_io_service_impl_.post_immediate_completion(op, false);
 }
 
 void resolver_service_base::start_work_thread()

Modified: branches/release/boost/asio/detail/impl/select_reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/select_reactor.hpp (original)
+++ branches/release/boost/asio/detail/impl/select_reactor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/select_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -50,7 +50,7 @@
 
   if (shutdown_)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, false);
     return;
   }
 

Modified: branches/release/boost/asio/detail/impl/select_reactor.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/select_reactor.ipp (original)
+++ branches/release/boost/asio/detail/impl/select_reactor.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/select_reactor.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -122,13 +122,14 @@
 }
 
 void select_reactor::start_op(int op_type, socket_type descriptor,
- select_reactor::per_descriptor_data&, reactor_op* op, bool)
+ select_reactor::per_descriptor_data&, reactor_op* op,
+ bool is_continuation, bool)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
 
   if (shutdown_)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, is_continuation);
     return;
   }
 
@@ -185,7 +186,7 @@
       max_fd = fd_sets_[i].max_descriptor();
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Connection operations on Windows use both except and write fd_sets.
   have_work_to_do = have_work_to_do || !op_queue_[connect_op].empty();
   op_queue_[connect_op].get_descriptors(fd_sets_[write_op], ops);
@@ -194,7 +195,7 @@
   op_queue_[connect_op].get_descriptors(fd_sets_[except_op], ops);
   if (fd_sets_[except_op].max_descriptor() > max_fd)
     max_fd = fd_sets_[except_op].max_descriptor();
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   // We can return immediately if there's no work to do and the reactor is
   // not supposed to block.
@@ -224,13 +225,13 @@
   // Dispatch all ready operations.
   if (retval > 0)
   {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     // Connection operations on Windows use both except and write fd_sets.
     op_queue_[connect_op].perform_operations_for_descriptors(
         fd_sets_[except_op], ops);
     op_queue_[connect_op].perform_operations_for_descriptors(
         fd_sets_[write_op], ops);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
     // Exception operations must be processed first to ensure that any
     // out-of-band data is read before normal data.

Modified: branches/release/boost/asio/detail/impl/service_registry.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/service_registry.hpp (original)
+++ branches/release/boost/asio/detail/impl/service_registry.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/service_registry.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/impl/service_registry.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/service_registry.ipp (original)
+++ branches/release/boost/asio/detail/impl/service_registry.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/service_registry.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,9 +16,9 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <vector>
 #include <boost/asio/detail/service_registry.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -146,7 +146,7 @@
     boost::asio::io_service::service* new_service)
 {
   if (&owner_ != &new_service->get_io_service())
- boost::throw_exception(invalid_service_owner());
+ boost::asio::detail::throw_exception(invalid_service_owner());
 
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
 
@@ -155,7 +155,7 @@
   while (service)
   {
     if (keys_match(service->key_, key))
- boost::throw_exception(service_already_exists());
+ boost::asio::detail::throw_exception(service_already_exists());
     service = service->next_;
   }
 

Modified: branches/release/boost/asio/detail/impl/signal_set_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/signal_set_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/signal_set_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/signal_set_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -59,23 +59,23 @@
 
 void asio_signal_handler(int signal_number)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   signal_set_service::deliver_signal(signal_number);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int saved_errno = errno;
   signal_state* state = get_signal_state();
   signed_size_type result = ::write(state->write_descriptor_,
       &signal_number, sizeof(signal_number));
   (void)result;
   errno = saved_errno;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(BOOST_ASIO_HAS_SIGNAL) && !defined(BOOST_ASIO_HAS_SIGACTION)
   ::signal(signal_number, asio_signal_handler);
 #endif // defined(BOOST_ASIO_HAS_SIGNAL) && !defined(BOOST_ASIO_HAS_SIGACTION)
 }
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 class signal_set_service::pipe_read_op : public reactor_op
 {
 public:
@@ -105,22 +105,22 @@
     delete o;
   }
 };
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 signal_set_service::signal_set_service(
     boost::asio::io_service& io_service)
   : io_service_(boost::asio::use_service<io_service_impl>(io_service)),
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     reactor_(boost::asio::use_service<reactor>(io_service)),
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     next_(0),
     prev_(0)
 {
   get_signal_state()->mutex_.init();
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   reactor_.init_task();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   for (int i = 0; i < max_signal_number; ++i)
     registrations_[i] = 0;
@@ -155,7 +155,7 @@
 void signal_set_service::fork_service(
     boost::asio::io_service::fork_event fork_ev)
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
   static_mutex::scoped_lock lock(state->mutex_);
 
@@ -185,9 +185,9 @@
   default:
     break;
   }
-#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#else // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   (void)fork_ev;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::construct(
@@ -247,12 +247,12 @@
       if (::signal(signal_number, asio_signal_handler) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         delete new_registration;
         return ec;
       }
@@ -317,12 +317,12 @@
       if (::signal(signal_number, SIG_DFL) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         return ec;
       }
     }
@@ -371,12 +371,12 @@
       if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR)
 # endif // defined(BOOST_ASIO_HAS_SIGACTION)
       {
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::asio::error::invalid_argument;
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         ec = boost::system::error_code(errno,
             boost::asio::error::get_system_category());
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
         return ec;
       }
     }
@@ -466,11 +466,11 @@
   signal_state* state = get_signal_state();
   static_mutex::scoped_lock lock(state->mutex_);
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // If this is the first service to be created, open a new pipe.
   if (state->service_list_ == 0)
     open_descriptors();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   // Insert service into linked list of all services.
   service->next_ = state->service_list_;
@@ -479,11 +479,11 @@
     state->service_list_->prev_ = service;
   state->service_list_ = service;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // Register for pipe readiness notifications.
   service->reactor_.register_internal_descriptor(reactor::read_op,
       state->read_descriptor_, service->reactor_data_, new pipe_read_op);
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::remove_service(signal_set_service* service)
@@ -493,11 +493,11 @@
 
   if (service->next_ || service->prev_ || state->service_list_ == service)
   {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     // Disable the pipe readiness notifications.
     service->reactor_.deregister_descriptor(
         state->read_descriptor_, service->reactor_data_, false);
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
     // Remove service from linked list of all services.
     if (state->service_list_ == service)
@@ -509,17 +509,17 @@
     service->next_ = 0;
     service->prev_ = 0;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
     // If this is the last service to be removed, close the pipe.
     if (state->service_list_ == 0)
       close_descriptors();
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   }
 }
 
 void signal_set_service::open_descriptors()
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
 
   int pipe_fds[2];
@@ -542,12 +542,12 @@
         boost::asio::error::get_system_category());
     boost::asio::detail::throw_error(ec, "signal_set_service pipe");
   }
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::close_descriptors()
 {
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   signal_state* state = get_signal_state();
 
   if (state->read_descriptor_ != -1)
@@ -557,7 +557,7 @@
   if (state->write_descriptor_ != -1)
     ::close(state->write_descriptor_);
   state->write_descriptor_ = -1;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 }
 
 void signal_set_service::start_wait_op(

Modified: branches/release/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/socket_ops.ipp (original)
+++ branches/release/boost/asio/detail/impl/socket_ops.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/socket_ops.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,17 +16,24 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/assert.hpp>
-#include <boost/detail/workaround.hpp>
 #include <cctype>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <cerrno>
 #include <new>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/error.hpp>
 
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) \
+ || defined(__MACH__) && defined(__APPLE__)
+# if defined(BOOST_ASIO_HAS_PTHREADS)
+# include <pthread.h>
+# endif // defined(BOOST_ASIO_HAS_PTHREADS)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
+ // || defined(__MACH__) && defined(__APPLE__)
+
 #include <boost/asio/detail/push_options.hpp>
 
 namespace boost {
@@ -34,9 +41,9 @@
 namespace detail {
 namespace socket_ops {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 struct msghdr { int msg_namelen; };
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(__hpux)
 // HP-UX doesn't declare these functions extern "C", so they are declared again
@@ -47,7 +54,7 @@
 
 inline void clear_last_error()
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   WSASetLastError(0);
 #else
   errno = 0;
@@ -58,7 +65,7 @@
 inline ReturnType error_wrapper(ReturnType return_value,
     boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ec = boost::system::error_code(WSAGetLastError(),
       boost::asio::error::get_system_category());
 #else
@@ -293,11 +300,11 @@
     }
 
     clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     result = error_wrapper(::closesocket(s), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     result = error_wrapper(::close(s), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
     if (result != 0
         && (ec == boost::asio::error::would_block
@@ -309,10 +316,10 @@
       // current OS where this behaviour is seen, Windows, says that the socket
       // remains open. Therefore we'll put the descriptor back into blocking
       // mode and have another attempt at closing it.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       ioctl_arg_type arg = 0;
       ::ioctlsocket(s, FIONBIO, &arg);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(__SYMBIAN32__)
       int flags = ::fcntl(s, F_GETFL, 0);
       if (flags >= 0)
@@ -321,15 +328,15 @@
       ioctl_arg_type arg = 0;
       ::ioctl(s, FIONBIO, &arg);
 # endif // defined(__SYMBIAN32__)
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       state &= ~non_blocking;
 
       clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       result = error_wrapper(::closesocket(s), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
       result = error_wrapper(::close(s), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     }
   }
 
@@ -348,7 +355,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
 #elif defined(__SYMBIAN32__)
@@ -401,7 +408,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
 #elif defined(__SYMBIAN32__)
@@ -501,8 +508,19 @@
       boost::asio::error::get_system_category());
 }
 
-bool non_blocking_connect(socket_type s, boost::system::error_code& ec)
+bool non_blocking_connect(socket_type s,
+ const socket_addr_type* addr, std::size_t addrlen,
+ boost::system::error_code& ec)
 {
+ // Check if the connect operation has finished. This is required since we may
+ // get spurious readiness notifications from the reactor.
+ socket_ops::connect(s, addr, addrlen, ec);
+ if (ec == boost::asio::error::already_started)
+ {
+ // The asynchronous connect operation is still in progress.
+ return false;
+ }
+
   // Get the error code from the connect operation.
   int connect_error = 0;
   size_t connect_error_len = sizeof(connect_error);
@@ -524,7 +542,7 @@
 int socketpair(int af, int type, int protocol,
     socket_type sv[2], boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(af);
   (void)(type);
   (void)(protocol);
@@ -550,11 +568,11 @@
 
 #if defined(SIOCATMARK)
   ioctl_arg_type value = 0;
-# if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, SIOCATMARK, &value), ec);
-# else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctl(s, SIOCATMARK, &value), ec);
-# endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+# endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (result == 0)
     ec = boost::system::error_code();
 # if defined(ENOTTY)
@@ -579,11 +597,11 @@
   }
 
   ioctl_arg_type value = 0;
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, FIONREAD, &value), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctl(s, FIONREAD, &value), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (result == 0)
     ec = boost::system::error_code();
 #if defined(ENOTTY)
@@ -620,32 +638,32 @@
   base = static_cast<T>(addr);
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef WSABUF buf;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef iovec buf;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 void init_buf(buf& b, void* data, size_t size)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   b.buf = static_cast<char*>(data);
   b.len = static_cast<u_long>(size);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   init_buf_iov_base(b.iov_base, data);
   b.iov_len = size;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 void init_buf(buf& b, const void* data, size_t size)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   b.buf = static_cast<char*>(const_cast<void*>(data));
   b.len = static_cast<u_long>(size);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   init_buf_iov_base(b.iov_base, const_cast<void*>(data));
   b.iov_len = size;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 inline void init_msghdr_msg_name(void*& name, socket_addr_type* addr)
@@ -674,7 +692,7 @@
     int flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Receive some data.
   DWORD recv_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -689,7 +707,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
   msg.msg_iovlen = static_cast<int>(count);
@@ -697,7 +715,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recv(socket_type s, state_type state, buf* bufs,
@@ -820,7 +838,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Receive some data.
   DWORD recv_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -837,7 +855,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
   msg.msg_namelen = static_cast<int>(*addrlen);
@@ -848,7 +866,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recvfrom(socket_type s, state_type state, buf* bufs,
@@ -945,10 +963,10 @@
     int in_flags, int& out_flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   out_flags = 0;
   return socket_ops::recv(s, bufs, count, in_flags, ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = bufs;
   msg.msg_iovlen = static_cast<int>(count);
@@ -961,7 +979,7 @@
   else
     out_flags = 0;
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_recvmsg(socket_type s, state_type state,
@@ -1057,7 +1075,7 @@
     int flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Send the data.
   DWORD send_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -1072,7 +1090,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   msg.msg_iov = const_cast<buf*>(bufs);
   msg.msg_iovlen = static_cast<int>(count);
@@ -1083,7 +1101,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_send(socket_type s, state_type state, const buf* bufs,
@@ -1184,7 +1202,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   // Send the data.
   DWORD send_buf_count = static_cast<DWORD>(count);
   DWORD bytes_transferred = 0;
@@ -1199,7 +1217,7 @@
     return socket_error_retval;
   ec = boost::system::error_code();
   return bytes_transferred;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   msghdr msg = msghdr();
   init_msghdr_msg_name(msg.msg_name, addr);
   msg.msg_namelen = static_cast<int>(addrlen);
@@ -1212,7 +1230,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 size_t sync_sendto(socket_type s, state_type state, const buf* bufs,
@@ -1289,7 +1307,7 @@
     boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   socket_type s = error_wrapper(::WSASocket(af, type, protocol, 0, 0,
         WSA_FLAG_OVERLAPPED), ec);
   if (s == invalid_socket)
@@ -1487,7 +1505,7 @@
   }
   ec = boost::asio::error::fault;
   return socket_error_retval;
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   clear_last_error();
   int result = error_wrapper(call_getsockopt(&msghdr::msg_namelen,
         s, level, optname, optval, optlen), ec);
@@ -1505,7 +1523,7 @@
   if (result == 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   clear_last_error();
   int result = error_wrapper(call_getsockopt(&msghdr::msg_namelen,
         s, level, optname, optval, optlen), ec);
@@ -1524,7 +1542,7 @@
   if (result == 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 template <typename SockLenType>
@@ -1546,7 +1564,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (cached)
   {
     // Check if socket is still connected.
@@ -1567,9 +1585,9 @@
     ec = boost::system::error_code();
     return 0;
   }
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)cached;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   clear_last_error();
   int result = error_wrapper(call_getpeername(
@@ -1616,7 +1634,7 @@
   }
 
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::ioctlsocket(s, cmd, arg), ec);
 #elif defined(__MACH__) && defined(__APPLE__) \
   || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -1657,7 +1675,7 @@
     fd_set* exceptfds, timeval* timeout, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (!readfds && !writefds && !exceptfds && timeout)
   {
     DWORD milliseconds = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
@@ -1677,7 +1695,7 @@
   if (timeout && timeout->tv_sec == 0
       && timeout->tv_usec > 0 && timeout->tv_usec < 1000)
     timeout->tv_usec = 1000;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #if defined(__hpux) && defined(__SELECT)
   timespec ts;
@@ -1702,7 +1720,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set fds;
@@ -1714,7 +1732,7 @@
   timeval* timeout = (state & user_set_non_blocking) ? &zero_timeout : 0;
   clear_last_error();
   int result = error_wrapper(::select(s, &fds, 0, 0, timeout), ec);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1724,7 +1742,7 @@
   int timeout = (state & user_set_non_blocking) ? 0 : -1;
   clear_last_error();
   int result = error_wrapper(::poll(&fds, 1, timeout), ec);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
   if (result == 0)
@@ -1743,7 +1761,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set fds;
@@ -1755,7 +1773,7 @@
   timeval* timeout = (state & user_set_non_blocking) ? &zero_timeout : 0;
   clear_last_error();
   int result = error_wrapper(::select(s, 0, &fds, 0, timeout), ec);
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1765,7 +1783,7 @@
   int timeout = (state & user_set_non_blocking) ? 0 : -1;
   clear_last_error();
   int result = error_wrapper(::poll(&fds, 1, timeout), ec);
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
   if (result == 0)
@@ -1784,7 +1802,7 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
   fd_set write_fds;
@@ -1798,7 +1816,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS)
+#else // defined(BOOST_ASIO_WINDOWS)
       // || defined(__CYGWIN__)
       // || defined(__SYMBIAN32__)
   pollfd fds;
@@ -1810,7 +1828,7 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 }
@@ -1819,7 +1837,7 @@
     unsigned long scope_id, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   using namespace std; // For memcpy.
 
   if (af != AF_INET && af != AF_INET6)
@@ -1873,7 +1891,7 @@
     ec = boost::asio::error::invalid_argument;
 
   return result == socket_error_retval ? 0 : dest;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   const char* result = error_wrapper(::inet_ntop(
         af, src, dest, static_cast<int>(length)), ec);
   if (result == 0 && !ec)
@@ -1891,14 +1909,14 @@
     strcat(dest, if_name);
   }
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 int inet_pton(int af, const char* src, void* dest,
     unsigned long* scope_id, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   using namespace std; // For memcpy and strcmp.
 
   if (af != AF_INET && af != AF_INET6)
@@ -1958,7 +1976,7 @@
     ec = boost::system::error_code();
 
   return result == socket_error_retval ? -1 : 1;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   int result = error_wrapper(::inet_pton(af, src, dest), ec);
   if (result <= 0 && !ec)
     ec = boost::asio::error::invalid_argument;
@@ -1978,21 +1996,21 @@
     }
   }
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 }
 
 int gethostname(char* name, int namelen, boost::system::error_code& ec)
 {
   clear_last_error();
   int result = error_wrapper(::gethostname(name, namelen), ec);
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
   if (result == 0)
     ec = boost::system::error_code();
 #endif
   return result;
 }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) \
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) \
   || defined(__MACH__) && defined(__APPLE__)
 
 // The following functions are only needed for emulation of getaddrinfo and
@@ -2013,7 +2031,7 @@
   case NO_DATA:
     return boost::asio::error::no_data;
   default:
- BOOST_ASSERT(false);
+ BOOST_ASIO_ASSERT(false);
     return boost::asio::error::invalid_argument;
   }
 }
@@ -2022,7 +2040,7 @@
     hostent* result, char* buffer, int buflength, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(buffer);
   (void)(buflength);
   hostent* retval = error_wrapper(::gethostbyaddr(addr, length, af), ec);
@@ -2065,7 +2083,7 @@
     char* buffer, int buflength, int ai_flags, boost::system::error_code& ec)
 {
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   (void)(buffer);
   (void)(buflength);
   (void)(ai_flags);
@@ -2250,12 +2268,12 @@
 inline void gai_strcpy(char* target, const char* source, std::size_t max_size)
 {
   using namespace std;
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   strcpy_s(target, max_size, source);
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   *target = 0;
   strncat(target, source, max_size);
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 }
 
 enum { gai_clone_flag = 1 << 30 };
@@ -2789,20 +2807,18 @@
       {
         return ec = boost::asio::error::no_buffer_space;
       }
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
       sprintf_s(serv, servlen, "%u", ntohs(port));
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
       sprintf(serv, "%u", ntohs(port));
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
     }
     else
     {
-#if defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS) \
- && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
       static ::pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
       ::pthread_mutex_lock(&mutex);
-#endif // defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS)
- // && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
       servent* sptr = ::getservbyport(port, (flags & NI_DGRAM) ? "udp" : 0);
       if (sptr && sptr->s_name && sptr->s_name[0] != '\0')
       {
@@ -2814,17 +2830,15 @@
         {
           return ec = boost::asio::error::no_buffer_space;
         }
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
         sprintf_s(serv, servlen, "%u", ntohs(port));
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
         sprintf(serv, "%u", ntohs(port));
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
       }
-#if defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS) \
- && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
       ::pthread_mutex_unlock(&mutex);
-#endif // defined(BOOST_HAS_THREADS) && defined(BOOST_HAS_PTHREADS)
- // && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
     }
   }
 
@@ -2832,7 +2846,7 @@
   return ec;
 }
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
        // || defined(__MACH__) && defined(__APPLE__)
 
 inline boost::system::error_code translate_addrinfo_error(int error)
@@ -2864,7 +2878,7 @@
   case EAI_SOCKTYPE:
     return boost::asio::error::socket_type_not_supported;
   default: // Possibly the non-portable EAI_SYSTEM.
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     return boost::system::error_code(
         WSAGetLastError(), boost::asio::error::get_system_category());
 #else
@@ -2881,7 +2895,7 @@
   host = (host && *host) ? host : 0;
   service = (service && *service) ? service : 0;
   clear_last_error();
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   int error = ::getaddrinfo(host, service, &hints, result);
@@ -2924,7 +2938,7 @@
 
 void freeaddrinfo(addrinfo_type* ai)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   ::freeaddrinfo(ai);
@@ -2952,7 +2966,7 @@
     std::size_t addrlen, char* host, std::size_t hostlen,
     char* serv, std::size_t servlen, int flags, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   clear_last_error();

Modified: branches/release/boost/asio/detail/impl/socket_select_interrupter.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/socket_select_interrupter.ipp (original)
+++ branches/release/boost/asio/detail/impl/socket_select_interrupter.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/socket_select_interrupter.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -166,7 +166,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: branches/release/boost/asio/detail/impl/strand_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/strand_service.hpp (original)
+++ branches/release/boost/asio/detail/impl/strand_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/strand_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/call_stack.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -46,13 +47,13 @@
     impl_->mutex_.unlock();
 
     if (more_handlers)
- io_service_->post_immediate_completion(impl_);
+ io_service_->post_immediate_completion(impl_, false);
   }
 };
 
 template <typename Handler>
 void strand_service::dispatch(strand_service::implementation_type& impl,
- Handler handler)
+ Handler& handler)
 {
   // If we are already in the strand then the handler can run immediately.
   if (call_stack<strand_impl>::contains(impl))
@@ -64,7 +65,7 @@
 
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);
@@ -92,18 +93,21 @@
 // Request the io_service to invoke the given handler and return immediately.
 template <typename Handler>
 void strand_service::post(strand_service::implementation_type& impl,
- Handler handler)
+ Handler& handler)
 {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);
 
   BOOST_ASIO_HANDLER_CREATION((p.p, "strand", impl, "post"));
 
- do_post(impl, p.p);
+ do_post(impl, p.p, is_continuation);
   p.v = p.p = 0;
 }
 

Modified: branches/release/boost/asio/detail/impl/strand_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/strand_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/strand_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/strand_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -38,7 +38,7 @@
     impl_->mutex_.unlock();
 
     if (more_handlers)
- owner_->post_private_immediate_completion(impl_);
+ owner_->post_immediate_completion(impl_, true);
   }
 };
 
@@ -85,6 +85,12 @@
   impl = implementations_[index].get();
 }
 
+bool strand_service::running_in_this_thread(
+ const implementation_type& impl) const
+{
+ return call_stack<strand_impl>::contains(impl) != 0;
+}
+
 bool strand_service::do_dispatch(implementation_type& impl, operation* op)
 {
   // If we are running inside the io_service, and no other handler already
@@ -112,13 +118,14 @@
     impl->locked_ = true;
     impl->mutex_.unlock();
     impl->ready_queue_.push(op);
- io_service_.post_immediate_completion(impl);
+ io_service_.post_immediate_completion(impl, false);
   }
 
   return false;
 }
 
-void strand_service::do_post(implementation_type& impl, operation* op)
+void strand_service::do_post(implementation_type& impl,
+ operation* op, bool is_continuation)
 {
   impl->mutex_.lock();
   if (impl->locked_)
@@ -134,7 +141,7 @@
     impl->locked_ = true;
     impl->mutex_.unlock();
     impl->ready_queue_.push(op);
- io_service_.post_immediate_completion(impl);
+ io_service_.post_immediate_completion(impl, is_continuation);
   }
 }
 

Modified: branches/release/boost/asio/detail/impl/task_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/task_io_service.hpp (original)
+++ branches/release/boost/asio/detail/impl/task_io_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/task_io_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,9 +15,11 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -27,7 +29,7 @@
 namespace detail {
 
 template <typename Handler>
-void task_io_service::dispatch(Handler handler)
+void task_io_service::dispatch(Handler& handler)
 {
   if (thread_call_stack::contains(this))
   {
@@ -38,31 +40,34 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "io_service", this, "dispatch"));
 
- post_non_private_immediate_completion(p.p);
+ do_dispatch(p.p);
     p.v = p.p = 0;
   }
 }
 
 template <typename Handler>
-void task_io_service::post(Handler handler)
+void task_io_service::post(Handler& handler)
 {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);
 
   BOOST_ASIO_HANDLER_CREATION((p.p, "io_service", this, "post"));
 
- post_immediate_completion(p.p);
+ post_immediate_completion(p.p, is_continuation);
   p.v = p.p = 0;
 }
 

Modified: branches/release/boost/asio/detail/impl/task_io_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/task_io_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/task_io_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/task_io_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,8 +19,8 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/detail/event.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/reactor.hpp>
 #include <boost/asio/detail/task_io_service.hpp>
 #include <boost/asio/detail/task_io_service_thread_info.hpp>
@@ -72,13 +72,13 @@
     }
     this_thread_->private_outstanding_work = 0;
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
     if (!this_thread_->private_op_queue.empty())
     {
       lock_->lock();
       task_io_service_->op_queue_.push(this_thread_->private_op_queue);
     }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
   }
 
   task_io_service* task_io_service_;
@@ -194,14 +194,14 @@
 
   mutex::scoped_lock lock(mutex_);
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   // We want to support nested calls to poll() and poll_one(), so any handlers
   // that are already on a thread-private queue need to be put on to the main
   // queue now.
   if (one_thread_)
     if (thread_info* outer_thread_info = ctx.next_by_key())
       op_queue_.push(outer_thread_info->private_op_queue);
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   std::size_t n = 0;
   for (; do_poll_one(lock, this_thread, ec); lock.lock())
@@ -227,14 +227,14 @@
 
   mutex::scoped_lock lock(mutex_);
 
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   // We want to support nested calls to poll() and poll_one(), so any handlers
   // that are already on a thread-private queue need to be put on to the main
   // queue now.
   if (one_thread_)
     if (thread_info* outer_thread_info = ctx.next_by_key())
       op_queue_.push(outer_thread_info->private_op_queue);
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   return do_poll_one(lock, this_thread, ec);
 }
@@ -257,10 +257,11 @@
   stopped_ = false;
 }
 
-void task_io_service::post_immediate_completion(task_io_service::operation* op)
+void task_io_service::post_immediate_completion(
+ task_io_service::operation* op, bool is_continuation)
 {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- if (one_thread_)
+#if defined(BOOST_ASIO_HAS_THREADS)
+ if (one_thread_ || is_continuation)
   {
     if (thread_info* this_thread = thread_call_stack::contains(this))
     {
@@ -269,7 +270,7 @@
       return;
     }
   }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   work_started();
   mutex::scoped_lock lock(mutex_);
@@ -279,7 +280,7 @@
 
 void task_io_service::post_deferred_completion(task_io_service::operation* op)
 {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
   if (one_thread_)
   {
     if (thread_info* this_thread = thread_call_stack::contains(this))
@@ -288,7 +289,7 @@
       return;
     }
   }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
   mutex::scoped_lock lock(mutex_);
   op_queue_.push(op);
@@ -300,7 +301,7 @@
 {
   if (!ops.empty())
   {
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_THREADS)
     if (one_thread_)
     {
       if (thread_info* this_thread = thread_call_stack::contains(this))
@@ -309,7 +310,7 @@
         return;
       }
     }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_THREADS)
 
     mutex::scoped_lock lock(mutex_);
     op_queue_.push(ops);
@@ -317,39 +318,10 @@
   }
 }
 
-void task_io_service::post_private_immediate_completion(
- task_io_service::operation* op)
-{
- work_started();
- post_private_deferred_completion(op);
-}
-
-void task_io_service::post_private_deferred_completion(
- task_io_service::operation* op)
-{
-#if defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
- if (thread_info* this_thread = thread_call_stack::contains(this))
- {
- this_thread->private_op_queue.push(op);
- return;
- }
-#endif // defined(BOOST_HAS_THREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
-
- mutex::scoped_lock lock(mutex_);
- op_queue_.push(op);
- wake_one_thread_and_unlock(lock);
-}
-
-void task_io_service::post_non_private_immediate_completion(
+void task_io_service::do_dispatch(
     task_io_service::operation* op)
 {
   work_started();
- post_non_private_deferred_completion(op);
-}
-
-void task_io_service::post_non_private_deferred_completion(
- task_io_service::operation* op)
-{
   mutex::scoped_lock lock(mutex_);
   op_queue_.push(op);
   wake_one_thread_and_unlock(lock);
@@ -452,7 +424,10 @@
 
     o = op_queue_.front();
     if (o == &task_operation_)
+ {
+ wake_one_idle_thread_and_unlock(lock);
       return 0;
+ }
   }
 
   if (o == 0)

Modified: branches/release/boost/asio/detail/impl/throw_error.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/throw_error.ipp (original)
+++ branches/release/boost/asio/detail/impl/throw_error.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/throw_error.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,8 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/system/system_error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -29,13 +29,13 @@
 void do_throw_error(const boost::system::error_code& err)
 {
   boost::system::system_error e(err);
- boost::throw_exception(e);
+ boost::asio::detail::throw_exception(e);
 }
 
 void do_throw_error(const boost::system::error_code& err, const char* location)
 {
   boost::system::system_error e(err, location);
- boost::throw_exception(e);
+ boost::asio::detail::throw_exception(e);
 }
 
 } // namespace detail

Modified: branches/release/boost/asio/detail/impl/timer_queue_ptime.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/timer_queue_ptime.ipp (original)
+++ branches/release/boost/asio/detail/impl/timer_queue_ptime.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/timer_queue_ptime.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,6 +20,8 @@
 
 #include <boost/asio/detail/push_options.hpp>
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -77,6 +79,8 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/asio/detail/pop_options.hpp>
 
 #endif // BOOST_ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP

Modified: branches/release/boost/asio/detail/impl/timer_queue_set.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/timer_queue_set.ipp (original)
+++ branches/release/boost/asio/detail/impl/timer_queue_set.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/timer_queue_set.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/impl/win_event.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_event.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_event.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_event.ipp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_event.hpp>
@@ -47,6 +47,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_EVENT_IPP

Modified: branches/release/boost/asio/detail/impl/win_iocp_handle_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_handle_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_iocp_handle_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_iocp_handle_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -293,7 +293,7 @@
 }
 
 size_t win_iocp_handle_service::do_write(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::const_buffer& buffer, boost::system::error_code& ec)
 {
   if (!is_open(impl))
@@ -349,7 +349,7 @@
 }
 
 void win_iocp_handle_service::start_write_op(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::const_buffer& buffer, operation* op)
 {
   update_cancellation_thread_id(impl);
@@ -387,7 +387,7 @@
 }
 
 size_t win_iocp_handle_service::do_read(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::mutable_buffer& buffer, boost::system::error_code& ec)
 {
   if (!is_open(impl))
@@ -457,7 +457,7 @@
 }
 
 void win_iocp_handle_service::start_read_op(
- win_iocp_handle_service::implementation_type& impl, boost::uint64_t offset,
+ win_iocp_handle_service::implementation_type& impl, uint64_t offset,
     const boost::asio::mutable_buffer& buffer, operation* op)
 {
   update_cancellation_thread_id(impl);

Modified: branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp (original)
+++ branches/release/boost/asio/detail/impl/win_iocp_io_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_iocp_io_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,6 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/completion_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -31,7 +32,7 @@
 namespace detail {
 
 template <typename Handler>
-void win_iocp_io_service::dispatch(Handler handler)
+void win_iocp_io_service::dispatch(Handler& handler)
 {
   if (thread_call_stack::contains(this))
   {
@@ -42,31 +43,31 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "io_service", this, "dispatch"));
 
- post_immediate_completion(p.p);
+ post_immediate_completion(p.p, false);
     p.v = p.p = 0;
   }
 }
 
 template <typename Handler>
-void win_iocp_io_service::post(Handler handler)
+void win_iocp_io_service::post(Handler& handler)
 {
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
     boost_asio_handler_alloc_helpers::allocate(
       sizeof(op), handler), 0 };
   p.p = new (p.v) op(handler);
 
   BOOST_ASIO_HANDLER_CREATION((p.p, "io_service", this, "post"));
 
- post_immediate_completion(p.p);
+ post_immediate_completion(p.p, false);
   p.v = p.p = 0;
 }
 
@@ -92,7 +93,7 @@
   // If the service has been shut down we silently discard the timer.
   if (::InterlockedExchangeAdd(&shutdown_, 0) != 0)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, false);
     return;
   }
 

Modified: branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_iocp_io_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_iocp_io_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,11 +19,11 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_iocp_io_service.hpp>
 

Modified: branches/release/boost/asio/detail/impl/win_iocp_serial_port_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_serial_port_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_iocp_serial_port_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_iocp_serial_port_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/detail/impl/win_iocp_socket_service_base.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_iocp_socket_service_base.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_iocp_socket_service_base.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_iocp_socket_service_base.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -534,13 +534,13 @@
 
   if (is_open(impl))
   {
- r.start_op(op_type, impl.socket_, impl.reactor_data_, op, false);
+ r.start_op(op_type, impl.socket_, impl.reactor_data_, op, false, false);
     return;
   }
   else
     op->ec_ = boost::asio::error::bad_descriptor;
 
- iocp_service_.post_immediate_completion(op);
+ iocp_service_.post_immediate_completion(op, false);
 }
 
 void win_iocp_socket_service_base::start_connect_op(
@@ -561,13 +561,13 @@
       {
         op->ec_ = boost::system::error_code();
         r.start_op(reactor::connect_op, impl.socket_,
- impl.reactor_data_, op, false);
+ impl.reactor_data_, op, false, false);
         return;
       }
     }
   }
 
- r.post_immediate_completion(op);
+ r.post_immediate_completion(op, false);
 }
 
 void win_iocp_socket_service_base::close_for_destruction(

Modified: branches/release/boost/asio/detail/impl/win_mutex.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_mutex.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_mutex.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_mutex.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_mutex.hpp>
@@ -75,6 +75,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_MUTEX_IPP

Modified: branches/release/boost/asio/detail/impl/win_object_handle_service.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_object_handle_service.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_object_handle_service.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_object_handle_service.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/detail/impl/win_static_mutex.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_static_mutex.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_static_mutex.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_static_mutex.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <cstdio>
 #include <boost/asio/detail/throw_error.hpp>
@@ -42,11 +42,11 @@
 {
   using namespace std; // For sprintf.
   wchar_t mutex_name[128];
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
   swprintf_s(
-#else // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
   _snwprintf(
-#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
       mutex_name, 128, L"asio-58CCDC44-6264-4842-90C2-F3C545CB8AA7-%u-%p",
       static_cast<unsigned int>(::GetCurrentProcessId()), this);
 
@@ -115,6 +115,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_STATIC_MUTEX_IPP

Modified: branches/release/boost/asio/detail/impl/win_thread.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_thread.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_thread.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_thread.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <process.h>
 #include <boost/asio/detail/throw_error.hpp>
@@ -136,6 +136,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_THREAD_IPP

Modified: branches/release/boost/asio/detail/impl/win_tss_ptr.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/win_tss_ptr.ipp (original)
+++ branches/release/boost/asio/detail/impl/win_tss_ptr.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/win_tss_ptr.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/detail/win_tss_ptr.hpp>
@@ -54,6 +54,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WIN_TSS_PTR_IPP

Modified: branches/release/boost/asio/detail/impl/winsock_init.ipp
==============================================================================
--- branches/release/boost/asio/detail/impl/winsock_init.ipp (original)
+++ branches/release/boost/asio/detail/impl/winsock_init.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/impl/winsock_init.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/socket_types.hpp>
 #include <boost/asio/detail/winsock_init.hpp>
@@ -66,6 +66,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_WINSOCK_INIT_IPP

Modified: branches/release/boost/asio/detail/io_control.hpp
==============================================================================
--- branches/release/boost/asio/detail/io_control.hpp (original)
+++ branches/release/boost/asio/detail/io_control.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/io_control.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,6 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/config.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>

Modified: branches/release/boost/asio/detail/keyword_tss_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/keyword_tss_ptr.hpp (original)
+++ branches/release/boost/asio/detail/keyword_tss_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/keyword_tss_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/kqueue_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -20,12 +20,12 @@
 
 #if defined(BOOST_ASIO_HAS_KQUEUE)
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #include <boost/asio/detail/kqueue_reactor_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/object_pool.hpp>
 #include <boost/asio/detail/op_queue.hpp>
@@ -108,16 +108,16 @@
       per_descriptor_data& source_descriptor_data);
 
   // Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op)
+ void post_immediate_completion(reactor_op* op, bool is_continuation)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
   }
 
   // Start a new operation. The reactor operation will be performed when the
   // given descriptor is flagged as ready, or an error has occurred.
   BOOST_ASIO_DECL void start_op(int op_type, socket_type descriptor,
- per_descriptor_data& descriptor_data,
- reactor_op* op, bool allow_speculative);
+ per_descriptor_data& descriptor_data, reactor_op* op,
+ bool is_continuation, bool allow_speculative);
 
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/kqueue_reactor_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Added: branches/release/boost/asio/detail/limits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/limits.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,26 @@
+//
+// detail/limits.hpp
+// ~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_LIMITS_HPP
+#define BOOST_ASIO_DETAIL_LIMITS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# include <boost/limits.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+# include <limits>
+#endif // defined(BOOST_ASIO_HAS_BOOST_LIMITS)
+
+#endif // BOOST_ASIO_DETAIL_LIMITS_HPP

Modified: branches/release/boost/asio/detail/local_free_on_block_exit.hpp
==============================================================================
--- branches/release/boost/asio/detail/local_free_on_block_exit.hpp (original)
+++ branches/release/boost/asio/detail/local_free_on_block_exit.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/local_free_on_block_exit.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -54,6 +54,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_LOCAL_FREE_ON_BLOCK_EXIT_HPP

Modified: branches/release/boost/asio/detail/macos_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/macos_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/macos_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/macos_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/mutex.hpp (original)
+++ branches/release/boost/asio/detail/mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/mutex.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_mutex.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_mutex.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_mutex.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,11 +31,11 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_mutex mutex;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_mutex mutex;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_mutex mutex;
 #endif
 

Modified: branches/release/boost/asio/detail/noncopyable.hpp
==============================================================================
--- branches/release/boost/asio/detail/noncopyable.hpp (original)
+++ branches/release/boost/asio/detail/noncopyable.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/noncopyable.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/detail/workaround.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -25,10 +23,6 @@
 namespace asio {
 namespace detail {
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-// Redefine the noncopyable class for Borland C++ since that compiler does not
-// apply the empty base optimisation unless the base class contains a dummy
-// char data member.
 class noncopyable
 {
 protected:
@@ -37,11 +31,7 @@
 private:
   noncopyable(const noncopyable&);
   const noncopyable& operator=(const noncopyable&);
- char dummy_;
 };
-#else
-using boost::noncopyable;
-#endif
 
 } // namespace detail
 

Modified: branches/release/boost/asio/detail/null_event.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_event.hpp (original)
+++ branches/release/boost/asio/detail/null_event.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_event.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 
@@ -72,6 +72,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP

Modified: branches/release/boost/asio/detail/null_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/null_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/null_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_mutex.hpp (original)
+++ branches/release/boost/asio/detail/null_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -61,6 +61,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_MUTEX_HPP

Modified: branches/release/boost/asio/detail/null_signal_blocker.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_signal_blocker.hpp (original)
+++ branches/release/boost/asio/detail/null_signal_blocker.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_signal_blocker.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) \
- || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) \
+#if !defined(BOOST_ASIO_HAS_THREADS) \
+ || defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -62,9 +61,8 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS)
- // || defined(BOOST_ASIO_DISABLE_THREADS)
- // || defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
+ // || defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: branches/release/boost/asio/detail/null_static_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_static_mutex.hpp (original)
+++ branches/release/boost/asio/detail/null_static_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_static_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/scoped_lock.hpp>
 
@@ -57,6 +57,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_STATIC_MUTEX_HPP

Modified: branches/release/boost/asio/detail/null_thread.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_thread.hpp (original)
+++ branches/release/boost/asio/detail/null_thread.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_thread.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -58,6 +58,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_THREAD_HPP

Modified: branches/release/boost/asio/detail/null_tss_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/null_tss_ptr.hpp (original)
+++ branches/release/boost/asio/detail/null_tss_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/null_tss_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 
@@ -65,6 +65,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_ASIO_HAS_THREADS)
 
 #endif // BOOST_ASIO_DETAIL_NULL_TSS_PTR_HPP

Modified: branches/release/boost/asio/detail/object_pool.hpp
==============================================================================
--- branches/release/boost/asio/detail/object_pool.hpp (original)
+++ branches/release/boost/asio/detail/object_pool.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/object_pool.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/old_win_sdk_compat.hpp
==============================================================================
--- branches/release/boost/asio/detail/old_win_sdk_compat.hpp (original)
+++ branches/release/boost/asio/detail/old_win_sdk_compat.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/old_win_sdk_compat.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 // Guess whether we are building against on old Platform SDK.
 #if !defined(IN6ADDR_ANY_INIT)
@@ -211,6 +211,6 @@
 # define IPPROTO_ICMPV6 58
 #endif
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_OLD_WIN_SDK_COMPAT_HPP

Modified: branches/release/boost/asio/detail/op_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/op_queue.hpp (original)
+++ branches/release/boost/asio/detail/op_queue.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/op_queue.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/operation.hpp
==============================================================================
--- branches/release/boost/asio/detail/operation.hpp (original)
+++ branches/release/boost/asio/detail/operation.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/operation.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/pipe_select_interrupter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
 #if !defined(__CYGWIN__)
 #if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
@@ -84,6 +84,6 @@
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
 #endif // !defined(__SYMBIAN32__)
 #endif // !defined(__CYGWIN__)
-#endif // !defined(BOOST_WINDOWS)
+#endif // !defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP

Modified: branches/release/boost/asio/detail/pop_options.hpp
==============================================================================
--- branches/release/boost/asio/detail/pop_options.hpp (original)
+++ branches/release/boost/asio/detail/pop_options.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/pop_options.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/posix_event.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_event.hpp (original)
+++ branches/release/boost/asio/detail/posix_event.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_event.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,10 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
-#include <boost/assert.hpp>
 #include <pthread.h>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -46,7 +46,7 @@
   template <typename Lock>
   void signal(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     signalled_ = true;
     ::pthread_cond_signal(&cond_); // Ignore EINVAL.
@@ -56,7 +56,7 @@
   template <typename Lock>
   void signal_and_unlock(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     signalled_ = true;
     lock.unlock();
     ::pthread_cond_signal(&cond_); // Ignore EINVAL.
@@ -66,7 +66,7 @@
   template <typename Lock>
   void clear(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     signalled_ = false;
   }
@@ -75,7 +75,7 @@
   template <typename Lock>
   void wait(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     while (!signalled_)
       ::pthread_cond_wait(&cond_, &lock.mutex().mutex_); // Ignore EINVAL.
   }
@@ -95,6 +95,6 @@
 # include <boost/asio/detail/impl/posix_event.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_EVENT_HPP

Modified: branches/release/boost/asio/detail/posix_fd_set_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_fd_set_adapter.hpp (original)
+++ branches/release/boost/asio/detail/posix_fd_set_adapter.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_fd_set_adapter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <cstring>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -84,6 +84,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_FD_SET_ADAPTER_HPP

Modified: branches/release/boost/asio/detail/posix_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_mutex.hpp (original)
+++ branches/release/boost/asio/detail/posix_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -73,6 +73,6 @@
 # include <boost/asio/detail/impl/posix_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_MUTEX_HPP

Modified: branches/release/boost/asio/detail/posix_signal_blocker.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_signal_blocker.hpp (original)
+++ branches/release/boost/asio/detail/posix_signal_blocker.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_signal_blocker.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <csignal>
 #include <pthread.h>
@@ -82,6 +82,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP

Modified: branches/release/boost/asio/detail/posix_static_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_static_mutex.hpp (original)
+++ branches/release/boost/asio/detail/posix_static_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_static_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -61,6 +61,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_STATIC_MUTEX_HPP

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_thread.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -102,6 +102,6 @@
 # include <boost/asio/detail/impl/posix_thread.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_THREAD_HPP

Modified: branches/release/boost/asio/detail/posix_tss_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_tss_ptr.hpp (original)
+++ branches/release/boost/asio/detail/posix_tss_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/posix_tss_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#if defined(BOOST_ASIO_HAS_PTHREADS)
 
 #include <pthread.h>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -77,6 +77,6 @@
 # include <boost/asio/detail/impl/posix_tss_ptr.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_HAS_PTHREADS) && !defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // defined(BOOST_ASIO_HAS_PTHREADS)
 
 #endif // BOOST_ASIO_DETAIL_POSIX_TSS_PTR_HPP

Modified: branches/release/boost/asio/detail/push_options.hpp
==============================================================================
--- branches/release/boost/asio/detail/push_options.hpp (original)
+++ branches/release/boost/asio/detail/push_options.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/push_options.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_descriptor_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/descriptor_ops.hpp>
@@ -186,18 +186,21 @@
   // lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
   void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.descriptor_, buffers, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor", &impl, "async_write_some"));
 
- start_op(impl, reactor::write_op, p.p, true,
+ start_op(impl, reactor::write_op, p.p, is_continuation, true,
         buffer_sequence_adapter<boost::asio::const_buffer,
           ConstBufferSequence>::all_empty(buffers));
     p.v = p.p = 0;
@@ -206,11 +209,14 @@
   // Start an asynchronous wait until data can be written without blocking.
   template <typename Handler>
   void async_write_some(implementation_type& impl,
- const null_buffers&, Handler handler)
+ const null_buffers&, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -218,7 +224,7 @@
     BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor",
           &impl, "async_write_some(null_buffers)"));
 
- start_op(impl, reactor::write_op, p.p, false, false);
+ start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -248,18 +254,21 @@
   // valid for the lifetime of the asynchronous operation.
   template <typename MutableBufferSequence, typename Handler>
   void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.descriptor_, buffers, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor", &impl, "async_read_some"));
 
- start_op(impl, reactor::read_op, p.p, true,
+ start_op(impl, reactor::read_op, p.p, is_continuation, true,
         buffer_sequence_adapter<boost::asio::mutable_buffer,
           MutableBufferSequence>::all_empty(buffers));
     p.v = p.p = 0;
@@ -268,11 +277,14 @@
   // Wait until data can be read without blocking.
   template <typename Handler>
   void async_read_some(implementation_type& impl,
- const null_buffers&, Handler handler)
+ const null_buffers&, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -280,14 +292,14 @@
     BOOST_ASIO_HANDLER_CREATION((p.p, "descriptor",
           &impl, "async_read_some(null_buffers)"));
 
- start_op(impl, reactor::read_op, p.p, false, false);
+ start_op(impl, reactor::read_op, p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
 private:
   // Start the asynchronous operation.
   BOOST_ASIO_DECL void start_op(implementation_type& impl, int op_type,
- reactor_op* op, bool is_non_blocking, bool noop);
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop);
 
   // The selector that performs event demultiplexing for the service.
   reactor& reactor_;
@@ -303,6 +315,6 @@
 # include <boost/asio/detail/impl/reactive_descriptor_service.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP

Modified: branches/release/boost/asio/detail/reactive_null_buffers_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_null_buffers_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_null_buffers_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_null_buffers_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -52,7 +52,7 @@
   {
     // Take ownership of the handler object.
     reactive_null_buffers_op* o(static_cast<reactive_null_buffers_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -64,7 +64,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_serial_port_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_serial_port_service.hpp (original)
+++ branches/release/boost/asio/detail/reactive_serial_port_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_serial_port_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -19,7 +19,7 @@
 #include <boost/asio/detail/config.hpp>
 
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <string>
 #include <boost/asio/error.hpp>
@@ -158,7 +158,7 @@
   // lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
   void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
   {
     descriptor_service_.async_write_some(impl, buffers, handler);
   }
@@ -175,7 +175,7 @@
   // valid for the lifetime of the asynchronous operation.
   template <typename MutableBufferSequence, typename Handler>
   void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
   {
     descriptor_service_.async_read_some(impl, buffers, handler);
   }
@@ -230,7 +230,7 @@
 # include <boost/asio/detail/impl/reactive_serial_port_service.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 #endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #endif // BOOST_ASIO_DETAIL_REACTIVE_SERIAL_PORT_SERVICE_HPP

Modified: branches/release/boost/asio/detail/reactive_socket_accept_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_accept_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_accept_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_accept_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -100,7 +100,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_accept_op* o(static_cast<reactive_socket_accept_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -112,7 +112,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, o->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_connect_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_connect_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_connect_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_connect_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -29,12 +29,15 @@
 namespace asio {
 namespace detail {
 
+template <typename Protocol>
 class reactive_socket_connect_op_base : public reactor_op
 {
 public:
- reactive_socket_connect_op_base(socket_type socket, func_type complete_func)
+ reactive_socket_connect_op_base(socket_type socket,
+ const typename Protocol::endpoint& peer_endpoint, func_type complete_func)
     : reactor_op(&reactive_socket_connect_op_base::do_perform, complete_func),
- socket_(socket)
+ socket_(socket),
+ peer_endpoint_(peer_endpoint)
   {
   }
 
@@ -43,21 +46,25 @@
     reactive_socket_connect_op_base* o(
         static_cast<reactive_socket_connect_op_base*>(base));
 
- return socket_ops::non_blocking_connect(o->socket_, o->ec_);
+ return socket_ops::non_blocking_connect(o->socket_,
+ o->peer_endpoint_.data(), o->peer_endpoint_.size(), o->ec_);
   }
 
 private:
   socket_type socket_;
+ typename Protocol::endpoint peer_endpoint_;
 };
 
-template <typename Handler>
-class reactive_socket_connect_op : public reactive_socket_connect_op_base
+template <typename Protocol, typename Handler>
+class reactive_socket_connect_op :
+ public reactive_socket_connect_op_base<Protocol>
 {
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_connect_op);
 
- reactive_socket_connect_op(socket_type socket, Handler& handler)
- : reactive_socket_connect_op_base(socket,
+ reactive_socket_connect_op(socket_type socket,
+ const typename Protocol::endpoint& peer_endpoint, Handler& handler)
+ : reactive_socket_connect_op_base<Protocol>(socket, peer_endpoint,
         &reactive_socket_connect_op::do_complete),
       handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
@@ -70,7 +77,7 @@
     // Take ownership of the handler object.
     reactive_socket_connect_op* o
       (static_cast<reactive_socket_connect_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -82,7 +89,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, o->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_recv_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_recv_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_recv_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_recv_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -87,7 +87,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_recv_op* o(static_cast<reactive_socket_recv_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -99,7 +99,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_recvfrom_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_recvfrom_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_recvfrom_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_recvfrom_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -97,7 +97,7 @@
     // Take ownership of the handler object.
     reactive_socket_recvfrom_op* o(
         static_cast<reactive_socket_recvfrom_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -109,7 +109,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_recvmsg_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_recvmsg_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_recvmsg_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_recvmsg_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -89,7 +89,7 @@
     // Take ownership of the handler object.
     reactive_socket_recvmsg_op* o(
         static_cast<reactive_socket_recvmsg_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -101,7 +101,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_send_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_send_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_send_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_send_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -84,7 +84,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_send_op* o(static_cast<reactive_socket_send_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -96,7 +96,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/reactive_socket_sendto_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_sendto_op.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_sendto_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_sendto_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -87,7 +87,7 @@
   {
     // Take ownership of the handler object.
     reactive_socket_sendto_op* o(static_cast<reactive_socket_sendto_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -99,7 +99,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, o->ec_, o->bytes_transferred_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,11 +19,11 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/reactive_null_buffers_op.hpp>
@@ -99,6 +99,18 @@
     other_impl.protocol_ = endpoint_type().protocol();
   }
 
+ // Move-construct a new socket implementation from another protocol type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename reactive_socket_service<
+ Protocol1>::implementation_type& other_impl)
+ {
+ this->base_move_construct(impl, other_impl);
+
+ impl.protocol_ = protocol_type(other_impl.protocol_);
+ other_impl.protocol_ = typename Protocol1::endpoint().protocol();
+ }
+
   // Open a new socket implementation.
   boost::system::error_code open(implementation_type& impl,
       const protocol_type& protocol, boost::system::error_code& ec)
@@ -215,30 +227,36 @@
   void async_send_to(implementation_type& impl,
       const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
- Handler handler)
+ Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_sendto_op<ConstBufferSequence,
         endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, destination, flags, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_send_to"));
 
- start_op(impl, reactor::write_op, p.p, true, false);
+ start_op(impl, reactor::write_op, p.p, is_continuation, true, false);
     p.v = p.p = 0;
   }
 
   // Start an asynchronous wait until data can be sent without blocking.
   template <typename Handler>
   void async_send_to(implementation_type& impl, const null_buffers&,
- const endpoint_type&, socket_base::message_flags, Handler handler)
+ const endpoint_type&, socket_base::message_flags, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -246,7 +264,7 @@
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket",
           &impl, "async_send_to(null_buffers)"));
 
- start_op(impl, reactor::write_op, p.p, false, false);
+ start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -292,12 +310,15 @@
   template <typename MutableBufferSequence, typename Handler>
   void async_receive_from(implementation_type& impl,
       const MutableBufferSequence& buffers, endpoint_type& sender_endpoint,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recvfrom_op<MutableBufferSequence,
         endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     int protocol = impl.protocol_.type();
@@ -310,7 +331,7 @@
     start_op(impl,
         (flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, true, false);
+ p.p, is_continuation, true, false);
     p.v = p.p = 0;
   }
 
@@ -318,11 +339,14 @@
   template <typename Handler>
   void async_receive_from(implementation_type& impl,
       const null_buffers&, endpoint_type& sender_endpoint,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -336,7 +360,7 @@
     start_op(impl,
         (flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, false, false);
+ p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -373,11 +397,14 @@
   // must be valid until the accept's handler is invoked.
   template <typename Socket, typename Handler>
   void async_accept(implementation_type& impl, Socket& peer,
- endpoint_type* peer_endpoint, Handler handler)
+ endpoint_type* peer_endpoint, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_accept_op<Socket, Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, impl.state_, peer,
@@ -385,7 +412,7 @@
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_accept"));
 
- start_accept_op(impl, p.p, peer.is_open());
+ start_accept_op(impl, p.p, is_continuation, peer.is_open());
     p.v = p.p = 0;
   }
 
@@ -401,18 +428,22 @@
   // Start an asynchronous connect.
   template <typename Handler>
   void async_connect(implementation_type& impl,
- const endpoint_type& peer_endpoint, Handler handler)
+ const endpoint_type& peer_endpoint, Handler& handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
- typedef reactive_socket_connect_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typedef reactive_socket_connect_op<Protocol, Handler> op;
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
- p.p = new (p.v) op(impl.socket_, handler);
+ p.p = new (p.v) op(impl.socket_, peer_endpoint, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_connect"));
 
- start_connect_op(impl, p.p, peer_endpoint.data(), peer_endpoint.size());
+ start_connect_op(impl, p.p, is_continuation,
+ peer_endpoint.data(), peer_endpoint.size());
     p.v = p.p = 0;
   }
 };

Modified: branches/release/boost/asio/detail/reactive_socket_service_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactive_socket_service_base.hpp (original)
+++ branches/release/boost/asio/detail/reactive_socket_service_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactive_socket_service_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,11 +19,11 @@
 
 #if !defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/reactive_null_buffers_op.hpp>
 #include <boost/asio/detail/reactive_socket_recv_op.hpp>
@@ -200,16 +200,19 @@
       const ConstBufferSequence& buffers,
       socket_base::message_flags flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, flags, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_send"));
 
- start_op(impl, reactor::write_op, p.p, true,
+ start_op(impl, reactor::write_op, p.p, is_continuation, true,
         ((impl.state_ & socket_ops::stream_oriented)
           && buffer_sequence_adapter<boost::asio::const_buffer,
             ConstBufferSequence>::all_empty(buffers)));
@@ -221,9 +224,12 @@
   void async_send(base_implementation_type& impl, const null_buffers&,
       socket_base::message_flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -231,7 +237,7 @@
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket",
           &impl, "async_send(null_buffers)"));
 
- start_op(impl, reactor::write_op, p.p, false, false);
+ start_op(impl, reactor::write_op, p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -265,9 +271,12 @@
       const MutableBufferSequence& buffers,
       socket_base::message_flags flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recv_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, impl.state_, buffers, flags, handler);
@@ -277,7 +286,8 @@
     start_op(impl,
         (flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, (flags & socket_base::message_out_of_band) == 0,
+ p.p, is_continuation,
+ (flags & socket_base::message_out_of_band) == 0,
         ((impl.state_ & socket_ops::stream_oriented)
           && buffer_sequence_adapter<boost::asio::mutable_buffer,
             MutableBufferSequence>::all_empty(buffers)));
@@ -289,9 +299,12 @@
   void async_receive(base_implementation_type& impl, const null_buffers&,
       socket_base::message_flags flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -302,7 +315,7 @@
     start_op(impl,
         (flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, false, false);
+ p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -343,9 +356,12 @@
       const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
       socket_base::message_flags& out_flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recvmsg_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.socket_, buffers, in_flags, out_flags, handler);
@@ -356,7 +372,8 @@
     start_op(impl,
         (in_flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, (in_flags & socket_base::message_out_of_band) == 0, false);
+ p.p, is_continuation,
+ (in_flags & socket_base::message_out_of_band) == 0, false);
     p.v = p.p = 0;
   }
 
@@ -366,9 +383,12 @@
       const null_buffers&, socket_base::message_flags in_flags,
       socket_base::message_flags& out_flags, Handler handler)
   {
+ bool is_continuation =
+ boost_asio_handler_cont_helpers::is_continuation(handler);
+
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -383,7 +403,7 @@
     start_op(impl,
         (in_flags & socket_base::message_out_of_band)
           ? reactor::except_op : reactor::read_op,
- p.p, false, false);
+ p.p, is_continuation, false, false);
     p.v = p.p = 0;
   }
 
@@ -400,15 +420,16 @@
 
   // Start the asynchronous read or write operation.
   BOOST_ASIO_DECL void start_op(base_implementation_type& impl, int op_type,
- reactor_op* op, bool is_non_blocking, bool noop);
+ reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop);
 
   // Start the asynchronous accept operation.
   BOOST_ASIO_DECL void start_accept_op(base_implementation_type& impl,
- reactor_op* op, bool peer_is_open);
+ reactor_op* op, bool is_continuation, bool peer_is_open);
 
   // Start the asynchronous connect operation.
   BOOST_ASIO_DECL void start_connect_op(base_implementation_type& impl,
- reactor_op* op, const socket_addr_type* addr, size_t addrlen);
+ reactor_op* op, bool is_continuation,
+ const socket_addr_type* addr, size_t addrlen);
 
   // The selector that performs event demultiplexing for the service.
   reactor& reactor_;

Modified: branches/release/boost/asio/detail/reactor.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactor.hpp (original)
+++ branches/release/boost/asio/detail/reactor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactor.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/reactor_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactor_fwd.hpp (original)
+++ branches/release/boost/asio/detail/reactor_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactor_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/reactor_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactor_op.hpp (original)
+++ branches/release/boost/asio/detail/reactor_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactor_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/reactor_op_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactor_op_queue.hpp (original)
+++ branches/release/boost/asio/detail/reactor_op_queue.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/reactor_op_queue.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/regex_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/regex_fwd.hpp (original)
+++ branches/release/boost/asio/detail/regex_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/regex_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,6 +15,8 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 #include <boost/regex_fwd.hpp>
 #include <boost/regex/v4/match_flags.hpp>
 
@@ -28,4 +30,6 @@
 
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 #endif // BOOST_ASIO_DETAIL_REGEX_FWD_HPP

Modified: branches/release/boost/asio/detail/resolve_endpoint_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/resolve_endpoint_op.hpp (original)
+++ branches/release/boost/asio/detail/resolve_endpoint_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/resolve_endpoint_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,10 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -58,7 +58,7 @@
   {
     // Take ownership of the operation object.
     resolve_endpoint_op* o(static_cast<resolve_endpoint_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner && owner != &o->io_service_impl_)
     {
@@ -92,7 +92,7 @@
       // after we have deallocated the memory here.
       detail::binder2<Handler, boost::system::error_code, iterator_type>
         handler(o->handler_, o->ec_, o->iter_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
       p.reset();
 
       if (owner)

Modified: branches/release/boost/asio/detail/resolve_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/resolve_op.hpp (original)
+++ branches/release/boost/asio/detail/resolve_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/resolve_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,11 +16,11 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
 #include <boost/asio/ip/basic_resolver_query.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -66,7 +66,7 @@
   {
     // Take ownership of the operation object.
     resolve_op* o(static_cast<resolve_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner && owner != &o->io_service_impl_)
     {
@@ -97,7 +97,7 @@
       // after we have deallocated the memory here.
       detail::binder2<Handler, boost::system::error_code, iterator_type>
         handler(o->handler_, o->ec_, iterator_type());
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
       if (o->addrinfo_)
       {
         handler.arg2_ = iterator_type::create(o->addrinfo_,

Modified: branches/release/boost/asio/detail/resolver_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/resolver_service.hpp (original)
+++ branches/release/boost/asio/detail/resolver_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/resolver_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
 #include <boost/asio/ip/basic_resolver_query.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/resolve_endpoint_op.hpp>
 #include <boost/asio/detail/resolve_op.hpp>
 #include <boost/asio/detail/resolver_service_base.hpp>
@@ -68,11 +69,11 @@
   // Asynchronously resolve a query to a list of entries.
   template <typename Handler>
   void async_resolve(implementation_type& impl,
- const query_type& query, Handler handler)
+ const query_type& query, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_op<Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl, query, io_service_impl_, handler);
@@ -100,11 +101,11 @@
   // Asynchronously resolve an endpoint to a list of entries.
   template <typename Handler>
   void async_resolve(implementation_type& impl,
- const endpoint_type& endpoint, Handler handler)
+ const endpoint_type& endpoint, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_endpoint_op<Protocol, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl, endpoint, io_service_impl_, handler);

Modified: branches/release/boost/asio/detail/resolver_service_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/resolver_service_base.hpp (original)
+++ branches/release/boost/asio/detail/resolver_service_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/resolver_service_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/scoped_lock.hpp
==============================================================================
--- branches/release/boost/asio/detail/scoped_lock.hpp (original)
+++ branches/release/boost/asio/detail/scoped_lock.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/scoped_lock.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/scoped_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/scoped_ptr.hpp (original)
+++ branches/release/boost/asio/detail/scoped_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/scoped_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/select_interrupter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/socket_select_interrupter.hpp>
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 # include <boost/asio/detail/eventfd_select_interrupter.hpp>
@@ -29,7 +29,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef socket_select_interrupter select_interrupter;
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 typedef eventfd_select_interrupter select_interrupter;

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/select_reactor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,9 +22,9 @@
       && !defined(BOOST_ASIO_HAS_EPOLL) \
       && !defined(BOOST_ASIO_HAS_KQUEUE))
 
-#include <boost/limits.hpp>
 #include <cstddef>
 #include <boost/asio/detail/fd_set_adapter.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/reactor_op.hpp>
@@ -52,13 +52,13 @@
   : public boost::asio::detail::service_base<select_reactor>
 {
 public:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   enum op_types { read_op = 0, write_op = 1, except_op = 2,
     max_select_ops = 3, connect_op = 3, max_ops = 4 };
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   enum op_types { read_op = 0, write_op = 1, except_op = 2,
     max_select_ops = 3, connect_op = 1, max_ops = 3 };
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
   // Per-descriptor data.
   struct per_descriptor_data
@@ -92,15 +92,15 @@
       per_descriptor_data& descriptor_data, reactor_op* op);
 
   // Post a reactor operation for immediate completion.
- void post_immediate_completion(reactor_op* op)
+ void post_immediate_completion(reactor_op* op, bool is_continuation)
   {
- io_service_.post_immediate_completion(op);
+ io_service_.post_immediate_completion(op, is_continuation);
   }
 
   // Start a new operation. The reactor operation will be performed when the
   // given descriptor is flagged as ready, or an error has occurred.
   BOOST_ASIO_DECL void start_op(int op_type, socket_type descriptor,
- per_descriptor_data&, reactor_op* op, bool);
+ per_descriptor_data&, reactor_op* op, bool is_continuation, bool);
 
   // Cancel all operations associated with the given descriptor. The
   // handlers associated with the descriptor will be invoked with the

Modified: branches/release/boost/asio/detail/select_reactor_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/select_reactor_fwd.hpp (original)
+++ branches/release/boost/asio/detail/select_reactor_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/select_reactor_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/service_registry.hpp
==============================================================================
--- branches/release/boost/asio/detail/service_registry.hpp (original)
+++ branches/release/boost/asio/detail/service_registry.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/service_registry.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,12 +21,6 @@
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/io_service.hpp>
 
-#if defined(BOOST_NO_TYPEID)
-# if !defined(BOOST_ASIO_NO_TYPEID)
-# define BOOST_ASIO_NO_TYPEID
-# endif // !defined(BOOST_ASIO_NO_TYPEID)
-#endif // defined(BOOST_NO_TYPEID)
-
 #include <boost/asio/detail/push_options.hpp>
 
 namespace boost {

Modified: branches/release/boost/asio/detail/service_registry_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/service_registry_fwd.hpp (original)
+++ branches/release/boost/asio/detail/service_registry_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/service_registry_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/shared_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/shared_ptr.hpp (original)
+++ branches/release/boost/asio/detail/shared_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/shared_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/signal_blocker.hpp
==============================================================================
--- branches/release/boost/asio/detail/signal_blocker.hpp (original)
+++ branches/release/boost/asio/detail/signal_blocker.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/signal_blocker.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,10 +17,10 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
+ || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/null_signal_blocker.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_signal_blocker.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -30,10 +30,10 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
- || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
+#if !defined(BOOST_ASIO_HAS_THREADS) || defined(BOOST_ASIO_WINDOWS) \
+ || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef null_signal_blocker signal_blocker;
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_signal_blocker signal_blocker;
 #endif
 

Modified: branches/release/boost/asio/detail/signal_handler.hpp
==============================================================================
--- branches/release/boost/asio/detail/signal_handler.hpp (original)
+++ branches/release/boost/asio/detail/signal_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/signal_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -45,7 +46,7 @@
   {
     // Take ownership of the handler object.
     signal_handler* h(static_cast<signal_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -57,7 +58,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, int>
       handler(h->handler_, h->ec_, h->signal_number_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/signal_init.hpp
==============================================================================
--- branches/release/boost/asio/detail/signal_init.hpp (original)
+++ branches/release/boost/asio/detail/signal_init.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/signal_init.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <csignal>
 
@@ -44,6 +44,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_SIGNAL_INIT_HPP

Modified: branches/release/boost/asio/detail/signal_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/signal_op.hpp (original)
+++ branches/release/boost/asio/detail/signal_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/signal_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/signal_set_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/signal_set_service.hpp (original)
+++ branches/release/boost/asio/detail/signal_set_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/signal_set_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,15 +21,16 @@
 #include <signal.h>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/signal_handler.hpp>
 #include <boost/asio/detail/signal_op.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 # include <boost/asio/detail/reactor.hpp>
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -144,11 +145,11 @@
 
   // Start an asynchronous operation to wait for a signal to be delivered.
   template <typename Handler>
- void async_wait(implementation_type& impl, Handler handler)
+ void async_wait(implementation_type& impl, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef signal_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);
@@ -181,7 +182,7 @@
   // The io_service instance used for dispatching handlers.
   io_service_impl& io_service_;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // The type used for registering for pipe reactor notifications.
   class pipe_read_op;
 
@@ -190,7 +191,7 @@
 
   // The per-descriptor reactor data used for the pipe.
   reactor::per_descriptor_data reactor_data_;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
   // A mapping from signal number to the registered signal sets.
   registration* registrations_[max_signal_number];

Modified: branches/release/boost/asio/detail/socket_holder.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_holder.hpp (original)
+++ branches/release/boost/asio/detail/socket_holder.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_holder.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_ops.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -106,8 +106,9 @@
 BOOST_ASIO_DECL void sync_connect(socket_type s, const socket_addr_type* addr,
     std::size_t addrlen, boost::system::error_code& ec);
 
-BOOST_ASIO_DECL bool non_blocking_connect(
- socket_type s, boost::system::error_code& ec);
+BOOST_ASIO_DECL bool non_blocking_connect(socket_type s,
+ const socket_addr_type* addr, std::size_t addrlen,
+ boost::system::error_code& ec);
 
 BOOST_ASIO_DECL int socketpair(int af, int type, int protocol,
     socket_type sv[2], boost::system::error_code& ec);
@@ -119,11 +120,11 @@
 BOOST_ASIO_DECL int listen(socket_type s,
     int backlog, boost::system::error_code& ec);
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef WSABUF buf;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef iovec buf;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 BOOST_ASIO_DECL void init_buf(buf& b, void* data, size_t size);
 

Modified: branches/release/boost/asio/detail/socket_option.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_option.hpp (original)
+++ branches/release/boost/asio/detail/socket_option.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_option.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <stdexcept>
-#include <boost/config.hpp>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -123,7 +122,7 @@
     default:
       {
         std::length_error ex("boolean socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
     }
   }
@@ -204,7 +203,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("integer socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 
@@ -228,7 +227,7 @@
   linger(bool e, int t)
   {
     enabled(e);
- timeout BOOST_PREVENT_MACRO_SUBSTITUTION(t);
+ timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION(t);
   }
 
   // Set the value for whether linger is enabled.
@@ -244,7 +243,7 @@
   }
 
   // Set the value for the linger timeout.
- void timeout BOOST_PREVENT_MACRO_SUBSTITUTION(int value)
+ void timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION(int value)
   {
 #if defined(WIN32)
     value_.l_linger = static_cast<u_short>(value);
@@ -254,7 +253,7 @@
   }
 
   // Get the value for the linger timeout.
- int timeout BOOST_PREVENT_MACRO_SUBSTITUTION() const
+ int timeout BOOST_ASIO_PREVENT_MACRO_SUBSTITUTION() const
   {
     return static_cast<int>(value_.l_linger);
   }
@@ -301,7 +300,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("linger socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_select_interrupter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) \
+#if defined(BOOST_ASIO_WINDOWS) \
   || defined(__CYGWIN__) \
   || defined(__SYMBIAN32__)
 
@@ -82,7 +82,7 @@
 # include <boost/asio/detail/impl/socket_select_interrupter.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
        // || defined(__CYGWIN__)
        // || defined(__SYMBIAN32__)
 

Modified: branches/release/boost/asio/detail/socket_types.hpp
==============================================================================
--- branches/release/boost/asio/detail/socket_types.hpp (original)
+++ branches/release/boost/asio/detail/socket_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_types.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # if defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
 # error WinSock.h has already been included
 # endif // defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
@@ -81,7 +81,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 typedef SOCKET socket_type;
 const SOCKET invalid_socket = INVALID_SOCKET;
 const int socket_error_retval = SOCKET_ERROR;

Modified: branches/release/boost/asio/detail/solaris_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/solaris_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/solaris_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/solaris_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/static_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/static_mutex.hpp (original)
+++ branches/release/boost/asio/detail/static_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/static_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,11 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_static_mutex.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_static_mutex.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_static_mutex.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -31,13 +31,13 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_NULL_STATIC_MUTEX_INIT
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 typedef win_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_WIN_STATIC_MUTEX_INIT
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_static_mutex static_mutex;
 # define BOOST_ASIO_STATIC_MUTEX_INIT BOOST_ASIO_POSIX_STATIC_MUTEX_INIT
 #endif

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/strand_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -86,11 +86,15 @@
 
   // Request the io_service to invoke the given handler.
   template <typename Handler>
- void dispatch(implementation_type& impl, Handler handler);
+ void dispatch(implementation_type& impl, Handler& handler);
 
   // Request the io_service to invoke the given handler and return immediately.
   template <typename Handler>
- void post(implementation_type& impl, Handler handler);
+ void post(implementation_type& impl, Handler& handler);
+
+ // Determine whether the strand is running in the current thread.
+ BOOST_ASIO_DECL bool running_in_this_thread(
+ const implementation_type& impl) const;
 
 private:
   // Helper function to dispatch a handler. Returns true if the handler should
@@ -98,7 +102,8 @@
   BOOST_ASIO_DECL bool do_dispatch(implementation_type& impl, operation* op);
 
   // Helper fiunction to post a handler.
- BOOST_ASIO_DECL void do_post(implementation_type& impl, operation* op);
+ BOOST_ASIO_DECL void do_post(implementation_type& impl,
+ operation* op, bool is_continuation);
 
   BOOST_ASIO_DECL static void do_complete(io_service_impl* owner,
       operation* base, const boost::system::error_code& ec,

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/task_io_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -94,15 +94,16 @@
 
   // Request invocation of the given handler.
   template <typename Handler>
- void dispatch(Handler handler);
+ void dispatch(Handler& handler);
 
   // Request invocation of the given handler and return immediately.
   template <typename Handler>
- void post(Handler handler);
+ void post(Handler& handler);
 
   // Request invocation of the given operation and return immediately. Assumes
   // that work_started() has not yet been called for the operation.
- BOOST_ASIO_DECL void post_immediate_completion(operation* op);
+ BOOST_ASIO_DECL void post_immediate_completion(
+ operation* op, bool is_continuation);
 
   // Request invocation of the given operation and return immediately. Assumes
   // that work_started() was previously called for the operation.
@@ -112,16 +113,6 @@
   // that work_started() was previously called for each operation.
   BOOST_ASIO_DECL void post_deferred_completions(op_queue<operation>& ops);
 
- // Request invocation of the given operation, preferring the thread-private
- // queue if available, and return immediately. Assumes that work_started()
- // has not yet been called for the operation.
- BOOST_ASIO_DECL void post_private_immediate_completion(operation* op);
-
- // Request invocation of the given operation, preferring the thread-private
- // queue if available, and return immediately. Assumes that work_started()
- // was previously called for the operation.
- BOOST_ASIO_DECL void post_private_deferred_completion(operation* op);
-
   // Process unfinished operations as part of a shutdown_service operation.
   // Assumes that work_started() was previously called for the operations.
   BOOST_ASIO_DECL void abandon_operations(op_queue<operation>& ops);
@@ -130,15 +121,9 @@
   // Structure containing information about an idle thread.
   typedef task_io_service_thread_info thread_info;
 
- // Request invocation of the given operation, avoiding the thread-private
- // queue, and return immediately. Assumes that work_started() has not yet
- // been called for the operation.
- BOOST_ASIO_DECL void post_non_private_immediate_completion(operation* op);
-
- // Request invocation of the given operation, avoiding the thread-private
- // queue, and return immediately. Assumes that work_started() was previously
- // called for the operation.
- BOOST_ASIO_DECL void post_non_private_deferred_completion(operation* op);
+ // Enqueue the given operation following a failed attempt to dispatch the
+ // operation for immediate invocation.
+ BOOST_ASIO_DECL void do_dispatch(operation* op);
 
   // Run at most one operation. May block.
   BOOST_ASIO_DECL std::size_t do_run_one(mutex::scoped_lock& lock,

Modified: branches/release/boost/asio/detail/task_io_service_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service_fwd.hpp (original)
+++ branches/release/boost/asio/detail/task_io_service_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/task_io_service_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/task_io_service_operation.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service_operation.hpp (original)
+++ branches/release/boost/asio/detail/task_io_service_operation.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/task_io_service_operation.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/task_io_service_thread_info.hpp
==============================================================================
--- branches/release/boost/asio/detail/task_io_service_thread_info.hpp (original)
+++ branches/release/boost/asio/detail/task_io_service_thread_info.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/task_io_service_thread_info.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/thread.hpp
==============================================================================
--- branches/release/boost/asio/detail/thread.hpp (original)
+++ branches/release/boost/asio/detail/thread.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/thread.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,15 +17,15 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_thread.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # if defined(UNDER_CE)
 # include <boost/asio/detail/wince_thread.hpp>
 # else
 # include <boost/asio/detail/win_thread.hpp>
 # endif
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_thread.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -35,15 +35,15 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 typedef null_thread thread;
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # if defined(UNDER_CE)
 typedef wince_thread thread;
 # else
 typedef win_thread thread;
 # endif
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 typedef posix_thread thread;
 #endif
 

Modified: branches/release/boost/asio/detail/thread_info_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/thread_info_base.hpp (original)
+++ branches/release/boost/asio/detail/thread_info_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/thread_info_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/throw_error.hpp
==============================================================================
--- branches/release/boost/asio/detail/throw_error.hpp (original)
+++ branches/release/boost/asio/detail/throw_error.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/throw_error.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/boost/asio/detail/throw_exception.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/throw_exception.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,53 @@
+//
+// detail/throw_exception.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
+#define BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+# include <boost/throw_exception.hpp>
+#endif // defined(BOOST_ASIO_BOOST_THROW_EXCEPTION)
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+#if defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+using boost::throw_exception;
+#else // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+// Declare the throw_exception function for all targets.
+template <typename Exception>
+void throw_exception(const Exception& e);
+
+// Only define the throw_exception function when exceptions are enabled.
+// Otherwise, it is up to the application to provide a definition of this
+// function.
+# if !defined(BOOST_ASIO_NO_EXCEPTIONS)
+template <typename Exception>
+void throw_exception(const Exception& e)
+{
+ throw e;
+}
+# endif // !defined(BOOST_ASIO_NO_EXCEPTIONS)
+
+#endif // defined(BOOST_ASIO_HAS_BOOST_THROW_EXCEPTION)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_THROW_EXCEPTION_HPP

Modified: branches/release/boost/asio/detail/timer_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_queue.hpp (original)
+++ branches/release/boost/asio/detail/timer_queue.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_queue.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,10 +18,9 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <vector>
-#include <boost/config.hpp>
-#include <boost/limits.hpp>
-#include <boost/cstdint.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/date_time_fwd.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/timer_queue_base.hpp>
 #include <boost/asio/detail/wait_op.hpp>
@@ -288,7 +287,7 @@
   {
     if (d.ticks() <= 0)
       return 0;
- boost::int64_t msec = d.total_milliseconds();
+ int64_t msec = d.total_milliseconds();
     if (msec == 0)
       return 1;
     if (msec > max_duration)
@@ -302,7 +301,7 @@
   {
     if (d.ticks() <= 0)
       return 0;
- boost::int64_t usec = d.total_microseconds();
+ int64_t usec = d.total_microseconds();
     if (usec == 0)
       return 1;
     if (usec > max_duration)

Modified: branches/release/boost/asio/detail/timer_queue_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_queue_base.hpp (original)
+++ branches/release/boost/asio/detail/timer_queue_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_queue_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/timer_queue_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_queue_fwd.hpp (original)
+++ branches/release/boost/asio/detail/timer_queue_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_queue_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/timer_queue_ptime.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_queue_ptime.hpp (original)
+++ branches/release/boost/asio/detail/timer_queue_ptime.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_queue_ptime.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,6 +20,8 @@
 
 #include <boost/asio/detail/push_options.hpp>
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -82,6 +84,8 @@
 } // namespace asio
 } // namespace boost
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/asio/detail/pop_options.hpp>
 
 #if defined(BOOST_ASIO_HEADER_ONLY)

Modified: branches/release/boost/asio/detail/timer_queue_set.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_queue_set.hpp (original)
+++ branches/release/boost/asio/detail/timer_queue_set.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_queue_set.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/timer_scheduler.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_scheduler.hpp (original)
+++ branches/release/boost/asio/detail/timer_scheduler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_scheduler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/timer_scheduler_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/timer_scheduler_fwd.hpp (original)
+++ branches/release/boost/asio/detail/timer_scheduler_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/timer_scheduler_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/tss_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/tss_ptr.hpp (original)
+++ branches/release/boost/asio/detail/tss_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/tss_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,13 +17,13 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
 # include <boost/asio/detail/null_tss_ptr.hpp>
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
 # include <boost/asio/detail/keyword_tss_ptr.hpp>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
 # include <boost/asio/detail/win_tss_ptr.hpp>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
 # include <boost/asio/detail/posix_tss_ptr.hpp>
 #else
 # error Only Windows and POSIX are supported!
@@ -37,26 +37,26 @@
 
 template <typename T>
 class tss_ptr
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
   : public null_tss_ptr<T>
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
   : public keyword_tss_ptr<T>
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
   : public win_tss_ptr<T>
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
   : public posix_tss_ptr<T>
 #endif
 {
 public:
   void operator=(T* value)
   {
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_ASIO_HAS_THREADS)
     null_tss_ptr<T>::operator=(value);
 #elif defined(BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION)
     keyword_tss_ptr<T>::operator=(value);
-#elif defined(BOOST_WINDOWS)
+#elif defined(BOOST_ASIO_WINDOWS)
     win_tss_ptr<T>::operator=(value);
-#elif defined(BOOST_HAS_PTHREADS)
+#elif defined(BOOST_ASIO_HAS_PTHREADS)
     posix_tss_ptr<T>::operator=(value);
 #endif
   }

Added: branches/release/boost/asio/detail/type_traits.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/detail/type_traits.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,60 @@
+//
+// detail/type_traits.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP
+#define BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+# include <type_traits>
+#else // defined(BOOST_ASIO_HAS_TYPE_TRAITS)
+# include <boost/type_traits/add_const.hpp>
+# include <boost/type_traits/is_const.hpp>
+# include <boost/type_traits/is_convertible.hpp>
+# include <boost/type_traits/is_function.hpp>
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/remove_pointer.hpp>
+# include <boost/type_traits/remove_reference.hpp>
+# include <boost/utility/enable_if.hpp>
+#endif // defined(BOOST_ASIO_HAS_TYPE_TRAITS)
+
+namespace boost {
+namespace asio {
+
+#if defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+using std::add_const;
+using std::enable_if;
+using std::is_const;
+using std::is_convertible;
+using std::is_function;
+using std::is_same;
+using std::remove_pointer;
+using std::remove_reference;
+#else // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+using boost::add_const;
+template <bool Condition, typename Type = void>
+struct enable_if : boost::enable_if_c<Condition, Type> {};
+using boost::is_const;
+using boost::is_convertible;
+using boost::is_function;
+using boost::is_same;
+using boost::remove_pointer;
+using boost::remove_reference;
+#endif // defined(BOOST_ASIO_HAS_STD_TYPE_TRAITS)
+
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_TYPE_TRAITS_HPP

Modified: branches/release/boost/asio/detail/wait_handler.hpp
==============================================================================
--- branches/release/boost/asio/detail/wait_handler.hpp (original)
+++ branches/release/boost/asio/detail/wait_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/wait_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
@@ -46,7 +47,7 @@
   {
     // Take ownership of the handler object.
     wait_handler* h(static_cast<wait_handler*>(base));
- ptr p = { boost::addressof(h->handler_), h, h };
+ ptr p = { boost::asio::detail::addressof(h->handler_), h, h };
 
     BOOST_ASIO_HANDLER_COMPLETION((h));
 
@@ -58,7 +59,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(h->handler_, h->ec_);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/wait_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/wait_op.hpp (original)
+++ branches/release/boost/asio/detail/wait_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/wait_op.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/weak_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/weak_ptr.hpp (original)
+++ branches/release/boost/asio/detail/weak_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/weak_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/win_event.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_event.hpp (original)
+++ branches/release/boost/asio/detail/win_event.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_event.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
@@ -46,7 +46,7 @@
   template <typename Lock>
   void signal(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     ::SetEvent(event_);
   }
@@ -55,7 +55,7 @@
   template <typename Lock>
   void signal_and_unlock(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     lock.unlock();
     ::SetEvent(event_);
   }
@@ -64,7 +64,7 @@
   template <typename Lock>
   void clear(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     (void)lock;
     ::ResetEvent(event_);
   }
@@ -73,7 +73,7 @@
   template <typename Lock>
   void wait(Lock& lock)
   {
- BOOST_ASSERT(lock.locked());
+ BOOST_ASIO_ASSERT(lock.locked());
     lock.unlock();
     ::WaitForSingleObject(event_, INFINITE);
     lock.lock();
@@ -93,6 +93,6 @@
 # include <boost/asio/detail/impl/win_event.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_EVENT_HPP

Modified: branches/release/boost/asio/detail/win_fd_set_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_fd_set_adapter.hpp (original)
+++ branches/release/boost/asio/detail/win_fd_set_adapter.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_fd_set_adapter.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -120,6 +120,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_WIN_FD_SET_ADAPTER_HPP

Modified: branches/release/boost/asio/detail/win_fenced_block.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_fenced_block.hpp (original)
+++ branches/release/boost/asio/detail/win_fenced_block.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_fenced_block.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <boost/asio/detail/socket_types.hpp>
 
@@ -45,7 +45,8 @@
 #if defined(__BORLANDC__)
     LONG barrier = 0;
     ::InterlockedExchange(&barrier, 1);
-#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
+#elif defined(BOOST_ASIO_MSVC) \
+ && ((BOOST_ASIO_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -64,7 +65,8 @@
 #if defined(__BORLANDC__)
     LONG barrier = 0;
     ::InterlockedExchange(&barrier, 1);
-#elif defined(BOOST_MSVC) && ((BOOST_MSVC < 1400) || !defined(MemoryBarrier))
+#elif defined(BOOST_ASIO_MSVC) \
+ && ((BOOST_ASIO_MSVC < 1400) || !defined(MemoryBarrier))
 # if defined(_M_IX86)
 # pragma warning(push)
 # pragma warning(disable:4793)
@@ -84,6 +86,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WIN_FENCED_BLOCK_HPP

Modified: branches/release/boost/asio/detail/win_iocp_handle_read_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_handle_read_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_handle_read_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_handle_read_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,7 +21,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -57,7 +57,7 @@
 
     // Take ownership of the operation object.
     win_iocp_handle_read_op* o(static_cast<win_iocp_handle_read_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -82,7 +82,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_handle_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -20,10 +20,11 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/cstdint.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/operation.hpp>
@@ -129,7 +130,7 @@
   // Write the given data at the specified offset. Returns the number of bytes
   // written.
   template <typename ConstBufferSequence>
- size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     boost::asio::const_buffer buffer =
@@ -143,11 +144,11 @@
   // lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
   void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -163,12 +164,12 @@
   // Start an asynchronous write at a specified offset. The data being written
   // must be valid for the lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
- void async_write_some_at(implementation_type& impl, boost::uint64_t offset,
- const ConstBufferSequence& buffers, Handler handler)
+ void async_write_some_at(implementation_type& impl, uint64_t offset,
+ const ConstBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_write_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -191,7 +192,7 @@
 
   // Read some data at a specified offset. Returns the number of bytes received.
   template <typename MutableBufferSequence>
- size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     boost::asio::mutable_buffer buffer =
@@ -205,11 +206,11 @@
   // valid for the lifetime of the asynchronous operation.
   template <typename MutableBufferSequence, typename Handler>
   void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -226,12 +227,12 @@
   // being received must be valid for the lifetime of the asynchronous
   // operation.
   template <typename MutableBufferSequence, typename Handler>
- void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
- const MutableBufferSequence& buffers, Handler handler)
+ void async_read_some_at(implementation_type& impl, uint64_t offset,
+ const MutableBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_read_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(buffers, handler);
@@ -248,46 +249,46 @@
   // Prevent the use of the null_buffers type with this service.
   size_t write_some(implementation_type& impl,
       const null_buffers& buffers, boost::system::error_code& ec);
- size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t write_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, boost::system::error_code& ec);
   template <typename Handler>
   void async_write_some(implementation_type& impl,
- const null_buffers& buffers, Handler handler);
+ const null_buffers& buffers, Handler& handler);
   template <typename Handler>
- void async_write_some_at(implementation_type& impl, boost::uint64_t offset,
- const null_buffers& buffers, Handler handler);
+ void async_write_some_at(implementation_type& impl, uint64_t offset,
+ const null_buffers& buffers, Handler& handler);
   size_t read_some(implementation_type& impl,
       const null_buffers& buffers, boost::system::error_code& ec);
- size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ size_t read_some_at(implementation_type& impl, uint64_t offset,
       const null_buffers& buffers, boost::system::error_code& ec);
   template <typename Handler>
   void async_read_some(implementation_type& impl,
- const null_buffers& buffers, Handler handler);
+ const null_buffers& buffers, Handler& handler);
   template <typename Handler>
- void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
- const null_buffers& buffers, Handler handler);
+ void async_read_some_at(implementation_type& impl, uint64_t offset,
+ const null_buffers& buffers, Handler& handler);
 
   // Helper class for waiting for synchronous operations to complete.
   class overlapped_wrapper;
 
   // Helper function to perform a synchronous write operation.
   BOOST_ASIO_DECL size_t do_write(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::const_buffer& buffer,
+ uint64_t offset, const boost::asio::const_buffer& buffer,
       boost::system::error_code& ec);
 
   // Helper function to start a write operation.
   BOOST_ASIO_DECL void start_write_op(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::const_buffer& buffer,
+ uint64_t offset, const boost::asio::const_buffer& buffer,
       operation* op);
 
   // Helper function to perform a synchronous write operation.
   BOOST_ASIO_DECL size_t do_read(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::mutable_buffer& buffer,
+ uint64_t offset, const boost::asio::mutable_buffer& buffer,
       boost::system::error_code& ec);
 
   // Helper function to start a read operation.
   BOOST_ASIO_DECL void start_read_op(implementation_type& impl,
- boost::uint64_t offset, const boost::asio::mutable_buffer& buffer,
+ uint64_t offset, const boost::asio::mutable_buffer& buffer,
       operation* op);
 
   // Update the ID of the thread from which cancellation is safe.

Modified: branches/release/boost/asio/detail/win_iocp_handle_write_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_handle_write_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_handle_write_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_handle_write_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,7 +21,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -53,7 +53,7 @@
   {
     // Take ownership of the operation object.
     win_iocp_handle_write_op* o(static_cast<win_iocp_handle_write_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -74,7 +74,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_io_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,9 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/call_stack.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/scoped_ptr.hpp>
@@ -113,15 +113,15 @@
 
   // Request invocation of the given handler.
   template <typename Handler>
- void dispatch(Handler handler);
+ void dispatch(Handler& handler);
 
   // Request invocation of the given handler and return immediately.
   template <typename Handler>
- void post(Handler handler);
+ void post(Handler& handler);
 
   // Request invocation of the given operation and return immediately. Assumes
   // that work_started() has not yet been called for the operation.
- void post_immediate_completion(win_iocp_operation* op)
+ void post_immediate_completion(win_iocp_operation* op, bool)
   {
     work_started();
     post_deferred_completion(op);
@@ -141,7 +141,7 @@
   // called for the operation.
   void post_private_immediate_completion(win_iocp_operation* op)
   {
- post_immediate_completion(op);
+ post_immediate_completion(op, false);
   }
 
   // Request invocation of the given operation using the thread-private queue

Modified: branches/release/boost/asio/detail/win_iocp_io_service_fwd.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_io_service_fwd.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_io_service_fwd.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_io_service_fwd.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/win_iocp_null_buffers_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_null_buffers_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_null_buffers_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_null_buffers_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -63,7 +63,7 @@
 
     // Take ownership of the operation object.
     win_iocp_null_buffers_op* o(static_cast<win_iocp_null_buffers_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -92,7 +92,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/win_iocp_operation.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_operation.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_operation.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_operation.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/win_iocp_overlapped_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_overlapped_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_overlapped_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_overlapped_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,7 +20,7 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/error.hpp>
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
@@ -50,7 +50,7 @@
   {
     // Take ownership of the operation object.
     win_iocp_overlapped_op* o(static_cast<win_iocp_overlapped_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -62,7 +62,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_overlapped_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,8 +19,8 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/win_iocp_overlapped_op.hpp>
@@ -78,7 +78,7 @@
   void reset(boost::asio::io_service& io_service, Handler handler)
   {
     typedef win_iocp_overlapped_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_serial_port_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_serial_port_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -153,7 +153,7 @@
   // lifetime of the asynchronous operation.
   template <typename ConstBufferSequence, typename Handler>
   void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
   {
     handle_service_.async_write_some(impl, buffers, handler);
   }
@@ -170,7 +170,7 @@
   // valid for the lifetime of the asynchronous operation.
   template <typename MutableBufferSequence, typename Handler>
   void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
   {
     handle_service_.async_read_some(impl, buffers, handler);
   }

Modified: branches/release/boost/asio/detail/win_iocp_socket_accept_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_accept_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_accept_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_accept_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -80,7 +80,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_accept_op* o(static_cast<win_iocp_socket_accept_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     if (owner)
     {
@@ -131,7 +131,7 @@
     // deallocated the memory here.
     detail::binder1<Handler, boost::system::error_code>
       handler(o->handler_, ec);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/win_iocp_socket_recv_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_recv_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_recv_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_recv_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -60,7 +60,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_recv_op* o(static_cast<win_iocp_socket_recv_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -86,7 +86,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_recvfrom_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -67,7 +67,7 @@
     // Take ownership of the operation object.
     win_iocp_socket_recvfrom_op* o(
         static_cast<win_iocp_socket_recvfrom_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -93,7 +93,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_recvmsg_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -63,7 +63,7 @@
     // Take ownership of the operation object.
     win_iocp_socket_recvmsg_op* o(
         static_cast<win_iocp_socket_recvmsg_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -87,7 +87,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

Modified: branches/release/boost/asio/detail/win_iocp_socket_send_op.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_send_op.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_send_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_send_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -58,7 +58,7 @@
 
     // Take ownership of the operation object.
     win_iocp_socket_send_op* o(static_cast<win_iocp_socket_send_op*>(base));
- ptr p = { boost::addressof(o->handler_), o, o };
+ ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
 
     BOOST_ASIO_HANDLER_COMPLETION((o));
 
@@ -81,7 +81,7 @@
     // deallocated the memory here.
     detail::binder2<Handler, boost::system::error_code, std::size_t>
       handler(o->handler_, ec, bytes_transferred);
- p.h = boost::addressof(handler.handler_);
+ p.h = boost::asio::detail::addressof(handler.handler_);
     p.reset();
 
     // Make the upcall if required.

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,10 +20,10 @@
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <cstring>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -291,11 +291,11 @@
   template <typename ConstBufferSequence, typename Handler>
   void async_send_to(implementation_type& impl,
       const ConstBufferSequence& buffers, const endpoint_type& destination,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, handler);
@@ -314,11 +314,11 @@
   // Start an asynchronous wait until data can be sent without blocking.
   template <typename Handler>
   void async_send_to(implementation_type& impl, const null_buffers&,
- const endpoint_type&, socket_base::message_flags, Handler handler)
+ const endpoint_type&, socket_base::message_flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -372,12 +372,12 @@
   template <typename MutableBufferSequence, typename Handler>
   void async_receive_from(implementation_type& impl,
       const MutableBufferSequence& buffers, endpoint_type& sender_endp,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recvfrom_op<
       MutableBufferSequence, endpoint_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(sender_endp, impl.cancel_token_, buffers, handler);
@@ -396,11 +396,11 @@
   template <typename Handler>
   void async_receive_from(implementation_type& impl,
       const null_buffers&, endpoint_type& sender_endpoint,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -448,11 +448,11 @@
   // must be valid until the accept's handler is invoked.
   template <typename Socket, typename Handler>
   void async_accept(implementation_type& impl, Socket& peer,
- endpoint_type* peer_endpoint, Handler handler)
+ endpoint_type* peer_endpoint, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_accept_op<Socket, protocol_type, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     bool enable_connection_aborted =
@@ -481,14 +481,14 @@
   // Start an asynchronous connect.
   template <typename Handler>
   void async_connect(implementation_type& impl,
- const endpoint_type& peer_endpoint, Handler handler)
+ const endpoint_type& peer_endpoint, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
- typedef reactive_socket_connect_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typedef reactive_socket_connect_op<Protocol, Handler> op;
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
- p.p = new (p.v) op(impl.socket_, handler);
+ p.p = new (p.v) op(impl.socket_, peer_endpoint, handler);
 
     BOOST_ASIO_HANDLER_CREATION((p.p, "socket", &impl, "async_connect"));
 

Modified: branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_socket_service_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_socket_service_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,11 +19,10 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
-#include <boost/type_traits/is_same.hpp>
-#include <boost/utility/addressof.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/socket_base.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
@@ -220,7 +219,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_send_op<ConstBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, handler);
@@ -243,7 +242,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -287,7 +286,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recv_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.state_, impl.cancel_token_, buffers, handler);
@@ -310,7 +309,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);
@@ -361,7 +360,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_socket_recvmsg_op<MutableBufferSequence, Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, buffers, out_flags, handler);
@@ -384,7 +383,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(impl.cancel_token_, handler);

Modified: branches/release/boost/asio/detail/win_iocp_thread_info.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_iocp_thread_info.hpp (original)
+++ branches/release/boost/asio/detail/win_iocp_thread_info.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_iocp_thread_info.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/detail/win_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_mutex.hpp (original)
+++ branches/release/boost/asio/detail/win_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/scoped_lock.hpp>
@@ -75,6 +75,6 @@
 # include <boost/asio/detail/impl/win_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_MUTEX_HPP

Modified: branches/release/boost/asio/detail/win_object_handle_service.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_object_handle_service.hpp (original)
+++ branches/release/boost/asio/detail/win_object_handle_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_object_handle_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -20,7 +20,7 @@
 
 #if defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE)
 
-#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/addressof.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/wait_handler.hpp>
 #include <boost/asio/error.hpp>
@@ -134,7 +134,7 @@
   {
     // Allocate and construct an operation to wrap the handler.
     typedef wait_handler<Handler> op;
- typename op::ptr p = { boost::addressof(handler),
+ typename op::ptr p = { boost::asio::detail::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
     p.p = new (p.v) op(handler);

Modified: branches/release/boost/asio/detail/win_static_mutex.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_static_mutex.hpp (original)
+++ branches/release/boost/asio/detail/win_static_mutex.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_static_mutex.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/scoped_lock.hpp>
 
@@ -71,6 +71,6 @@
 # include <boost/asio/detail/impl/win_static_mutex.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_STATIC_MUTEX_HPP

Modified: branches/release/boost/asio/detail/win_thread.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_thread.hpp (original)
+++ branches/release/boost/asio/detail/win_thread.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_thread.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -136,6 +136,6 @@
 # include <boost/asio/detail/impl/win_thread.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && !defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WIN_THREAD_HPP

Modified: branches/release/boost/asio/detail/win_tss_ptr.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_tss_ptr.hpp (original)
+++ branches/release/boost/asio/detail/win_tss_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/win_tss_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -76,6 +76,6 @@
 # include <boost/asio/detail/impl/win_tss_ptr.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS)
+#endif // defined(BOOST_ASIO_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_WIN_TSS_PTR_HPP

Modified: branches/release/boost/asio/detail/wince_thread.hpp
==============================================================================
--- branches/release/boost/asio/detail/wince_thread.hpp (original)
+++ branches/release/boost/asio/detail/wince_thread.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/wince_thread.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
 #include <memory>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -113,6 +113,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
 #endif // BOOST_ASIO_DETAIL_WINCE_THREAD_HPP

Modified: branches/release/boost/asio/detail/winsock_init.hpp
==============================================================================
--- branches/release/boost/asio/detail/winsock_init.hpp (original)
+++ branches/release/boost/asio/detail/winsock_init.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/winsock_init.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -87,6 +87,6 @@
 # include <boost/asio/detail/impl/winsock_init.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 
 #endif // BOOST_ASIO_DETAIL_WINSOCK_INIT_HPP

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/wrapped_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -25,7 +26,26 @@
 namespace asio {
 namespace detail {
 
-template <typename Dispatcher, typename Handler>
+struct is_continuation_delegated
+{
+ template <typename Dispatcher, typename Handler>
+ bool operator()(Dispatcher&, Handler& handler) const
+ {
+ return boost_asio_handler_cont_helpers::is_continuation(handler);
+ }
+};
+
+struct is_continuation_if_running
+{
+ template <typename Dispatcher, typename Handler>
+ bool operator()(Dispatcher& dispatcher, Handler&) const
+ {
+ return dispatcher.running_in_this_thread();
+ }
+};
+
+template <typename Dispatcher, typename Handler,
+ typename IsContinuation = is_continuation_delegated>
 class wrapped_handler
 {
 public:
@@ -181,34 +201,43 @@
   Handler handler_;
 };
 
-template <typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
 inline void* asio_handler_allocate(std::size_t size,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
 {
   return boost_asio_handler_alloc_helpers::allocate(
       size, this_handler->handler_);
 }
 
-template <typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
 inline void asio_handler_deallocate(void* pointer, std::size_t size,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
 {
   boost_asio_handler_alloc_helpers::deallocate(
       pointer, size, this_handler->handler_);
 }
 
-template <typename Function, typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
+inline bool asio_handler_is_continuation(
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
+{
+ return IsContinuation()(this_handler->dispatcher_, this_handler->handler_);
+}
+
+template <typename Function, typename Dispatcher,
+ typename Handler, typename IsContinuation>
 inline void asio_handler_invoke(Function& function,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
 {
   this_handler->dispatcher_.dispatch(
       rewrapped_handler<Function, Handler>(
         function, this_handler->handler_));
 }
 
-template <typename Function, typename Dispatcher, typename Handler>
+template <typename Function, typename Dispatcher,
+ typename Handler, typename IsContinuation>
 inline void asio_handler_invoke(const Function& function,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
 {
   this_handler->dispatcher_.dispatch(
       rewrapped_handler<Function, Handler>(
@@ -231,6 +260,14 @@
       pointer, size, this_handler->context_);
 }
 
+template <typename Dispatcher, typename Context>
+inline bool asio_handler_is_continuation(
+ rewrapped_handler<Dispatcher, Context>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+}
+
 template <typename Function, typename Handler, typename Context>
 inline void asio_handler_invoke(Function& function,
     rewrapped_handler<Handler, Context>* this_handler)

Modified: branches/release/boost/asio/error.hpp
==============================================================================
--- branches/release/boost/asio/error.hpp (original)
+++ branches/release/boost/asio/error.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // error.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,7 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <boost/cerrno.hpp>
 #include <boost/system/error_code.hpp>
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <winerror.h>
 #else
 # include <cerrno>
@@ -36,7 +36,7 @@
 # define BOOST_ASIO_GETADDRINFO_ERROR(e) implementation_defined
 /// INTERNAL ONLY.
 # define BOOST_ASIO_WIN_OR_POSIX(e_win, e_posix) implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_NATIVE_ERROR(e) e
 # define BOOST_ASIO_SOCKET_ERROR(e) WSA ## e
 # define BOOST_ASIO_NETDB_ERROR(e) WSA ## e
@@ -216,7 +216,7 @@
   return boost::system::system_category();
 }
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_netdb_category();
@@ -224,7 +224,7 @@
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_addrinfo_category();
 
-#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#else // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 inline const boost::system::error_category& get_netdb_category()
 {
@@ -236,7 +236,7 @@
   return get_system_category();
 }
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_misc_category();

Added: branches/release/boost/asio/generic/basic_endpoint.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/basic_endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,195 @@
+//
+// generic/basic_endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_BASIC_ENDPOINT_HPP
+#define BOOST_ASIO_GENERIC_BASIC_ENDPOINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/generic/detail/endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+
+/// Describes an endpoint for any socket type.
+/**
+ * The boost::asio::generic::basic_endpoint class template describes an endpoint
+ * that may be associated with any socket type.
+ *
+ * @note The socket types sockaddr type must be able to fit into a
+ * @c sockaddr_storage structure.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Unsafe.
+ *
+ * @par Concepts:
+ * Endpoint.
+ */
+template <typename Protocol>
+class basic_endpoint
+{
+public:
+ /// The protocol type associated with the endpoint.
+ typedef Protocol protocol_type;
+
+ /// The type of the endpoint structure. This type is dependent on the
+ /// underlying implementation of the socket layer.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined data_type;
+#else
+ typedef boost::asio::detail::socket_addr_type data_type;
+#endif
+
+ /// Default constructor.
+ basic_endpoint()
+ {
+ }
+
+ /// Construct an endpoint from the specified socket address.
+ basic_endpoint(const void* socket_address,
+ std::size_t socket_address_size, int socket_protocol = 0)
+ : impl_(socket_address, socket_address_size, socket_protocol)
+ {
+ }
+
+ /// Construct an endpoint from the specific endpoint type.
+ template <typename Endpoint>
+ basic_endpoint(const Endpoint& endpoint)
+ : impl_(endpoint.data(), endpoint.size(), endpoint.protocol().protocol())
+ {
+ }
+
+ /// Copy constructor.
+ basic_endpoint(const basic_endpoint& other)
+ : impl_(other.impl_)
+ {
+ }
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move constructor.
+ basic_endpoint(basic_endpoint&& other)
+ : impl_(other.impl_)
+ {
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ /// Assign from another endpoint.
+ basic_endpoint& operator=(const basic_endpoint& other)
+ {
+ impl_ = other.impl_;
+ return *this;
+ }
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ /// Move-assign from another endpoint.
+ basic_endpoint& operator=(basic_endpoint&& other)
+ {
+ impl_ = other.impl_;
+ return *this;
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ /// The protocol associated with the endpoint.
+ protocol_type protocol() const
+ {
+ return protocol_type(impl_.family(), impl_.protocol());
+ }
+
+ /// Get the underlying endpoint in the native type.
+ data_type* data()
+ {
+ return impl_.data();
+ }
+
+ /// Get the underlying endpoint in the native type.
+ const data_type* data() const
+ {
+ return impl_.data();
+ }
+
+ /// Get the underlying size of the endpoint in the native type.
+ std::size_t size() const
+ {
+ return impl_.size();
+ }
+
+ /// Set the underlying size of the endpoint in the native type.
+ void resize(std::size_t new_size)
+ {
+ impl_.resize(new_size);
+ }
+
+ /// Get the capacity of the endpoint in the native type.
+ std::size_t capacity() const
+ {
+ return impl_.capacity();
+ }
+
+ /// Compare two endpoints for equality.
+ friend bool operator==(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return e1.impl_ == e2.impl_;
+ }
+
+ /// Compare two endpoints for inequality.
+ friend bool operator!=(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return !(e1.impl_ == e2.impl_);
+ }
+
+ /// Compare endpoints for ordering.
+ friend bool operator<(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return e1.impl_ < e2.impl_;
+ }
+
+ /// Compare endpoints for ordering.
+ friend bool operator>(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return e2.impl_ < e1.impl_;
+ }
+
+ /// Compare endpoints for ordering.
+ friend bool operator<=(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return !(e2 < e1);
+ }
+
+ /// Compare endpoints for ordering.
+ friend bool operator>=(const basic_endpoint<Protocol>& e1,
+ const basic_endpoint<Protocol>& e2)
+ {
+ return !(e1 < e2);
+ }
+
+private:
+ // The underlying generic endpoint.
+ boost::asio::generic::detail::endpoint impl_;
+};
+
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_BASIC_ENDPOINT_HPP

Added: branches/release/boost/asio/generic/datagram_protocol.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/datagram_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,125 @@
+//
+// generic/datagram_protocol.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP
+#define BOOST_ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <typeinfo>
+#include <boost/asio/basic_datagram_socket.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
+#include <boost/asio/generic/basic_endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+
+/// Encapsulates the flags needed for a generic datagram-oriented socket.
+/**
+ * The boost::asio::generic::datagram_protocol class contains flags necessary
+ * for datagram-oriented sockets of any address family and protocol.
+ *
+ * @par Examples
+ * Constructing using a native address family and socket protocol:
+ * @code datagram_protocol p(AF_INET, IPPROTO_UDP); @endcode
+ * Constructing from a specific protocol type:
+ * @code datagram_protocol p(boost::asio::ip::udp::v4()); @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Safe.
+ *
+ * @par Concepts:
+ * Protocol.
+ */
+class datagram_protocol
+{
+public:
+ /// Construct a protocol object for a specific address family and protocol.
+ datagram_protocol(int address_family, int socket_protocol)
+ : family_(address_family),
+ protocol_(socket_protocol)
+ {
+ }
+
+ /// Construct a generic protocol object from a specific protocol.
+ /**
+ * @throws @c bad_cast Thrown if the source protocol is not datagram-oriented.
+ */
+ template <typename Protocol>
+ datagram_protocol(const Protocol& source_protocol)
+ : family_(source_protocol.family()),
+ protocol_(source_protocol.protocol())
+ {
+ if (source_protocol.type() != type())
+ {
+ std::bad_cast ex;
+ boost::asio::detail::throw_exception(ex);
+ }
+ }
+
+ /// Obtain an identifier for the type of the protocol.
+ int type() const
+ {
+ return SOCK_DGRAM;
+ }
+
+ /// Obtain an identifier for the protocol.
+ int protocol() const
+ {
+ return protocol_;
+ }
+
+ /// Obtain an identifier for the protocol family.
+ int family() const
+ {
+ return family_;
+ }
+
+ /// Compare two protocols for equality.
+ friend bool operator==(const datagram_protocol& p1,
+ const datagram_protocol& p2)
+ {
+ return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_;
+ }
+
+ /// Compare two protocols for inequality.
+ friend bool operator!=(const datagram_protocol& p1,
+ const datagram_protocol& p2)
+ {
+ return !(p1 == p2);
+ }
+
+ /// The type of an endpoint.
+ typedef basic_endpoint<datagram_protocol> endpoint;
+
+ /// The generic socket type.
+ typedef basic_datagram_socket<datagram_protocol> socket;
+
+private:
+ int family_;
+ int protocol_;
+};
+
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_DATAGRAM_PROTOCOL_HPP

Added: branches/release/boost/asio/generic/detail/endpoint.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/detail/endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,135 @@
+//
+// generic/detail/endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_DETAIL_ENDPOINT_HPP
+#define BOOST_ASIO_GENERIC_DETAIL_ENDPOINT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <cstddef>
+#include <boost/asio/detail/socket_types.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+namespace detail {
+
+// Helper class for implementing a generic socket endpoint.
+class endpoint
+{
+public:
+ // Default constructor.
+ BOOST_ASIO_DECL endpoint();
+
+ // Construct an endpoint from the specified raw bytes.
+ BOOST_ASIO_DECL endpoint(const void* sock_addr,
+ std::size_t sock_addr_size, int sock_protocol);
+
+ // Copy constructor.
+ endpoint(const endpoint& other)
+ : data_(other.data_),
+ size_(other.size_),
+ protocol_(other.protocol_)
+ {
+ }
+
+ // Assign from another endpoint.
+ endpoint& operator=(const endpoint& other)
+ {
+ data_ = other.data_;
+ size_ = other.size_;
+ protocol_ = other.protocol_;
+ return *this;
+ }
+
+ // Get the address family associated with the endpoint.
+ int family() const
+ {
+ return data_.base.sa_family;
+ }
+
+ // Get the socket protocol associated with the endpoint.
+ int protocol() const
+ {
+ return protocol_;
+ }
+
+ // Get the underlying endpoint in the native type.
+ boost::asio::detail::socket_addr_type* data()
+ {
+ return &data_.base;
+ }
+
+ // Get the underlying endpoint in the native type.
+ const boost::asio::detail::socket_addr_type* data() const
+ {
+ return &data_.base;
+ }
+
+ // Get the underlying size of the endpoint in the native type.
+ std::size_t size() const
+ {
+ return size_;
+ }
+
+ // Set the underlying size of the endpoint in the native type.
+ BOOST_ASIO_DECL void resize(std::size_t size);
+
+ // Get the capacity of the endpoint in the native type.
+ std::size_t capacity() const
+ {
+ return sizeof(boost::asio::detail::sockaddr_storage_type);
+ }
+
+ // Compare two endpoints for equality.
+ BOOST_ASIO_DECL friend bool operator==(
+ const endpoint& e1, const endpoint& e2);
+
+ // Compare endpoints for ordering.
+ BOOST_ASIO_DECL friend bool operator<(
+ const endpoint& e1, const endpoint& e2);
+
+private:
+ // The underlying socket address.
+ union data_union
+ {
+ boost::asio::detail::socket_addr_type base;
+ boost::asio::detail::sockaddr_storage_type generic;
+ } data_;
+
+ // The length of the socket address stored in the endpoint.
+ std::size_t size_;
+
+ // The socket protocol associated with the endpoint.
+ int protocol_;
+
+ // Initialise with a specified memory.
+ BOOST_ASIO_DECL void init(const void* sock_addr,
+ std::size_t sock_addr_size, int sock_protocol);
+};
+
+} // namespace detail
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/generic/detail/impl/endpoint.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
+#endif // BOOST_ASIO_GENERIC_DETAIL_ENDPOINT_HPP

Added: branches/release/boost/asio/generic/detail/impl/endpoint.ipp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/detail/impl/endpoint.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,111 @@
+//
+// generic/detail/impl/endpoint.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_DETAIL_IMPL_ENDPOINT_IPP
+#define BOOST_ASIO_GENERIC_DETAIL_IMPL_ENDPOINT_IPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <cstring>
+#include <typeinfo>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/generic/detail/endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+namespace detail {
+
+endpoint::endpoint()
+{
+ init(0, 0, 0);
+}
+
+endpoint::endpoint(const void* sock_addr,
+ std::size_t sock_addr_size, int sock_protocol)
+{
+ init(sock_addr, sock_addr_size, sock_protocol);
+}
+
+void endpoint::resize(std::size_t new_size)
+{
+ if (new_size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ {
+ boost::system::error_code ec(boost::asio::error::invalid_argument);
+ boost::asio::detail::throw_error(ec);
+ }
+ else
+ {
+ size_ = new_size;
+ protocol_ = 0;
+ }
+}
+
+bool operator==(const endpoint& e1, const endpoint& e2)
+{
+ using namespace std; // For memcmp.
+ return e1.size() == e2.size() && memcmp(e1.data(), e2.data(), e1.size()) == 0;
+}
+
+bool operator<(const endpoint& e1, const endpoint& e2)
+{
+ if (e1.protocol() < e2.protocol())
+ return true;
+
+ if (e1.protocol() > e2.protocol())
+ return false;
+
+ using namespace std; // For memcmp.
+ std::size_t compare_size = e1.size() < e2.size() ? e1.size() : e2.size();
+ int compare_result = memcmp(e1.data(), e2.data(), compare_size);
+
+ if (compare_result < 0)
+ return true;
+
+ if (compare_result > 0)
+ return false;
+
+ return e1.size() < e2.size();
+}
+
+void endpoint::init(const void* sock_addr,
+ std::size_t sock_addr_size, int sock_protocol)
+{
+ if (sock_addr_size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ {
+ boost::system::error_code ec(boost::asio::error::invalid_argument);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ using namespace std; // For memset and memcpy.
+ memset(&data_.generic, 0, sizeof(boost::asio::detail::sockaddr_storage_type));
+ memcpy(&data_.generic, sock_addr, sock_addr_size);
+
+ size_ = sock_addr_size;
+ protocol_ = sock_protocol;
+}
+
+} // namespace detail
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_DETAIL_IMPL_ENDPOINT_IPP

Added: branches/release/boost/asio/generic/raw_protocol.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/raw_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,123 @@
+//
+// generic/raw_protocol.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_RAW_PROTOCOL_HPP
+#define BOOST_ASIO_GENERIC_RAW_PROTOCOL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <typeinfo>
+#include <boost/asio/basic_raw_socket.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
+#include <boost/asio/generic/basic_endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+
+/// Encapsulates the flags needed for a generic raw socket.
+/**
+ * The boost::asio::generic::raw_protocol class contains flags necessary for
+ * raw sockets of any address family and protocol.
+ *
+ * @par Examples
+ * Constructing using a native address family and socket protocol:
+ * @code raw_protocol p(AF_INET, IPPROTO_ICMP); @endcode
+ * Constructing from a specific protocol type:
+ * @code raw_protocol p(boost::asio::ip::icmp::v4()); @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Safe.
+ *
+ * @par Concepts:
+ * Protocol.
+ */
+class raw_protocol
+{
+public:
+ /// Construct a protocol object for a specific address family and protocol.
+ raw_protocol(int address_family, int socket_protocol)
+ : family_(address_family),
+ protocol_(socket_protocol)
+ {
+ }
+
+ /// Construct a generic protocol object from a specific protocol.
+ /**
+ * @throws @c bad_cast Thrown if the source protocol is not raw-oriented.
+ */
+ template <typename Protocol>
+ raw_protocol(const Protocol& source_protocol)
+ : family_(source_protocol.family()),
+ protocol_(source_protocol.protocol())
+ {
+ if (source_protocol.type() != type())
+ {
+ std::bad_cast ex;
+ boost::asio::detail::throw_exception(ex);
+ }
+ }
+
+ /// Obtain an identifier for the type of the protocol.
+ int type() const
+ {
+ return SOCK_RAW;
+ }
+
+ /// Obtain an identifier for the protocol.
+ int protocol() const
+ {
+ return protocol_;
+ }
+
+ /// Obtain an identifier for the protocol family.
+ int family() const
+ {
+ return family_;
+ }
+
+ /// Compare two protocols for equality.
+ friend bool operator==(const raw_protocol& p1, const raw_protocol& p2)
+ {
+ return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_;
+ }
+
+ /// Compare two protocols for inequality.
+ friend bool operator!=(const raw_protocol& p1, const raw_protocol& p2)
+ {
+ return !(p1 == p2);
+ }
+
+ /// The type of an endpoint.
+ typedef basic_endpoint<raw_protocol> endpoint;
+
+ /// The generic socket type.
+ typedef basic_raw_socket<raw_protocol> socket;
+
+private:
+ int family_;
+ int protocol_;
+};
+
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_RAW_PROTOCOL_HPP

Added: branches/release/boost/asio/generic/seq_packet_protocol.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/seq_packet_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,124 @@
+//
+// generic/seq_packet_protocol.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP
+#define BOOST_ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <typeinfo>
+#include <boost/asio/basic_seq_packet_socket.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
+#include <boost/asio/generic/basic_endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+
+/// Encapsulates the flags needed for a generic sequenced packet socket.
+/**
+ * The boost::asio::generic::seq_packet_protocol class contains flags necessary
+ * for seq_packet-oriented sockets of any address family and protocol.
+ *
+ * @par Examples
+ * Constructing using a native address family and socket protocol:
+ * @code seq_packet_protocol p(AF_INET, IPPROTO_SCTP); @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Safe.
+ *
+ * @par Concepts:
+ * Protocol.
+ */
+class seq_packet_protocol
+{
+public:
+ /// Construct a protocol object for a specific address family and protocol.
+ seq_packet_protocol(int address_family, int socket_protocol)
+ : family_(address_family),
+ protocol_(socket_protocol)
+ {
+ }
+
+ /// Construct a generic protocol object from a specific protocol.
+ /**
+ * @throws @c bad_cast Thrown if the source protocol is not based around
+ * sequenced packets.
+ */
+ template <typename Protocol>
+ seq_packet_protocol(const Protocol& source_protocol)
+ : family_(source_protocol.family()),
+ protocol_(source_protocol.protocol())
+ {
+ if (source_protocol.type() != type())
+ {
+ std::bad_cast ex;
+ boost::asio::detail::throw_exception(ex);
+ }
+ }
+
+ /// Obtain an identifier for the type of the protocol.
+ int type() const
+ {
+ return SOCK_SEQPACKET;
+ }
+
+ /// Obtain an identifier for the protocol.
+ int protocol() const
+ {
+ return protocol_;
+ }
+
+ /// Obtain an identifier for the protocol family.
+ int family() const
+ {
+ return family_;
+ }
+
+ /// Compare two protocols for equality.
+ friend bool operator==(const seq_packet_protocol& p1,
+ const seq_packet_protocol& p2)
+ {
+ return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_;
+ }
+
+ /// Compare two protocols for inequality.
+ friend bool operator!=(const seq_packet_protocol& p1,
+ const seq_packet_protocol& p2)
+ {
+ return !(p1 == p2);
+ }
+
+ /// The type of an endpoint.
+ typedef basic_endpoint<seq_packet_protocol> endpoint;
+
+ /// The generic socket type.
+ typedef basic_seq_packet_socket<seq_packet_protocol> socket;
+
+private:
+ int family_;
+ int protocol_;
+};
+
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_SEQ_PACKET_PROTOCOL_HPP

Added: branches/release/boost/asio/generic/stream_protocol.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/generic/stream_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,129 @@
+//
+// generic/stream_protocol.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_GENERIC_STREAM_PROTOCOL_HPP
+#define BOOST_ASIO_GENERIC_STREAM_PROTOCOL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <typeinfo>
+#include <boost/asio/basic_socket_iostream.hpp>
+#include <boost/asio/basic_stream_socket.hpp>
+#include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
+#include <boost/asio/generic/basic_endpoint.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace generic {
+
+/// Encapsulates the flags needed for a generic stream-oriented socket.
+/**
+ * The boost::asio::generic::stream_protocol class contains flags necessary for
+ * stream-oriented sockets of any address family and protocol.
+ *
+ * @par Examples
+ * Constructing using a native address family and socket protocol:
+ * @code stream_protocol p(AF_INET, IPPROTO_TCP); @endcode
+ * Constructing from a specific protocol type:
+ * @code stream_protocol p(boost::asio::ip::tcp::v4()); @endcode
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Safe.
+ *
+ * @par Concepts:
+ * Protocol.
+ */
+class stream_protocol
+{
+public:
+ /// Construct a protocol object for a specific address family and protocol.
+ stream_protocol(int address_family, int socket_protocol)
+ : family_(address_family),
+ protocol_(socket_protocol)
+ {
+ }
+
+ /// Construct a generic protocol object from a specific protocol.
+ /**
+ * @throws @c bad_cast Thrown if the source protocol is not stream-oriented.
+ */
+ template <typename Protocol>
+ stream_protocol(const Protocol& source_protocol)
+ : family_(source_protocol.family()),
+ protocol_(source_protocol.protocol())
+ {
+ if (source_protocol.type() != type())
+ {
+ std::bad_cast ex;
+ boost::asio::detail::throw_exception(ex);
+ }
+ }
+
+ /// Obtain an identifier for the type of the protocol.
+ int type() const
+ {
+ return SOCK_STREAM;
+ }
+
+ /// Obtain an identifier for the protocol.
+ int protocol() const
+ {
+ return protocol_;
+ }
+
+ /// Obtain an identifier for the protocol family.
+ int family() const
+ {
+ return family_;
+ }
+
+ /// Compare two protocols for equality.
+ friend bool operator==(const stream_protocol& p1, const stream_protocol& p2)
+ {
+ return p1.family_ == p2.family_ && p1.protocol_ == p2.protocol_;
+ }
+
+ /// Compare two protocols for inequality.
+ friend bool operator!=(const stream_protocol& p1, const stream_protocol& p2)
+ {
+ return !(p1 == p2);
+ }
+
+ /// The type of an endpoint.
+ typedef basic_endpoint<stream_protocol> endpoint;
+
+ /// The generic socket type.
+ typedef basic_stream_socket<stream_protocol> socket;
+
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
+ /// The generic socket iostream type.
+ typedef basic_socket_iostream<stream_protocol> iostream;
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
+
+private:
+ int family_;
+ int protocol_;
+};
+
+} // namespace generic
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_GENERIC_STREAM_PROTOCOL_HPP

Modified: branches/release/boost/asio/handler_alloc_hook.hpp
==============================================================================
--- branches/release/boost/asio/handler_alloc_hook.hpp (original)
+++ branches/release/boost/asio/handler_alloc_hook.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // handler_alloc_hook.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/boost/asio/handler_continuation_hook.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/handler_continuation_hook.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,56 @@
+//
+// handler_continuation_hook.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP
+#define BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// Default continuation function for handlers.
+/**
+ * Asynchronous operations may represent a continuation of the asynchronous
+ * control flow associated with the current handler. The implementation can use
+ * this knowledge to optimise scheduling of the handler.
+ *
+ * Implement asio_handler_is_continuation for your own handlers to indicate
+ * when a handler represents a continuation.
+ *
+ * The default implementation of the continuation hook returns <tt>false</tt>.
+ *
+ * @par Example
+ * @code
+ * class my_handler;
+ *
+ * bool asio_handler_is_continuation(my_handler* context)
+ * {
+ * return true;
+ * }
+ * @endcode
+ */
+inline bool asio_handler_is_continuation(...)
+{
+ return false;
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_HANDLER_CONTINUATION_HOOK_HPP

Modified: branches/release/boost/asio/handler_invoke_hook.hpp
==============================================================================
--- branches/release/boost/asio/handler_invoke_hook.hpp (original)
+++ branches/release/boost/asio/handler_invoke_hook.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // handler_invoke_hook.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/boost/asio/handler_type.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/handler_type.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,110 @@
+//
+// handler_type.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_HANDLER_TYPE_HPP
+#define BOOST_ASIO_HANDLER_TYPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// Default handler type traits provided for all handlers.
+/**
+ * The handler_type traits class is used for determining the concrete handler
+ * type to be used for an asynchronous operation. It allows the handler type to
+ * be determined at the point where the specific completion handler signature
+ * is known.
+ *
+ * This template may be specialised for user-defined handler types.
+ */
+template <typename Handler, typename Signature>
+struct handler_type
+{
+ /// The handler type for the specific signature.
+ typedef Handler type;
+};
+
+template <typename Handler, typename Signature>
+struct handler_type<const Handler, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<volatile Handler, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<const volatile Handler, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<const Handler&, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<volatile Handler&, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<const volatile Handler&, Signature>
+ : handler_type<Handler, Signature> {};
+
+template <typename Handler, typename Signature>
+struct handler_type<Handler&, Signature>
+ : handler_type<Handler, Signature> {};
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+template <typename Handler, typename Signature>
+struct handler_type<Handler&&, Signature>
+ : handler_type<Handler, Signature> {};
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+template <typename ReturnType, typename Signature>
+struct handler_type<ReturnType(), Signature>
+ : handler_type<ReturnType(*)(), Signature> {};
+
+template <typename ReturnType, typename Arg1, typename Signature>
+struct handler_type<ReturnType(Arg1), Signature>
+ : handler_type<ReturnType(*)(Arg1), Signature> {};
+
+template <typename ReturnType, typename Arg1, typename Arg2, typename Signature>
+struct handler_type<ReturnType(Arg1, Arg2), Signature>
+ : handler_type<ReturnType(*)(Arg1, Arg2), Signature> {};
+
+template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
+ typename Signature>
+struct handler_type<ReturnType(Arg1, Arg2, Arg3), Signature>
+ : handler_type<ReturnType(*)(Arg1, Arg2, Arg3), Signature> {};
+
+template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
+ typename Arg4, typename Signature>
+struct handler_type<ReturnType(Arg1, Arg2, Arg3, Arg4), Signature>
+ : handler_type<ReturnType(*)(Arg1, Arg2, Arg3, Arg4), Signature> {};
+
+template <typename ReturnType, typename Arg1, typename Arg2, typename Arg3,
+ typename Arg4, typename Arg5, typename Signature>
+struct handler_type<ReturnType(Arg1, Arg2, Arg3, Arg4, Arg5), Signature>
+ : handler_type<ReturnType(*)(Arg1, Arg2, Arg3, Arg4, Arg5), Signature> {};
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#define BOOST_ASIO_HANDLER_TYPE(h, sig) \
+ typename handler_type<h, sig>::type
+
+#endif // BOOST_ASIO_HANDLER_TYPE_HPP

Modified: branches/release/boost/asio/high_resolution_timer.hpp
==============================================================================
--- branches/release/boost/asio/high_resolution_timer.hpp (original)
+++ branches/release/boost/asio/high_resolution_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // high_resolution_timer.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/impl/connect.hpp
==============================================================================
--- branches/release/boost/asio/impl/connect.hpp (original)
+++ branches/release/boost/asio/impl/connect.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/connect.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -184,6 +185,7 @@
         socket_(sock),
         iter_(begin),
         end_(end),
+ start_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))
     {
     }
@@ -194,6 +196,7 @@
         socket_(other.socket_),
         iter_(other.iter_),
         end_(other.end_),
+ start_(other.start_),
         handler_(other.handler_)
     {
     }
@@ -203,6 +206,7 @@
         socket_(other.socket_),
         iter_(other.iter_),
         end_(other.end_),
+ start_(other.start_),
         handler_(BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(other.handler_))
     {
     }
@@ -210,7 +214,7 @@
 
     void operator()(boost::system::error_code ec, int start = 0)
     {
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         for (;;)
@@ -258,6 +262,7 @@
     basic_socket<Protocol, SocketService>& socket_;
     Iterator iter_;
     Iterator end_;
+ int start_;
     ComposedConnectHandler handler_;
   };
 
@@ -281,6 +286,16 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+ inline bool asio_handler_is_continuation(
+ connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>* this_handler)
+ {
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename Protocol,
       typename SocketService, typename Iterator,
       typename ConnectCondition, typename ComposedConnectHandler>
@@ -302,25 +317,13 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename Protocol, typename SocketService, typename Iterator,
- typename ConnectCondition, typename ComposedConnectHandler>
- inline connect_op<Protocol, SocketService, Iterator,
- ConnectCondition, ComposedConnectHandler>
- make_connect_op(basic_socket<Protocol, SocketService>& sock,
- const Iterator& begin, const Iterator& end,
- const ConnectCondition& connect_condition,
- ComposedConnectHandler handler)
- {
- return connect_op<Protocol, SocketService, Iterator,
- ConnectCondition, ComposedConnectHandler>(
- sock, begin, end, connect_condition, handler);
- }
 } // namespace detail
 
 template <typename Protocol, typename SocketService,
     typename Iterator, typename ComposedConnectHandler>
-inline void async_connect(basic_socket<Protocol, SocketService>& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
@@ -328,15 +331,24 @@
   BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
       ComposedConnectHandler, handler, Iterator) type_check;
 
- detail::make_connect_op(s, begin, Iterator(),
- detail::default_connect_condition(),
- BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))(
- boost::system::error_code(), 1);
+ detail::async_result_init<ComposedConnectHandler,
+ void (boost::system::error_code, Iterator)> init(
+ BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler));
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ detail::default_connect_condition, BOOST_ASIO_HANDLER_TYPE(
+ ComposedConnectHandler, void (boost::system::error_code, Iterator))>(s,
+ begin, Iterator(), detail::default_connect_condition(), init.handler)(
+ boost::system::error_code(), 1);
+
+ return init.result.get();
 }
 
 template <typename Protocol, typename SocketService,
     typename Iterator, typename ComposedConnectHandler>
-inline void async_connect(basic_socket<Protocol, SocketService>& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, Iterator end,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler)
 {
@@ -345,15 +357,24 @@
   BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
       ComposedConnectHandler, handler, Iterator) type_check;
 
- detail::make_connect_op(s, begin, end,
- detail::default_connect_condition(),
- BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))(
- boost::system::error_code(), 1);
+ detail::async_result_init<ComposedConnectHandler,
+ void (boost::system::error_code, Iterator)> init(
+ BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler));
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ detail::default_connect_condition, BOOST_ASIO_HANDLER_TYPE(
+ ComposedConnectHandler, void (boost::system::error_code, Iterator))>(s,
+ begin, end, detail::default_connect_condition(), init.handler)(
+ boost::system::error_code(), 1);
+
+ return init.result.get();
 }
 
 template <typename Protocol, typename SocketService, typename Iterator,
     typename ConnectCondition, typename ComposedConnectHandler>
-inline void async_connect(basic_socket<Protocol, SocketService>& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, ConnectCondition connect_condition,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler)
 {
@@ -362,14 +383,24 @@
   BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
       ComposedConnectHandler, handler, Iterator) type_check;
 
- detail::make_connect_op(s, begin, Iterator(), connect_condition,
- BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))(
- boost::system::error_code(), 1);
+ detail::async_result_init<ComposedConnectHandler,
+ void (boost::system::error_code, Iterator)> init(
+ BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler));
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, BOOST_ASIO_HANDLER_TYPE(
+ ComposedConnectHandler, void (boost::system::error_code, Iterator))>(s,
+ begin, Iterator(), connect_condition, init.handler)(
+ boost::system::error_code(), 1);
+
+ return init.result.get();
 }
 
 template <typename Protocol, typename SocketService, typename Iterator,
     typename ConnectCondition, typename ComposedConnectHandler>
-void async_connect(basic_socket<Protocol, SocketService>& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler,
+ void (boost::system::error_code, Iterator))
+async_connect(basic_socket<Protocol, SocketService>& s,
     Iterator begin, Iterator end, ConnectCondition connect_condition,
     BOOST_ASIO_MOVE_ARG(ComposedConnectHandler) handler)
 {
@@ -378,9 +409,17 @@
   BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
       ComposedConnectHandler, handler, Iterator) type_check;
 
- detail::make_connect_op(s, begin, end, connect_condition,
- BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))(
- boost::system::error_code(), 1);
+ detail::async_result_init<ComposedConnectHandler,
+ void (boost::system::error_code, Iterator)> init(
+ BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler));
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, BOOST_ASIO_HANDLER_TYPE(
+ ComposedConnectHandler, void (boost::system::error_code, Iterator))>(s,
+ begin, end, connect_condition, init.handler)(
+ boost::system::error_code(), 1);
+
+ return init.result.get();
 }
 
 } // namespace asio

Modified: branches/release/boost/asio/impl/error.ipp
==============================================================================
--- branches/release/boost/asio/impl/error.ipp (original)
+++ branches/release/boost/asio/impl/error.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/error.ipp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -24,7 +24,7 @@
 namespace asio {
 namespace error {
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 namespace detail {
 
@@ -86,7 +86,7 @@
   return instance;
 }
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
 namespace detail {
 

Modified: branches/release/boost/asio/impl/handler_alloc_hook.ipp
==============================================================================
--- branches/release/boost/asio/impl/handler_alloc_hook.ipp (original)
+++ branches/release/boost/asio/impl/handler_alloc_hook.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/handler_alloc_hook.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/impl/io_service.hpp
==============================================================================
--- branches/release/boost/asio/impl/io_service.hpp (original)
+++ branches/release/boost/asio/impl/io_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/io_service.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -77,24 +77,37 @@
 namespace asio {
 
 template <typename CompletionHandler>
-inline void io_service::dispatch(
- BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
+inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+io_service::dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a CompletionHandler.
   BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check;
 
- impl_.dispatch(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+ detail::async_result_init<
+ CompletionHandler, void ()> init(
+ BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+
+ impl_.dispatch(init.handler);
+
+ return init.result.get();
 }
 
 template <typename CompletionHandler>
-inline void io_service::post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
+inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+io_service::post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a CompletionHandler.
   BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check;
 
- impl_.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+ detail::async_result_init<
+ CompletionHandler, void ()> init(
+ BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+
+ impl_.post(init.handler);
+
+ return init.result.get();
 }
 
 template <typename Handler>

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/io_service.ipp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,8 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/scoped_ptr.hpp>
 #include <boost/asio/detail/service_registry.hpp>
 #include <boost/asio/detail/throw_error.hpp>

Modified: branches/release/boost/asio/impl/read.hpp
==============================================================================
--- branches/release/boost/asio/impl/read.hpp (original)
+++ branches/release/boost/asio/impl/read.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/read.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -24,6 +24,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/dependent_type.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -83,7 +84,7 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncReadStream, typename Allocator,
     typename CompletionCondition>
@@ -138,7 +139,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -154,6 +155,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -164,6 +166,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -173,6 +176,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -182,7 +186,7 @@
     void operator()(const boost::system::error_code& ec,
         std::size_t bytes_transferred, int start = 0)
     {
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         buffers_.prepare(this->check_for_completion(ec, total_transferred_));
@@ -207,6 +211,7 @@
     AsyncReadStream& stream_;
     boost::asio::detail::consuming_buffers<
       mutable_buffer, MutableBufferSequence> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -225,6 +230,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -235,6 +241,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -244,6 +251,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -254,7 +262,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -278,6 +286,7 @@
   //private:
     AsyncReadStream& stream_;
     boost::asio::mutable_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -295,6 +304,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -305,6 +315,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -314,6 +325,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -330,7 +342,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -357,6 +369,7 @@
   //private:
     AsyncReadStream& stream_;
     boost::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -376,6 +389,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -386,6 +400,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -395,6 +410,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -411,7 +427,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -438,6 +454,7 @@
   //private:
     AsyncReadStream& stream_;
     std::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -464,6 +481,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename MutableBufferSequence,
+ typename CompletionCondition, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_op<AsyncReadStream, MutableBufferSequence,
+ CompletionCondition, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream,
       typename MutableBufferSequence, typename CompletionCondition,
       typename ReadHandler>
@@ -485,22 +513,13 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename MutableBufferSequence,
- typename CompletionCondition, typename ReadHandler>
- inline read_op<AsyncReadStream, MutableBufferSequence,
- CompletionCondition, ReadHandler>
- make_read_op(AsyncReadStream& s, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, ReadHandler handler)
- {
- return read_op<AsyncReadStream, MutableBufferSequence, CompletionCondition,
- ReadHandler>(s, buffers, completion_condition, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename MutableBufferSequence,
     typename CompletionCondition, typename ReadHandler>
-inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -508,27 +527,44 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_op(
- s, buffers, completion_condition,
- BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_op<AsyncReadStream, MutableBufferSequence,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(
+ ReadHandler, void (boost::system::error_code, std::size_t))>(
+ s, buffers, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncReadStream, typename MutableBufferSequence,
     typename ReadHandler>
-inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_op(
- s, buffers, transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_op<AsyncReadStream, MutableBufferSequence,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(
+ ReadHandler, void (boost::system::error_code, std::size_t))>(
+ s, buffers, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -545,6 +581,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         streambuf_(streambuf),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -555,6 +592,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         streambuf_(other.streambuf_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -564,6 +602,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         streambuf_(other.streambuf_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -574,7 +613,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t max_size, bytes_available;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         max_size = this->check_for_completion(ec, total_transferred_);
@@ -599,6 +638,7 @@
   //private:
     AsyncReadStream& stream_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -623,6 +663,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename Allocator,
+ typename CompletionCondition, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_streambuf_op<AsyncReadStream, Allocator,
+ CompletionCondition, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream,
       typename Allocator, typename CompletionCondition, typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -642,23 +693,13 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename Allocator,
- typename CompletionCondition, typename ReadHandler>
- inline read_streambuf_op<AsyncReadStream, Allocator,
- CompletionCondition, ReadHandler>
- make_read_streambuf_op(
- AsyncReadStream& s, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, ReadHandler handler)
- {
- return read_streambuf_op<AsyncReadStream, Allocator, CompletionCondition,
- ReadHandler>(s, b, completion_condition, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename Allocator,
     typename CompletionCondition, typename ReadHandler>
-inline void async_read(AsyncReadStream& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
@@ -667,13 +708,23 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_streambuf_op(
- s, b, completion_condition, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_streambuf_op<AsyncReadStream, Allocator,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(
+ ReadHandler, void (boost::system::error_code, std::size_t))>(
+ s, b, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-inline void async_read(AsyncReadStream& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -681,12 +732,20 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_streambuf_op(
- s, b, transfer_all(), BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_streambuf_op<AsyncReadStream, Allocator,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(
+ ReadHandler, void (boost::system::error_code, std::size_t))>(
+ s, b, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: branches/release/boost/asio/impl/read_at.hpp
==============================================================================
--- branches/release/boost/asio/impl/read_at.hpp (original)
+++ branches/release/boost/asio/impl/read_at.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/read_at.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -24,6 +24,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/dependent_type.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -37,7 +38,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -60,7 +61,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers)
+ uint64_t offset, const MutableBufferSequence& buffers)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_at(
@@ -71,7 +72,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     boost::system::error_code& ec)
 {
   return read_at(d, offset, buffers, transfer_all(), ec);
@@ -80,7 +81,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -90,12 +91,12 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -118,7 +119,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_at(
@@ -129,7 +130,7 @@
 
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     boost::system::error_code& ec)
 {
   return read_at(d, offset, b, transfer_all(), ec);
@@ -138,7 +139,7 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -148,7 +149,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -160,13 +161,14 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -178,6 +180,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -188,6 +191,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -197,7 +201,7 @@
     void operator()(const boost::system::error_code& ec,
         std::size_t bytes_transferred, int start = 0)
     {
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         buffers_.prepare(this->check_for_completion(ec, total_transferred_));
@@ -220,9 +224,10 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::detail::consuming_buffers<
       mutable_buffer, MutableBufferSequence> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -235,13 +240,14 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
+ uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -253,6 +259,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -263,6 +270,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -273,7 +281,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -296,8 +304,9 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::mutable_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -310,13 +319,14 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const boost::array<Elem, 2>& buffers,
+ uint64_t offset, const boost::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -328,6 +338,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -338,6 +349,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -354,7 +366,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -381,8 +393,9 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -397,13 +410,14 @@
   {
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, const std::array<Elem, 2>& buffers,
+ uint64_t offset, const std::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -415,6 +429,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -425,6 +440,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -441,7 +457,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -468,8 +484,9 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     std::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -498,6 +515,18 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncRandomAccessReadDevice,
+ typename MutableBufferSequence, typename CompletionCondition,
+ typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
+ CompletionCondition, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncRandomAccessReadDevice,
       typename MutableBufferSequence, typename CompletionCondition,
       typename ReadHandler>
@@ -526,7 +555,7 @@
   inline read_at_op<AsyncRandomAccessReadDevice,
       MutableBufferSequence, CompletionCondition, ReadHandler>
   make_read_at_op(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
       CompletionCondition completion_condition, ReadHandler handler)
   {
     return read_at_op<AsyncRandomAccessReadDevice,
@@ -537,8 +566,10 @@
 
 template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition, typename ReadHandler>
-inline void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -546,29 +577,45 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_at_op(
- d, offset, buffers, completion_condition,
- BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ d, offset, buffers, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename ReadHandler>
-inline void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_at_op(
- d, offset, buffers, transfer_all(),
- BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_at_op<AsyncRandomAccessReadDevice, MutableBufferSequence,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ d, offset, buffers, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -579,13 +626,14 @@
   {
   public:
     read_at_streambuf_op(AsyncRandomAccessReadDevice& device,
- boost::uint64_t offset, basic_streambuf<Allocator>& streambuf,
+ uint64_t offset, basic_streambuf<Allocator>& streambuf,
         CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         streambuf_(streambuf),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -597,6 +645,7 @@
         device_(other.device_),
         offset_(other.offset_),
         streambuf_(other.streambuf_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -607,6 +656,7 @@
         device_(other.device_),
         offset_(other.offset_),
         streambuf_(other.streambuf_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -617,7 +667,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t max_size, bytes_available;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         max_size = this->check_for_completion(ec, total_transferred_);
@@ -642,8 +692,9 @@
 
   //private:
     AsyncRandomAccessReadDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
+ int start_;
     std::size_t total_transferred_;
     ReadHandler handler_;
   };
@@ -668,6 +719,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncRandomAccessReadDevice, typename Allocator,
+ typename CompletionCondition, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
+ CompletionCondition, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncRandomAccessReadDevice,
       typename Allocator, typename CompletionCondition, typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -687,25 +749,14 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncRandomAccessReadDevice, typename Allocator,
- typename CompletionCondition, typename ReadHandler>
- inline read_at_streambuf_op<AsyncRandomAccessReadDevice,
- Allocator, CompletionCondition, ReadHandler>
- make_read_at_streambuf_op(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
- CompletionCondition completion_condition, ReadHandler handler)
- {
- return read_at_streambuf_op<AsyncRandomAccessReadDevice,
- Allocator, CompletionCondition, ReadHandler>(
- d, offset, b, completion_condition, handler);
- }
 } // namespace detail
 
 template <typename AsyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition, typename ReadHandler>
-inline void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -713,29 +764,45 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_at_streambuf_op(
- d, offset, b, completion_condition,
- BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ d, offset, b, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncRandomAccessReadDevice, typename Allocator,
     typename ReadHandler>
-inline void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_at_streambuf_op(
- d, offset, b, transfer_all(),
- BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_at_streambuf_op<AsyncRandomAccessReadDevice, Allocator,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ d, offset, b, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: branches/release/boost/asio/impl/read_until.hpp
==============================================================================
--- branches/release/boost/asio/impl/read_until.hpp (original)
+++ branches/release/boost/asio/impl/read_until.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/read_until.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,13 +19,14 @@
 #include <string>
 #include <vector>
 #include <utility>
-#include <boost/limits.hpp>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/buffers_iterator.hpp>
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
+#include <boost/asio/detail/limits.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -189,6 +190,8 @@
   }
 }
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 template <typename SyncReadStream, typename Allocator>
 inline std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr)
@@ -256,11 +259,13 @@
   }
 }
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, boost::system::error_code& ec,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   std::size_t search_position = 0;
   for (;;)
@@ -311,7 +316,7 @@
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 inline std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = read_until(s, b, match_condition, ec);
@@ -331,6 +336,7 @@
       : stream_(stream),
         streambuf_(streambuf),
         delim_(delim),
+ start_(0),
         search_position_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -341,6 +347,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         delim_(other.delim_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(other.handler_)
     {
@@ -350,6 +357,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         delim_(other.delim_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -361,7 +369,7 @@
     {
       const std::size_t not_found = (std::numeric_limits<std::size_t>::max)();
       std::size_t bytes_to_read;
- switch (start)
+ switch (start_ = start)
       {
       case 1:
         for (;;)
@@ -430,6 +438,7 @@
     AsyncReadStream& stream_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
     char delim_;
+ int start_;
     std::size_t search_position_;
     ReadHandler handler_;
   };
@@ -452,6 +461,16 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_until_delim_op<AsyncReadStream,
+ Allocator, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream, typename Allocator,
       typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -471,20 +490,12 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
- inline read_until_delim_op<AsyncReadStream, Allocator, ReadHandler>
- make_read_until_delim_op(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- char delim, ReadHandler handler)
- {
- return read_until_delim_op<AsyncReadStream, Allocator, ReadHandler>(
- s, b, delim, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, char delim,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -492,9 +503,17 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_until_delim_op(
- s, b, delim, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_until_delim_op<AsyncReadStream,
+ Allocator, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ s, b, delim, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 namespace detail
@@ -509,6 +528,7 @@
       : stream_(stream),
         streambuf_(streambuf),
         delim_(delim),
+ start_(0),
         search_position_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -519,6 +539,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         delim_(other.delim_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(other.handler_)
     {
@@ -528,6 +549,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         delim_(BOOST_ASIO_MOVE_CAST(std::string)(other.delim_)),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -539,7 +561,7 @@
     {
       const std::size_t not_found = (std::numeric_limits<std::size_t>::max)();
       std::size_t bytes_to_read;
- switch (start)
+ switch (start_ = start)
       {
       case 1:
         for (;;)
@@ -619,6 +641,7 @@
     AsyncReadStream& stream_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
     std::string delim_;
+ int start_;
     std::size_t search_position_;
     ReadHandler handler_;
   };
@@ -641,6 +664,16 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_until_delim_string_op<AsyncReadStream,
+ Allocator, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream,
       typename Allocator, typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -660,20 +693,12 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
- inline read_until_delim_string_op<AsyncReadStream, Allocator, ReadHandler>
- make_read_until_delim_string_op(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- const std::string& delim, ReadHandler handler)
- {
- return read_until_delim_string_op<AsyncReadStream, Allocator, ReadHandler>(
- s, b, delim, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -681,11 +706,21 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_until_delim_string_op(
- s, b, delim, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_until_delim_string_op<AsyncReadStream,
+ Allocator, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ s, b, delim, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 namespace detail
 {
   template <typename AsyncReadStream, typename Allocator,
@@ -699,6 +734,7 @@
       : stream_(stream),
         streambuf_(streambuf),
         expr_(expr),
+ start_(0),
         search_position_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -709,6 +745,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         expr_(other.expr_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(other.handler_)
     {
@@ -718,6 +755,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         expr_(other.expr_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -729,7 +767,7 @@
     {
       const std::size_t not_found = (std::numeric_limits<std::size_t>::max)();
       std::size_t bytes_to_read;
- switch (start)
+ switch (start_ = start)
       {
       case 1:
         for (;;)
@@ -812,6 +850,7 @@
     AsyncReadStream& stream_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
     RegEx expr_;
+ int start_;
     std::size_t search_position_;
     ReadHandler handler_;
   };
@@ -836,6 +875,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename Allocator,
+ typename RegEx, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_until_expr_op<AsyncReadStream,
+ Allocator, RegEx, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream, typename Allocator,
       typename RegEx, typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -855,21 +905,12 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename Allocator,
- typename RegEx, typename ReadHandler>
- inline read_until_expr_op<AsyncReadStream, Allocator, RegEx, ReadHandler>
- make_read_until_expr_op(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- const RegEx& expr, ReadHandler handler)
- {
- return read_until_expr_op<AsyncReadStream, Allocator, RegEx, ReadHandler>(
- s, b, expr, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
 {
@@ -877,11 +918,21 @@
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_until_expr_op(
- s, b, expr, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_until_expr_op<AsyncReadStream, Allocator,
+ boost::regex, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ s, b, expr, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+
 namespace detail
 {
   template <typename AsyncReadStream, typename Allocator,
@@ -895,6 +946,7 @@
       : stream_(stream),
         streambuf_(streambuf),
         match_condition_(match_condition),
+ start_(0),
         search_position_(0),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
@@ -905,6 +957,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         match_condition_(other.match_condition_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(other.handler_)
     {
@@ -914,6 +967,7 @@
       : stream_(other.stream_),
         streambuf_(other.streambuf_),
         match_condition_(other.match_condition_),
+ start_(other.start_),
         search_position_(other.search_position_),
         handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(other.handler_))
     {
@@ -925,7 +979,7 @@
     {
       const std::size_t not_found = (std::numeric_limits<std::size_t>::max)();
       std::size_t bytes_to_read;
- switch (start)
+ switch (start_ = start)
       {
       case 1:
         for (;;)
@@ -1004,6 +1058,7 @@
     AsyncReadStream& stream_;
     boost::asio::basic_streambuf<Allocator>& streambuf_;
     MatchCondition match_condition_;
+ int start_;
     std::size_t search_position_;
     ReadHandler handler_;
   };
@@ -1028,6 +1083,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncReadStream, typename Allocator,
+ typename MatchCondition, typename ReadHandler>
+ inline bool asio_handler_is_continuation(
+ read_until_match_op<AsyncReadStream,
+ Allocator, MatchCondition, ReadHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncReadStream, typename Allocator,
       typename MatchCondition, typename ReadHandler>
   inline void asio_handler_invoke(Function& function,
@@ -1047,35 +1113,32 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncReadStream, typename Allocator,
- typename MatchCondition, typename ReadHandler>
- inline read_until_match_op<AsyncReadStream, Allocator,
- MatchCondition, ReadHandler>
- make_read_until_match_op(AsyncReadStream& s,
- boost::asio::basic_streambuf<Allocator>& b,
- MatchCondition match_condition, ReadHandler handler)
- {
- return read_until_match_op<AsyncReadStream,
- Allocator, MatchCondition, ReadHandler>(
- s, b, match_condition, handler);
- }
 } // namespace detail
 
 template <typename AsyncReadStream, typename Allocator,
     typename MatchCondition, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type*)
+ typename enable_if<is_match_condition<MatchCondition>::value>::type*)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a ReadHandler.
   BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::make_read_until_match_op(
- s, b, match_condition, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::read_until_match_op<AsyncReadStream, Allocator,
+ MatchCondition, BOOST_ASIO_HANDLER_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))>(
+ s, b, match_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 } // namespace asio

Modified: branches/release/boost/asio/impl/serial_port_base.hpp
==============================================================================
--- branches/release/boost/asio/impl/serial_port_base.hpp (original)
+++ branches/release/boost/asio/impl/serial_port_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/serial_port_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/impl/serial_port_base.ipp
==============================================================================
--- branches/release/boost/asio/impl/serial_port_base.ipp (original)
+++ branches/release/boost/asio/impl/serial_port_base.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/serial_port_base.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,13 +21,13 @@
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT)
 
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/serial_port_base.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 
 #if defined(GENERATING_DOCUMENTATION)
 # define BOOST_ASIO_OPTION_STORAGE implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_OPTION_STORAGE DCB
 #else
 # define BOOST_ASIO_OPTION_STORAGE termios
@@ -41,7 +41,7 @@
 boost::system::error_code serial_port_base::baud_rate::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.BaudRate = value_;
 #else
   speed_t baud;
@@ -129,7 +129,7 @@
 boost::system::error_code serial_port_base::baud_rate::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   value_ = storage.BaudRate;
 #else
   speed_t baud = ::cfgetospeed(&storage);
@@ -215,14 +215,14 @@
   if (t != none && t != software && t != hardware)
   {
     std::out_of_range ex("invalid flow_control value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::flow_control::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.fOutxCtsFlow = FALSE;
   storage.fOutxDsrFlow = FALSE;
   storage.fTXContinueOnXoff = TRUE;
@@ -289,7 +289,7 @@
 boost::system::error_code serial_port_base::flow_control::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.fOutX && storage.fInX)
   {
     value_ = software;
@@ -333,14 +333,14 @@
   if (t != none && t != odd && t != even)
   {
     std::out_of_range ex("invalid parity value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::parity::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   switch (value_)
   {
   case none:
@@ -387,7 +387,7 @@
 boost::system::error_code serial_port_base::parity::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.Parity == EVENPARITY)
   {
     value_ = even;
@@ -428,14 +428,14 @@
   if (t != one && t != onepointfive && t != two)
   {
     std::out_of_range ex("invalid stop_bits value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::stop_bits::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   switch (value_)
   {
   case one:
@@ -471,7 +471,7 @@
 boost::system::error_code serial_port_base::stop_bits::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   if (storage.StopBits == ONESTOPBIT)
   {
     value_ = one;
@@ -501,14 +501,14 @@
   if (t < 5 || t > 8)
   {
     std::out_of_range ex("invalid character_size value");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 }
 
 boost::system::error_code serial_port_base::character_size::store(
     BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec) const
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   storage.ByteSize = value_;
 #else
   storage.c_cflag &= ~CSIZE;
@@ -528,7 +528,7 @@
 boost::system::error_code serial_port_base::character_size::load(
     const BOOST_ASIO_OPTION_STORAGE& storage, boost::system::error_code& ec)
 {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   value_ = storage.ByteSize;
 #else
   if ((storage.c_cflag & CSIZE) == CS5) { value_ = 5; }

Added: branches/release/boost/asio/impl/spawn.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/impl/spawn.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,330 @@
+//
+// impl/spawn.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMPL_SPAWN_HPP
+#define BOOST_ASIO_IMPL_SPAWN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
+#include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/noncopyable.hpp>
+#include <boost/asio/detail/shared_ptr.hpp>
+#include <boost/asio/handler_type.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+ template <typename Handler, typename T>
+ class coro_handler
+ {
+ public:
+ coro_handler(basic_yield_context<Handler> ctx)
+ : coro_(ctx.coro_.lock()),
+ ca_(ctx.ca_),
+ handler_(ctx.handler_),
+ ec_(ctx.ec_),
+ value_(0)
+ {
+ }
+
+ void operator()(T value)
+ {
+ *ec_ = boost::system::error_code();
+ *value_ = value;
+ (*coro_)();
+ }
+
+ void operator()(boost::system::error_code ec, T value)
+ {
+ *ec_ = ec;
+ *value_ = value;
+ (*coro_)();
+ }
+
+ //private:
+ detail::shared_ptr<boost::coroutines::coroutine<void()> > coro_;
+ boost::coroutines::coroutine<void()>::caller_type& ca_;
+ Handler& handler_;
+ boost::system::error_code* ec_;
+ T* value_;
+ };
+
+ template <typename Handler>
+ class coro_handler<Handler, void>
+ {
+ public:
+ coro_handler(basic_yield_context<Handler> ctx)
+ : coro_(ctx.coro_.lock()),
+ ca_(ctx.ca_),
+ handler_(ctx.handler_),
+ ec_(ctx.ec_)
+ {
+ }
+
+ void operator()()
+ {
+ *ec_ = boost::system::error_code();
+ (*coro_)();
+ }
+
+ void operator()(boost::system::error_code ec)
+ {
+ *ec_ = ec;
+ (*coro_)();
+ }
+
+ //private:
+ detail::shared_ptr<boost::coroutines::coroutine<void()> > coro_;
+ boost::coroutines::coroutine<void()>::caller_type& ca_;
+ Handler& handler_;
+ boost::system::error_code* ec_;
+ };
+
+ template <typename Handler, typename T>
+ inline void* asio_handler_allocate(std::size_t size,
+ coro_handler<Handler, T>* this_handler)
+ {
+ return boost_asio_handler_alloc_helpers::allocate(
+ size, this_handler->handler_);
+ }
+
+ template <typename Handler, typename T>
+ inline void asio_handler_deallocate(void* pointer, std::size_t size,
+ coro_handler<Handler, T>* this_handler)
+ {
+ boost_asio_handler_alloc_helpers::deallocate(
+ pointer, size, this_handler->handler_);
+ }
+
+ template <typename Handler, typename T>
+ inline bool asio_handler_is_continuation(coro_handler<Handler, T>*)
+ {
+ return true;
+ }
+
+ template <typename Function, typename Handler, typename T>
+ inline void asio_handler_invoke(Function& function,
+ coro_handler<Handler, T>* this_handler)
+ {
+ boost_asio_handler_invoke_helpers::invoke(
+ function, this_handler->handler_);
+ }
+
+ template <typename Function, typename Handler, typename T>
+ inline void asio_handler_invoke(const Function& function,
+ coro_handler<Handler, T>* this_handler)
+ {
+ boost_asio_handler_invoke_helpers::invoke(
+ function, this_handler->handler_);
+ }
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+template <typename Handler, typename ReturnType>
+struct handler_type<basic_yield_context<Handler>, ReturnType()>
+{
+ typedef detail::coro_handler<Handler, void> type;
+};
+
+template <typename Handler, typename ReturnType, typename Arg1>
+struct handler_type<basic_yield_context<Handler>, ReturnType(Arg1)>
+{
+ typedef detail::coro_handler<Handler, Arg1> type;
+};
+
+template <typename Handler, typename ReturnType>
+struct handler_type<basic_yield_context<Handler>,
+ ReturnType(boost::system::error_code)>
+{
+ typedef detail::coro_handler<Handler, void> type;
+};
+
+template <typename Handler, typename ReturnType, typename Arg2>
+struct handler_type<basic_yield_context<Handler>,
+ ReturnType(boost::system::error_code, Arg2)>
+{
+ typedef detail::coro_handler<Handler, Arg2> type;
+};
+
+template <typename Handler, typename T>
+class async_result<detail::coro_handler<Handler, T> >
+{
+public:
+ typedef T type;
+
+ explicit async_result(detail::coro_handler<Handler, T>& h)
+ : ca_(h.ca_)
+ {
+ out_ec_ = h.ec_;
+ if (!out_ec_) h.ec_ = &ec_;
+ h.value_ = &value_;
+ }
+
+ type get()
+ {
+ ca_();
+ if (!out_ec_ && ec_) throw boost::system::system_error(ec_);
+ return value_;
+ }
+
+private:
+ boost::coroutines::coroutine<void()>::caller_type& ca_;
+ boost::system::error_code* out_ec_;
+ boost::system::error_code ec_;
+ type value_;
+};
+
+template <typename Handler>
+class async_result<detail::coro_handler<Handler, void> >
+{
+public:
+ typedef void type;
+
+ explicit async_result(detail::coro_handler<Handler, void>& h)
+ : ca_(h.ca_)
+ {
+ out_ec_ = h.ec_;
+ if (!out_ec_) h.ec_ = &ec_;
+ }
+
+ void get()
+ {
+ ca_();
+ if (!out_ec_ && ec_) throw boost::system::system_error(ec_);
+ }
+
+private:
+ boost::coroutines::coroutine<void()>::caller_type& ca_;
+ boost::system::error_code* out_ec_;
+ boost::system::error_code ec_;
+};
+
+namespace detail {
+
+ template <typename Handler, typename Function>
+ struct spawn_data : private noncopyable
+ {
+ spawn_data(BOOST_ASIO_MOVE_ARG(Handler) handler,
+ bool call_handler, BOOST_ASIO_MOVE_ARG(Function) function)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ call_handler_(call_handler),
+ function_(BOOST_ASIO_MOVE_CAST(Function)(function))
+ {
+ }
+
+ weak_ptr<boost::coroutines::coroutine<void()> > coro_;
+ Handler handler_;
+ bool call_handler_;
+ Function function_;
+ };
+
+ template <typename Handler, typename Function>
+ struct coro_entry_point
+ {
+ void operator()(boost::coroutines::coroutine<void()>::caller_type& ca)
+ {
+ shared_ptr<spawn_data<Handler, Function> > data(data_);
+ ca(); // Yield until coroutine pointer has been initialised.
+ const basic_yield_context<Handler> yield(
+ data->coro_, ca, data->handler_);
+ (data->function_)(yield);
+ if (data->call_handler_)
+ (data->handler_)();
+ }
+
+ shared_ptr<spawn_data<Handler, Function> > data_;
+ };
+
+ template <typename Handler, typename Function>
+ struct spawn_helper
+ {
+ void operator()()
+ {
+ coro_entry_point<Handler, Function> entry_point = { data_ };
+ shared_ptr<boost::coroutines::coroutine<void()> > coro(
+ new boost::coroutines::coroutine<void()>(entry_point, attributes_));
+ data_->coro_ = coro;
+ (*coro)();
+ }
+
+ shared_ptr<spawn_data<Handler, Function> > data_;
+ boost::coroutines::attributes attributes_;
+ };
+
+ inline void default_spawn_handler() {}
+
+} // namespace detail
+
+template <typename Handler, typename Function>
+void spawn(BOOST_ASIO_MOVE_ARG(Handler) handler,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes)
+{
+ detail::spawn_helper<Handler, Function> helper;
+ helper.data_.reset(
+ new detail::spawn_data<Handler, Function>(
+ BOOST_ASIO_MOVE_CAST(Handler)(handler), true,
+ BOOST_ASIO_MOVE_CAST(Function)(function)));
+ helper.attributes_ = attributes;
+ boost_asio_handler_invoke_helpers::invoke(helper, helper.data_->handler_);
+}
+
+template <typename Handler, typename Function>
+void spawn(basic_yield_context<Handler> ctx,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes)
+{
+ Handler handler(ctx.handler_); // Explicit copy that might be moved from.
+ detail::spawn_helper<Handler, Function> helper;
+ helper.data_.reset(
+ new detail::spawn_data<Handler, Function>(
+ BOOST_ASIO_MOVE_CAST(Handler)(handler), false,
+ BOOST_ASIO_MOVE_CAST(Function)(function)));
+ helper.attributes_ = attributes;
+ boost_asio_handler_invoke_helpers::invoke(helper, helper.data_->handler_);
+}
+
+template <typename Function>
+void spawn(boost::asio::io_service::strand strand,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes)
+{
+ boost::asio::spawn(strand.wrap(&detail::default_spawn_handler),
+ BOOST_ASIO_MOVE_CAST(Function)(function), attributes);
+}
+
+template <typename Function>
+void spawn(boost::asio::io_service& io_service,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes)
+{
+ boost::asio::spawn(boost::asio::io_service::strand(io_service),
+ BOOST_ASIO_MOVE_CAST(Function)(function), attributes);
+}
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_SPAWN_HPP

Modified: branches/release/boost/asio/impl/src.cpp
==============================================================================
--- branches/release/boost/asio/impl/src.cpp (original)
+++ branches/release/boost/asio/impl/src.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/src.cpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/impl/src.hpp
==============================================================================
--- branches/release/boost/asio/impl/src.hpp (original)
+++ branches/release/boost/asio/impl/src.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/src.hpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -59,6 +59,7 @@
 #include <boost/asio/detail/impl/win_thread.ipp>
 #include <boost/asio/detail/impl/win_tss_ptr.ipp>
 #include <boost/asio/detail/impl/winsock_init.ipp>
+#include <boost/asio/generic/detail/impl/endpoint.ipp>
 #include <boost/asio/ip/impl/address.ipp>
 #include <boost/asio/ip/impl/address_v4.ipp>
 #include <boost/asio/ip/impl/address_v6.ipp>

Added: branches/release/boost/asio/impl/use_future.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/impl/use_future.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,174 @@
+//
+// impl/use_future.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_IMPL_USE_FUTURE_HPP
+#define BOOST_ASIO_IMPL_USE_FUTURE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <future>
+#include <boost/asio/async_result.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/asio/handler_type.hpp>
+#include <boost/system/system_error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+ // Completion handler to adapt a promise as a completion handler.
+ template <typename T>
+ class promise_handler
+ {
+ public:
+ // Construct from use_future special value.
+ template <typename Allocator>
+ promise_handler(use_future_t<Allocator> uf)
+ : promise_(std::allocate_shared<std::promise<T> >(
+ uf.get_allocator(), std::allocator_arg, uf.get_allocator()))
+ {
+ }
+
+ void operator()(T t)
+ {
+ promise_->set_value(t);
+ }
+
+ void operator()(const boost::system::error_code& ec, T t)
+ {
+ if (ec)
+ promise_->set_exception(
+ std::make_exception_ptr(
+ boost::system::system_error(ec)));
+ else
+ promise_->set_value(t);
+ }
+
+ //private:
+ std::shared_ptr<std::promise<T> > promise_;
+ };
+
+ // Completion handler to adapt a void promise as a completion handler.
+ template <>
+ class promise_handler<void>
+ {
+ public:
+ // Construct from use_future special value. Used during rebinding.
+ template <typename Allocator>
+ promise_handler(use_future_t<Allocator> uf)
+ : promise_(std::allocate_shared<std::promise<void> >(
+ uf.get_allocator(), std::allocator_arg, uf.get_allocator()))
+ {
+ }
+
+ void operator()()
+ {
+ promise_->set_value();
+ }
+
+ void operator()(const boost::system::error_code& ec)
+ {
+ if (ec)
+ promise_->set_exception(
+ std::make_exception_ptr(
+ boost::system::system_error(ec)));
+ else
+ promise_->set_value();
+ }
+
+ //private:
+ std::shared_ptr<std::promise<void> > promise_;
+ };
+
+ // Ensure any exceptions thrown from the handler are propagated back to the
+ // caller via the future.
+ template <typename Function, typename T>
+ void asio_handler_invoke(Function f, promise_handler<T>* h)
+ {
+ std::shared_ptr<std::promise<T> > p(h->promise_);
+ try
+ {
+ f();
+ }
+ catch (...)
+ {
+ p->set_exception(std::current_exception());
+ }
+ }
+
+} // namespace detail
+
+#if !defined(GENERATING_DOCUMENTATION)
+
+// Handler traits specialisation for promise_handler.
+template <typename T>
+class async_result<detail::promise_handler<T> >
+{
+public:
+ // The initiating function will return a future.
+ typedef std::future<T> type;
+
+ // Constructor creates a new promise for the async operation, and obtains the
+ // corresponding future.
+ explicit async_result(detail::promise_handler<T>& h)
+ {
+ value_ = h.promise_->get_future();
+ }
+
+ // Obtain the future to be returned from the initiating function.
+ type get() { return std::move(value_); }
+
+private:
+ type value_;
+};
+
+// Handler type specialisation for use_future.
+template <typename Allocator, typename ReturnType>
+struct handler_type<use_future_t<Allocator>, ReturnType()>
+{
+ typedef detail::promise_handler<void> type;
+};
+
+// Handler type specialisation for use_future.
+template <typename Allocator, typename ReturnType, typename Arg1>
+struct handler_type<use_future_t<Allocator>, ReturnType(Arg1)>
+{
+ typedef detail::promise_handler<Arg1> type;
+};
+
+// Handler type specialisation for use_future.
+template <typename Allocator, typename ReturnType>
+struct handler_type<use_future_t<Allocator>,
+ ReturnType(boost::system::error_code)>
+{
+ typedef detail::promise_handler<void> type;
+};
+
+// Handler type specialisation for use_future.
+template <typename Allocator, typename ReturnType, typename Arg2>
+struct handler_type<use_future_t<Allocator>,
+ ReturnType(boost::system::error_code, Arg2)>
+{
+ typedef detail::promise_handler<Arg2> type;
+};
+
+#endif // !defined(GENERATING_DOCUMENTATION)
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_USE_FUTURE_HPP

Modified: branches/release/boost/asio/impl/write.hpp
==============================================================================
--- branches/release/boost/asio/impl/write.hpp (original)
+++ branches/release/boost/asio/impl/write.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/write.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/dependent_type.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -81,7 +82,7 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncWriteStream, typename Allocator,
     typename CompletionCondition>
@@ -124,7 +125,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -140,6 +141,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -150,6 +152,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -159,6 +162,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -168,7 +172,7 @@
     void operator()(const boost::system::error_code& ec,
         std::size_t bytes_transferred, int start = 0)
     {
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         buffers_.prepare(this->check_for_completion(ec, total_transferred_));
@@ -193,6 +197,7 @@
     AsyncWriteStream& stream_;
     boost::asio::detail::consuming_buffers<
       const_buffer, ConstBufferSequence> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -212,6 +217,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -222,6 +228,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -231,6 +238,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -241,7 +249,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -265,6 +273,7 @@
   //private:
     AsyncWriteStream& stream_;
     boost::asio::mutable_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -284,6 +293,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -294,6 +304,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -303,6 +314,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -313,7 +325,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -337,6 +349,7 @@
   //private:
     AsyncWriteStream& stream_;
     boost::asio::const_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -354,6 +367,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -364,6 +378,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -373,6 +388,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -389,7 +405,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -416,6 +432,7 @@
   //private:
     AsyncWriteStream& stream_;
     boost::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -435,6 +452,7 @@
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -445,6 +463,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -454,6 +473,7 @@
       : detail::base_from_completion_cond<CompletionCondition>(other),
         stream_(other.stream_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -470,7 +490,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -497,6 +517,7 @@
   //private:
     AsyncWriteStream& stream_;
     std::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -523,6 +544,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncWriteStream, typename ConstBufferSequence,
+ typename CompletionCondition, typename WriteHandler>
+ inline bool asio_handler_is_continuation(
+ write_op<AsyncWriteStream, ConstBufferSequence,
+ CompletionCondition, WriteHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncWriteStream,
       typename ConstBufferSequence, typename CompletionCondition,
       typename WriteHandler>
@@ -544,22 +576,13 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename AsyncWriteStream, typename ConstBufferSequence,
- typename CompletionCondition, typename WriteHandler>
- inline write_op<AsyncWriteStream, ConstBufferSequence,
- CompletionCondition, WriteHandler>
- make_write_op(AsyncWriteStream& s, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, WriteHandler handler)
- {
- return write_op<AsyncWriteStream, ConstBufferSequence, CompletionCondition,
- WriteHandler>(s, buffers, completion_condition, handler);
- }
 } // namespace detail
 
 template <typename AsyncWriteStream, typename ConstBufferSequence,
   typename CompletionCondition, typename WriteHandler>
-inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -567,27 +590,44 @@
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- detail::make_write_op(
- s, buffers, completion_condition,
- BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ detail::write_op<AsyncWriteStream, ConstBufferSequence,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ s, buffers, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncWriteStream, typename ConstBufferSequence,
     typename WriteHandler>
-inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- detail::make_write_op(
- s, buffers, transfer_all(), BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ detail::write_op<AsyncWriteStream, ConstBufferSequence,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ s, buffers, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -644,6 +684,14 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename Allocator, typename WriteHandler>
+ inline bool asio_handler_is_continuation(
+ write_streambuf_handler<Allocator, WriteHandler>* this_handler)
+ {
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename Allocator, typename WriteHandler>
   inline void asio_handler_invoke(Function& function,
       write_streambuf_handler<Allocator, WriteHandler>* this_handler)
@@ -659,19 +707,13 @@
     boost_asio_handler_invoke_helpers::invoke(
         function, this_handler->handler_);
   }
-
- template <typename Allocator, typename WriteHandler>
- inline write_streambuf_handler<Allocator, WriteHandler>
- make_write_streambuf_handler(
- boost::asio::basic_streambuf<Allocator>& b, WriteHandler handler)
- {
- return write_streambuf_handler<Allocator, WriteHandler>(b, handler);
- }
 } // namespace detail
 
 template <typename AsyncWriteStream, typename Allocator,
     typename CompletionCondition, typename WriteHandler>
-inline void async_write(AsyncWriteStream& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
@@ -680,13 +722,22 @@
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
   async_write(s, b.data(), completion_condition,
- detail::make_write_streambuf_handler(
- b, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
+ detail::write_streambuf_handler<Allocator, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ b, init.handler));
+
+ return init.result.get();
 }
 
 template <typename AsyncWriteStream, typename Allocator, typename WriteHandler>
-inline void async_write(AsyncWriteStream& s,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -694,12 +745,19 @@
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
   async_write(s, b.data(), transfer_all(),
- detail::make_write_streambuf_handler(
- b, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
+ detail::write_streambuf_handler<Allocator, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ b, init.handler));
+
+ return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: branches/release/boost/asio/impl/write_at.hpp
==============================================================================
--- branches/release/boost/asio/impl/write_at.hpp (original)
+++ branches/release/boost/asio/impl/write_at.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/write_at.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/dependent_type.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
@@ -35,7 +36,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   ec = boost::system::error_code();
@@ -58,7 +59,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers)
+ uint64_t offset, const ConstBufferSequence& buffers)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = write_at(
@@ -69,7 +70,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     boost::system::error_code& ec)
 {
   return write_at(d, offset, buffers, transfer_all(), ec);
@@ -78,7 +79,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -88,12 +89,12 @@
   return bytes_transferred;
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec)
 {
   std::size_t bytes_transferred = write_at(
@@ -104,7 +105,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b)
 {
   boost::system::error_code ec;
   std::size_t bytes_transferred = write_at(d, offset, b, transfer_all(), ec);
@@ -114,7 +115,7 @@
 
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     boost::system::error_code& ec)
 {
   return write_at(d, offset, b, transfer_all(), ec);
@@ -123,7 +124,7 @@
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition)
 {
   boost::system::error_code ec;
@@ -133,7 +134,7 @@
   return bytes_transferred;
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -144,13 +145,14 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -162,6 +164,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -172,6 +175,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -181,7 +185,7 @@
     void operator()(const boost::system::error_code& ec,
         std::size_t bytes_transferred, int start = 0)
     {
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         buffers_.prepare(this->check_for_completion(ec, total_transferred_));
@@ -205,9 +209,10 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::detail::consuming_buffers<
       const_buffer, ConstBufferSequence> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -220,7 +225,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
+ uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition,
         WriteHandler& handler)
       : detail::base_from_completion_cond<
@@ -228,6 +233,7 @@
         device_(device),
         offset_(offset),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -239,6 +245,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -249,6 +256,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -259,7 +267,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -282,8 +290,9 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::mutable_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -296,7 +305,7 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::asio::const_buffers_1& buffers,
+ uint64_t offset, const boost::asio::const_buffers_1& buffers,
         CompletionCondition completion_condition,
         WriteHandler& handler)
       : detail::base_from_completion_cond<
@@ -304,6 +313,7 @@
         device_(device),
         offset_(offset),
         buffer_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -315,6 +325,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -325,6 +336,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffer_(other.buffer_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -335,7 +347,7 @@
         std::size_t bytes_transferred, int start = 0)
     {
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -358,8 +370,9 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::asio::const_buffer buffer_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -372,13 +385,14 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const boost::array<Elem, 2>& buffers,
+ uint64_t offset, const boost::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -390,6 +404,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -400,6 +415,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -416,7 +432,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -443,8 +459,9 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     boost::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -459,13 +476,14 @@
   {
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
- boost::uint64_t offset, const std::array<Elem, 2>& buffers,
+ uint64_t offset, const std::array<Elem, 2>& buffers,
         CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
+ start_(0),
         total_transferred_(0),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
@@ -477,6 +495,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(other.handler_)
     {
@@ -487,6 +506,7 @@
         device_(other.device_),
         offset_(other.offset_),
         buffers_(other.buffers_),
+ start_(other.start_),
         total_transferred_(other.total_transferred_),
         handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(other.handler_))
     {
@@ -503,7 +523,7 @@
       std::size_t buffer_size0 = boost::asio::buffer_size(bufs[0]);
       std::size_t buffer_size1 = boost::asio::buffer_size(bufs[1]);
       std::size_t n = 0;
- switch (start)
+ switch (start_ = start)
       {
         case 1:
         n = this->check_for_completion(ec, total_transferred_);
@@ -530,8 +550,9 @@
 
   //private:
     AsyncRandomAccessWriteDevice& device_;
- boost::uint64_t offset_;
+ uint64_t offset_;
     std::array<Elem, 2> buffers_;
+ int start_;
     std::size_t total_transferred_;
     WriteHandler handler_;
   };
@@ -558,6 +579,17 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
+ typename CompletionCondition, typename WriteHandler>
+ inline bool asio_handler_is_continuation(
+ write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
+ CompletionCondition, WriteHandler>* this_handler)
+ {
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename AsyncRandomAccessWriteDevice,
       typename ConstBufferSequence, typename CompletionCondition,
       typename WriteHandler>
@@ -585,7 +617,7 @@
   inline write_at_op<AsyncRandomAccessWriteDevice,
       ConstBufferSequence, CompletionCondition, WriteHandler>
   make_write_at_op(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
       CompletionCondition completion_condition, WriteHandler handler)
   {
     return write_at_op<AsyncRandomAccessWriteDevice,
@@ -596,8 +628,10 @@
 
 template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition, typename WriteHandler>
-inline void async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -605,29 +639,45 @@
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- detail::make_write_at_op(
- d, offset, buffers, completion_condition,
- BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ detail::write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
+ CompletionCondition, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ d, offset, buffers, completion_condition, init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
 template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename WriteHandler>
-inline void async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- detail::make_write_at_op(
- d, offset, buffers, transfer_all(),
- BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))(
- boost::system::error_code(), 0, 1);
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ detail::write_at_op<AsyncRandomAccessWriteDevice, ConstBufferSequence,
+ detail::transfer_all_t, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ d, offset, buffers, transfer_all(), init.handler)(
+ boost::system::error_code(), 0, 1);
+
+ return init.result.get();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 namespace detail
 {
@@ -685,6 +735,14 @@
         pointer, size, this_handler->handler_);
   }
 
+ template <typename Allocator, typename WriteHandler>
+ inline bool asio_handler_is_continuation(
+ write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
+ {
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->handler_);
+ }
+
   template <typename Function, typename Allocator, typename WriteHandler>
   inline void asio_handler_invoke(Function& function,
       write_at_streambuf_op<Allocator, WriteHandler>* this_handler)
@@ -712,8 +770,10 @@
 
 template <typename AsyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition, typename WriteHandler>
-inline void async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
@@ -721,27 +781,43 @@
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
   async_write_at(d, offset, b.data(), completion_condition,
- detail::make_write_at_streambuf_op(
- b, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
+ detail::write_at_streambuf_op<Allocator, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ b, init.handler));
+
+ return init.result.get();
 }
 
 template <typename AsyncRandomAccessWriteDevice, typename Allocator,
     typename WriteHandler>
-inline void async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+inline BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
 {
   // If you get an error on the following line it means that your handler does
   // not meet the documented type requirements for a WriteHandler.
   BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
   async_write_at(d, offset, b.data(), transfer_all(),
- detail::make_write_at_streambuf_op(
- b, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
+ detail::write_at_streambuf_op<Allocator, BOOST_ASIO_HANDLER_TYPE(
+ WriteHandler, void (boost::system::error_code, std::size_t))>(
+ b, init.handler));
+
+ return init.result.get();
 }
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace asio
 } // namespace boost

Modified: branches/release/boost/asio/io_service.hpp
==============================================================================
--- branches/release/boost/asio/io_service.hpp (original)
+++ branches/release/boost/asio/io_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // io_service.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,6 +19,7 @@
 #include <cstddef>
 #include <stdexcept>
 #include <typeinfo>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/noncopyable.hpp>
 #include <boost/asio/detail/service_registry_fwd.hpp>
 #include <boost/asio/detail/wrapped_handler.hpp>
@@ -30,7 +31,7 @@
 # include <boost/asio/detail/task_io_service_fwd.hpp>
 #endif
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # include <boost/asio/detail/winsock_init.hpp>
 #elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
   || defined(__osf__)
@@ -441,7 +442,8 @@
    * throws an exception.
    */
   template <typename CompletionHandler>
- void dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler);
+ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+ dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler);
 
   /// Request the io_service to invoke the given handler and return immediately.
   /**
@@ -466,7 +468,8 @@
    * throws an exception.
    */
   template <typename CompletionHandler>
- void post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler);
+ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+ post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler);
 
   /// Create a new handler that automatically dispatches the wrapped handler
   /// on the io_service.
@@ -600,7 +603,7 @@
   friend bool has_service(io_service& ios);
 
 private:
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   detail::winsock_init<> init_;
 #elif defined(__sun) || defined(__QNX__) || defined(__hpux) || defined(_AIX) \
   || defined(__osf__)

Modified: branches/release/boost/asio/ip/address.hpp
==============================================================================
--- branches/release/boost/asio/ip/address.hpp (original)
+++ branches/release/boost/asio/ip/address.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/address.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,9 +21,9 @@
 #include <boost/asio/ip/address_v4.hpp>
 #include <boost/asio/ip/address_v6.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -168,7 +168,7 @@
   boost::asio::ip::address_v6 ipv6_address_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -186,7 +186,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: branches/release/boost/asio/ip/address_v4.hpp
==============================================================================
--- branches/release/boost/asio/ip/address_v4.hpp (original)
+++ branches/release/boost/asio/ip/address_v4.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/address_v4.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,9 +22,9 @@
 #include <boost/asio/detail/winsock_init.hpp>
 #include <boost/system/error_code.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -209,7 +209,7 @@
   boost::asio::detail::in4_addr_type addr_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -227,7 +227,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address_v4& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: branches/release/boost/asio/ip/address_v6.hpp
==============================================================================
--- branches/release/boost/asio/ip/address_v6.hpp (original)
+++ branches/release/boost/asio/ip/address_v6.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/address_v6.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,9 +23,9 @@
 #include <boost/system/error_code.hpp>
 #include <boost/asio/ip/address_v4.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -214,7 +214,7 @@
   unsigned long scope_id_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an address as a string.
 /**
@@ -232,7 +232,7 @@
 std::basic_ostream<Elem, Traits>& operator<<(
     std::basic_ostream<Elem, Traits>& os, const address_v6& addr);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: branches/release/boost/asio/ip/basic_endpoint.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_endpoint.hpp (original)
+++ branches/release/boost/asio/ip/basic_endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/basic_endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,9 @@
 #include <boost/asio/ip/address.hpp>
 #include <boost/asio/ip/detail/endpoint.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -233,7 +233,7 @@
   boost::asio::ip::detail::endpoint impl_;
 };
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Output an endpoint as a string.
 /**
@@ -252,7 +252,7 @@
     std::basic_ostream<Elem, Traits>& os,
     const basic_endpoint<InternetProtocol>& endpoint);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace ip
 } // namespace asio

Modified: branches/release/boost/asio/ip/basic_resolver.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_resolver.hpp (original)
+++ branches/release/boost/asio/ip/basic_resolver.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/basic_resolver.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -153,7 +153,9 @@
    * the handler.
    */
   template <typename ResolveHandler>
- void async_resolve(const query& q,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
+ void (boost::system::error_code, iterator))
+ async_resolve(const query& q,
       BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
@@ -244,7 +246,9 @@
    * the handler.
    */
   template <typename ResolveHandler>
- void async_resolve(const endpoint_type& e,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
+ void (boost::system::error_code, iterator))
+ async_resolve(const endpoint_type& e,
       BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
   {
     // If you get an error on the following line it means that your handler does

Modified: branches/release/boost/asio/ip/basic_resolver_entry.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_resolver_entry.hpp (original)
+++ branches/release/boost/asio/ip/basic_resolver_entry.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/basic_resolver_entry.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/basic_resolver_iterator.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_resolver_iterator.hpp (original)
+++ branches/release/boost/asio/ip/basic_resolver_iterator.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/basic_resolver_iterator.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/basic_resolver_query.hpp
==============================================================================
--- branches/release/boost/asio/ip/basic_resolver_query.hpp (original)
+++ branches/release/boost/asio/ip/basic_resolver_query.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/basic_resolver_query.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/detail/endpoint.hpp
==============================================================================
--- branches/release/boost/asio/ip/detail/endpoint.hpp (original)
+++ branches/release/boost/asio/ip/detail/endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/detail/endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -112,10 +112,10 @@
     return data_.base.sa_family == AF_INET;
   }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   // Convert to a string.
   BOOST_ASIO_DECL std::string to_string(boost::system::error_code& ec) const;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 private:
   // The underlying IP socket address.

Modified: branches/release/boost/asio/ip/detail/impl/endpoint.ipp
==============================================================================
--- branches/release/boost/asio/ip/detail/impl/endpoint.ipp (original)
+++ branches/release/boost/asio/ip/detail/impl/endpoint.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/detail/impl/endpoint.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstring>
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <sstream>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
@@ -177,7 +177,7 @@
   return e1.port() < e2.port();
 }
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 std::string endpoint::to_string(boost::system::error_code& ec) const
 {
   std::string a = address().to_string(ec);
@@ -194,7 +194,7 @@
 
   return tmp_os.str();
 }
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 } // namespace detail
 } // namespace ip

Modified: branches/release/boost/asio/ip/detail/socket_option.hpp
==============================================================================
--- branches/release/boost/asio/ip/detail/socket_option.hpp (original)
+++ branches/release/boost/asio/ip/detail/socket_option.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // detail/socket_option.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,9 @@
 #include <cstddef>
 #include <cstring>
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/socket_types.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/ip/address.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -142,7 +142,7 @@
       if (s != sizeof(ipv6_value_))
       {
         std::length_error ex("multicast_enable_loopback socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv4_value_ = ipv6_value_ ? 1 : 0;
     }
@@ -151,7 +151,7 @@
       if (s != sizeof(ipv4_value_))
       {
         std::length_error ex("multicast_enable_loopback socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv6_value_ = ipv4_value_ ? 1 : 0;
     }
@@ -238,7 +238,7 @@
     if (s != sizeof(value_))
     {
       std::length_error ex("unicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
 #if defined(__hpux)
     if (value_ < 0)
@@ -255,7 +255,7 @@
 class multicast_hops
 {
 public:
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   typedef int ipv4_value_type;
 #else
   typedef unsigned char ipv4_value_type;
@@ -275,7 +275,7 @@
     if (v < 0 || v > 255)
     {
       std::out_of_range ex("multicast hops value out of range");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
     ipv4_value_ = (ipv4_value_type)v;
     ipv6_value_ = v;
@@ -287,7 +287,7 @@
     if (v < 0 || v > 255)
     {
       std::out_of_range ex("multicast hops value out of range");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
     ipv4_value_ = (ipv4_value_type)v;
     ipv6_value_ = v;
@@ -354,7 +354,7 @@
       if (s != sizeof(ipv6_value_))
       {
         std::length_error ex("multicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       if (ipv6_value_ < 0)
         ipv4_value_ = 0;
@@ -368,7 +368,7 @@
       if (s != sizeof(ipv4_value_))
       {
         std::length_error ex("multicast hops socket option resize");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
       }
       ipv6_value_ = ipv4_value_;
     }

Modified: branches/release/boost/asio/ip/host_name.hpp
==============================================================================
--- branches/release/boost/asio/ip/host_name.hpp (original)
+++ branches/release/boost/asio/ip/host_name.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/host_name.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/icmp.hpp
==============================================================================
--- branches/release/boost/asio/ip/icmp.hpp (original)
+++ branches/release/boost/asio/ip/icmp.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/icmp.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/impl/address.hpp
==============================================================================
--- branches/release/boost/asio/ip/impl/address.hpp (original)
+++ branches/release/boost/asio/ip/impl/address.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_HPP

Modified: branches/release/boost/asio/ip/impl/address.ipp
==============================================================================
--- branches/release/boost/asio/ip/impl/address.ipp (original)
+++ branches/release/boost/asio/ip/impl/address.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address.ipp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,8 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <typeinfo>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ip/address.hpp>
 #include <boost/system/system_error.hpp>
@@ -105,7 +105,7 @@
   if (type_ != ipv4)
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
   return ipv4_address_;
 }
@@ -115,7 +115,7 @@
   if (type_ != ipv6)
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
   return ipv6_address_;
 }

Modified: branches/release/boost/asio/ip/impl/address_v4.hpp
==============================================================================
--- branches/release/boost/asio/ip/impl/address_v4.hpp (original)
+++ branches/release/boost/asio/ip/impl/address_v4.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address_v4.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_V4_HPP

Modified: branches/release/boost/asio/ip/impl/address_v4.ipp
==============================================================================
--- branches/release/boost/asio/ip/impl/address_v4.ipp (original)
+++ branches/release/boost/asio/ip/impl/address_v4.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address_v4.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,10 +18,10 @@
 #include <boost/asio/detail/config.hpp>
 #include <climits>
 #include <stdexcept>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/ip/address_v4.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -37,7 +37,7 @@
       || bytes[2] > 0xFF || bytes[3] > 0xFF)
   {
     std::out_of_range ex("address_v4 from bytes_type");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 #endif // UCHAR_MAX > 0xFF
 
@@ -51,7 +51,7 @@
   if (addr > 0xFFFFFFFF)
   {
     std::out_of_range ex("address_v4 from unsigned long");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 #endif // ULONG_MAX > 0xFFFFFFFF
 

Modified: branches/release/boost/asio/ip/impl/address_v6.hpp
==============================================================================
--- branches/release/boost/asio/ip/impl/address_v6.hpp (original)
+++ branches/release/boost/asio/ip/impl/address_v6.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address_v6.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -50,6 +50,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_ADDRESS_V6_HPP

Modified: branches/release/boost/asio/ip/impl/address_v6.ipp
==============================================================================
--- branches/release/boost/asio/ip/impl/address_v6.ipp (original)
+++ branches/release/boost/asio/ip/impl/address_v6.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/address_v6.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,9 @@
 #include <cstring>
 #include <stdexcept>
 #include <typeinfo>
-#include <boost/throw_exception.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/throw_exception.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ip/address_v6.hpp>
 
@@ -47,7 +47,7 @@
     if (bytes[i] > 0xFF)
     {
       std::out_of_range ex("address_v6 from bytes_type");
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
     }
   }
 #endif // UCHAR_MAX > 0xFF
@@ -151,7 +151,7 @@
   if (!is_v4_mapped() && !is_v4_compatible())
   {
     std::bad_cast ex;
- boost::throw_exception(ex);
+ boost::asio::detail::throw_exception(ex);
   }
 
   address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12],

Modified: branches/release/boost/asio/ip/impl/basic_endpoint.hpp
==============================================================================
--- branches/release/boost/asio/ip/impl/basic_endpoint.hpp (original)
+++ branches/release/boost/asio/ip/impl/basic_endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/basic_endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/throw_error.hpp>
 
@@ -52,6 +52,6 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_IP_IMPL_BASIC_ENDPOINT_HPP

Modified: branches/release/boost/asio/ip/impl/host_name.ipp
==============================================================================
--- branches/release/boost/asio/ip/impl/host_name.ipp (original)
+++ branches/release/boost/asio/ip/impl/host_name.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/impl/host_name.ipp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/multicast.hpp
==============================================================================
--- branches/release/boost/asio/ip/multicast.hpp (original)
+++ branches/release/boost/asio/ip/multicast.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/multicast.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/resolver_query_base.hpp
==============================================================================
--- branches/release/boost/asio/ip/resolver_query_base.hpp (original)
+++ branches/release/boost/asio/ip/resolver_query_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/resolver_query_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -140,12 +139,6 @@
   ~resolver_query_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ip

Modified: branches/release/boost/asio/ip/resolver_service.hpp
==============================================================================
--- branches/release/boost/asio/ip/resolver_service.hpp (original)
+++ branches/release/boost/asio/ip/resolver_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/resolver_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/asio/detail/resolver_service.hpp>
 #include <boost/asio/io_service.hpp>
@@ -104,11 +105,18 @@
 
   /// Asynchronously resolve a query to a list of entries.
   template <typename ResolveHandler>
- void async_resolve(implementation_type& impl, const query_type& query,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
+ void (boost::system::error_code, iterator_type))
+ async_resolve(implementation_type& impl, const query_type& query,
       BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
   {
- service_impl_.async_resolve(impl, query,
+ boost::asio::detail::async_result_init<
+ ResolveHandler, void (boost::system::error_code, iterator_type)> init(
         BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
+
+ service_impl_.async_resolve(impl, query, init.handler);
+
+ return init.result.get();
   }
 
   /// Resolve an endpoint to a list of entries.
@@ -120,11 +128,18 @@
 
   /// Asynchronously resolve an endpoint to a list of entries.
   template <typename ResolveHandler>
- void async_resolve(implementation_type& impl, const endpoint_type& endpoint,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
+ void (boost::system::error_code, iterator_type))
+ async_resolve(implementation_type& impl, const endpoint_type& endpoint,
       BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
   {
- return service_impl_.async_resolve(impl, endpoint,
+ boost::asio::detail::async_result_init<
+ ResolveHandler, void (boost::system::error_code, iterator_type)> init(
         BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
+
+ service_impl_.async_resolve(impl, endpoint, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/ip/tcp.hpp
==============================================================================
--- branches/release/boost/asio/ip/tcp.hpp (original)
+++ branches/release/boost/asio/ip/tcp.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/tcp.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -88,10 +88,10 @@
   /// The TCP resolver type.
   typedef basic_resolver<tcp> resolver;
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   /// The TCP iostream type.
   typedef basic_socket_iostream<tcp> iostream;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
   /// Socket option for disabling the Nagle algorithm.
   /**

Modified: branches/release/boost/asio/ip/udp.hpp
==============================================================================
--- branches/release/boost/asio/ip/udp.hpp (original)
+++ branches/release/boost/asio/ip/udp.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/udp.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/unicast.hpp
==============================================================================
--- branches/release/boost/asio/ip/unicast.hpp (original)
+++ branches/release/boost/asio/ip/unicast.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/unicast.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ip/v6_only.hpp
==============================================================================
--- branches/release/boost/asio/ip/v6_only.hpp (original)
+++ branches/release/boost/asio/ip/v6_only.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ip/v6_only.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/is_read_buffered.hpp
==============================================================================
--- branches/release/boost/asio/is_read_buffered.hpp (original)
+++ branches/release/boost/asio/is_read_buffered.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // is_read_buffered.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -48,7 +48,7 @@
   /// read data.
   static const bool value;
 #else
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_ASIO_STATIC_CONSTANT(bool,
       value = sizeof(detail::is_read_buffered_helper((Stream*)0)) == 1);
 #endif
 };

Modified: branches/release/boost/asio/is_write_buffered.hpp
==============================================================================
--- branches/release/boost/asio/is_write_buffered.hpp (original)
+++ branches/release/boost/asio/is_write_buffered.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // is_write_buffered.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -48,7 +48,7 @@
   /// written data.
   static const bool value;
 #else
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_ASIO_STATIC_CONSTANT(bool,
       value = sizeof(detail::is_write_buffered_helper((Stream*)0)) == 1);
 #endif
 };

Modified: branches/release/boost/asio/local/basic_endpoint.hpp
==============================================================================
--- branches/release/boost/asio/local/basic_endpoint.hpp (original)
+++ branches/release/boost/asio/local/basic_endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/basic_endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Derived from a public domain implementation written by Daniel Casimiro.
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -23,9 +23,9 @@
 
 #include <boost/asio/local/detail/endpoint.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 # include <iosfwd>
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/detail/push_options.hpp>
 

Modified: branches/release/boost/asio/local/connect_pair.hpp
==============================================================================
--- branches/release/boost/asio/local/connect_pair.hpp (original)
+++ branches/release/boost/asio/local/connect_pair.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/connect_pair.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/local/datagram_protocol.hpp
==============================================================================
--- branches/release/boost/asio/local/datagram_protocol.hpp (original)
+++ branches/release/boost/asio/local/datagram_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/datagram_protocol.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/local/detail/endpoint.hpp
==============================================================================
--- branches/release/boost/asio/local/detail/endpoint.hpp (original)
+++ branches/release/boost/asio/local/detail/endpoint.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/detail/endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Derived from a public domain implementation written by Daniel Casimiro.
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/local/detail/impl/endpoint.ipp
==============================================================================
--- branches/release/boost/asio/local/detail/impl/endpoint.ipp (original)
+++ branches/release/boost/asio/local/detail/impl/endpoint.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/detail/impl/endpoint.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Derived from a public domain implementation written by Daniel Casimiro.
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/local/stream_protocol.hpp
==============================================================================
--- branches/release/boost/asio/local/stream_protocol.hpp (original)
+++ branches/release/boost/asio/local/stream_protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // local/stream_protocol.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -74,10 +74,10 @@
   /// The UNIX domain acceptor type.
   typedef basic_socket_acceptor<stream_protocol> acceptor;
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
   /// The UNIX domain iostream type.
   typedef basic_socket_iostream<stream_protocol> iostream;
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 };
 
 } // namespace local

Modified: branches/release/boost/asio/placeholders.hpp
==============================================================================
--- branches/release/boost/asio/placeholders.hpp (original)
+++ branches/release/boost/asio/placeholders.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // placeholders.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,10 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/bind/arg.hpp>
-#include <boost/detail/workaround.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind/arg.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -47,7 +49,8 @@
 /// boost::asio::signal_set::async_wait.
 unspecified signal_number;
 
-#elif defined(__BORLANDC__) || defined(__GNUC__)
+#elif defined(BOOST_ASIO_HAS_BOOST_BIND)
+# if defined(__BORLANDC__) || defined(__GNUC__)
 
 inline boost::arg<1> error()
 {
@@ -69,7 +72,7 @@
   return boost::arg<2>();
 }
 
-#else
+# else
 
 namespace detail
 {
@@ -84,7 +87,7 @@
   };
 }
 
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+# if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC < 1400)
 
 static boost::arg<1>& error
   = boost::asio::placeholders::detail::placeholder<1>::get();
@@ -95,7 +98,7 @@
 static boost::arg<2>& signal_number
   = boost::asio::placeholders::detail::placeholder<2>::get();
 
-#else
+# else
 
 namespace
 {
@@ -109,8 +112,8 @@
     = boost::asio::placeholders::detail::placeholder<2>::get();
 } // namespace
 
-#endif
-
+# endif
+# endif
 #endif
 
 } // namespace placeholders

Modified: branches/release/boost/asio/posix/basic_descriptor.hpp
==============================================================================
--- branches/release/boost/asio/posix/basic_descriptor.hpp (original)
+++ branches/release/boost/asio/posix/basic_descriptor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix/basic_descriptor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/posix/basic_stream_descriptor.hpp
==============================================================================
--- branches/release/boost/asio/posix/basic_stream_descriptor.hpp (original)
+++ branches/release/boost/asio/posix/basic_stream_descriptor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix/basic_stream_descriptor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -225,14 +225,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_write_some(this->get_implementation(),
+ return this->get_service().async_write_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -336,14 +338,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_read_some(this->get_implementation(),
+ return this->get_service().async_read_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/posix/descriptor_base.hpp
==============================================================================
--- branches/release/boost/asio/posix/descriptor_base.hpp (original)
+++ branches/release/boost/asio/posix/descriptor_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix/descriptor_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/posix/stream_descriptor.hpp
==============================================================================
--- branches/release/boost/asio/posix/stream_descriptor.hpp (original)
+++ branches/release/boost/asio/posix/stream_descriptor.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix/stream_descriptor.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix/stream_descriptor_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,6 +21,7 @@
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/reactive_descriptor_service.hpp>
@@ -198,12 +199,19 @@
 
   /// Start an asynchronous write.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(implementation_type& impl,
       const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_write_some(impl, buffers,
+ boost::asio::detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_write_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
   /// Read some data from the stream.
@@ -216,12 +224,19 @@
 
   /// Start an asynchronous read.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(implementation_type& impl,
       const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_read_some(impl, buffers,
+ boost::asio::detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_read_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
 private:

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // raw_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -111,6 +113,19 @@
   {
     service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
   }
+
+ /// Move-construct a new raw socket implementation from another protocol
+ /// type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename raw_socket_service<
+ Protocol1>::implementation_type& other_impl,
+ typename enable_if<is_convertible<
+ Protocol1, Protocol>::value>::type* = 0)
+ {
+ service_impl_.template converting_move_construct<Protocol1>(
+ impl, other_impl);
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Destroy a raw socket implementation.
@@ -200,12 +215,19 @@
 
   /// Start an asynchronous connect.
   template <typename ConnectHandler>
- void async_connect(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
+ void (boost::system::error_code))
+ async_connect(implementation_type& impl,
       const endpoint_type& peer_endpoint,
       BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
   {
- service_impl_.async_connect(impl, peer_endpoint,
+ detail::async_result_init<
+ ConnectHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+
+ service_impl_.async_connect(impl, peer_endpoint, init.handler);
+
+ return init.result.get();
   }
 
   /// Set a socket option.
@@ -290,12 +312,19 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(implementation_type& impl, const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(implementation_type& impl, const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send(impl, buffers, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Send raw data to the specified endpoint.
@@ -309,13 +338,21 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send_to(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send_to(implementation_type& impl,
       const ConstBufferSequence& buffers, const endpoint_type& destination,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send_to(impl, buffers, destination, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send_to(impl, buffers,
+ destination, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive some data from the peer.
@@ -329,13 +366,20 @@
 
   /// Start an asynchronous receive.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(implementation_type& impl,
       const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive(impl, buffers, flags,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive raw data with the endpoint of the sender.
@@ -350,13 +394,21 @@
 
   /// Start an asynchronous receive that will get the endpoint of the sender.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive_from(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive_from(implementation_type& impl,
       const MutableBufferSequence& buffers, endpoint_type& sender_endpoint,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive_from(impl, buffers, sender_endpoint, flags,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive_from(impl, buffers,
+ sender_endpoint, flags, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/read.hpp
==============================================================================
--- branches/release/boost/asio/read.hpp (original)
+++ branches/release/boost/asio/read.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read.hpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
 #include <boost/asio/error.hpp>
 
@@ -207,7 +208,7 @@
 std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Attempt to read a certain amount of data from a stream before returning.
 /**
@@ -349,7 +350,7 @@
 std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -422,7 +423,9 @@
  */
 template <typename AsyncReadStream, typename MutableBufferSequence,
     typename ReadHandler>
-void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
 /// Start an asynchronous operation to read a certain amount of data from a
@@ -490,11 +493,13 @@
  */
 template <typename AsyncReadStream, typename MutableBufferSequence,
     typename CompletionCondition, typename ReadHandler>
-void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to read a certain amount of data from a
 /// stream.
@@ -545,7 +550,9 @@
  * handler); @endcode
  */
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
 /// Start an asynchronous operation to read a certain amount of data from a
@@ -606,11 +613,13 @@
  */
 template <typename AsyncReadStream, typename Allocator,
     typename CompletionCondition, typename ReadHandler>
-void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: branches/release/boost/asio/read_at.hpp
==============================================================================
--- branches/release/boost/asio/read_at.hpp (original)
+++ branches/release/boost/asio/read_at.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read_at.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,8 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/cstdint.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -76,7 +77,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers);
+ uint64_t offset, const MutableBufferSequence& buffers);
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -121,7 +122,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     boost::system::error_code& ec);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -177,7 +178,7 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -226,10 +227,10 @@
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -261,7 +262,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b);
+ uint64_t offset, basic_streambuf<Allocator>& b);
 
 /// Attempt to read a certain amount of data at the specified offset before
 /// returning.
@@ -293,7 +294,7 @@
  */
 template <typename SyncRandomAccessReadDevice, typename Allocator>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     boost::system::error_code& ec);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -336,7 +337,7 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition);
 
 /// Attempt to read a certain amount of data at the specified offset before
@@ -380,10 +381,10 @@
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 std::size_t read_at(SyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -455,7 +456,9 @@
  */
 template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename ReadHandler>
-void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
     const MutableBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
@@ -526,12 +529,14 @@
  */
 template <typename AsyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition, typename ReadHandler>
-void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to read a certain amount of data at the
 /// specified offset.
@@ -580,7 +585,9 @@
  */
 template <typename AsyncRandomAccessReadDevice, typename Allocator,
     typename ReadHandler>
-void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
 /// Start an asynchronous operation to read a certain amount of data at the
@@ -638,12 +645,14 @@
  */
 template <typename AsyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition, typename ReadHandler>
-void async_read_at(AsyncRandomAccessReadDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_at(AsyncRandomAccessReadDevice& d,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: branches/release/boost/asio/read_until.hpp
==============================================================================
--- branches/release/boost/asio/read_until.hpp (original)
+++ branches/release/boost/asio/read_until.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read_until.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,16 +17,14 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <cstddef>
-#include <boost/type_traits/is_function.hpp>
-#include <boost/type_traits/remove_pointer.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/detail/workaround.hpp>
 #include <string>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf.hpp>
 #include <boost/asio/detail/regex_fwd.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -59,7 +57,8 @@
 #else
   enum
   {
- value = boost::is_function<typename boost::remove_pointer<T>::type>::value
+ value = boost::asio::is_function<
+ typename boost::asio::remove_pointer<T>::type>::value
       || detail::has_result_type<T>::value
   };
 #endif
@@ -247,6 +246,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     boost::system::error_code& ec);
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
+ || defined(GENERATING_DOCUMENTATION)
+
 /// Read data into a streambuf until some part of the data it contains matches
 /// a regular expression.
 /**
@@ -339,6 +341,9 @@
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     boost::system::error_code& ec);
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+ // || defined(GENERATING_DOCUMENTATION)
+
 /// Read data into a streambuf until a function object indicates a match.
 /**
  * This function is used to read data into the specified streambuf until a
@@ -441,7 +446,7 @@
 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /// Read data into a streambuf until a function object indicates a match.
 /**
@@ -497,7 +502,7 @@
 std::size_t read_until(SyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, boost::system::error_code& ec,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /*@}*/
 /**
@@ -588,7 +593,9 @@
  * @c async_read_until operation.
  */
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     char delim, BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
@@ -671,10 +678,15 @@
  * @c async_read_until operation.
  */
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
+#if defined(BOOST_ASIO_HAS_BOOST_REGEX) \
+ || defined(GENERATING_DOCUMENTATION)
+
 /// Start an asynchronous operation to read data into a streambuf until some
 /// part of its data matches a regular expression.
 /**
@@ -758,10 +770,15 @@
  * @c async_read_until operation.
  */
 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     BOOST_ASIO_MOVE_ARG(ReadHandler) handler);
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_REGEX)
+ // || defined(GENERATING_DOCUMENTATION)
+
 /// Start an asynchronous operation to read data into a streambuf until a
 /// function object indicates a match.
 /**
@@ -887,10 +904,12 @@
  */
 template <typename AsyncReadStream, typename Allocator,
     typename MatchCondition, typename ReadHandler>
-void async_read_until(AsyncReadStream& s,
+BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b,
     MatchCondition match_condition, BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
- typename boost::enable_if<is_match_condition<MatchCondition> >::type* = 0);
+ typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
 
 /*@}*/
 
@@ -901,6 +920,6 @@
 
 #include <boost/asio/impl/read_until.hpp>
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_READ_UNTIL_HPP

Modified: branches/release/boost/asio/seq_packet_socket_service.hpp
==============================================================================
--- branches/release/boost/asio/seq_packet_socket_service.hpp (original)
+++ branches/release/boost/asio/seq_packet_socket_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // seq_packet_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -113,6 +115,19 @@
   {
     service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
   }
+
+ /// Move-construct a new sequenced packet socket implementation from another
+ /// protocol type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename seq_packet_socket_service<
+ Protocol1>::implementation_type& other_impl,
+ typename enable_if<is_convertible<
+ Protocol1, Protocol>::value>::type* = 0)
+ {
+ service_impl_.template converting_move_construct<Protocol1>(
+ impl, other_impl);
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Destroy a sequenced packet socket implementation.
@@ -202,12 +217,19 @@
 
   /// Start an asynchronous connect.
   template <typename ConnectHandler>
- void async_connect(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
+ void (boost::system::error_code))
+ async_connect(implementation_type& impl,
       const endpoint_type& peer_endpoint,
       BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
   {
- service_impl_.async_connect(impl, peer_endpoint,
+ detail::async_result_init<
+ ConnectHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+
+ service_impl_.async_connect(impl, peer_endpoint, init.handler);
+
+ return init.result.get();
   }
 
   /// Set a socket option.

Modified: branches/release/boost/asio/serial_port.hpp
==============================================================================
--- branches/release/boost/asio/serial_port.hpp (original)
+++ branches/release/boost/asio/serial_port.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/serial_port_base.hpp
==============================================================================
--- branches/release/boost/asio/serial_port_base.hpp (original)
+++ branches/release/boost/asio/serial_port_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,17 +21,16 @@
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
   || defined(GENERATING_DOCUMENTATION)
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 # include <termios.h>
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/socket_types.hpp>
 #include <boost/system/error_code.hpp>
 
 #if defined(GENERATING_DOCUMENTATION)
 # define BOOST_ASIO_OPTION_STORAGE implementation_defined
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
 # define BOOST_ASIO_OPTION_STORAGE DCB
 #else
 # define BOOST_ASIO_OPTION_STORAGE termios
@@ -150,12 +149,6 @@
   ~serial_port_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace asio

Modified: branches/release/boost/asio/serial_port_service.hpp
==============================================================================
--- branches/release/boost/asio/serial_port_service.hpp (original)
+++ branches/release/boost/asio/serial_port_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,6 +22,7 @@
 
 #include <cstddef>
 #include <string>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/reactive_serial_port_service.hpp>
 #include <boost/asio/detail/win_iocp_serial_port_service.hpp>
 #include <boost/asio/error.hpp>
@@ -192,12 +193,19 @@
 
   /// Start an asynchronous write.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(implementation_type& impl,
       const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_write_some(impl, buffers,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_write_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
   /// Read some data from the stream.
@@ -210,12 +218,19 @@
 
   /// Start an asynchronous read.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(implementation_type& impl,
       const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_read_some(impl, buffers,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_read_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/signal_set.hpp
==============================================================================
--- branches/release/boost/asio/signal_set.hpp (original)
+++ branches/release/boost/asio/signal_set.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // signal_set.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/signal_set_service.hpp
==============================================================================
--- branches/release/boost/asio/signal_set_service.hpp (original)
+++ branches/release/boost/asio/signal_set_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // signal_set_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/signal_set_service.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -96,11 +97,18 @@
 
   // Start an asynchronous operation to wait for a signal to be delivered.
   template <typename SignalHandler>
- void async_wait(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler,
+ void (boost::system::error_code, int))
+ async_wait(implementation_type& impl,
       BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
   {
- service_impl_.async_wait(impl,
+ detail::async_result_init<
+ SignalHandler, void (boost::system::error_code, int)> init(
         BOOST_ASIO_MOVE_CAST(SignalHandler)(handler));
+
+ service_impl_.async_wait(impl, init.handler);
+
+ return init.result.get();
   }
 
 private:

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // socket_acceptor_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/basic_socket.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -111,6 +112,19 @@
   {
     service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
   }
+
+ /// Move-construct a new socket acceptor implementation from another protocol
+ /// type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename socket_acceptor_service<
+ Protocol1>::implementation_type& other_impl,
+ typename enable_if<is_convertible<
+ Protocol1, Protocol>::value>::type* = 0)
+ {
+ service_impl_.template converting_move_construct<Protocol1>(
+ impl, other_impl);
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Destroy a socket acceptor implementation.
@@ -239,23 +253,32 @@
   }
 
   /// Accept a new connection.
- template <typename SocketService>
+ template <typename Protocol1, typename SocketService>
   boost::system::error_code accept(implementation_type& impl,
- basic_socket<protocol_type, SocketService>& peer,
- endpoint_type* peer_endpoint, boost::system::error_code& ec)
+ basic_socket<Protocol1, SocketService>& peer,
+ endpoint_type* peer_endpoint, boost::system::error_code& ec,
+ typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0)
   {
     return service_impl_.accept(impl, peer, peer_endpoint, ec);
   }
 
   /// Start an asynchronous accept.
- template <typename SocketService, typename AcceptHandler>
- void async_accept(implementation_type& impl,
- basic_socket<protocol_type, SocketService>& peer,
+ template <typename Protocol1, typename SocketService, typename AcceptHandler>
+ BOOST_ASIO_INITFN_RESULT_TYPE(AcceptHandler,
+ void (boost::system::error_code))
+ async_accept(implementation_type& impl,
+ basic_socket<Protocol1, SocketService>& peer,
       endpoint_type* peer_endpoint,
- BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
+ BOOST_ASIO_MOVE_ARG(AcceptHandler) handler,
+ typename enable_if<is_convertible<Protocol, Protocol1>::value>::type* = 0)
   {
- service_impl_.async_accept(impl, peer, peer_endpoint,
+ detail::async_result_init<
+ AcceptHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
+
+ service_impl_.async_accept(impl, peer, peer_endpoint, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/socket_base.hpp
==============================================================================
--- branches/release/boost/asio/socket_base.hpp (original)
+++ branches/release/boost/asio/socket_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // socket_base.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/detail/io_control.hpp>
 #include <boost/asio/detail/socket_option.hpp>
 #include <boost/asio/detail/socket_types.hpp>
@@ -67,13 +66,13 @@
   /// Specifies that the data marks the end of a record.
   static const int message_end_of_record = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_peek = boost::asio::detail::message_peek);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_out_of_band = boost::asio::detail::message_out_of_band);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_do_not_route = boost::asio::detail::message_do_not_route);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int,
       message_end_of_record = boost::asio::detail::message_end_of_record);
 #endif
 
@@ -496,7 +495,7 @@
 #if defined(GENERATING_DOCUMENTATION)
   static const int max_connections = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(int, max_connections = SOMAXCONN);
+ BOOST_ASIO_STATIC_CONSTANT(int, max_connections = SOMAXCONN);
 #endif
 
 protected:
@@ -504,12 +503,6 @@
   ~socket_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace asio

Added: branches/release/boost/asio/spawn.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/spawn.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,100 @@
+//
+// spawn.hpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_SPAWN_HPP
+#define BOOST_ASIO_SPAWN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <boost/coroutine/coroutine.hpp>
+#include <boost/asio/detail/weak_ptr.hpp>
+#include <boost/asio/detail/wrapped_handler.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/strand.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+template <typename Handler>
+class basic_yield_context
+{
+public:
+ basic_yield_context(
+ const detail::weak_ptr<boost::coroutines::coroutine<void()> >& coro,
+ boost::coroutines::coroutine<void()>::caller_type& ca, Handler& handler)
+ : coro_(coro),
+ ca_(ca),
+ handler_(handler),
+ ec_(0)
+ {
+ }
+
+ basic_yield_context operator[](boost::system::error_code& ec)
+ {
+ basic_yield_context tmp(*this);
+ tmp.ec_ = &ec;
+ return tmp;
+ }
+
+#if defined(GENERATING_DOCUMENTATION)
+private:
+#endif // defined(GENERATING_DOCUMENTATION)
+ detail::weak_ptr<boost::coroutines::coroutine<void()> > coro_;
+ boost::coroutines::coroutine<void()>::caller_type& ca_;
+ Handler& handler_;
+ boost::system::error_code* ec_;
+};
+
+#if defined(GENERATING_DOCUMENTATION)
+typedef basic_yield_context<unspecified> yield_context;
+#else // defined(GENERATING_DOCUMENTATION)
+typedef basic_yield_context<
+ detail::wrapped_handler<
+ io_service::strand, void(*)(),
+ detail::is_continuation_if_running> > yield_context;
+#endif // defined(GENERATING_DOCUMENTATION)
+
+template <typename Handler, typename Function>
+void spawn(BOOST_ASIO_MOVE_ARG(Handler) handler,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes
+ = boost::coroutines::attributes());
+
+template <typename Handler, typename Function>
+void spawn(basic_yield_context<Handler> ctx,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes
+ = boost::coroutines::attributes());
+
+template <typename Function>
+void spawn(boost::asio::io_service::strand strand,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes
+ = boost::coroutines::attributes());
+
+template <typename Function>
+void spawn(boost::asio::io_service& io_service,
+ BOOST_ASIO_MOVE_ARG(Function) function,
+ const boost::coroutines::attributes& attributes
+ = boost::coroutines::attributes());
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/impl/spawn.hpp>
+
+#endif // BOOST_ASIO_SPAWN_HPP

Modified: branches/release/boost/asio/ssl.hpp
==============================================================================
--- branches/release/boost/asio/ssl.hpp (original)
+++ branches/release/boost/asio/ssl.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl.hpp
 // ~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/basic_context.hpp
==============================================================================
--- branches/release/boost/asio/ssl/basic_context.hpp (original)
+++ branches/release/boost/asio/ssl/basic_context.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/basic_context.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/context.hpp
==============================================================================
--- branches/release/boost/asio/ssl/context.hpp (original)
+++ branches/release/boost/asio/ssl/context.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/context.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,6 +22,7 @@
 # include <boost/asio/ssl/context_service.hpp>
 #else // defined(BOOST_ASIO_ENABLE_OLD_SSL)
 # include <string>
+# include <boost/asio/buffer.hpp>
 # include <boost/asio/io_service.hpp>
 # include <boost/asio/ssl/context_base.hpp>
 # include <boost/asio/ssl/detail/openssl_types.hpp>
@@ -167,6 +168,35 @@
   BOOST_ASIO_DECL boost::system::error_code set_verify_mode(
       verify_mode v, boost::system::error_code& ec);
 
+ /// Set the peer verification depth.
+ /**
+ * This function may be used to configure the maximum verification depth
+ * allowed by the context.
+ *
+ * @param depth Maximum depth for the certificate chain verification that
+ * shall be allowed.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_set_verify_depth.
+ */
+ BOOST_ASIO_DECL void set_verify_depth(int depth);
+
+ /// Set the peer verification depth.
+ /**
+ * This function may be used to configure the maximum verification depth
+ * allowed by the context.
+ *
+ * @param depth Maximum depth for the certificate chain verification that
+ * shall be allowed.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_set_verify_depth.
+ */
+ BOOST_ASIO_DECL boost::system::error_code set_verify_depth(
+ int depth, boost::system::error_code& ec);
+
   /// Set the callback used to verify peer certificates.
   /**
    * This function is used to specify a callback function that will be called
@@ -239,6 +269,35 @@
   BOOST_ASIO_DECL boost::system::error_code load_verify_file(
       const std::string& filename, boost::system::error_code& ec);
 
+ /// Add certification authority for performing verification.
+ /**
+ * This function is used to add one trusted certification authority
+ * from a memory buffer.
+ *
+ * @param ca The buffer containing the certification authority certificate.
+ * The certificate must use the PEM format.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_get_cert_store and @c X509_STORE_add_cert.
+ */
+ BOOST_ASIO_DECL void add_certificate_authority(const const_buffer& ca);
+
+ /// Add certification authority for performing verification.
+ /**
+ * This function is used to add one trusted certification authority
+ * from a memory buffer.
+ *
+ * @param ca The buffer containing the certification authority certificate.
+ * The certificate must use the PEM format.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_get_cert_store and @c X509_STORE_add_cert.
+ */
+ BOOST_ASIO_DECL boost::system::error_code add_certificate_authority(
+ const const_buffer& ca, boost::system::error_code& ec);
+
   /// Configures the context to use the default directories for finding
   /// certification authority certificates.
   /**
@@ -299,6 +358,37 @@
   BOOST_ASIO_DECL boost::system::error_code add_verify_path(
       const std::string& path, boost::system::error_code& ec);
 
+ /// Use a certificate from a memory buffer.
+ /**
+ * This function is used to load a certificate into the context from a buffer.
+ *
+ * @param certificate The buffer containing the certificate.
+ *
+ * @param format The certificate format (ASN.1 or PEM).
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1.
+ */
+ BOOST_ASIO_DECL void use_certificate(
+ const const_buffer& certificate, file_format format);
+
+ /// Use a certificate from a memory buffer.
+ /**
+ * This function is used to load a certificate into the context from a buffer.
+ *
+ * @param certificate The buffer containing the certificate.
+ *
+ * @param format The certificate format (ASN.1 or PEM).
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_use_certificate or SSL_CTX_use_certificate_ASN1.
+ */
+ BOOST_ASIO_DECL boost::system::error_code use_certificate(
+ const const_buffer& certificate, file_format format,
+ boost::system::error_code& ec);
+
   /// Use a certificate from a file.
   /**
    * This function is used to load a certificate into the context from a file.
@@ -330,6 +420,35 @@
       const std::string& filename, file_format format,
       boost::system::error_code& ec);
 
+ /// Use a certificate chain from a memory buffer.
+ /**
+ * This function is used to load a certificate chain into the context from a
+ * buffer.
+ *
+ * @param chain The buffer containing the certificate chain. The certificate
+ * chain must use the PEM format.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert.
+ */
+ BOOST_ASIO_DECL void use_certificate_chain(const const_buffer& chain);
+
+ /// Use a certificate chain from a memory buffer.
+ /**
+ * This function is used to load a certificate chain into the context from a
+ * buffer.
+ *
+ * @param chain The buffer containing the certificate chain. The certificate
+ * chain must use the PEM format.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_use_certificate and SSL_CTX_add_extra_chain_cert.
+ */
+ BOOST_ASIO_DECL boost::system::error_code use_certificate_chain(
+ const const_buffer& chain, boost::system::error_code& ec);
+
   /// Use a certificate chain from a file.
   /**
    * This function is used to load a certificate chain into the context from a
@@ -359,6 +478,37 @@
   BOOST_ASIO_DECL boost::system::error_code use_certificate_chain_file(
       const std::string& filename, boost::system::error_code& ec);
 
+ /// Use a private key from a memory buffer.
+ /**
+ * This function is used to load a private key into the context from a buffer.
+ *
+ * @param private_key The buffer containing the private key.
+ *
+ * @param format The private key format (ASN.1 or PEM).
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1.
+ */
+ BOOST_ASIO_DECL void use_private_key(
+ const const_buffer& private_key, file_format format);
+
+ /// Use a private key from a memory buffer.
+ /**
+ * This function is used to load a private key into the context from a buffer.
+ *
+ * @param private_key The buffer containing the private key.
+ *
+ * @param format The private key format (ASN.1 or PEM).
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_use_PrivateKey or SSL_CTX_use_PrivateKey_ASN1.
+ */
+ BOOST_ASIO_DECL boost::system::error_code use_private_key(
+ const const_buffer& private_key, file_format format,
+ boost::system::error_code& ec);
+
   /// Use a private key from a file.
   /**
    * This function is used to load a private key into the context from a file.
@@ -390,6 +540,39 @@
       const std::string& filename, file_format format,
       boost::system::error_code& ec);
 
+ /// Use an RSA private key from a memory buffer.
+ /**
+ * This function is used to load an RSA private key into the context from a
+ * buffer.
+ *
+ * @param private_key The buffer containing the RSA private key.
+ *
+ * @param format The private key format (ASN.1 or PEM).
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1.
+ */
+ BOOST_ASIO_DECL void use_rsa_private_key(
+ const const_buffer& private_key, file_format format);
+
+ /// Use an RSA private key from a memory buffer.
+ /**
+ * This function is used to load an RSA private key into the context from a
+ * buffer.
+ *
+ * @param private_key The buffer containing the RSA private key.
+ *
+ * @param format The private key format (ASN.1 or PEM).
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_use_RSAPrivateKey or SSL_CTX_use_RSAPrivateKey_ASN1.
+ */
+ BOOST_ASIO_DECL boost::system::error_code use_rsa_private_key(
+ const const_buffer& private_key, file_format format,
+ boost::system::error_code& ec);
+
   /// Use an RSA private key from a file.
   /**
    * This function is used to load an RSA private key into the context from a
@@ -423,6 +606,37 @@
       const std::string& filename, file_format format,
       boost::system::error_code& ec);
 
+ /// Use the specified memory buffer to obtain the temporary Diffie-Hellman
+ /// parameters.
+ /**
+ * This function is used to load Diffie-Hellman parameters into the context
+ * from a buffer.
+ *
+ * @param dh The memory buffer containing the Diffie-Hellman parameters. The
+ * buffer must use the PEM format.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_CTX_set_tmp_dh.
+ */
+ BOOST_ASIO_DECL void use_tmp_dh(const const_buffer& dh);
+
+ /// Use the specified memory buffer to obtain the temporary Diffie-Hellman
+ /// parameters.
+ /**
+ * This function is used to load Diffie-Hellman parameters into the context
+ * from a buffer.
+ *
+ * @param dh The memory buffer containing the Diffie-Hellman parameters. The
+ * buffer must use the PEM format.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_CTX_set_tmp_dh.
+ */
+ BOOST_ASIO_DECL boost::system::error_code use_tmp_dh(
+ const const_buffer& dh, boost::system::error_code& ec);
+
   /// Use the specified file to obtain the temporary Diffie-Hellman parameters.
   /**
    * This function is used to load Diffie-Hellman parameters into the context
@@ -494,6 +708,12 @@
       boost::system::error_code& ec);
 
 private:
+ struct bio_cleanup;
+ struct x509_cleanup;
+ struct evp_pkey_cleanup;
+ struct rsa_cleanup;
+ struct dh_cleanup;
+
   // Helper function used to set a peer certificate verification callback.
   BOOST_ASIO_DECL boost::system::error_code do_set_verify_callback(
       detail::verify_callback_base* callback, boost::system::error_code& ec);
@@ -510,6 +730,13 @@
   BOOST_ASIO_DECL static int password_callback_function(
       char* buf, int size, int purpose, void* data);
 
+ // Helper function to set the temporary Diffie-Hellman parameters from a BIO.
+ BOOST_ASIO_DECL boost::system::error_code do_use_tmp_dh(
+ BIO* bio, boost::system::error_code& ec);
+
+ // Helper function to make a BIO from a memory buffer.
+ BOOST_ASIO_DECL BIO* make_buffer_bio(const const_buffer& b);
+
   // The underlying native implementation.
   native_handle_type handle_;
 

Modified: branches/release/boost/asio/ssl/context_base.hpp
==============================================================================
--- branches/release/boost/asio/ssl/context_base.hpp (original)
+++ branches/release/boost/asio/ssl/context_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/context_base.hpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -67,7 +66,25 @@
     sslv23_client,
 
     /// SSL/TLS server.
- sslv23_server
+ sslv23_server,
+
+ /// Generic TLS version 1.1.
+ tlsv11,
+
+ /// TLS version 1.1 client.
+ tlsv11_client,
+
+ /// TLS version 1.1 server.
+ tlsv11_server,
+
+ /// Generic TLS version 1.2.
+ tlsv12,
+
+ /// TLS version 1.2 client.
+ tlsv12_client,
+
+ /// TLS version 1.2 server.
+ tlsv12_server
   };
 
   /// Bitmask type for SSL options.
@@ -89,11 +106,11 @@
   /// Disable TLS v1.
   static const long no_tlsv1 = implementation_defined;
 #else
- BOOST_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
- BOOST_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
- BOOST_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
- BOOST_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
- BOOST_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
+ BOOST_ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
+ BOOST_ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
 #endif
 
   /// File format types.
@@ -111,11 +128,11 @@
   // New programs should use the equivalents of the same names that are defined
   // in the boost::asio::ssl namespace.
   typedef int verify_mode;
- BOOST_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
- BOOST_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
+ BOOST_ASIO_STATIC_CONSTANT(int,
       verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
- BOOST_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
 #endif
 
   /// Purpose of PEM password.
@@ -133,12 +150,6 @@
   ~context_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ssl

Modified: branches/release/boost/asio/ssl/context_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/context_service.hpp (original)
+++ branches/release/boost/asio/ssl/context_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/context_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/boost/asio/ssl/detail/buffered_handshake_op.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/ssl/detail/buffered_handshake_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,112 @@
+//
+// ssl/detail/buffered_handshake_op.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP
+#define BOOST_ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+# include <boost/asio/ssl/detail/engine.hpp>
+#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace ssl {
+namespace detail {
+
+#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+
+template <typename ConstBufferSequence>
+class buffered_handshake_op
+{
+public:
+ buffered_handshake_op(stream_base::handshake_type type,
+ const ConstBufferSequence& buffers)
+ : type_(type),
+ buffers_(buffers),
+ total_buffer_size_(boost::asio::buffer_size(buffers_))
+ {
+ }
+
+ engine::want operator()(engine& eng,
+ boost::system::error_code& ec,
+ std::size_t& bytes_transferred) const
+ {
+ typename ConstBufferSequence::const_iterator iter = buffers_.begin();
+ typename ConstBufferSequence::const_iterator end = buffers_.end();
+ std::size_t accumulated_size = 0;
+
+ for (;;)
+ {
+ engine::want want = eng.handshake(type_, ec);
+ if (want != engine::want_input_and_retry
+ || bytes_transferred == total_buffer_size_)
+ return want;
+
+ // Find the next buffer piece to be fed to the engine.
+ while (iter != end)
+ {
+ const_buffer buffer(*iter);
+
+ // Skip over any buffers which have already been consumed by the engine.
+ if (bytes_transferred >= accumulated_size + buffer_size(buffer))
+ {
+ accumulated_size += buffer_size(buffer);
+ ++iter;
+ continue;
+ }
+
+ // The current buffer may have been partially consumed by the engine on
+ // a previous iteration. If so, adjust the buffer to point to the
+ // unused portion.
+ if (bytes_transferred > accumulated_size)
+ buffer = buffer + (bytes_transferred - accumulated_size);
+
+ // Pass the buffer to the engine, and update the bytes transferred to
+ // reflect the total number of bytes consumed so far.
+ bytes_transferred += buffer_size(buffer);
+ buffer = eng.put_input(buffer);
+ bytes_transferred -= buffer_size(buffer);
+ break;
+ }
+ }
+ }
+
+ template <typename Handler>
+ void call_handler(Handler& handler,
+ const boost::system::error_code& ec,
+ const std::size_t& bytes_transferred) const
+ {
+ handler(ec, bytes_transferred);
+ }
+
+private:
+ stream_base::handshake_type type_;
+ ConstBufferSequence buffers_;
+ std::size_t total_buffer_size_;
+};
+
+#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+
+} // namespace detail
+} // namespace ssl
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_SSL_DETAIL_BUFFERED_HANDSHAKE_OP_HPP

Modified: branches/release/boost/asio/ssl/detail/engine.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/engine.hpp (original)
+++ branches/release/boost/asio/ssl/detail/engine.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/engine.hpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -73,6 +73,10 @@
   BOOST_ASIO_DECL boost::system::error_code set_verify_mode(
       verify_mode v, boost::system::error_code& ec);
 
+ // Set the peer verification depth.
+ BOOST_ASIO_DECL boost::system::error_code set_verify_depth(
+ int depth, boost::system::error_code& ec);
+
   // Set a peer certificate verification callback.
   BOOST_ASIO_DECL boost::system::error_code set_verify_callback(
       verify_callback_base* callback, boost::system::error_code& ec);

Modified: branches/release/boost/asio/ssl/detail/handshake_op.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/handshake_op.hpp (original)
+++ branches/release/boost/asio/ssl/detail/handshake_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/handshake_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/impl/engine.ipp
==============================================================================
--- branches/release/boost/asio/ssl/detail/impl/engine.ipp (original)
+++ branches/release/boost/asio/ssl/detail/impl/engine.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/impl/engine.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -84,6 +84,15 @@
   return ec;
 }
 
+boost::system::error_code engine::set_verify_depth(
+ int depth, boost::system::error_code& ec)
+{
+ ::SSL_set_verify_depth(ssl_, depth);
+
+ ec = boost::system::error_code();
+ return ec;
+}
+
 boost::system::error_code engine::set_verify_callback(
     verify_callback_base* callback, boost::system::error_code& ec)
 {

Modified: branches/release/boost/asio/ssl/detail/impl/openssl_init.ipp
==============================================================================
--- branches/release/boost/asio/ssl/detail/impl/openssl_init.ipp (original)
+++ branches/release/boost/asio/ssl/detail/impl/openssl_init.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,7 +18,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <vector>
-#include <boost/assert.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/tss_ptr.hpp>
 #include <boost/asio/ssl/detail/openssl_init.hpp>
@@ -64,15 +64,15 @@
 private:
   static unsigned long openssl_id_func()
   {
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     return ::GetCurrentThreadId();
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
     void* id = instance()->thread_id_;
     if (id == 0)
       instance()->thread_id_ = id = &id; // Ugh.
- BOOST_ASSERT(sizeof(unsigned long) >= sizeof(void*));
+ BOOST_ASIO_ASSERT(sizeof(unsigned long) >= sizeof(void*));
     return reinterpret_cast<unsigned long>(id);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__)
   }
 
   static void openssl_locking_func(int mode, int n,
@@ -88,10 +88,10 @@
   std::vector<boost::asio::detail::shared_ptr<
         boost::asio::detail::mutex> > mutexes_;
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
   // The thread identifiers to be used by openssl.
   boost::asio::detail::tss_ptr<void> thread_id_;
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(BOOST_ASIO_WINDOWS) && !defined(__CYGWIN__)
 };
 
 boost::asio::detail::shared_ptr<openssl_init_base::do_init>

Modified: branches/release/boost/asio/ssl/detail/io.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/io.hpp (original)
+++ branches/release/boost/asio/ssl/detail/io.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/io.hpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -96,6 +96,7 @@
     : next_layer_(next_layer),
       core_(core),
       op_(op),
+ start_(0),
       bytes_transferred_(0),
       handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
@@ -106,6 +107,7 @@
     : next_layer_(other.next_layer_),
       core_(other.core_),
       op_(other.op_),
+ start_(other.start_),
       want_(other.want_),
       ec_(other.ec_),
       bytes_transferred_(other.bytes_transferred_),
@@ -117,6 +119,7 @@
     : next_layer_(other.next_layer_),
       core_(other.core_),
       op_(other.op_),
+ start_(other.start_),
       want_(other.want_),
       ec_(other.ec_),
       bytes_transferred_(other.bytes_transferred_),
@@ -128,7 +131,7 @@
   void operator()(boost::system::error_code ec,
       std::size_t bytes_transferred = ~std::size_t(0), int start = 0)
   {
- switch (start)
+ switch (start_ = start)
     {
     case 1: // Called after at least one async operation.
       do
@@ -149,10 +152,10 @@
           // cannot allow more than one read operation at a time on the
           // underlying transport. The pending_read_ timer's expiry is set to
           // pos_infin if a read is in progress, and neg_infin otherwise.
- if (core_.pending_read_.expires_at() == boost::posix_time::neg_infin)
+ if (core_.pending_read_.expires_at() == core_.neg_infin())
           {
             // Prevent other read operations from being started.
- core_.pending_read_.expires_at(boost::posix_time::pos_infin);
+ core_.pending_read_.expires_at(core_.pos_infin());
 
             // Start reading some data from the underlying transport.
             next_layer_.async_read_some(
@@ -176,10 +179,10 @@
           // cannot allow more than one write operation at a time on the
           // underlying transport. The pending_write_ timer's expiry is set to
           // pos_infin if a write is in progress, and neg_infin otherwise.
- if (core_.pending_write_.expires_at() == boost::posix_time::neg_infin)
+ if (core_.pending_write_.expires_at() == core_.neg_infin())
           {
             // Prevent other write operations from being started.
- core_.pending_write_.expires_at(boost::posix_time::pos_infin);
+ core_.pending_write_.expires_at(core_.pos_infin());
 
             // Start writing all the data to the underlying transport.
             boost::asio::async_write(next_layer_,
@@ -234,7 +237,7 @@
           core_.input_ = core_.engine_.put_input(core_.input_);
 
           // Release any waiting read operations.
- core_.pending_read_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_read_.expires_at(core_.neg_infin());
 
           // Try the operation again.
           continue;
@@ -242,7 +245,7 @@
         case engine::want_output_and_retry:
 
           // Release any waiting write operations.
- core_.pending_write_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_write_.expires_at(core_.neg_infin());
 
           // Try the operation again.
           continue;
@@ -250,7 +253,7 @@
         case engine::want_output:
 
           // Release any waiting write operations.
- core_.pending_write_.expires_at(boost::posix_time::neg_infin);
+ core_.pending_write_.expires_at(core_.neg_infin());
 
           // Fall through to call handler.
 
@@ -275,6 +278,7 @@
   Stream& next_layer_;
   stream_core& core_;
   Operation op_;
+ int start_;
   engine::want want_;
   boost::system::error_code ec_;
   std::size_t bytes_transferred_;
@@ -297,6 +301,14 @@
       pointer, size, this_handler->handler_);
 }
 
+template <typename Stream, typename Operation, typename Handler>
+inline bool asio_handler_is_continuation(
+ io_op<Stream, Operation, Handler>* this_handler)
+{
+ return this_handler->start_ == 0 ? true
+ : boost_asio_handler_cont_helpers::is_continuation(this_handler->handler_);
+}
+
 template <typename Function, typename Stream,
     typename Operation, typename Handler>
 inline void asio_handler_invoke(Function& function,
@@ -317,7 +329,7 @@
 
 template <typename Stream, typename Operation, typename Handler>
 inline void async_io(Stream& next_layer, stream_core& core,
- const Operation& op, Handler handler)
+ const Operation& op, Handler& handler)
 {
   io_op<Stream, Operation, Handler>(
     next_layer, core, op, handler)(

Modified: branches/release/boost/asio/ssl/detail/openssl_init.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/openssl_init.hpp (original)
+++ branches/release/boost/asio/ssl/detail/openssl_init.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/openssl_init.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/openssl_types.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/openssl_types.hpp (original)
+++ branches/release/boost/asio/ssl/detail/openssl_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/openssl_types.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/password_callback.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/password_callback.hpp (original)
+++ branches/release/boost/asio/ssl/detail/password_callback.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/password_callback.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/read_op.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/read_op.hpp (original)
+++ branches/release/boost/asio/ssl/detail/read_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/read_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/shutdown_op.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/shutdown_op.hpp (original)
+++ branches/release/boost/asio/ssl/detail/shutdown_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/shutdown_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/stream_core.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/stream_core.hpp (original)
+++ branches/release/boost/asio/ssl/detail/stream_core.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/stream_core.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,7 +18,11 @@
 #include <boost/asio/detail/config.hpp>
 
 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
-# include <boost/asio/deadline_timer.hpp>
+# if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+# else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+# endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
 # include <boost/asio/ssl/detail/engine.hpp>
 # include <boost/asio/buffer.hpp>
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
@@ -47,8 +51,8 @@
       input_buffer_space_(max_tls_record_size),
       input_buffer_(boost::asio::buffer(input_buffer_space_))
   {
- pending_read_.expires_at(boost::posix_time::neg_infin);
- pending_write_.expires_at(boost::posix_time::neg_infin);
+ pending_read_.expires_at(neg_infin());
+ pending_write_.expires_at(neg_infin());
   }
 
   ~stream_core()
@@ -58,20 +62,52 @@
   // The SSL engine.
   engine engine_;
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
   // Timer used for storing queued read operations.
   boost::asio::deadline_timer pending_read_;
 
   // Timer used for storing queued write operations.
   boost::asio::deadline_timer pending_write_;
 
+ // Helper function for obtaining a time value that always fires.
+ static boost::asio::deadline_timer::time_type neg_infin()
+ {
+ return boost::posix_time::neg_infin;
+ }
+
+ // Helper function for obtaining a time value that never fires.
+ static boost::asio::deadline_timer::time_type pos_infin()
+ {
+ return boost::posix_time::pos_infin;
+ }
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // Timer used for storing queued read operations.
+ boost::asio::steady_timer pending_read_;
+
+ // Timer used for storing queued write operations.
+ boost::asio::steady_timer pending_write_;
+
+ // Helper function for obtaining a time value that always fires.
+ static boost::asio::steady_timer::time_point neg_infin()
+ {
+ return boost::asio::steady_timer::time_point::min();
+ }
+
+ // Helper function for obtaining a time value that never fires.
+ static boost::asio::steady_timer::time_point pos_infin()
+ {
+ return boost::asio::steady_timer::time_point::max();
+ }
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
   // Buffer space used to prepare output intended for the transport.
- std::vector<unsigned char> output_buffer_space_;
+ std::vector<unsigned char> output_buffer_space_;
 
   // A buffer that may be used to prepare output intended for the transport.
- const boost::asio::mutable_buffers_1 output_buffer_;
+ const boost::asio::mutable_buffers_1 output_buffer_;
 
   // Buffer space used to read input intended for the engine.
- std::vector<unsigned char> input_buffer_space_;
+ std::vector<unsigned char> input_buffer_space_;
 
   // A buffer that may be used to read input intended for the engine.
   const boost::asio::mutable_buffers_1 input_buffer_;

Modified: branches/release/boost/asio/ssl/detail/verify_callback.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/verify_callback.hpp (original)
+++ branches/release/boost/asio/ssl/detail/verify_callback.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/verify_callback.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/detail/write_op.hpp
==============================================================================
--- branches/release/boost/asio/ssl/detail/write_op.hpp (original)
+++ branches/release/boost/asio/ssl/detail/write_op.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/detail/write_op.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/error.hpp
==============================================================================
--- branches/release/boost/asio/ssl/error.hpp (original)
+++ branches/release/boost/asio/ssl/error.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/error.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/impl/context.hpp
==============================================================================
--- branches/release/boost/asio/ssl/impl/context.hpp (original)
+++ branches/release/boost/asio/ssl/impl/context.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/impl/context.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/context.ipp (original)
+++ branches/release/boost/asio/ssl/impl/context.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -34,6 +34,36 @@
 
 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
 
+struct context::bio_cleanup
+{
+ BIO* p;
+ ~bio_cleanup() { if (p) ::BIO_free(p); }
+};
+
+struct context::x509_cleanup
+{
+ X509* p;
+ ~x509_cleanup() { if (p) ::X509_free(p); }
+};
+
+struct context::evp_pkey_cleanup
+{
+ EVP_PKEY* p;
+ ~evp_pkey_cleanup() { if (p) ::EVP_PKEY_free(p); }
+};
+
+struct context::rsa_cleanup
+{
+ RSA* p;
+ ~rsa_cleanup() { if (p) ::RSA_free(p); }
+};
+
+struct context::dh_cleanup
+{
+ DH* p;
+ ~dh_cleanup() { if (p) ::DH_free(p); }
+};
+
 context::context(context::method m)
   : handle_(0)
 {
@@ -84,6 +114,42 @@
   case context::sslv23_server:
     handle_ = ::SSL_CTX_new(::SSLv23_server_method());
     break;
+#if defined(SSL_TXT_TLSV1_1)
+ case context::tlsv11:
+ handle_ = ::SSL_CTX_new(::TLSv1_1_method());
+ break;
+ case context::tlsv11_client:
+ handle_ = ::SSL_CTX_new(::TLSv1_1_client_method());
+ break;
+ case context::tlsv11_server:
+ handle_ = ::SSL_CTX_new(::TLSv1_1_server_method());
+ break;
+#else // defined(SSL_TXT_TLSV1_1)
+ case context::tlsv11:
+ case context::tlsv11_client:
+ case context::tlsv11_server:
+ boost::asio::detail::throw_error(
+ boost::asio::error::invalid_argument, "context");
+ break;
+#endif // defined(SSL_TXT_TLSV1_1)
+#if defined(SSL_TXT_TLSV1_2)
+ case context::tlsv12:
+ handle_ = ::SSL_CTX_new(::TLSv1_2_method());
+ break;
+ case context::tlsv12_client:
+ handle_ = ::SSL_CTX_new(::TLSv1_2_client_method());
+ break;
+ case context::tlsv12_server:
+ handle_ = ::SSL_CTX_new(::TLSv1_2_server_method());
+ break;
+#else // defined(SSL_TXT_TLSV1_2)
+ case context::tlsv12:
+ case context::tlsv12_client:
+ case context::tlsv12_server:
+ boost::asio::detail::throw_error(
+ boost::asio::error::invalid_argument, "context");
+ break;
+#endif // defined(SSL_TXT_TLSV1_2)
   default:
     handle_ = ::SSL_CTX_new(0);
     break;
@@ -190,6 +256,22 @@
   return ec;
 }
 
+void context::set_verify_depth(int depth)
+{
+ boost::system::error_code ec;
+ set_verify_depth(depth, ec);
+ boost::asio::detail::throw_error(ec, "set_verify_depth");
+}
+
+boost::system::error_code context::set_verify_depth(
+ int depth, boost::system::error_code& ec)
+{
+ ::SSL_CTX_set_verify_depth(handle_, depth);
+
+ ec = boost::system::error_code();
+ return ec;
+}
+
 void context::load_verify_file(const std::string& filename)
 {
   boost::system::error_code ec;
@@ -212,6 +294,41 @@
   return ec;
 }
 
+void context::add_certificate_authority(const const_buffer& ca)
+{
+ boost::system::error_code ec;
+ add_certificate_authority(ca, ec);
+ boost::asio::detail::throw_error(ec, "add_certificate_authority");
+}
+
+boost::system::error_code context::add_certificate_authority(
+ const const_buffer& ca, boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
+
+ bio_cleanup bio = { make_buffer_bio(ca) };
+ if (bio.p)
+ {
+ x509_cleanup cert = { ::PEM_read_bio_X509(bio.p, 0, 0, 0) };
+ if (cert.p)
+ {
+ if (X509_STORE* store = ::SSL_CTX_get_cert_store(handle_))
+ {
+ if (::X509_STORE_add_cert(store, cert.p) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+ }
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 void context::set_default_verify_paths()
 {
   boost::system::error_code ec;
@@ -256,6 +373,57 @@
   return ec;
 }
 
+void context::use_certificate(
+ const const_buffer& certificate, file_format format)
+{
+ boost::system::error_code ec;
+ use_certificate(certificate, format, ec);
+ boost::asio::detail::throw_error(ec, "use_certificate");
+}
+
+boost::system::error_code context::use_certificate(
+ const const_buffer& certificate, file_format format,
+ boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
+
+ if (format == context_base::asn1)
+ {
+ if (::SSL_CTX_use_certificate_ASN1(handle_, buffer_size(certificate),
+ buffer_cast<const unsigned char*>(certificate)) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+ else if (format == context_base::pem)
+ {
+ bio_cleanup bio = { make_buffer_bio(certificate) };
+ if (bio.p)
+ {
+ x509_cleanup cert = { ::PEM_read_bio_X509(bio.p, 0, 0, 0) };
+ if (cert.p)
+ {
+ if (::SSL_CTX_use_certificate(handle_, cert.p) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+ }
+ }
+ else
+ {
+ ec = boost::asio::error::invalid_argument;
+ return ec;
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 void context::use_certificate_file(
     const std::string& filename, file_format format)
 {
@@ -296,6 +464,76 @@
   return ec;
 }
 
+void context::use_certificate_chain(const const_buffer& chain)
+{
+ boost::system::error_code ec;
+ use_certificate_chain(chain, ec);
+ boost::asio::detail::throw_error(ec, "use_certificate_chain");
+}
+
+boost::system::error_code context::use_certificate_chain(
+ const const_buffer& chain, boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
+
+ bio_cleanup bio = { make_buffer_bio(chain) };
+ if (bio.p)
+ {
+ x509_cleanup cert = {
+ ::PEM_read_bio_X509_AUX(bio.p, 0,
+ handle_->default_passwd_callback,
+ handle_->default_passwd_callback_userdata) };
+ if (!cert.p)
+ {
+ ec = boost::system::error_code(ERR_R_PEM_LIB,
+ boost::asio::error::get_ssl_category());
+ return ec;
+ }
+
+ int result = ::SSL_CTX_use_certificate(handle_, cert.p);
+ if (result == 0 || ::ERR_peek_error() != 0)
+ {
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+ }
+
+ if (handle_->extra_certs)
+ {
+ ::sk_X509_pop_free(handle_->extra_certs, X509_free);
+ handle_->extra_certs = 0;
+ }
+
+ while (X509* cacert = ::PEM_read_bio_X509(bio.p, 0,
+ handle_->default_passwd_callback,
+ handle_->default_passwd_callback_userdata))
+ {
+ if (!::SSL_CTX_add_extra_chain_cert(handle_, cacert))
+ {
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+ }
+ }
+
+ result = ::ERR_peek_last_error();
+ if ((ERR_GET_LIB(result) == ERR_LIB_PEM)
+ && (ERR_GET_REASON(result) == PEM_R_NO_START_LINE))
+ {
+ ::ERR_clear_error();
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 void context::use_certificate_chain_file(const std::string& filename)
 {
   boost::system::error_code ec;
@@ -318,6 +556,55 @@
   return ec;
 }
 
+void context::use_private_key(
+ const const_buffer& private_key, context::file_format format)
+{
+ boost::system::error_code ec;
+ use_private_key(private_key, format, ec);
+ boost::asio::detail::throw_error(ec, "use_private_key");
+}
+
+boost::system::error_code context::use_private_key(
+ const const_buffer& private_key, context::file_format format,
+ boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
+
+ bio_cleanup bio = { make_buffer_bio(private_key) };
+ if (bio.p)
+ {
+ evp_pkey_cleanup evp_private_key = { 0 };
+ switch (format)
+ {
+ case context_base::asn1:
+ evp_private_key.p = ::d2i_PrivateKey_bio(bio.p, 0);
+ break;
+ case context_base::pem:
+ evp_private_key.p = ::PEM_read_bio_PrivateKey(bio.p, 0, 0, 0);
+ break;
+ default:
+ {
+ ec = boost::asio::error::invalid_argument;
+ return ec;
+ }
+ }
+
+ if (evp_private_key.p)
+ {
+ if (::SSL_CTX_use_PrivateKey(handle_, evp_private_key.p) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 void context::use_private_key_file(
     const std::string& filename, context::file_format format)
 {
@@ -326,6 +613,55 @@
   boost::asio::detail::throw_error(ec, "use_private_key_file");
 }
 
+void context::use_rsa_private_key(
+ const const_buffer& private_key, context::file_format format)
+{
+ boost::system::error_code ec;
+ use_rsa_private_key(private_key, format, ec);
+ boost::asio::detail::throw_error(ec, "use_rsa_private_key");
+}
+
+boost::system::error_code context::use_rsa_private_key(
+ const const_buffer& private_key, context::file_format format,
+ boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
+
+ bio_cleanup bio = { make_buffer_bio(private_key) };
+ if (bio.p)
+ {
+ rsa_cleanup rsa_private_key = { 0 };
+ switch (format)
+ {
+ case context_base::asn1:
+ rsa_private_key.p = ::d2i_RSAPrivateKey_bio(bio.p, 0);
+ break;
+ case context_base::pem:
+ rsa_private_key.p = ::PEM_read_bio_RSAPrivateKey(bio.p, 0, 0, 0);
+ break;
+ default:
+ {
+ ec = boost::asio::error::invalid_argument;
+ return ec;
+ }
+ }
+
+ if (rsa_private_key.p)
+ {
+ if (::SSL_CTX_use_RSAPrivateKey(handle_, rsa_private_key.p) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
+ }
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 boost::system::error_code context::use_private_key_file(
     const std::string& filename, context::file_format format,
     boost::system::error_code& ec)
@@ -399,6 +735,28 @@
   return ec;
 }
 
+void context::use_tmp_dh(const const_buffer& dh)
+{
+ boost::system::error_code ec;
+ use_tmp_dh(dh, ec);
+ boost::asio::detail::throw_error(ec, "use_tmp_dh");
+}
+
+boost::system::error_code context::use_tmp_dh(
+ const const_buffer& dh, boost::system::error_code& ec)
+{
+ bio_cleanup bio = { make_buffer_bio(dh) };
+ if (bio.p)
+ {
+ return do_use_tmp_dh(bio.p, ec);
+ }
+
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
 void context::use_tmp_dh_file(const std::string& filename)
 {
   boost::system::error_code ec;
@@ -409,33 +767,36 @@
 boost::system::error_code context::use_tmp_dh_file(
     const std::string& filename, boost::system::error_code& ec)
 {
- ::BIO* bio = ::BIO_new_file(filename.c_str(), "r");
- if (!bio)
+ bio_cleanup bio = { ::BIO_new_file(filename.c_str(), "r") };
+ if (bio.p)
   {
- ec = boost::asio::error::invalid_argument;
- return ec;
+ return do_use_tmp_dh(bio.p, ec);
   }
 
- ::DH* dh = ::PEM_read_bio_DHparams(bio, 0, 0, 0);
- if (!dh)
- {
- ::BIO_free(bio);
- ec = boost::asio::error::invalid_argument;
- return ec;
- }
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
+ return ec;
+}
+
+boost::system::error_code context::do_use_tmp_dh(
+ BIO* bio, boost::system::error_code& ec)
+{
+ ::ERR_clear_error();
 
- ::BIO_free(bio);
- long result = ::SSL_CTX_set_tmp_dh(handle_, dh);
- ::DH_free(dh);
- if (result != 1)
+ dh_cleanup dh = { ::PEM_read_bio_DHparams(bio, 0, 0, 0) };
+ if (dh.p)
   {
- ec = boost::system::error_code(
- static_cast<int>(::ERR_get_error()),
- boost::asio::error::get_ssl_category());
- return ec;
+ if (::SSL_CTX_set_tmp_dh(handle_, dh.p) == 1)
+ {
+ ec = boost::system::error_code();
+ return ec;
+ }
   }
 
- ec = boost::system::error_code();
+ ec = boost::system::error_code(
+ static_cast<int>(::ERR_get_error()),
+ boost::asio::error::get_ssl_category());
   return ec;
 }
 
@@ -512,12 +873,12 @@
     std::string passwd = callback->call(static_cast<std::size_t>(size),
         purpose ? context_base::for_writing : context_base::for_reading);
 
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
+#if defined(BOOST_ASIO_HAS_SECURE_RTL)
     strcpy_s(buf, size, passwd.c_str());
-#else
+#else // defined(BOOST_ASIO_HAS_SECURE_RTL)
     *buf = '\0';
     strncat(buf, passwd.c_str(), size);
-#endif
+#endif // defined(BOOST_ASIO_HAS_SECURE_RTL)
 
     return static_cast<int>(strlen(buf));
   }
@@ -525,6 +886,13 @@
   return 0;
 }
 
+BIO* context::make_buffer_bio(const const_buffer& b)
+{
+ return ::BIO_new_mem_buf(
+ const_cast<void*>(buffer_cast<const void*>(b)),
+ buffer_size(b));
+}
+
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
 
 } // namespace ssl

Modified: branches/release/boost/asio/ssl/impl/error.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/error.ipp (original)
+++ branches/release/boost/asio/ssl/impl/error.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/impl/error.ipp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/impl/rfc2818_verification.ipp
==============================================================================
--- branches/release/boost/asio/ssl/impl/rfc2818_verification.ipp (original)
+++ branches/release/boost/asio/ssl/impl/rfc2818_verification.ipp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/impl/rfc2818_verification.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/impl/src.hpp
==============================================================================
--- branches/release/boost/asio/ssl/impl/src.hpp (original)
+++ branches/release/boost/asio/ssl/impl/src.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // impl/ssl/src.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/old/basic_context.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/basic_context.hpp (original)
+++ branches/release/boost/asio/ssl/old/basic_context.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/old/context_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/context_service.hpp (original)
+++ branches/release/boost/asio/ssl/old/context_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/old/detail/openssl_context_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/detail/openssl_context_service.hpp (original)
+++ branches/release/boost/asio/ssl/old/detail/openssl_context_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp (original)
+++ branches/release/boost/asio/ssl/old/detail/openssl_operation.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -17,9 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/function.hpp>
-#include <boost/assert.hpp>
 #include <boost/bind.hpp>
 #include <boost/asio/buffer.hpp>
+#include <boost/asio/detail/assert.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/placeholders.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
@@ -314,7 +314,7 @@
         unsigned char *data_start = send_buf_.get_unused_start();
         send_buf_.data_added(len);
  
- BOOST_ASSERT(strand_);
+ BOOST_ASIO_ASSERT(strand_);
         boost::asio::async_write
         (
           socket_,
@@ -379,7 +379,7 @@
   int do_async_read()
   {
     // Wait for new data
- BOOST_ASSERT(strand_);
+ BOOST_ASIO_ASSERT(strand_);
     socket_.async_read_some
     (
       boost::asio::buffer(recv_buf_.get_unused_start(),

Modified: branches/release/boost/asio/ssl/old/detail/openssl_stream_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/detail/openssl_stream_service.hpp (original)
+++ branches/release/boost/asio/ssl/old/detail/openssl_stream_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/old/stream.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/stream.hpp (original)
+++ branches/release/boost/asio/ssl/old/stream.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,8 +19,8 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <boost/noncopyable.hpp>
-#include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/ssl/basic_context.hpp>
 #include <boost/asio/ssl/stream_base.hpp>
@@ -60,7 +60,7 @@
 {
 public:
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;

Modified: branches/release/boost/asio/ssl/old/stream_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/old/stream_service.hpp (original)
+++ branches/release/boost/asio/ssl/old/stream_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -3,7 +3,7 @@
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
-// Copyright (c) 2005-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2005-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/rfc2818_verification.hpp
==============================================================================
--- branches/release/boost/asio/ssl/rfc2818_verification.hpp (original)
+++ branches/release/boost/asio/ssl/rfc2818_verification.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/rfc2818_verification.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/stream.hpp
==============================================================================
--- branches/release/boost/asio/ssl/stream.hpp (original)
+++ branches/release/boost/asio/ssl/stream.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/stream.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,10 +20,13 @@
 #if defined(BOOST_ASIO_ENABLE_OLD_SSL)
 # include <boost/asio/ssl/old/stream.hpp>
 #else // defined(BOOST_ASIO_ENABLE_OLD_SSL)
+# include <boost/asio/async_result.hpp>
 # include <boost/asio/detail/buffer_sequence_adapter.hpp>
 # include <boost/asio/detail/handler_type_requirements.hpp>
 # include <boost/asio/detail/noncopyable.hpp>
+# include <boost/asio/detail/type_traits.hpp>
 # include <boost/asio/ssl/context.hpp>
+# include <boost/asio/ssl/detail/buffered_handshake_op.hpp>
 # include <boost/asio/ssl/detail/handshake_op.hpp>
 # include <boost/asio/ssl/detail/io.hpp>
 # include <boost/asio/ssl/detail/read_op.hpp>
@@ -31,7 +34,6 @@
 # include <boost/asio/ssl/detail/stream_core.hpp>
 # include <boost/asio/ssl/detail/write_op.hpp>
 # include <boost/asio/ssl/stream_base.hpp>
-# include <boost/type_traits/remove_reference.hpp>
 #endif // defined(BOOST_ASIO_ENABLE_OLD_SSL)
 
 #include <boost/asio/detail/push_options.hpp>
@@ -87,7 +89,7 @@
   typedef impl_struct* impl_type;
 
   /// The type of the next layer.
- typedef typename boost::remove_reference<Stream>::type next_layer_type;
+ typedef typename remove_reference<Stream>::type next_layer_type;
 
   /// The type of the lowest layer.
   typedef typename next_layer_type::lowest_layer_type lowest_layer_type;
@@ -257,6 +259,43 @@
     return core_.engine_.set_verify_mode(v, ec);
   }
 
+ /// Set the peer verification depth.
+ /**
+ * This function may be used to configure the maximum verification depth
+ * allowed by the stream.
+ *
+ * @param depth Maximum depth for the certificate chain verification that
+ * shall be allowed.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note Calls @c SSL_set_verify_depth.
+ */
+ void set_verify_depth(int depth)
+ {
+ boost::system::error_code ec;
+ set_verify_depth(depth, ec);
+ boost::asio::detail::throw_error(ec, "set_verify_depth");
+ }
+
+ /// Set the peer verification depth.
+ /**
+ * This function may be used to configure the maximum verification depth
+ * allowed by the stream.
+ *
+ * @param depth Maximum depth for the certificate chain verification that
+ * shall be allowed.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note Calls @c SSL_set_verify_depth.
+ */
+ boost::system::error_code set_verify_depth(
+ int depth, boost::system::error_code& ec)
+ {
+ return core_.engine_.set_verify_depth(depth, ec);
+ }
+
   /// Set the callback used to verify peer certificates.
   /**
    * This function is used to specify a callback function that will be called
@@ -343,6 +382,47 @@
     return ec;
   }
 
+ /// Perform SSL handshaking.
+ /**
+ * This function is used to perform SSL handshaking on the stream. The
+ * function call will block until handshaking is complete or an error occurs.
+ *
+ * @param type The type of handshaking to be performed, i.e. as a client or as
+ * a server.
+ *
+ * @param buffers The buffered data to be reused for the handshake.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ */
+ template <typename ConstBufferSequence>
+ void handshake(handshake_type type, const ConstBufferSequence& buffers)
+ {
+ boost::system::error_code ec;
+ handshake(type, buffers, ec);
+ boost::asio::detail::throw_error(ec, "handshake");
+ }
+
+ /// Perform SSL handshaking.
+ /**
+ * This function is used to perform SSL handshaking on the stream. The
+ * function call will block until handshaking is complete or an error occurs.
+ *
+ * @param type The type of handshaking to be performed, i.e. as a client or as
+ * a server.
+ *
+ * @param buffers The buffered data to be reused for the handshake.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ */
+ template <typename ConstBufferSequence>
+ boost::system::error_code handshake(handshake_type type,
+ const ConstBufferSequence& buffers, boost::system::error_code& ec)
+ {
+ detail::io(next_layer_, core_,
+ detail::buffered_handshake_op<ConstBufferSequence>(type, buffers), ec);
+ return ec;
+ }
+
   /// Start an asynchronous SSL handshake.
   /**
    * This function is used to asynchronously perform an SSL handshake on the
@@ -359,15 +439,66 @@
    * ); @endcode
    */
   template <typename HandshakeHandler>
- void async_handshake(handshake_type type,
+ BOOST_ASIO_INITFN_RESULT_TYPE(HandshakeHandler,
+ void (boost::system::error_code))
+ async_handshake(handshake_type type,
       BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a HandshakeHandler.
     BOOST_ASIO_HANDSHAKE_HANDLER_CHECK(HandshakeHandler, handler) type_check;
 
- detail::async_io(next_layer_, core_, detail::handshake_op(type),
+ boost::asio::detail::async_result_init<
+ HandshakeHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(HandshakeHandler)(handler));
+
+ detail::async_io(next_layer_, core_,
+ detail::handshake_op(type), init.handler);
+
+ return init.result.get();
+ }
+
+ /// Start an asynchronous SSL handshake.
+ /**
+ * This function is used to asynchronously perform an SSL handshake on the
+ * stream. This function call always returns immediately.
+ *
+ * @param type The type of handshaking to be performed, i.e. as a client or as
+ * a server.
+ *
+ * @param buffers The buffered data to be reused for the handshake. Although
+ * the buffers object may be copied as necessary, ownership of the underlying
+ * buffers is retained by the caller, which must guarantee that they remain
+ * valid until the handler is called.
+ *
+ * @param handler The handler to be called when the handshake operation
+ * completes. Copies will be made of the handler as required. The equivalent
+ * function signature of the handler must be:
+ * @code void handler(
+ * const boost::system::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Amount of buffers used in handshake.
+ * ); @endcode
+ */
+ template <typename ConstBufferSequence, typename BufferedHandshakeHandler>
+ BOOST_ASIO_INITFN_RESULT_TYPE(BufferedHandshakeHandler,
+ void (boost::system::error_code, std::size_t))
+ async_handshake(handshake_type type, const ConstBufferSequence& buffers,
+ BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler)
+ {
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a BufferedHandshakeHandler.
+ BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK(
+ BufferedHandshakeHandler, handler) type_check;
+
+ boost::asio::detail::async_result_init<BufferedHandshakeHandler,
+ void (boost::system::error_code, std::size_t)> init(
+ BOOST_ASIO_MOVE_CAST(BufferedHandshakeHandler)(handler));
+
+ detail::async_io(next_layer_, core_,
+ detail::buffered_handshake_op<ConstBufferSequence>(type, buffers),
+ init.handler);
+
+ return init.result.get();
   }
 
   /// Shut down SSL on the stream.
@@ -410,14 +541,21 @@
    * ); @endcode
    */
   template <typename ShutdownHandler>
- void async_shutdown(BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(ShutdownHandler,
+ void (boost::system::error_code))
+ async_shutdown(BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ShutdownHandler.
     BOOST_ASIO_SHUTDOWN_HANDLER_CHECK(ShutdownHandler, handler) type_check;
 
- detail::async_io(next_layer_, core_, detail::shutdown_op(),
+ boost::asio::detail::async_result_init<
+ ShutdownHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(ShutdownHandler)(handler));
+
+ detail::async_io(next_layer_, core_, detail::shutdown_op(), init.handler);
+
+ return init.result.get();
   }
 
   /// Write some data to the stream.
@@ -492,16 +630,23 @@
    * ensure that all data is written before the blocking operation completes.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- detail::async_io(next_layer_, core_,
- detail::write_op<ConstBufferSequence>(buffers),
+ boost::asio::detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ detail::async_io(next_layer_, core_,
+ detail::write_op<ConstBufferSequence>(buffers), init.handler);
+
+ return init.result.get();
   }
 
   /// Read some data from the stream.
@@ -577,16 +722,23 @@
    * operation completes.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- detail::async_io(next_layer_, core_,
- detail::read_op<MutableBufferSequence>(buffers),
+ boost::asio::detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ detail::async_io(next_layer_, core_,
+ detail::read_op<MutableBufferSequence>(buffers), init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/ssl/stream_base.hpp
==============================================================================
--- branches/release/boost/asio/ssl/stream_base.hpp (original)
+++ branches/release/boost/asio/ssl/stream_base.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/stream_base.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -44,12 +43,6 @@
   ~stream_base()
   {
   }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
 };
 
 } // namespace ssl

Modified: branches/release/boost/asio/ssl/stream_service.hpp
==============================================================================
--- branches/release/boost/asio/ssl/stream_service.hpp (original)
+++ branches/release/boost/asio/ssl/stream_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/stream_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/verify_context.hpp
==============================================================================
--- branches/release/boost/asio/ssl/verify_context.hpp (original)
+++ branches/release/boost/asio/ssl/verify_context.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/verify_context.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/ssl/verify_mode.hpp
==============================================================================
--- branches/release/boost/asio/ssl/verify_mode.hpp (original)
+++ branches/release/boost/asio/ssl/verify_mode.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ssl/verify_mode.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/steady_timer.hpp
==============================================================================
--- branches/release/boost/asio/steady_timer.hpp (original)
+++ branches/release/boost/asio/steady_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // steady_timer.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/strand.hpp
==============================================================================
--- branches/release/boost/asio/strand.hpp (original)
+++ branches/release/boost/asio/strand.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // strand.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/strand_service.hpp>
 #include <boost/asio/detail/wrapped_handler.hpp>
@@ -140,13 +141,20 @@
    * @code void handler(); @endcode
    */
   template <typename CompletionHandler>
- void dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+ dispatch(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a CompletionHandler.
     BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check;
 
- service_.dispatch(impl_, BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+ detail::async_result_init<
+ CompletionHandler, void ()> init(
+ BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+
+ service_.dispatch(impl_, init.handler);
+
+ return init.result.get();
   }
 
   /// Request the strand to invoke the given handler and return
@@ -166,13 +174,20 @@
    * @code void handler(); @endcode
    */
   template <typename CompletionHandler>
- void post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionHandler, void ())
+ post(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a CompletionHandler.
     BOOST_ASIO_COMPLETION_HANDLER_CHECK(CompletionHandler, handler) type_check;
 
- service_.post(impl_, BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+ detail::async_result_init<
+ CompletionHandler, void ()> init(
+ BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler));
+
+ service_.post(impl_, init.handler);
+
+ return init.result.get();
   }
 
   /// Create a new handler that automatically dispatches the wrapped handler
@@ -200,11 +215,23 @@
 #if defined(GENERATING_DOCUMENTATION)
   unspecified
 #else
- detail::wrapped_handler<strand, Handler>
+ detail::wrapped_handler<strand, Handler, detail::is_continuation_if_running>
 #endif
   wrap(Handler handler)
   {
- return detail::wrapped_handler<io_service::strand, Handler>(*this, handler);
+ return detail::wrapped_handler<io_service::strand, Handler,
+ detail::is_continuation_if_running>(*this, handler);
+ }
+
+ /// Determine whether the strand is running in the current thread.
+ /**
+ * @return @c true if the current thread is executing a handler that was
+ * submitted to the strand using post(), dispatch() or wrap(). Otherwise
+ * returns @c false.
+ */
+ bool running_in_this_thread() const
+ {
+ return service_.running_in_this_thread(impl_);
   }
 
 private:

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,8 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
 
@@ -111,6 +113,19 @@
   {
     service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
   }
+
+ /// Move-construct a new stream socket implementation from another protocol
+ /// type.
+ template <typename Protocol1>
+ void converting_move_construct(implementation_type& impl,
+ typename stream_socket_service<
+ Protocol1>::implementation_type& other_impl,
+ typename enable_if<is_convertible<
+ Protocol1, Protocol>::value>::type* = 0)
+ {
+ service_impl_.template converting_move_construct<Protocol1>(
+ impl, other_impl);
+ }
 #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
 
   /// Destroy a stream socket implementation.
@@ -200,12 +215,19 @@
 
   /// Start an asynchronous connect.
   template <typename ConnectHandler>
- void async_connect(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
+ void (boost::system::error_code))
+ async_connect(implementation_type& impl,
       const endpoint_type& peer_endpoint,
       BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
   {
- service_impl_.async_connect(impl, peer_endpoint,
+ detail::async_result_init<
+ ConnectHandler, void (boost::system::error_code)> init(
         BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
+
+ service_impl_.async_connect(impl, peer_endpoint, init.handler);
+
+ return init.result.get();
   }
 
   /// Set a socket option.
@@ -290,13 +312,20 @@
 
   /// Start an asynchronous send.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_send(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_send(implementation_type& impl,
       const ConstBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_send(impl, buffers, flags,
+ detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_send(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
   /// Receive some data from the peer.
@@ -310,13 +339,20 @@
 
   /// Start an asynchronous receive.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_receive(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_receive(implementation_type& impl,
       const MutableBufferSequence& buffers,
       socket_base::message_flags flags,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_receive(impl, buffers, flags,
+ detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_receive(impl, buffers, flags, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/streambuf.hpp
==============================================================================
--- branches/release/boost/asio/streambuf.hpp (original)
+++ branches/release/boost/asio/streambuf.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // streambuf.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #include <boost/asio/basic_streambuf.hpp>
 
@@ -30,6 +30,6 @@
 } // namespace asio
 } // namespace boost
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 #endif // BOOST_ASIO_STREAMBUF_HPP

Modified: branches/release/boost/asio/system_timer.hpp
==============================================================================
--- branches/release/boost/asio/system_timer.hpp (original)
+++ branches/release/boost/asio/system_timer.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // system_timer.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/time_traits.hpp
==============================================================================
--- branches/release/boost/asio/time_traits.hpp (original)
+++ branches/release/boost/asio/time_traits.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // time_traits.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,9 @@
 
 #include <boost/asio/detail/socket_types.hpp> // Must come before posix_time.
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME) \
+ || defined(GENERATING_DOCUMENTATION)
+
 #include <boost/asio/detail/push_options.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <boost/asio/detail/pop_options.hpp>
@@ -81,4 +84,7 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #endif // BOOST_ASIO_TIME_TRAITS_HPP

Added: branches/release/boost/asio/unyield.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/unyield.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,21 @@
+//
+// unyield.hpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifdef reenter
+# undef reenter
+#endif
+
+#ifdef yield
+# undef yield
+#endif
+
+#ifdef fork
+# undef fork
+#endif

Added: branches/release/boost/asio/use_future.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/use_future.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,66 @@
+//
+// use_future.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_ASIO_USE_FUTURE_HPP
+#define BOOST_ASIO_USE_FUTURE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+#include <memory>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+template <typename Allocator = std::allocator<void> >
+class use_future_t
+{
+public:
+ typedef Allocator allocator_type;
+
+ constexpr use_future_t()
+ {
+ }
+
+ explicit use_future_t(const Allocator& allocator)
+ : allocator_(allocator)
+ {
+ }
+
+ template <typename OtherAllocator>
+ use_future_t<OtherAllocator> operator[](const OtherAllocator& allocator) const
+ {
+ return use_future_t<OtherAllocator>(allocator);
+ }
+
+ allocator_type get_allocator() const
+ {
+ return allocator_;
+ }
+
+private:
+ Allocator allocator_;
+};
+
+// A special value, similar to std::nothrow.
+constexpr use_future_t<> use_future;
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/impl/use_future.hpp>
+
+#endif // BOOST_ASIO_USE_FUTURE_HPP

Modified: branches/release/boost/asio/version.hpp
==============================================================================
--- branches/release/boost/asio/version.hpp (original)
+++ branches/release/boost/asio/version.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // version.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/wait_traits.hpp
==============================================================================
--- branches/release/boost/asio/wait_traits.hpp (original)
+++ branches/release/boost/asio/wait_traits.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // wait_traits.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/waitable_timer_service.hpp
==============================================================================
--- branches/release/boost/asio/waitable_timer_service.hpp (original)
+++ branches/release/boost/asio/waitable_timer_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // waitable_timer_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/chrono_time_traits.hpp>
 #include <boost/asio/detail/deadline_timer_service.hpp>
 #include <boost/asio/io_service.hpp>
@@ -136,10 +137,18 @@
 
   // Start an asynchronous wait on the timer.
   template <typename WaitHandler>
- void async_wait(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(implementation_type& impl,
       BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
- service_impl_.async_wait(impl, BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+ detail::async_result_init<
+ WaitHandler, void (boost::system::error_code)> init(
+ BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+
+ service_impl_.async_wait(impl, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/windows/basic_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/basic_handle.hpp (original)
+++ branches/release/boost/asio/windows/basic_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/basic_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/windows/basic_object_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/basic_object_handle.hpp (original)
+++ branches/release/boost/asio/windows/basic_object_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/basic_object_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -159,9 +159,12 @@
    * boost::asio::io_service::post().
    */
   template <typename WaitHandler>
- void async_wait(WaitHandler handler)
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
- this->get_service().async_wait(this->get_implementation(), handler);
+ return this->get_service().async_wait(this->get_implementation(),
+ BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
   }
 };
 

Modified: branches/release/boost/asio/windows/basic_random_access_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/basic_random_access_handle.hpp (original)
+++ branches/release/boost/asio/windows/basic_random_access_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/basic_random_access_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -156,7 +156,7 @@
    * std::vector.
    */
   template <typename ConstBufferSequence>
- std::size_t write_some_at(boost::uint64_t offset,
+ std::size_t write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers)
   {
     boost::system::error_code ec;
@@ -185,7 +185,7 @@
    * all data is written before the blocking operation completes.
    */
   template <typename ConstBufferSequence>
- std::size_t write_some_at(boost::uint64_t offset,
+ std::size_t write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     return this->get_service().write_some_at(
@@ -230,7 +230,9 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some_at(boost::uint64_t offset,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some_at(uint64_t offset,
       const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
@@ -238,7 +240,7 @@
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_write_some_at(this->get_implementation(),
+ return this->get_service().async_write_some_at(this->get_implementation(),
         offset, buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -273,7 +275,7 @@
    * std::vector.
    */
   template <typename MutableBufferSequence>
- std::size_t read_some_at(boost::uint64_t offset,
+ std::size_t read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers)
   {
     boost::system::error_code ec;
@@ -303,7 +305,7 @@
    * completes.
    */
   template <typename MutableBufferSequence>
- std::size_t read_some_at(boost::uint64_t offset,
+ std::size_t read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     return this->get_service().read_some_at(
@@ -349,7 +351,9 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some_at(boost::uint64_t offset,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some_at(uint64_t offset,
       const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
@@ -357,7 +361,7 @@
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_read_some_at(this->get_implementation(),
+ return this->get_service().async_read_some_at(this->get_implementation(),
         offset, buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/windows/basic_stream_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/basic_stream_handle.hpp (original)
+++ branches/release/boost/asio/windows/basic_stream_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/basic_stream_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -222,14 +222,16 @@
    * std::vector.
    */
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a WriteHandler.
     BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
 
- this->get_service().async_write_some(this->get_implementation(),
+ return this->get_service().async_write_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
@@ -333,14 +335,16 @@
    * std::vector.
    */
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
     // If you get an error on the following line it means that your handler does
     // not meet the documented type requirements for a ReadHandler.
     BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
 
- this->get_service().async_read_some(this->get_implementation(),
+ return this->get_service().async_read_some(this->get_implementation(),
         buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };

Modified: branches/release/boost/asio/windows/object_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/object_handle.hpp (original)
+++ branches/release/boost/asio/windows/object_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/object_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying

Modified: branches/release/boost/asio/windows/object_handle_service.hpp
==============================================================================
--- branches/release/boost/asio/windows/object_handle_service.hpp (original)
+++ branches/release/boost/asio/windows/object_handle_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/object_handle_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2011 Boris Schaeling (boris_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -21,6 +21,7 @@
 #if defined(BOOST_ASIO_HAS_WINDOWS_OBJECT_HANDLE) \
   || defined(GENERATING_DOCUMENTATION)
 
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/win_object_handle_service.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -141,10 +142,18 @@
 
   /// Start an asynchronous wait.
   template <typename WaitHandler>
- void async_wait(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
+ void (boost::system::error_code))
+ async_wait(implementation_type& impl,
       BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
   {
- service_impl_.async_wait(impl, BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+ boost::asio::detail::async_result_init<
+ WaitHandler, void (boost::system::error_code)> init(
+ BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
+
+ service_impl_.async_wait(impl, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/windows/overlapped_ptr.hpp
==============================================================================
--- branches/release/boost/asio/windows/overlapped_ptr.hpp (original)
+++ branches/release/boost/asio/windows/overlapped_ptr.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/overlapped_ptr.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/windows/random_access_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/random_access_handle.hpp (original)
+++ branches/release/boost/asio/windows/random_access_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/random_access_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/windows/random_access_handle_service.hpp
==============================================================================
--- branches/release/boost/asio/windows/random_access_handle_service.hpp (original)
+++ branches/release/boost/asio/windows/random_access_handle_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/random_access_handle_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,7 +22,8 @@
 
 #include <cstddef>
 #include <boost/config.hpp>
-#include <boost/cstdint.hpp>
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/detail/win_iocp_handle_service.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -151,7 +152,7 @@
 
   /// Write the given data at the specified offset.
   template <typename ConstBufferSequence>
- std::size_t write_some_at(implementation_type& impl, boost::uint64_t offset,
+ std::size_t write_some_at(implementation_type& impl, uint64_t offset,
       const ConstBufferSequence& buffers, boost::system::error_code& ec)
   {
     return service_impl_.write_some_at(impl, offset, buffers, ec);
@@ -159,17 +160,24 @@
 
   /// Start an asynchronous write at the specified offset.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some_at(implementation_type& impl,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some_at(implementation_type& impl,
+ uint64_t offset, const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_write_some_at(impl, offset, buffers,
+ boost::asio::detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_write_some_at(impl, offset, buffers, init.handler);
+
+ return init.result.get();
   }
 
   /// Read some data from the specified offset.
   template <typename MutableBufferSequence>
- std::size_t read_some_at(implementation_type& impl, boost::uint64_t offset,
+ std::size_t read_some_at(implementation_type& impl, uint64_t offset,
       const MutableBufferSequence& buffers, boost::system::error_code& ec)
   {
     return service_impl_.read_some_at(impl, offset, buffers, ec);
@@ -177,12 +185,19 @@
 
   /// Start an asynchronous read at the specified offset.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some_at(implementation_type& impl,
- boost::uint64_t offset, const MutableBufferSequence& buffers,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some_at(implementation_type& impl,
+ uint64_t offset, const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_read_some_at(impl, offset, buffers,
+ boost::asio::detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_read_some_at(impl, offset, buffers, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/windows/stream_handle.hpp
==============================================================================
--- branches/release/boost/asio/windows/stream_handle.hpp (original)
+++ branches/release/boost/asio/windows/stream_handle.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/stream_handle.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/boost/asio/windows/stream_handle_service.hpp
==============================================================================
--- branches/release/boost/asio/windows/stream_handle_service.hpp (original)
+++ branches/release/boost/asio/windows/stream_handle_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // windows/stream_handle_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -21,6 +21,7 @@
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/detail/win_iocp_handle_service.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -156,12 +157,19 @@
 
   /// Start an asynchronous write.
   template <typename ConstBufferSequence, typename WriteHandler>
- void async_write_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+ async_write_some(implementation_type& impl,
       const ConstBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
   {
- service_impl_.async_write_some(impl, buffers,
+ boost::asio::detail::async_result_init<
+ WriteHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+
+ service_impl_.async_write_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
   /// Read some data from the stream.
@@ -174,12 +182,19 @@
 
   /// Start an asynchronous read.
   template <typename MutableBufferSequence, typename ReadHandler>
- void async_read_some(implementation_type& impl,
+ BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
+ void (boost::system::error_code, std::size_t))
+ async_read_some(implementation_type& impl,
       const MutableBufferSequence& buffers,
       BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
   {
- service_impl_.async_read_some(impl, buffers,
+ boost::asio::detail::async_result_init<
+ ReadHandler, void (boost::system::error_code, std::size_t)> init(
         BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+
+ service_impl_.async_read_some(impl, buffers, init.handler);
+
+ return init.result.get();
   }
 
 private:

Modified: branches/release/boost/asio/write.hpp
==============================================================================
--- branches/release/boost/asio/write.hpp (original)
+++ branches/release/boost/asio/write.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // write.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
 #include <boost/asio/error.hpp>
 
@@ -206,7 +207,7 @@
 std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Write all of the supplied data to a stream before returning.
 /**
@@ -348,7 +349,7 @@
 std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -413,7 +414,9 @@
  */
 template <typename AsyncWriteStream, typename ConstBufferSequence,
     typename WriteHandler>
-void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
 /// Start an asynchronous operation to write a certain amount of data to a
@@ -485,11 +488,13 @@
  */
 template <typename AsyncWriteStream, typename ConstBufferSequence,
     typename CompletionCondition, typename WriteHandler>
-void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to write all of the supplied data to a
 /// stream.
@@ -533,7 +538,9 @@
  * boost::asio::io_service::post().
  */
 template <typename AsyncWriteStream, typename Allocator, typename WriteHandler>
-void async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
 /// Start an asynchronous operation to write a certain amount of data to a
@@ -593,11 +600,13 @@
  */
 template <typename AsyncWriteStream, typename Allocator,
     typename CompletionCondition, typename WriteHandler>
-void async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Modified: branches/release/boost/asio/write_at.hpp
==============================================================================
--- branches/release/boost/asio/write_at.hpp (original)
+++ branches/release/boost/asio/write_at.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // write_at.hpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,8 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <boost/cstdint.hpp>
+#include <boost/asio/async_result.hpp>
 #include <boost/asio/basic_streambuf_fwd.hpp>
+#include <boost/asio/detail/cstdint.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -74,7 +75,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers);
+ uint64_t offset, const ConstBufferSequence& buffers);
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -118,7 +119,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     boost::system::error_code& ec);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -173,7 +174,7 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -221,10 +222,10 @@
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, boost::system::error_code& ec);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -257,7 +258,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b);
+ uint64_t offset, basic_streambuf<Allocator>& b);
 
 /// Write all of the supplied data at the specified offset before returning.
 /**
@@ -290,7 +291,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator>
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ uint64_t offset, basic_streambuf<Allocator>& b,
     boost::system::error_code& ec);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -333,7 +334,7 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
-std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition);
 
 /// Write a certain amount of data at a specified offset before returning.
@@ -377,11 +378,11 @@
  */
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
-std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+std::size_t write_at(SyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
     boost::system::error_code& ec);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 /**
@@ -445,7 +446,9 @@
  */
 template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename WriteHandler>
-void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     const ConstBufferSequence& buffers,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
@@ -517,12 +520,14 @@
  */
 template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition, typename WriteHandler>
-void async_write_at(AsyncRandomAccessWriteDevice& d,
- boost::uint64_t offset, const ConstBufferSequence& buffers,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d,
+ uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#if !defined(BOOST_NO_IOSTREAM)
+#if !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /// Start an asynchronous operation to write all of the supplied data at the
 /// specified offset.
@@ -566,7 +571,9 @@
  */
 template <typename AsyncRandomAccessWriteDevice, typename Allocator,
     typename WriteHandler>
-void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
 /// Start an asynchronous operation to write a certain amount of data at the
@@ -625,11 +632,13 @@
  */
 template <typename AsyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition, typename WriteHandler>
-void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset,
+BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
+ void (boost::system::error_code, std::size_t))
+async_write_at(AsyncRandomAccessWriteDevice& d, uint64_t offset,
     basic_streambuf<Allocator>& b, CompletionCondition completion_condition,
     BOOST_ASIO_MOVE_ARG(WriteHandler) handler);
 
-#endif // !defined(BOOST_NO_IOSTREAM)
+#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
 
 /*@}*/
 

Added: branches/release/boost/asio/yield.hpp
==============================================================================
--- (empty file)
+++ branches/release/boost/asio/yield.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,23 @@
+//
+// yield.hpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "coroutine.hpp"
+
+#ifndef reenter
+# define reenter(c) BOOST_ASIO_CORO_REENTER(c)
+#endif
+
+#ifndef yield
+# define yield BOOST_ASIO_CORO_YIELD
+#endif
+
+#ifndef fork
+# define fork BOOST_ASIO_CORO_FORK
+#endif

Modified: branches/release/libs/asio/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/asio/doc/Jamfile.v2 (original)
+++ branches/release/libs/asio/doc/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -25,10 +25,13 @@
     <location>html/boost_asio
   ;
 
-local example-names = allocation buffers chat echo fork http/client http/server
- http/server2 http/server3 http/server4 icmp invocation iostreams local
- multicast nonblocking porthopper serialization services socks4 ssl timeouts
- timers windows ;
+local example-names = cpp03/allocation cpp03/buffers cpp03/chat cpp03/echo
+ cpp03/fork cpp03/http/client cpp03/http/server cpp03/http/server2
+ cpp03/http/server3 cpp03/http/server4 cpp03/icmp cpp03/invocation
+ cpp03/iostreams cpp03/local cpp03/multicast cpp03/nonblocking cpp03/porthopper
+ cpp03/serialization cpp03/services cpp03/socks4 cpp03/spawn cpp03/ssl
+ cpp03/timeouts cpp03/timers cpp03/windows cpp11/allocaton cpp11/buffers
+ cpp11/chat cpp11/echo cpp11/futures cpp11/http/server cpp11/spawn ;
 
 for local l in $(example-names)
 {

Modified: branches/release/libs/asio/doc/asio.qbk
==============================================================================
--- branches/release/libs/asio/doc/asio.qbk (original)
+++ branches/release/libs/asio/doc/asio.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -7,7 +7,7 @@
 
 [library Boost.Asio
     [quickbook 1.4]
- [copyright 2003 - 2012 Christopher M. Kohlhoff]
+ [copyright 2003 - 2013 Christopher M. Kohlhoff]
     [purpose Networking library]
     [license
         Distributed under the Boost Software License, Version 1.0.

Modified: branches/release/libs/asio/doc/doxy2qbk.pl
==============================================================================
--- branches/release/libs/asio/doc/doxy2qbk.pl (original)
+++ branches/release/libs/asio/doc/doxy2qbk.pl 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/examples.qbk
==============================================================================
--- branches/release/libs/asio/doc/examples.qbk (original)
+++ branches/release/libs/asio/doc/examples.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,12 +8,24 @@
 [section:examples Examples]
 
 
+* [link boost_asio.examples.cpp03_examples C++03 Examples]: Illustrates the use of
+Boost.Asio using only C++03 language and library features. Where necessary, the
+examples make use of selected Boost C++ libraries.
+
+* [link boost_asio.examples.cpp11_examples C++11 Examples]: Contains a limited set of
+the C++03 Boost.Asio examples, updated to use only C++11 library and language
+facilities. These examples do not make direct use of Boost C++ libraries.
+
+
+[section:cpp03_examples C++03 Examples]
+
+
 [heading Allocation]
 
 This example shows how to customise the allocation of memory associated with
 asynchronous operations.
 
-* [@boost_asio/example/allocation/server.cpp]
+* [@boost_asio/example/cpp03/allocation/server.cpp]
 
 
 [heading Buffers]
@@ -21,7 +33,7 @@
 This example demonstrates how to create reference counted buffers that can be
 used with socket read and write operations.
 
-* [@boost_asio/example/buffers/reference_counted.cpp]
+* [@boost_asio/example/cpp03/buffers/reference_counted.cpp]
 
 
 [heading Chat]
@@ -29,15 +41,15 @@
 This example implements a chat server and client. The programs use a custom
 protocol with a fixed length message header and variable length message body.
 
-* [@boost_asio/example/chat/chat_message.hpp]
-* [@boost_asio/example/chat/chat_client.cpp]
-* [@boost_asio/example/chat/chat_server.cpp]
+* [@boost_asio/example/cpp03/chat/chat_message.hpp]
+* [@boost_asio/example/cpp03/chat/chat_client.cpp]
+* [@boost_asio/example/cpp03/chat/chat_server.cpp]
 
 The following POSIX-specific chat client demonstrates how to use the
 [link boost_asio.reference.posix__stream_descriptor posix::stream_descriptor] class to
 perform console input and output.
 
-* [@boost_asio/example/chat/posix_chat_client.cpp]
+* [@boost_asio/example/cpp03/chat/posix_chat_client.cpp]
 
 
 [heading Echo]
@@ -45,12 +57,12 @@
 A collection of simple clients and servers, showing the use of both synchronous
 and asynchronous operations.
 
-* [@boost_asio/example/echo/async_tcp_echo_server.cpp]
-* [@boost_asio/example/echo/async_udp_echo_server.cpp]
-* [@boost_asio/example/echo/blocking_tcp_echo_client.cpp]
-* [@boost_asio/example/echo/blocking_tcp_echo_server.cpp]
-* [@boost_asio/example/echo/blocking_udp_echo_client.cpp]
-* [@boost_asio/example/echo/blocking_udp_echo_server.cpp]
+* [@boost_asio/example/cpp03/echo/async_tcp_echo_server.cpp]
+* [@boost_asio/example/cpp03/echo/async_udp_echo_server.cpp]
+* [@boost_asio/example/cpp03/echo/blocking_tcp_echo_client.cpp]
+* [@boost_asio/example/cpp03/echo/blocking_tcp_echo_server.cpp]
+* [@boost_asio/example/cpp03/echo/blocking_udp_echo_client.cpp]
+* [@boost_asio/example/cpp03/echo/blocking_udp_echo_server.cpp]
 
 
 [heading Fork]
@@ -59,12 +71,12 @@
 `fork()` system call. The first example illustrates the steps required to start
 a daemon process:
 
-* [@boost_asio/example/fork/daemon.cpp]
+* [@boost_asio/example/cpp03/fork/daemon.cpp]
 
 The second example demonstrates how it is possible to fork a process from
 within a completion handler.
 
-* [@boost_asio/example/fork/process_per_connection.cpp]
+* [@boost_asio/example/cpp03/fork/process_per_connection.cpp]
 
 
 [heading HTTP Client]
@@ -73,8 +85,8 @@
 to use the [link boost_asio.reference.read_until read_until] and [link
 boost_asio.reference.async_read_until async_read_until] functions.
 
-* [@boost_asio/example/http/client/sync_client.cpp]
-* [@boost_asio/example/http/client/async_client.cpp]
+* [@boost_asio/example/cpp03/http/client/sync_client.cpp]
+* [@boost_asio/example/cpp03/http/client/async_client.cpp]
 
 
 [heading HTTP Server]
@@ -83,98 +95,95 @@
 implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown by
 cancelling all outstanding asynchronous operations.
 
-* [@boost_asio/example/http/server/connection.cpp]
-* [@boost_asio/example/http/server/connection.hpp]
-* [@boost_asio/example/http/server/connection_manager.cpp]
-* [@boost_asio/example/http/server/connection_manager.hpp]
-* [@boost_asio/example/http/server/header.hpp]
-* [@boost_asio/example/http/server/main.cpp]
-* [@boost_asio/example/http/server/mime_types.cpp]
-* [@boost_asio/example/http/server/mime_types.hpp]
-* [@boost_asio/example/http/server/reply.cpp]
-* [@boost_asio/example/http/server/reply.hpp]
-* [@boost_asio/example/http/server/request.hpp]
-* [@boost_asio/example/http/server/request_handler.cpp]
-* [@boost_asio/example/http/server/request_handler.hpp]
-* [@boost_asio/example/http/server/request_parser.cpp]
-* [@boost_asio/example/http/server/request_parser.hpp]
-* [@boost_asio/example/http/server/server.cpp]
-* [@boost_asio/example/http/server/server.hpp]
+* [@boost_asio/example/cpp03/http/server/connection.cpp]
+* [@boost_asio/example/cpp03/http/server/connection.hpp]
+* [@boost_asio/example/cpp03/http/server/connection_manager.cpp]
+* [@boost_asio/example/cpp03/http/server/connection_manager.hpp]
+* [@boost_asio/example/cpp03/http/server/header.hpp]
+* [@boost_asio/example/cpp03/http/server/main.cpp]
+* [@boost_asio/example/cpp03/http/server/mime_types.cpp]
+* [@boost_asio/example/cpp03/http/server/mime_types.hpp]
+* [@boost_asio/example/cpp03/http/server/reply.cpp]
+* [@boost_asio/example/cpp03/http/server/reply.hpp]
+* [@boost_asio/example/cpp03/http/server/request.hpp]
+* [@boost_asio/example/cpp03/http/server/request_handler.cpp]
+* [@boost_asio/example/cpp03/http/server/request_handler.hpp]
+* [@boost_asio/example/cpp03/http/server/request_parser.cpp]
+* [@boost_asio/example/cpp03/http/server/request_parser.hpp]
+* [@boost_asio/example/cpp03/http/server/server.cpp]
+* [@boost_asio/example/cpp03/http/server/server.hpp]
 
 
 [heading HTTP Server 2]
 
 An HTTP server using an io_service-per-CPU design.
 
-* [@boost_asio/example/http/server2/connection.cpp]
-* [@boost_asio/example/http/server2/connection.hpp]
-* [@boost_asio/example/http/server2/header.hpp]
-* [@boost_asio/example/http/server2/io_service_pool.cpp]
-* [@boost_asio/example/http/server2/io_service_pool.hpp]
-* [@boost_asio/example/http/server2/main.cpp]
-* [@boost_asio/example/http/server2/mime_types.cpp]
-* [@boost_asio/example/http/server2/mime_types.hpp]
-* [@boost_asio/example/http/server2/reply.cpp]
-* [@boost_asio/example/http/server2/reply.hpp]
-* [@boost_asio/example/http/server2/request.hpp]
-* [@boost_asio/example/http/server2/request_handler.cpp]
-* [@boost_asio/example/http/server2/request_handler.hpp]
-* [@boost_asio/example/http/server2/request_parser.cpp]
-* [@boost_asio/example/http/server2/request_parser.hpp]
-* [@boost_asio/example/http/server2/server.cpp]
-* [@boost_asio/example/http/server2/server.hpp]
+* [@boost_asio/example/cpp03/http/server2/connection.cpp]
+* [@boost_asio/example/cpp03/http/server2/connection.hpp]
+* [@boost_asio/example/cpp03/http/server2/header.hpp]
+* [@boost_asio/example/cpp03/http/server2/io_service_pool.cpp]
+* [@boost_asio/example/cpp03/http/server2/io_service_pool.hpp]
+* [@boost_asio/example/cpp03/http/server2/main.cpp]
+* [@boost_asio/example/cpp03/http/server2/mime_types.cpp]
+* [@boost_asio/example/cpp03/http/server2/mime_types.hpp]
+* [@boost_asio/example/cpp03/http/server2/reply.cpp]
+* [@boost_asio/example/cpp03/http/server2/reply.hpp]
+* [@boost_asio/example/cpp03/http/server2/request.hpp]
+* [@boost_asio/example/cpp03/http/server2/request_handler.cpp]
+* [@boost_asio/example/cpp03/http/server2/request_handler.hpp]
+* [@boost_asio/example/cpp03/http/server2/request_parser.cpp]
+* [@boost_asio/example/cpp03/http/server2/request_parser.hpp]
+* [@boost_asio/example/cpp03/http/server2/server.cpp]
+* [@boost_asio/example/cpp03/http/server2/server.hpp]
 
 
 [heading HTTP Server 3]
 
 An HTTP server using a single io_service and a thread pool calling `io_service::run()`.
 
-* [@boost_asio/example/http/server3/connection.cpp]
-* [@boost_asio/example/http/server3/connection.hpp]
-* [@boost_asio/example/http/server3/header.hpp]
-* [@boost_asio/example/http/server3/main.cpp]
-* [@boost_asio/example/http/server3/mime_types.cpp]
-* [@boost_asio/example/http/server3/mime_types.hpp]
-* [@boost_asio/example/http/server3/reply.cpp]
-* [@boost_asio/example/http/server3/reply.hpp]
-* [@boost_asio/example/http/server3/request.hpp]
-* [@boost_asio/example/http/server3/request_handler.cpp]
-* [@boost_asio/example/http/server3/request_handler.hpp]
-* [@boost_asio/example/http/server3/request_parser.cpp]
-* [@boost_asio/example/http/server3/request_parser.hpp]
-* [@boost_asio/example/http/server3/server.cpp]
-* [@boost_asio/example/http/server3/server.hpp]
+* [@boost_asio/example/cpp03/http/server3/connection.cpp]
+* [@boost_asio/example/cpp03/http/server3/connection.hpp]
+* [@boost_asio/example/cpp03/http/server3/header.hpp]
+* [@boost_asio/example/cpp03/http/server3/main.cpp]
+* [@boost_asio/example/cpp03/http/server3/mime_types.cpp]
+* [@boost_asio/example/cpp03/http/server3/mime_types.hpp]
+* [@boost_asio/example/cpp03/http/server3/reply.cpp]
+* [@boost_asio/example/cpp03/http/server3/reply.hpp]
+* [@boost_asio/example/cpp03/http/server3/request.hpp]
+* [@boost_asio/example/cpp03/http/server3/request_handler.cpp]
+* [@boost_asio/example/cpp03/http/server3/request_handler.hpp]
+* [@boost_asio/example/cpp03/http/server3/request_parser.cpp]
+* [@boost_asio/example/cpp03/http/server3/request_parser.hpp]
+* [@boost_asio/example/cpp03/http/server3/server.cpp]
+* [@boost_asio/example/cpp03/http/server3/server.hpp]
 
 
 [heading HTTP Server 4]
 
 A single-threaded HTTP server implemented using stackless coroutines.
 
-* [@boost_asio/example/http/server4/coroutine.hpp]
-* [@boost_asio/example/http/server4/file_handler.cpp]
-* [@boost_asio/example/http/server4/file_handler.hpp]
-* [@boost_asio/example/http/server4/header.hpp]
-* [@boost_asio/example/http/server4/main.cpp]
-* [@boost_asio/example/http/server4/mime_types.cpp]
-* [@boost_asio/example/http/server4/mime_types.hpp]
-* [@boost_asio/example/http/server4/reply.cpp]
-* [@boost_asio/example/http/server4/reply.hpp]
-* [@boost_asio/example/http/server4/request.hpp]
-* [@boost_asio/example/http/server4/request_parser.cpp]
-* [@boost_asio/example/http/server4/request_parser.hpp]
-* [@boost_asio/example/http/server4/server.cpp]
-* [@boost_asio/example/http/server4/server.hpp]
-* [@boost_asio/example/http/server4/unyield.hpp]
-* [@boost_asio/example/http/server4/yield.hpp]
+* [@boost_asio/example/cpp03/http/server4/file_handler.cpp]
+* [@boost_asio/example/cpp03/http/server4/file_handler.hpp]
+* [@boost_asio/example/cpp03/http/server4/header.hpp]
+* [@boost_asio/example/cpp03/http/server4/main.cpp]
+* [@boost_asio/example/cpp03/http/server4/mime_types.cpp]
+* [@boost_asio/example/cpp03/http/server4/mime_types.hpp]
+* [@boost_asio/example/cpp03/http/server4/reply.cpp]
+* [@boost_asio/example/cpp03/http/server4/reply.hpp]
+* [@boost_asio/example/cpp03/http/server4/request.hpp]
+* [@boost_asio/example/cpp03/http/server4/request_parser.cpp]
+* [@boost_asio/example/cpp03/http/server4/request_parser.hpp]
+* [@boost_asio/example/cpp03/http/server4/server.cpp]
+* [@boost_asio/example/cpp03/http/server4/server.hpp]
 
 
 [heading ICMP]
 
 This example shows how to use raw sockets with ICMP to ping a remote host.
 
-* [@boost_asio/example/icmp/ping.cpp]
-* [@boost_asio/example/icmp/ipv4_header.hpp]
-* [@boost_asio/example/icmp/icmp_header.hpp]
+* [@boost_asio/example/cpp03/icmp/ping.cpp]
+* [@boost_asio/example/cpp03/icmp/ipv4_header.hpp]
+* [@boost_asio/example/cpp03/icmp/icmp_header.hpp]
 
 
 [heading Invocation]
@@ -182,7 +191,7 @@
 This example shows how to customise handler invocation. Completion handlers are
 added to a priority queue rather than executed immediately.
 
-* [@boost_asio/example/invocation/prioritised_handlers.cpp]
+* [@boost_asio/example/cpp03/invocation/prioritised_handlers.cpp]
 
 
 [heading Iostreams]
@@ -190,9 +199,9 @@
 Two examples showing how to use [link boost_asio.reference.ip__tcp.iostream
 ip::tcp::iostream].
 
-* [@boost_asio/example/iostreams/daytime_client.cpp]
-* [@boost_asio/example/iostreams/daytime_server.cpp]
-* [@boost_asio/example/iostreams/http_client.cpp]
+* [@boost_asio/example/cpp03/iostreams/daytime_client.cpp]
+* [@boost_asio/example/cpp03/iostreams/daytime_server.cpp]
+* [@boost_asio/example/cpp03/iostreams/http_client.cpp]
 
 
 [heading Multicast]
@@ -200,8 +209,8 @@
 An example showing the use of multicast to transmit packets to a group of
 subscribers.
 
-* [@boost_asio/example/multicast/receiver.cpp]
-* [@boost_asio/example/multicast/sender.cpp]
+* [@boost_asio/example/cpp03/multicast/receiver.cpp]
+* [@boost_asio/example/cpp03/multicast/sender.cpp]
 
 
 [heading Serialization]
@@ -209,10 +218,10 @@
 This example shows how Boost.Serialization can be used with asio to encode and
 decode structures for transmission over a socket.
 
-* [@boost_asio/example/serialization/client.cpp]
-* [@boost_asio/example/serialization/connection.hpp]
-* [@boost_asio/example/serialization/server.cpp]
-* [@boost_asio/example/serialization/stock.hpp]
+* [@boost_asio/example/cpp03/serialization/client.cpp]
+* [@boost_asio/example/cpp03/serialization/connection.hpp]
+* [@boost_asio/example/cpp03/serialization/server.cpp]
+* [@boost_asio/example/cpp03/serialization/stock.hpp]
 
 
 [heading Services]
@@ -222,12 +231,12 @@
 how to use a custom service with [link
 boost_asio.reference.basic_stream_socket basic_stream_socket<>].
 
-* [@boost_asio/example/services/basic_logger.hpp]
-* [@boost_asio/example/services/daytime_client.cpp]
-* [@boost_asio/example/services/logger.hpp]
-* [@boost_asio/example/services/logger_service.cpp]
-* [@boost_asio/example/services/logger_service.hpp]
-* [@boost_asio/example/services/stream_socket_service.hpp]
+* [@boost_asio/example/cpp03/services/basic_logger.hpp]
+* [@boost_asio/example/cpp03/services/daytime_client.cpp]
+* [@boost_asio/example/cpp03/services/logger.hpp]
+* [@boost_asio/example/cpp03/services/logger_service.cpp]
+* [@boost_asio/example/cpp03/services/logger_service.hpp]
+* [@boost_asio/example/cpp03/services/stream_socket_service.hpp]
 
 
 [heading SOCKS 4]
@@ -235,8 +244,8 @@
 Example client program implementing the SOCKS 4 protocol for communication via
 a proxy.
 
-* [@boost_asio/example/socks4/sync_client.cpp]
-* [@boost_asio/example/socks4/socks4.hpp]
+* [@boost_asio/example/cpp03/socks4/sync_client.cpp]
+* [@boost_asio/example/cpp03/socks4/socks4.hpp]
 
 
 [heading SSL]
@@ -244,8 +253,8 @@
 Example client and server programs showing the use of the [link
 boost_asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations.
 
-* [@boost_asio/example/ssl/client.cpp]
-* [@boost_asio/example/ssl/server.cpp]
+* [@boost_asio/example/cpp03/ssl/client.cpp]
+* [@boost_asio/example/cpp03/ssl/server.cpp]
 
 
 [heading Timeouts]
@@ -253,18 +262,18 @@
 A collection of examples showing how to cancel long running asynchronous
 operations after a period of time.
 
-* [@boost_asio/example/timeouts/async_tcp_client.cpp]
-* [@boost_asio/example/timeouts/blocking_tcp_client.cpp]
-* [@boost_asio/example/timeouts/blocking_udp_client.cpp]
-* [@boost_asio/example/timeouts/server.cpp]
+* [@boost_asio/example/cpp03/timeouts/async_tcp_client.cpp]
+* [@boost_asio/example/cpp03/timeouts/blocking_tcp_client.cpp]
+* [@boost_asio/example/cpp03/timeouts/blocking_udp_client.cpp]
+* [@boost_asio/example/cpp03/timeouts/server.cpp]
 
 
 [heading Timers]
 
 Examples showing how to customise deadline_timer using different time types.
 
-* [@boost_asio/example/timers/tick_count_timer.cpp]
-* [@boost_asio/example/timers/time_t_timer.cpp]
+* [@boost_asio/example/cpp03/timers/tick_count_timer.cpp]
+* [@boost_asio/example/cpp03/timers/time_t_timer.cpp]
 
 
 [heading Porthopper]
@@ -272,9 +281,9 @@
 Example illustrating mixed synchronous and asynchronous operations, and how to
 use Boost.Lambda with Boost.Asio.
 
-* [@boost_asio/example/porthopper/protocol.hpp]
-* [@boost_asio/example/porthopper/client.cpp]
-* [@boost_asio/example/porthopper/server.cpp]
+* [@boost_asio/example/cpp03/porthopper/protocol.hpp]
+* [@boost_asio/example/cpp03/porthopper/client.cpp]
+* [@boost_asio/example/cpp03/porthopper/server.cpp]
 
 
 [heading Nonblocking]
@@ -282,16 +291,26 @@
 Example demonstrating reactor-style operations for integrating a third-party
 library that wants to perform the I/O operations itself.
 
-* [@boost_asio/example/nonblocking/third_party_lib.cpp]
+* [@boost_asio/example/cpp03/nonblocking/third_party_lib.cpp]
+
+
+[heading Spawn]
+
+Example of using the boost::asio::spawn() function, a wrapper around the
+[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine]
+library, to implement a chain of asynchronous operations using stackful
+coroutines.
+
+* [@boost_asio/example/cpp03/spawn/echo_server.cpp]
 
 
 [heading UNIX Domain Sockets]
 
 Examples showing how to use UNIX domain (local) sockets.
 
-* [@boost_asio/example/local/connect_pair.cpp]
-* [@boost_asio/example/local/stream_server.cpp]
-* [@boost_asio/example/local/stream_client.cpp]
+* [@boost_asio/example/cpp03/local/connect_pair.cpp]
+* [@boost_asio/example/cpp03/local/stream_server.cpp]
+* [@boost_asio/example/cpp03/local/stream_client.cpp]
 
 
 [heading Windows]
@@ -299,7 +318,98 @@
 An example showing how to use the Windows-specific function `TransmitFile`
 with Boost.Asio.
 
-* [@boost_asio/example/windows/transmit_file.cpp]
+* [@boost_asio/example/cpp03/windows/transmit_file.cpp]
+
+
+[endsect]
+
+
+[section:cpp11_examples C++11 Examples]
+
+
+[heading Allocation]
+
+This example shows how to customise the allocation of memory associated with
+asynchronous operations.
+
+* [@boost_asio/example/cpp11/allocation/server.cpp]
+
+
+[heading Buffers]
+
+This example demonstrates how to create reference counted buffers that can be
+used with socket read and write operations.
+
+* [@boost_asio/example/cpp11/buffers/reference_counted.cpp]
+
+
+[heading Chat]
+
+This example implements a chat server and client. The programs use a custom
+protocol with a fixed length message header and variable length message body.
+
+* [@boost_asio/example/cpp11/chat/chat_message.hpp]
+* [@boost_asio/example/cpp11/chat/chat_client.cpp]
+* [@boost_asio/example/cpp11/chat/chat_server.cpp]
+
+
+[heading Echo]
+
+A collection of simple clients and servers, showing the use of both synchronous
+and asynchronous operations.
+
+* [@boost_asio/example/cpp11/echo/async_tcp_echo_server.cpp]
+* [@boost_asio/example/cpp11/echo/async_udp_echo_server.cpp]
+* [@boost_asio/example/cpp11/echo/blocking_tcp_echo_client.cpp]
+* [@boost_asio/example/cpp11/echo/blocking_tcp_echo_server.cpp]
+* [@boost_asio/example/cpp11/echo/blocking_udp_echo_client.cpp]
+* [@boost_asio/example/cpp11/echo/blocking_udp_echo_server.cpp]
+
+
+[heading Futures]
+
+This example demonstrates how to use std::future in conjunction with
+Boost.Asio's asynchronous operations.
+
+* [@boost_asio/example/cpp11/futures/daytime_client.cpp]
+
+
+[heading HTTP Server]
+
+This example illustrates the use of asio in a simple single-threaded server
+implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown by
+cancelling all outstanding asynchronous operations.
+
+* [@boost_asio/example/cpp11/http/server/connection.cpp]
+* [@boost_asio/example/cpp11/http/server/connection.hpp]
+* [@boost_asio/example/cpp11/http/server/connection_manager.cpp]
+* [@boost_asio/example/cpp11/http/server/connection_manager.hpp]
+* [@boost_asio/example/cpp11/http/server/header.hpp]
+* [@boost_asio/example/cpp11/http/server/main.cpp]
+* [@boost_asio/example/cpp11/http/server/mime_types.cpp]
+* [@boost_asio/example/cpp11/http/server/mime_types.hpp]
+* [@boost_asio/example/cpp11/http/server/reply.cpp]
+* [@boost_asio/example/cpp11/http/server/reply.hpp]
+* [@boost_asio/example/cpp11/http/server/request.hpp]
+* [@boost_asio/example/cpp11/http/server/request_handler.cpp]
+* [@boost_asio/example/cpp11/http/server/request_handler.hpp]
+* [@boost_asio/example/cpp11/http/server/request_parser.cpp]
+* [@boost_asio/example/cpp11/http/server/request_parser.hpp]
+* [@boost_asio/example/cpp11/http/server/server.cpp]
+* [@boost_asio/example/cpp11/http/server/server.hpp]
+
+
+[heading Spawn]
+
+Example of using the boost::asio::spawn() function, a wrapper around the
+[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine]
+library, to implement a chain of asynchronous operations using stackful
+coroutines.
+
+* [@boost_asio/example/cpp11/spawn/echo_server.cpp]
+
+
+[endsect]
 
 
 [endsect]

Modified: branches/release/libs/asio/doc/history.qbk
==============================================================================
--- branches/release/libs/asio/doc/history.qbk (original)
+++ branches/release/libs/asio/doc/history.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/index.xml
==============================================================================
--- branches/release/libs/asio/doc/index.xml (original)
+++ branches/release/libs/asio/doc/index.xml 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "../../../tools/boostbook/dtd/boostbook.dtd">
 
 <!--
- Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/noncopyable_dox.txt
==============================================================================
--- branches/release/libs/asio/doc/noncopyable_dox.txt (original)
+++ branches/release/libs/asio/doc/noncopyable_dox.txt 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview.qbk (original)
+++ branches/release/libs/asio/doc/overview.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/allocation.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/allocation.qbk (original)
+++ branches/release/libs/asio/doc/overview/allocation.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -52,6 +52,7 @@
 
 [link boost_asio.reference.asio_handler_allocate asio_handler_allocate],
 [link boost_asio.reference.asio_handler_deallocate asio_handler_deallocate],
-[link boost_asio.examples.allocation custom memory allocation example].
+[link boost_asio.examples.cpp03_examples.allocation custom memory allocation example (C++03)],
+[link boost_asio.examples.cpp11_examples.allocation custom memory allocation example (C++11)].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/async.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/async.qbk (original)
+++ branches/release/libs/asio/doc/overview/async.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/basics.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/basics.qbk (original)
+++ branches/release/libs/asio/doc/overview/basics.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/bsd_sockets.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/bsd_sockets.qbk (original)
+++ branches/release/libs/asio/doc/overview/bsd_sockets.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/buffers.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/buffers.qbk (original)
+++ branches/release/libs/asio/doc/overview/buffers.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -157,6 +157,7 @@
 [link boost_asio.reference.streambuf streambuf],
 [link boost_asio.reference.ConstBufferSequence ConstBufferSequence],
 [link boost_asio.reference.MutableBufferSequence MutableBufferSequence],
-[link boost_asio.examples.buffers buffers example].
+[link boost_asio.examples.cpp03_examples.buffers buffers example (C++03)],
+[link boost_asio.examples.cpp11_examples.buffers buffers example (c++11)].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/cpp2011.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/cpp2011.qbk (original)
+++ branches/release/libs/asio/doc/overview/cpp2011.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/handler_tracking.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/handler_tracking.qbk (original)
+++ branches/release/libs/asio/doc/overview/handler_tracking.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/implementation.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/implementation.qbk (original)
+++ branches/release/libs/asio/doc/overview/implementation.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/iostreams.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/iostreams.qbk (original)
+++ branches/release/libs/asio/doc/overview/iostreams.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -62,7 +62,7 @@
 
 [link boost_asio.reference.ip__tcp.iostream ip::tcp::iostream],
 [link boost_asio.reference.basic_socket_iostream basic_socket_iostream],
-[link boost_asio.examples.iostreams iostreams examples].
+[link boost_asio.examples.cpp03_examples.iostreams iostreams examples].
 
 [heading Notes]
 

Modified: branches/release/libs/asio/doc/overview/line_based.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/line_based.qbk (original)
+++ branches/release/libs/asio/doc/overview/line_based.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -113,6 +113,6 @@
 [link boost_asio.reference.is_match_condition is_match_condition],
 [link boost_asio.reference.read_until read_until()],
 [link boost_asio.reference.streambuf streambuf],
-[link boost_asio.examples.http_client HTTP client example].
+[link boost_asio.examples.cpp03_examples.http_client HTTP client example].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/posix.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/posix.qbk (original)
+++ branches/release/libs/asio/doc/overview/posix.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -61,7 +61,7 @@
 [link boost_asio.reference.local__stream_protocol.endpoint local::stream_protocol::endpoint],
 [link boost_asio.reference.local__stream_protocol.iostream local::stream_protocol::iostream],
 [link boost_asio.reference.local__stream_protocol.socket local::stream_protocol::socket],
-[link boost_asio.examples.unix_domain_sockets UNIX domain sockets examples].
+[link boost_asio.examples.cpp03_examples.unix_domain_sockets UNIX domain sockets examples].
 
 [heading Notes]
 
@@ -95,7 +95,8 @@
 [link boost_asio.reference.posix__stream_descriptor posix::stream_descriptor],
 [link boost_asio.reference.posix__basic_stream_descriptor posix::basic_stream_descriptor],
 [link boost_asio.reference.posix__stream_descriptor_service posix::stream_descriptor_service],
-[link boost_asio.examples.chat Chat example].
+[link boost_asio.examples.cpp03_examples.chat Chat example (C++03)],
+[link boost_asio.examples.cpp11_examples.chat Chat example (C++11)].
 
 [heading Notes]
 
@@ -138,7 +139,7 @@
 [link boost_asio.reference.io_service.notify_fork io_service::notify_fork()],
 [link boost_asio.reference.io_service.fork_event io_service::fork_event],
 [link boost_asio.reference.io_service__service.fork_service io_service::service::fork_service()],
-[link boost_asio.examples.fork Fork examples].
+[link boost_asio.examples.cpp03_examples.fork Fork examples].
 
 [endsect]
 

Modified: branches/release/libs/asio/doc/overview/protocols.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/protocols.qbk (original)
+++ branches/release/libs/asio/doc/overview/protocols.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -150,6 +150,6 @@
 [link boost_asio.reference.ip__udp ip::udp],
 [link boost_asio.reference.ip__icmp ip::icmp],
 [link boost_asio.tutorial.tutdaytime1 daytime protocol tutorials],
-[link boost_asio.examples.icmp ICMP ping example].
+[link boost_asio.examples.cpp03_examples.icmp ICMP ping example].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/rationale.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/rationale.qbk (original)
+++ branches/release/libs/asio/doc/overview/rationale.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/reactor.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/reactor.qbk (original)
+++ branches/release/libs/asio/doc/overview/reactor.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -39,6 +39,6 @@
 [link boost_asio.reference.null_buffers null_buffers],
 [link boost_asio.reference.basic_socket.non_blocking basic_socket::non_blocking()],
 [link boost_asio.reference.basic_socket.native_non_blocking basic_socket::native_non_blocking()],
-[link boost_asio.examples.nonblocking nonblocking example].
+[link boost_asio.examples.cpp03_examples.nonblocking nonblocking example].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/serial_ports.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/serial_ports.qbk (original)
+++ branches/release/libs/asio/doc/overview/serial_ports.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/signals.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/signals.qbk (original)
+++ branches/release/libs/asio/doc/overview/signals.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -38,6 +38,7 @@
 [heading See Also]
 
 [link boost_asio.reference.signal_set signal_set],
-[link boost_asio.examples.http_server HTTP server example].
+[link boost_asio.examples.cpp03_examples.http_server HTTP server example (C++03)],
+[link boost_asio.examples.cpp11_examples.http_server HTTP server example (C++11)].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/ssl.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/ssl.qbk (original)
+++ branches/release/libs/asio/doc/overview/ssl.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -110,7 +110,7 @@
 [link boost_asio.reference.ssl__context ssl::context],
 [link boost_asio.reference.ssl__rfc2818_verification ssl::rfc2818_verification],
 [link boost_asio.reference.ssl__stream ssl::stream],
-[link boost_asio.examples.ssl SSL example].
+[link boost_asio.examples.cpp03_examples.ssl SSL example].
 
 [heading Notes]
 

Modified: branches/release/libs/asio/doc/overview/strands.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/strands.qbk (original)
+++ branches/release/libs/asio/doc/overview/strands.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -57,6 +57,6 @@
 
 [link boost_asio.reference.io_service__strand io_service::strand],
 [link boost_asio.tutorial.tuttimer5 tutorial Timer.5],
-[link boost_asio.examples.http_server_3 HTTP server 3 example].
+[link boost_asio.examples.cpp03_examples.http_server_3 HTTP server 3 example].
 
 [endsect]

Modified: branches/release/libs/asio/doc/overview/streams.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/streams.qbk (original)
+++ branches/release/libs/asio/doc/overview/streams.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/threads.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/threads.qbk (original)
+++ branches/release/libs/asio/doc/overview/threads.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/timers.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/timers.qbk (original)
+++ branches/release/libs/asio/doc/overview/timers.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/overview/windows.qbk
==============================================================================
--- branches/release/libs/asio/doc/overview/windows.qbk (original)
+++ branches/release/libs/asio/doc/overview/windows.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/quickref.xml
==============================================================================
--- branches/release/libs/asio/doc/quickref.xml (original)
+++ branches/release/libs/asio/doc/quickref.xml 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "../../../tools/boostbook/dtd/boostbook.dtd">
 
 <!--
- Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/reference.dox
==============================================================================
--- branches/release/libs/asio/doc/reference.dox (original)
+++ branches/release/libs/asio/doc/reference.dox 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -193,7 +193,10 @@
                          BOOST_ASIO_SOCKET_ERROR(e)=implementation_defined \
                          BOOST_ASIO_NETDB_ERROR(e)=implementation_defined \
                          BOOST_ASIO_EOF_ERROR(e)=implementation_defined \
- BOOST_ASIO_OS_ERROR(e1,e2)=implementation_defined
+ BOOST_ASIO_OS_ERROR(e1,e2)=implementation_defined \
+ BOOST_ASIO_MOVE_ARG(a)=a \
+ BOOST_ASIO_DECL= \
+ BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=void_or_deduced
 EXPAND_AS_DEFINED =
 SKIP_FUNCTION_MACROS = YES
 #---------------------------------------------------------------------------

Modified: branches/release/libs/asio/doc/reference.qbk
==============================================================================
--- branches/release/libs/asio/doc/reference.qbk (original)
+++ branches/release/libs/asio/doc/reference.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/reference.xsl
==============================================================================
--- branches/release/libs/asio/doc/reference.xsl (original)
+++ branches/release/libs/asio/doc/reference.xsl 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
 <!--
- Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -26,7 +26,7 @@
 -->
 <xsl:template match="/doxygen">
 <xsl:text>[/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -42,6 +42,7 @@
 [include requirements/AsyncRandomAccessWriteDevice.qbk]
 [include requirements/AsyncReadStream.qbk]
 [include requirements/AsyncWriteStream.qbk]
+[include requirements/BufferedHandshakeHandler.qbk]
 [include requirements/CompletionHandler.qbk]
 [include requirements/ComposedConnectHandler.qbk]
 [include requirements/ConnectHandler.qbk]
@@ -177,17 +178,27 @@
 
 <xsl:template name="cleanup-type">
   <xsl:param name="name"/>
+ <xsl:variable name="type">
+ <xsl:choose>
+ <xsl:when test="contains($name, 'BOOST_ASIO_DECL ')">
+ <xsl:value-of select="substring-after($name, 'BOOST_ASIO_DECL ')"/>
+ </xsl:when>
+ <xsl:when test="contains($name, 'BOOST_ASIO_DECL')">
+ <xsl:value-of select="substring-after($name, 'BOOST_ASIO_DECL')"/>
+ </xsl:when>
+ <xsl:when test="$name = 'virtual'"></xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
   <xsl:choose>
- <xsl:when test="contains($name, 'BOOST_ASIO_DECL ')">
- <xsl:value-of select="substring-after($name, 'BOOST_ASIO_DECL ')"/>
- </xsl:when>
- <xsl:when test="contains($name, 'BOOST_ASIO_DECL')">
- <xsl:value-of select="substring-after($name, 'BOOST_ASIO_DECL')"/>
- </xsl:when>
- <xsl:when test="$name = 'virtual'"></xsl:when>
+ <xsl:when test="$type='void_or_deduced'">
+ <xsl:text>``[link boost_asio.reference.asynchronous_operations.return_type ['void-or-deduced]]``</xsl:text>
+ </xsl:when>
     <xsl:otherwise>
- <xsl:value-of select="$name"/>
- </xsl:otherwise>
+ <xsl:value-of select="$type"/>
+ </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
@@ -413,7 +424,10 @@
 </xsl:template>
 
 
-<xsl:template match="emphasis" mode="markup">[*<xsl:value-of select="."/>]</xsl:template>
+<xsl:template match="bold" mode="markup">[*<xsl:apply-templates mode="markup"/>]</xsl:template>
+
+
+<xsl:template match="emphasis" mode="markup">['<xsl:apply-templates mode="markup"/>]</xsl:template>
 
 
 <xsl:template match="parameterlist" mode="markup">
@@ -1429,6 +1443,9 @@
         <xsl:when test="declname = 'Context_Service'">
           <xsl:value-of select="declname"/>
         </xsl:when>
+ <xsl:when test="declname = 'DatagramSocketService1'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.DatagramSocketService ', declname, ']``')"/>
+ </xsl:when>
         <xsl:when test="declname = 'Elem'">
           <xsl:value-of select="declname"/>
         </xsl:when>
@@ -1456,12 +1473,24 @@
         <xsl:when test="declname = 'PointerToPodType'">
           <xsl:value-of select="declname"/>
         </xsl:when>
+ <xsl:when test="declname = 'Protocol1'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.Protocol ', declname, ']``')"/>
+ </xsl:when>
+ <xsl:when test="declname = 'RawSocketService1'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.RawSocketService ', declname, ']``')"/>
+ </xsl:when>
+ <xsl:when test="declname = 'SeqPacketSocketService1'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.SeqPacketSocketService ', declname, ']``')"/>
+ </xsl:when>
         <xsl:when test="declname = 'SocketService1' or declname = 'SocketService2'">
           <xsl:value-of select="concat('``[link boost_asio.reference.SocketService ', declname, ']``')"/>
         </xsl:when>
         <xsl:when test="declname = 'Stream'">
           <xsl:value-of select="declname"/>
         </xsl:when>
+ <xsl:when test="declname = 'StreamSocketService1'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.StreamSocketService ', declname, ']``')"/>
+ </xsl:when>
         <xsl:when test="declname = 'T'">
           <xsl:value-of select="declname"/>
         </xsl:when>

Modified: branches/release/libs/asio/doc/requirements.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements.qbk (original)
+++ branches/release/libs/asio/doc/requirements.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/AcceptHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/AcceptHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/AcceptHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/AsyncRandomAccessReadDevice.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/AsyncRandomAccessReadDevice.qbk (original)
+++ branches/release/libs/asio/doc/requirements/AsyncRandomAccessReadDevice.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/AsyncRandomAccessWriteDevice.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/AsyncRandomAccessWriteDevice.qbk (original)
+++ branches/release/libs/asio/doc/requirements/AsyncRandomAccessWriteDevice.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/AsyncReadStream.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/AsyncReadStream.qbk (original)
+++ branches/release/libs/asio/doc/requirements/AsyncReadStream.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/AsyncWriteStream.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/AsyncWriteStream.qbk (original)
+++ branches/release/libs/asio/doc/requirements/AsyncWriteStream.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/libs/asio/doc/requirements/BufferedHandshakeHandler.qbk
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/doc/requirements/BufferedHandshakeHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,54 @@
+[/
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ /
+ / Distributed under the Boost Software License, Version 1.0. (See accompanying
+ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[section:BufferedHandshakeHandler Buffered handshake handler requirements]
+
+A buffered handshake handler must meet the requirements for a [link
+boost_asio.reference.Handler handler]. A value `h` of a buffered handshake handler
+class should work correctly in the expression `h(ec, s)`, where `ec` is an
+lvalue of type `const error_code` and `s` is an lvalue of type `const size_t`.
+
+[heading Examples]
+
+A free function as a buffered handshake handler:
+
+ void handshake_handler(
+ const boost::system::error_code& ec,
+ std::size_t bytes_transferred)
+ {
+ ...
+ }
+
+A buffered handshake handler function object:
+
+ struct handshake_handler
+ {
+ ...
+ void operator()(
+ const boost::system::error_code& ec,
+ std::size_t bytes_transferred)
+ {
+ ...
+ }
+ ...
+ };
+
+A non-static class member function adapted to a buffered handshake handler using `bind()`:
+
+ void my_class::handshake_handler(
+ const boost::system::error_code& ec,
+ std::size_t bytes_transferred)
+ {
+ ...
+ }
+ ...
+ socket.async_handshake(...,
+ boost::bind(&my_class::handshake_handler,
+ this, boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred));
+
+[endsect]

Modified: branches/release/libs/asio/doc/requirements/CompletionHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/CompletionHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/CompletionHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ComposedConnectHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ComposedConnectHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ComposedConnectHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ConnectHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ConnectHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ConnectHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ConstBufferSequence.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ConstBufferSequence.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ConstBufferSequence.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ConvertibleToConstBuffer.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ConvertibleToConstBuffer.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ConvertibleToConstBuffer.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ConvertibleToMutableBuffer.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ConvertibleToMutableBuffer.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ConvertibleToMutableBuffer.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/DatagramSocketService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/DatagramSocketService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/DatagramSocketService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/DescriptorService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/DescriptorService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/DescriptorService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/Endpoint.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/Endpoint.qbk (original)
+++ branches/release/libs/asio/doc/requirements/Endpoint.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/GettableSerialPortOption.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/GettableSerialPortOption.qbk (original)
+++ branches/release/libs/asio/doc/requirements/GettableSerialPortOption.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/GettableSocketOption.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/GettableSocketOption.qbk (original)
+++ branches/release/libs/asio/doc/requirements/GettableSocketOption.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/HandleService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/HandleService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/HandleService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/Handler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/Handler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/Handler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/HandshakeHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/HandshakeHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/HandshakeHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/InternetProtocol.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/InternetProtocol.qbk (original)
+++ branches/release/libs/asio/doc/requirements/InternetProtocol.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/IoControlCommand.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/IoControlCommand.qbk (original)
+++ branches/release/libs/asio/doc/requirements/IoControlCommand.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/IoObjectService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/IoObjectService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/IoObjectService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/MutableBufferSequence.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/MutableBufferSequence.qbk (original)
+++ branches/release/libs/asio/doc/requirements/MutableBufferSequence.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ObjectHandleService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ObjectHandleService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ObjectHandleService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/Protocol.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/Protocol.qbk (original)
+++ branches/release/libs/asio/doc/requirements/Protocol.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/RandomAccessHandleService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/RandomAccessHandleService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/RandomAccessHandleService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/RawSocketService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/RawSocketService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/RawSocketService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ReadHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ReadHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ReadHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ResolveHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ResolveHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ResolveHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ResolverService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ResolverService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ResolverService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SeqPacketSocketService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SeqPacketSocketService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SeqPacketSocketService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SerialPortService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SerialPortService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SerialPortService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/Service.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/Service.qbk (original)
+++ branches/release/libs/asio/doc/requirements/Service.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SettableSerialPortOption.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SettableSerialPortOption.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SettableSerialPortOption.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SettableSocketOption.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SettableSocketOption.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SettableSocketOption.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/ShutdownHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/ShutdownHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/ShutdownHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SignalHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SignalHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SignalHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SignalSetService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SignalSetService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SignalSetService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SocketAcceptorService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SocketAcceptorService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SocketAcceptorService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SocketService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SocketService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SocketService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/StreamDescriptorService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/StreamDescriptorService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/StreamDescriptorService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/StreamHandleService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/StreamHandleService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/StreamHandleService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/StreamSocketService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/StreamSocketService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/StreamSocketService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SyncRandomAccessReadDevice.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SyncRandomAccessReadDevice.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SyncRandomAccessReadDevice.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SyncRandomAccessWriteDevice.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SyncRandomAccessWriteDevice.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SyncRandomAccessWriteDevice.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SyncReadStream.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SyncReadStream.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SyncReadStream.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/SyncWriteStream.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/SyncWriteStream.qbk (original)
+++ branches/release/libs/asio/doc/requirements/SyncWriteStream.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/TimeTraits.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/TimeTraits.qbk (original)
+++ branches/release/libs/asio/doc/requirements/TimeTraits.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/TimerService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/TimerService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/TimerService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/WaitHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/WaitHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/WaitHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/WaitTraits.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/WaitTraits.qbk (original)
+++ branches/release/libs/asio/doc/requirements/WaitTraits.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/WaitableTimerService.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/WaitableTimerService.qbk (original)
+++ branches/release/libs/asio/doc/requirements/WaitableTimerService.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/WriteHandler.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/WriteHandler.qbk (original)
+++ branches/release/libs/asio/doc/requirements/WriteHandler.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/requirements/asynchronous_operations.qbk
==============================================================================
--- branches/release/libs/asio/doc/requirements/asynchronous_operations.qbk (original)
+++ branches/release/libs/asio/doc/requirements/asynchronous_operations.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -173,4 +173,8 @@
 `asio_handler_invoke`. Multiple storage blocks may be allocated for a single
 asynchronous operation.
 
+[section:return_type Return type of an initiating function]
+
+[endsect]
+
 [endsect]

Modified: branches/release/libs/asio/doc/std_exception_dox.txt
==============================================================================
--- branches/release/libs/asio/doc/std_exception_dox.txt (original)
+++ branches/release/libs/asio/doc/std_exception_dox.txt 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/tutorial.qbk
==============================================================================
--- branches/release/libs/asio/doc/tutorial.qbk (original)
+++ branches/release/libs/asio/doc/tutorial.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -142,7 +142,7 @@
   ``''''''``// timer.cpp
   ``''''''``// ~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -242,7 +242,7 @@
   ``''''''``// timer.cpp
   ``''''''``// ~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -390,7 +390,7 @@
   ``''''''``// timer.cpp
   ``''''''``// ~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -551,7 +551,7 @@
   ``''''''``// timer.cpp
   ``''''''``// ~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -751,7 +751,7 @@
   ``''''''``// timer.cpp
   ``''''''``// ~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -959,7 +959,7 @@
   ``''''''``// client.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1118,7 +1118,7 @@
   ``''''''``// server.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1370,7 +1370,7 @@
   ``''''''``// server.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1591,7 +1591,7 @@
   ``''''''``// client.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1734,7 +1734,7 @@
   ``''''''``// server.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -1952,7 +1952,7 @@
   ``''''''``// server.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -2231,7 +2231,7 @@
   ``''''''``// server.cpp
   ``''''''``// ~~~~~~~~~~
   ``''''''``//
- ``''''''``// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ ``''''''``// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
   ``''''''``//
   ``''''''``// Distributed under the Boost Software License, Version 1.0. (See accompanying
   ``''''''``// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/tutorial.xsl
==============================================================================
--- branches/release/libs/asio/doc/tutorial.xsl (original)
+++ branches/release/libs/asio/doc/tutorial.xsl 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
 <!--
- Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -20,7 +20,7 @@
 
 <xsl:template match="/doxygen">
 <xsl:text>[/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/doc/using.qbk
==============================================================================
--- branches/release/libs/asio/doc/using.qbk (original)
+++ branches/release/libs/asio/doc/using.qbk 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+ / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  /
  / Distributed under the Boost Software License, Version 1.0. (See accompanying
  / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/allocation/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/allocation/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/allocation/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/allocation/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/allocation/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/allocation/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/allocation/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/allocation/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/allocation/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/buffers/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/buffers/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/buffers/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/buffers/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/buffers/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/buffers/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/buffers/reference_counted.cpp
==============================================================================
--- /branches/release/libs/asio/example/buffers/reference_counted.cpp (original)
+++ branches/release/libs/asio/example/cpp03/buffers/reference_counted.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reference_counted.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/chat/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/chat/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/chat/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/chat/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/chat_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/chat/chat_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/chat/chat_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // chat_client.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/chat_message.hpp
==============================================================================
--- /branches/release/libs/asio/example/chat/chat_message.hpp (original)
+++ branches/release/libs/asio/example/cpp03/chat/chat_message.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // chat_message.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/chat_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/chat/chat_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/chat/chat_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // chat_server.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/chat/posix_chat_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/chat/posix_chat_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/chat/posix_chat_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // posix_chat_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/echo/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/echo/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/echo/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/echo/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/async_tcp_echo_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/async_tcp_echo_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/async_tcp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // async_tcp_echo_server.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/async_udp_echo_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/async_udp_echo_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/async_udp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // async_udp_echo_server.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/blocking_tcp_echo_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_tcp_echo_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/blocking_tcp_echo_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/blocking_tcp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_tcp_echo_server.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -45,7 +45,7 @@
   }
 }
 
-void server(boost::asio::io_service& io_service, short port)
+void server(boost::asio::io_service& io_service, unsigned short port)
 {
   tcp::acceptor a(io_service, tcp::endpoint(tcp::v4(), port));
   for (;;)

Modified: branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/blocking_udp_echo_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_udp_echo_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/echo/blocking_udp_echo_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/echo/blocking_udp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_udp_echo_server.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
 
 enum { max_length = 1024 };
 
-void server(boost::asio::io_service& io_service, short port)
+void server(boost::asio::io_service& io_service, unsigned short port)
 {
   udp::socket sock(io_service, udp::endpoint(udp::v4(), port));
   for (;;)

Modified: branches/release/libs/asio/example/cpp03/fork/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/fork/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/fork/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/fork/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/fork/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/fork/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/fork/daemon.cpp
==============================================================================
--- /branches/release/libs/asio/example/fork/daemon.cpp (original)
+++ branches/release/libs/asio/example/cpp03/fork/daemon.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // daemon.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/fork/process_per_connection.cpp
==============================================================================
--- /branches/release/libs/asio/example/fork/process_per_connection.cpp (original)
+++ branches/release/libs/asio/example/cpp03/fork/process_per_connection.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // process_per_connection.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/client/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/http/client/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/http/client/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/client/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/http/client/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/http/client/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/client/async_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/client/async_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/client/async_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // async_client.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/client/sync_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/client/sync_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/client/sync_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // sync_client.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/doc_root/data_1K.html
==============================================================================
--- /branches/release/libs/asio/example/http/doc_root/data_1K.html (original)
+++ branches/release/libs/asio/example/cpp03/http/doc_root/data_1K.html 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 <!--
-Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/doc_root/data_2K.html
==============================================================================
--- /branches/release/libs/asio/example/http/doc_root/data_2K.html (original)
+++ branches/release/libs/asio/example/cpp03/http/doc_root/data_2K.html 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 <!--
-Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/doc_root/data_4K.html
==============================================================================
--- /branches/release/libs/asio/example/http/doc_root/data_4K.html (original)
+++ branches/release/libs/asio/example/cpp03/http/doc_root/data_4K.html 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 <!--
-Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/doc_root/data_8K.html
==============================================================================
--- /branches/release/libs/asio/example/http/doc_root/data_8K.html (original)
+++ branches/release/libs/asio/example/cpp03/http/doc_root/data_8K.html 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 <!--
-Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/http/server/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/http/server/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/http/server/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/http/server/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/connection.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/connection.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/connection.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/connection.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/connection.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/connection.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/connection_manager.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/connection_manager.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/connection_manager.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection_manager.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/connection_manager.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/connection_manager.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/connection_manager.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection_manager.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/header.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // header.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/main.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/main.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/main.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // main.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/mime_types.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/mime_types.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/mime_types.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/mime_types.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/mime_types.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/mime_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/reply.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/reply.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/reply.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/reply.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/reply.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/reply.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/request.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/request.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/request.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/request_handler.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/request_handler.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/request_handler.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/request_handler.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/request_handler.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/request_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/request_parser.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/request_parser.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/request_parser.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/request_parser.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/request_parser.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/request_parser.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server/server.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server/server.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server/server.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/http/server2/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/http/server2/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/connection.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/connection.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/connection.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/connection.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/connection.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/connection.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/header.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // header.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/io_service_pool.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // io_service_pool.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/io_service_pool.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/io_service_pool.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // io_service_pool.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/main.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/main.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/main.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // main.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/mime_types.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/mime_types.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/mime_types.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/mime_types.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/mime_types.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/mime_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/reply.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/reply.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/reply.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/reply.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/reply.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/reply.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/request.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/request.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/request.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/request_handler.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/request_handler.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/request_handler.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/request_handler.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/request_handler.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/request_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/request_parser.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/request_parser.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/request_parser.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/request_parser.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/request_parser.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/request_parser.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server2/server.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server2/server.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server2/server.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/http/server3/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/http/server3/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/connection.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/connection.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/connection.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/connection.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/connection.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/connection.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/header.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // header.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/main.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/main.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/main.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // main.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/mime_types.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/mime_types.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/mime_types.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/mime_types.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/mime_types.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/mime_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/reply.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/reply.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/reply.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/reply.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/reply.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/reply.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/request.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/request.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/request.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/request_handler.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/request_handler.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/request_handler.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/request_handler.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/request_handler.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/request_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_handler.hpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/request_parser.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/request_parser.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/request_parser.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/request_parser.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/request_parser.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/request_parser.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server3/server.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server3/server.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server3/server.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/http/server4/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/http/server4/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/file_handler.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/file_handler.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/file_handler.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // file_handler.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/file_handler.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/file_handler.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/file_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // file_handler.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/header.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // header.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/main.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/main.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/main.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // main.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/mime_types.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/mime_types.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/mime_types.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/mime_types.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/mime_types.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/mime_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // mime_types.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/reply.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/reply.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/reply.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/reply.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/reply.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/reply.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // reply.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/request.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/request.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/request.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/http/server4/request_parser.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/request_parser.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/request_parser.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,8 @@
 namespace http {
 namespace server4 {
 
-#include "yield.hpp" // Enable the pseudo-keywords reenter, yield and fork.
+// Enable the pseudo-keywords reenter, yield and fork.
+#include <boost/asio/yield.hpp>
 
 std::string request_parser::content_length_name_ = "Content-Length";
 
@@ -175,7 +176,8 @@
   return true;
 }
 
-#include "unyield.hpp" // Disable the pseudo-keywords reenter, yield and fork.
+// Disable the pseudo-keywords reenter, yield and fork.
+#include <boost/asio/unyield.hpp>
 
 bool request_parser::is_char(int c)
 {

Modified: branches/release/libs/asio/example/cpp03/http/server4/request_parser.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/request_parser.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/request_parser.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // request_parser.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
 #include <string>
 #include <boost/logic/tribool.hpp>
 #include <boost/tuple/tuple.hpp>
-#include "coroutine.hpp"
+#include <boost/asio/coroutine.hpp>
 
 namespace http {
 namespace server4 {
@@ -22,7 +22,7 @@
 struct request;
 
 /// Parser for incoming requests.
-class request_parser : coroutine
+class request_parser : boost::asio::coroutine
 {
 public:
   /// Parse some data. The tribool return value is true when a complete request

Modified: branches/release/libs/asio/example/cpp03/http/server4/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -25,7 +25,8 @@
   acceptor_.reset(new tcp::acceptor(io_service, *resolver.resolve(query)));
 }
 
-#include "yield.hpp" // Enable the pseudo-keywords reenter, yield and fork.
+// Enable the pseudo-keywords reenter, yield and fork.
+#include <boost/asio/yield.hpp>
 
 void server::operator()(boost::system::error_code ec, std::size_t length)
 {
@@ -113,7 +114,8 @@
   // will be destroyed automatically after this function call returns.
 }
 
-#include "unyield.hpp" // Disable the pseudo-keywords reenter, yield and fork.
+// Disable the pseudo-keywords reenter, yield and fork.
+#include <boost/asio/unyield.hpp>
 
 } // namespace server4
 } // namespace http

Modified: branches/release/libs/asio/example/cpp03/http/server4/server.hpp
==============================================================================
--- /branches/release/libs/asio/example/http/server4/server.hpp (original)
+++ branches/release/libs/asio/example/cpp03/http/server4/server.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 #include <boost/array.hpp>
 #include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
-#include "coroutine.hpp"
 #include "request_parser.hpp"
 
 namespace http {
@@ -26,7 +25,7 @@
 struct reply;
 
 /// The top-level coroutine of the HTTP server.
-class server : coroutine
+class server : boost::asio::coroutine
 {
 public:
   /// Construct the server to listen on the specified TCP address and port, and

Modified: branches/release/libs/asio/example/cpp03/icmp/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/icmp/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/icmp/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/icmp/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/icmp/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/icmp/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/icmp/icmp_header.hpp
==============================================================================
--- /branches/release/libs/asio/example/icmp/icmp_header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/icmp/icmp_header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // icmp_header.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/icmp/ipv4_header.hpp
==============================================================================
--- /branches/release/libs/asio/example/icmp/ipv4_header.hpp (original)
+++ branches/release/libs/asio/example/cpp03/icmp/ipv4_header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ipv4_header.hpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/icmp/ping.cpp
==============================================================================
--- /branches/release/libs/asio/example/icmp/ping.cpp (original)
+++ branches/release/libs/asio/example/cpp03/icmp/ping.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // ping.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -121,7 +121,7 @@
 
   static unsigned short get_identifier()
   {
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
     return static_cast<unsigned short>(::GetCurrentProcessId());
 #else
     return static_cast<unsigned short>(::getpid());
@@ -145,7 +145,7 @@
     if (argc != 2)
     {
       std::cerr << "Usage: ping <host>" << std::endl;
-#if !defined(BOOST_WINDOWS)
+#if !defined(BOOST_ASIO_WINDOWS)
       std::cerr << "(You may need to run this program as root.)" << std::endl;
 #endif
       return 1;

Modified: branches/release/libs/asio/example/cpp03/invocation/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/invocation/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/invocation/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/invocation/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/invocation/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/invocation/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/invocation/prioritised_handlers.cpp
==============================================================================
--- /branches/release/libs/asio/example/invocation/prioritised_handlers.cpp (original)
+++ branches/release/libs/asio/example/cpp03/invocation/prioritised_handlers.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // prioritised_handlers.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/iostreams/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/iostreams/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/iostreams/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/iostreams/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/iostreams/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/iostreams/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/iostreams/daytime_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/iostreams/daytime_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/iostreams/daytime_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // daytime_client.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/iostreams/daytime_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/iostreams/daytime_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/iostreams/daytime_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // daytime_server.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/iostreams/http_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/iostreams/http_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/iostreams/http_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // sync_client.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/local/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/local/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/local/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/local/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/connect_pair.cpp
==============================================================================
--- /branches/release/libs/asio/example/local/connect_pair.cpp (original)
+++ branches/release/libs/asio/example/cpp03/local/connect_pair.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connect_pair.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/iostream_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/local/iostream_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/local/iostream_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_client.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/stream_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/local/stream_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/local/stream_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_client.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/local/stream_server.cpp
==============================================================================
--- /branches/release/libs/asio/example/local/stream_server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/local/stream_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_server.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/multicast/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/multicast/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/multicast/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/multicast/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/multicast/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/multicast/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/multicast/receiver.cpp
==============================================================================
--- /branches/release/libs/asio/example/multicast/receiver.cpp (original)
+++ branches/release/libs/asio/example/cpp03/multicast/receiver.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // receiver.cpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/multicast/sender.cpp
==============================================================================
--- /branches/release/libs/asio/example/multicast/sender.cpp (original)
+++ branches/release/libs/asio/example/cpp03/multicast/sender.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // sender.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/nonblocking/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/nonblocking/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/nonblocking/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/nonblocking/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/nonblocking/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/nonblocking/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/nonblocking/third_party_lib.cpp
==============================================================================
--- /branches/release/libs/asio/example/nonblocking/third_party_lib.cpp (original)
+++ branches/release/libs/asio/example/cpp03/nonblocking/third_party_lib.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // third_party_lib.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/porthopper/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/porthopper/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/porthopper/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/porthopper/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/porthopper/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/porthopper/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/porthopper/client.cpp
==============================================================================
--- /branches/release/libs/asio/example/porthopper/client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/porthopper/client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // client.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/porthopper/protocol.hpp
==============================================================================
--- /branches/release/libs/asio/example/porthopper/protocol.hpp (original)
+++ branches/release/libs/asio/example/cpp03/porthopper/protocol.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // protocol.hpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/porthopper/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/porthopper/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/porthopper/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/serialization/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/serialization/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/serialization/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/serialization/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/client.cpp
==============================================================================
--- /branches/release/libs/asio/example/serialization/client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/serialization/client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // client.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/connection.hpp
==============================================================================
--- /branches/release/libs/asio/example/serialization/connection.hpp (original)
+++ branches/release/libs/asio/example/cpp03/serialization/connection.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connection.hpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/serialization/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/serialization/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/serialization/stock.hpp
==============================================================================
--- /branches/release/libs/asio/example/serialization/stock.hpp (original)
+++ branches/release/libs/asio/example/cpp03/serialization/stock.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stock.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/services/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/services/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/services/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/services/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/basic_logger.hpp
==============================================================================
--- /branches/release/libs/asio/example/services/basic_logger.hpp (original)
+++ branches/release/libs/asio/example/cpp03/services/basic_logger.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_logger.hpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/daytime_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/services/daytime_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/services/daytime_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // daytime_client.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/logger.hpp
==============================================================================
--- /branches/release/libs/asio/example/services/logger.hpp (original)
+++ branches/release/libs/asio/example/cpp03/services/logger.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // logger.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/logger_service.cpp
==============================================================================
--- /branches/release/libs/asio/example/services/logger_service.cpp (original)
+++ branches/release/libs/asio/example/cpp03/services/logger_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // logger_service.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/logger_service.hpp
==============================================================================
--- /branches/release/libs/asio/example/services/logger_service.hpp (original)
+++ branches/release/libs/asio/example/cpp03/services/logger_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // logger_service.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/services/stream_socket_service.hpp
==============================================================================
--- /branches/release/libs/asio/example/services/stream_socket_service.hpp (original)
+++ branches/release/libs/asio/example/cpp03/services/stream_socket_service.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_socket_service.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/socks4/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/socks4/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/socks4/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/socks4/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/socks4/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/socks4/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/socks4/socks4.hpp
==============================================================================
--- /branches/release/libs/asio/example/socks4/socks4.hpp (original)
+++ branches/release/libs/asio/example/cpp03/socks4/socks4.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // socks4.hpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/socks4/sync_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/socks4/sync_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/socks4/sync_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // sync_client.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/libs/asio/example/cpp03/spawn/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp03/spawn/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : echo_server.cpp
+ /boost/context//boost_context
+ /boost/coroutine//boost_coroutine
+ /boost/system//boost_system
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp03/spawn/echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp03/spawn/echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,122 @@
+//
+// echo_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <boost/asio/deadline_timer.hpp>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/spawn.hpp>
+#include <boost/asio/write.hpp>
+#include <boost/bind.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <iostream>
+
+using boost::asio::ip::tcp;
+
+class session : public boost::enable_shared_from_this<session>
+{
+public:
+ explicit session(boost::asio::io_service& io_service)
+ : strand_(io_service),
+ socket_(io_service),
+ timer_(io_service)
+ {
+ }
+
+ tcp::socket& socket()
+ {
+ return socket_;
+ }
+
+ void go()
+ {
+ boost::asio::spawn(strand_,
+ boost::bind(&session::echo,
+ shared_from_this(), _1));
+ boost::asio::spawn(strand_,
+ boost::bind(&session::timeout,
+ shared_from_this(), _1));
+ }
+
+private:
+ void echo(boost::asio::yield_context yield)
+ {
+ try
+ {
+ char data[128];
+ for (;;)
+ {
+ timer_.expires_from_now(boost::posix_time::seconds(10));
+ std::size_t n = socket_.async_read_some(boost::asio::buffer(data), yield);
+ boost::asio::async_write(socket_, boost::asio::buffer(data, n), yield);
+ }
+ }
+ catch (std::exception& e)
+ {
+ socket_.close();
+ timer_.cancel();
+ }
+ }
+
+ void timeout(boost::asio::yield_context yield)
+ {
+ while (socket_.is_open())
+ {
+ boost::system::error_code ignored_ec;
+ timer_.async_wait(yield[ignored_ec]);
+ if (timer_.expires_from_now() <= boost::posix_time::seconds(0))
+ socket_.close();
+ }
+ }
+
+ boost::asio::io_service::strand strand_;
+ tcp::socket socket_;
+ boost::asio::deadline_timer timer_;
+};
+
+void do_accept(boost::asio::io_service& io_service,
+ unsigned short port, boost::asio::yield_context yield)
+{
+ tcp::acceptor acceptor(io_service, tcp::endpoint(tcp::v4(), port));
+
+ for (;;)
+ {
+ boost::system::error_code ec;
+ boost::shared_ptr<session> new_session(new session(io_service));
+ acceptor.async_accept(new_session->socket(), yield[ec]);
+ if (!ec) new_session->go();
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ boost::asio::spawn(io_service,
+ boost::bind(do_accept,
+ boost::ref(io_service), atoi(argv[1]), _1));
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Modified: branches/release/libs/asio/example/cpp03/ssl/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/ssl/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/ssl/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/ssl/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/ssl/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/ssl/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/ssl/README
==============================================================================
--- /branches/release/libs/asio/example/ssl/README (original)
+++ branches/release/libs/asio/example/cpp03/ssl/README 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 
 
 -------------------------------------------------------------------------------
-Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 
 Distributed under the Boost Software License, Version 1.0. (See accompanying
 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/ssl/client.cpp
==============================================================================
--- /branches/release/libs/asio/example/ssl/client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/ssl/client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // client.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/ssl/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/ssl/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/ssl/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/timeouts/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/timeouts/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/async_tcp_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/timeouts/async_tcp_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/async_tcp_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // async_tcp_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/blocking_tcp_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/timeouts/blocking_tcp_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/blocking_tcp_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_tcp_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/blocking_udp_client.cpp
==============================================================================
--- /branches/release/libs/asio/example/timeouts/blocking_udp_client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/blocking_udp_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // blocking_udp_client.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timeouts/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/timeouts/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timeouts/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timers/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/timers/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/timers/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timers/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/timers/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/timers/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timers/tick_count_timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/timers/tick_count_timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timers/tick_count_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // tick_count_timer.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/timers/time_t_timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/timers/time_t_timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/timers/time_t_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // time_t_timer.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/tutorial/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/tutorial/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime1/client.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime1/client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime1/client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // client.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime2/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime2/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime2/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime3/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime3/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime3/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime4/client.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime4/client.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime4/client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // client.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime5/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime5/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime5/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime6/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime6/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime6/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime7/server.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime7/server.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime7/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // server.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/daytime_dox.txt
==============================================================================
--- /branches/release/libs/asio/example/tutorial/daytime_dox.txt (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/daytime_dox.txt 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/index_dox.txt
==============================================================================
--- /branches/release/libs/asio/example/tutorial/index_dox.txt (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/index_dox.txt 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer1/timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer1/timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer1/timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // timer.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer2/timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer2/timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer2/timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // timer.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer3/timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer3/timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer3/timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // timer.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer4/timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer4/timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer4/timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // timer.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer5/timer.cpp
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer5/timer.cpp (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer5/timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // timer.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/tutorial/timer_dox.txt
==============================================================================
--- /branches/release/libs/asio/example/tutorial/timer_dox.txt (original)
+++ branches/release/libs/asio/example/cpp03/tutorial/timer_dox.txt 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/windows/Jamfile
==============================================================================
--- /branches/release/libs/asio/example/windows/Jamfile (original)
+++ branches/release/libs/asio/example/cpp03/windows/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/windows/Jamfile.v2
==============================================================================
--- /branches/release/libs/asio/example/windows/Jamfile.v2 (original)
+++ branches/release/libs/asio/example/cpp03/windows/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/example/cpp03/windows/transmit_file.cpp
==============================================================================
--- /branches/release/libs/asio/example/windows/transmit_file.cpp (original)
+++ branches/release/libs/asio/example/cpp03/windows/transmit_file.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // transmit_file.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Added: branches/release/libs/asio/example/cpp11/allocation/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/allocation/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/allocation ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+exe server
+ : <lib>@boost/libs/system/build/boost_system
+ server.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;

Added: branches/release/libs/asio/example/cpp11/allocation/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/allocation/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : server.cpp
+ /boost/system//boost_system
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp11/allocation/server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/allocation/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,215 @@
+//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <array>
+#include <cstdlib>
+#include <iostream>
+#include <memory>
+#include <type_traits>
+#include <utility>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::tcp;
+
+// Class to manage the memory to be used for handler-based custom allocation.
+// It contains a single block of memory which may be returned for allocation
+// requests. If the memory is in use when an allocation request is made, the
+// allocator delegates allocation to the global heap.
+class handler_allocator
+{
+public:
+ handler_allocator()
+ : in_use_(false)
+ {
+ }
+
+ handler_allocator(const handler_allocator&) = delete;
+ handler_allocator& operator=(const handler_allocator&) = delete;
+
+ void* allocate(std::size_t size)
+ {
+ if (!in_use_ && size < sizeof(storage_))
+ {
+ in_use_ = true;
+ return &storage_;
+ }
+ else
+ {
+ return ::operator new(size);
+ }
+ }
+
+ void deallocate(void* pointer)
+ {
+ if (pointer == &storage_)
+ {
+ in_use_ = false;
+ }
+ else
+ {
+ ::operator delete(pointer);
+ }
+ }
+
+private:
+ // Storage space used for handler-based custom memory allocation.
+ typename std::aligned_storage<1024>::type storage_;
+
+ // Whether the handler-based custom allocation storage has been used.
+ bool in_use_;
+};
+
+// Wrapper class template for handler objects to allow handler memory
+// allocation to be customised. Calls to operator() are forwarded to the
+// encapsulated handler.
+template <typename Handler>
+class custom_alloc_handler
+{
+public:
+ custom_alloc_handler(handler_allocator& a, Handler h)
+ : allocator_(a),
+ handler_(h)
+ {
+ }
+
+ template <typename ...Args>
+ void operator()(Args&&... args)
+ {
+ handler_(std::forward<Args>(args)...);
+ }
+
+ friend void* asio_handler_allocate(std::size_t size,
+ custom_alloc_handler<Handler>* this_handler)
+ {
+ return this_handler->allocator_.allocate(size);
+ }
+
+ friend void asio_handler_deallocate(void* pointer, std::size_t /*size*/,
+ custom_alloc_handler<Handler>* this_handler)
+ {
+ this_handler->allocator_.deallocate(pointer);
+ }
+
+private:
+ handler_allocator& allocator_;
+ Handler handler_;
+};
+
+// Helper function to wrap a handler object to add custom allocation.
+template <typename Handler>
+inline custom_alloc_handler<Handler> make_custom_alloc_handler(
+ handler_allocator& a, Handler h)
+{
+ return custom_alloc_handler<Handler>(a, h);
+}
+
+class session
+ : public std::enable_shared_from_this<session>
+{
+public:
+ session(tcp::socket socket)
+ : socket_(std::move(socket))
+ {
+ }
+
+ void start()
+ {
+ do_read();
+ }
+
+private:
+ void do_read()
+ {
+ auto self(shared_from_this());
+ socket_.async_read_some(boost::asio::buffer(data_),
+ make_custom_alloc_handler(allocator_,
+ [this, self](boost::system::error_code ec, std::size_t length)
+ {
+ if (!ec)
+ {
+ do_write(length);
+ }
+ }));
+ }
+
+ void do_write(std::size_t length)
+ {
+ auto self(shared_from_this());
+ boost::asio::async_write(socket_, boost::asio::buffer(data_, length),
+ make_custom_alloc_handler(allocator_,
+ [this, self](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ do_read();
+ }
+ }));
+ }
+
+ // The socket used to communicate with the client.
+ tcp::socket socket_;
+
+ // Buffer used to store data received from the client.
+ std::array<char, 1024> data_;
+
+ // The allocator to use for handler-based custom memory allocation.
+ handler_allocator allocator_;
+};
+
+class server
+{
+public:
+ server(boost::asio::io_service& io_service, short port)
+ : acceptor_(io_service, tcp::endpoint(tcp::v4(), port)),
+ socket_(io_service)
+ {
+ do_accept();
+ }
+
+private:
+ void do_accept()
+ {
+ acceptor_.async_accept(socket_,
+ [this](boost::system::error_code ec)
+ {
+ if (!ec)
+ {
+ std::make_shared<session>(std::move(socket_))->start();
+ }
+
+ do_accept();
+ });
+ }
+
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+ server s(io_service, std::atoi(argv[1]));
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/buffers/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/buffers/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/buffers ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+exe server
+ : <lib>@boost/libs/system/build/boost_system
+ reference_counted.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;

Added: branches/release/libs/asio/example/cpp11/buffers/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/buffers/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : reference_counted.cpp
+ /boost/system//boost_system
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp11/buffers/reference_counted.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/buffers/reference_counted.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,123 @@
+//
+// reference_counted.cpp
+// ~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <boost/asio.hpp>
+#include <iostream>
+#include <memory>
+#include <utility>
+#include <vector>
+
+using boost::asio::ip::tcp;
+
+// A reference-counted non-modifiable buffer class.
+class shared_const_buffer
+{
+public:
+ // Construct from a std::string.
+ explicit shared_const_buffer(const std::string& data)
+ : data_(new std::vector<char>(data.begin(), data.end())),
+ buffer_(boost::asio::buffer(*data_))
+ {
+ }
+
+ // Implement the ConstBufferSequence requirements.
+ typedef boost::asio::const_buffer value_type;
+ typedef const boost::asio::const_buffer* const_iterator;
+ const boost::asio::const_buffer* begin() const { return &buffer_; }
+ const boost::asio::const_buffer* end() const { return &buffer_ + 1; }
+
+private:
+ std::shared_ptr<std::vector<char> > data_;
+ boost::asio::const_buffer buffer_;
+};
+
+class session
+ : public std::enable_shared_from_this<session>
+{
+public:
+ session(tcp::socket socket)
+ : socket_(std::move(socket))
+ {
+ }
+
+ void start()
+ {
+ do_write();
+ }
+
+private:
+ void do_write()
+ {
+ std::time_t now = std::time(0);
+ shared_const_buffer buffer(std::ctime(&now));
+
+ auto self(shared_from_this());
+ boost::asio::async_write(socket_, buffer,
+ [this, self](boost::system::error_code /*ec*/, std::size_t /*length*/)
+ {
+ });
+ }
+
+ // The socket used to communicate with the client.
+ tcp::socket socket_;
+};
+
+class server
+{
+public:
+ server(boost::asio::io_service& io_service, short port)
+ : acceptor_(io_service, tcp::endpoint(tcp::v4(), port)),
+ socket_(io_service)
+ {
+ do_accept();
+ }
+
+private:
+ void do_accept()
+ {
+ acceptor_.async_accept(socket_,
+ [this](boost::system::error_code ec)
+ {
+ if (!ec)
+ {
+ std::make_shared<session>(std::move(socket_))->start();
+ }
+
+ do_accept();
+ });
+ }
+
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: reference_counted <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ server s(io_service, std::atoi(argv[1]));
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/chat/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/chat/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/chat ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+exe chat_client
+ : <lib>@boost/libs/thread/build/boost_thread
+ <lib>@boost/libs/system/build/boost_system
+ chat_client.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;
+
+exe chat_server
+ : <lib>@boost/libs/thread/build/boost_thread
+ <lib>@boost/libs/system/build/boost_system
+ chat_server.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;

Added: branches/release/libs/asio/example/cpp11/chat/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/chat/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+project
+ : requirements
+ <library>/boost/system//boost_system
+ <library>/boost/thread//boost_thread
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;
+
+exe chat_server : chat_server.cpp ;
+exe chat_client : chat_client.cpp ;

Added: branches/release/libs/asio/example/cpp11/chat/chat_client.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/chat/chat_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,167 @@
+//
+// chat_client.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <deque>
+#include <iostream>
+#include <thread>
+#include <boost/asio.hpp>
+#include "chat_message.hpp"
+
+using boost::asio::ip::tcp;
+
+typedef std::deque<chat_message> chat_message_queue;
+
+class chat_client
+{
+public:
+ chat_client(boost::asio::io_service& io_service,
+ tcp::resolver::iterator endpoint_iterator)
+ : io_service_(io_service),
+ socket_(io_service)
+ {
+ do_connect(endpoint_iterator);
+ }
+
+ void write(const chat_message& msg)
+ {
+ io_service_.post(
+ [this, msg]()
+ {
+ bool write_in_progress = !write_msgs_.empty();
+ write_msgs_.push_back(msg);
+ if (!write_in_progress)
+ {
+ do_write();
+ }
+ });
+ }
+
+ void close()
+ {
+ io_service_.post([this]() { socket_.close(); });
+ }
+
+private:
+ void do_connect(tcp::resolver::iterator endpoint_iterator)
+ {
+ boost::asio::async_connect(socket_, endpoint_iterator,
+ [this](boost::system::error_code ec, tcp::resolver::iterator)
+ {
+ if (!ec)
+ {
+ do_read_header();
+ }
+ });
+ }
+
+ void do_read_header()
+ {
+ boost::asio::async_read(socket_,
+ boost::asio::buffer(read_msg_.data(), chat_message::header_length),
+ [this](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec && read_msg_.decode_header())
+ {
+ do_read_body();
+ }
+ else
+ {
+ socket_.close();
+ }
+ });
+ }
+
+ void do_read_body()
+ {
+ boost::asio::async_read(socket_,
+ boost::asio::buffer(read_msg_.body(), read_msg_.body_length()),
+ [this](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ std::cout.write(read_msg_.body(), read_msg_.body_length());
+ std::cout << "\n";
+ do_read_header();
+ }
+ else
+ {
+ socket_.close();
+ }
+ });
+ }
+
+ void do_write()
+ {
+ boost::asio::async_write(socket_,
+ boost::asio::buffer(write_msgs_.front().data(),
+ write_msgs_.front().length()),
+ [this](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ write_msgs_.pop_front();
+ if (!write_msgs_.empty())
+ {
+ do_write();
+ }
+ }
+ else
+ {
+ socket_.close();
+ }
+ });
+ }
+
+private:
+ boost::asio::io_service& io_service_;
+ tcp::socket socket_;
+ chat_message read_msg_;
+ chat_message_queue write_msgs_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: chat_client <host> <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ tcp::resolver resolver(io_service);
+ auto endpoint_iterator = resolver.resolve({ argv[1], argv[2] });
+ chat_client c(io_service, endpoint_iterator);
+
+ std::thread t([&io_service](){ io_service.run(); });
+
+ char line[chat_message::max_body_length + 1];
+ while (std::cin.getline(line, chat_message::max_body_length + 1))
+ {
+ chat_message msg;
+ msg.body_length(std::strlen(line));
+ std::memcpy(msg.body(), line, msg.body_length());
+ msg.encode_header();
+ c.write(msg);
+ }
+
+ c.close();
+ t.join();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/chat/chat_message.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/chat/chat_message.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,91 @@
+//
+// chat_message.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef CHAT_MESSAGE_HPP
+#define CHAT_MESSAGE_HPP
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+class chat_message
+{
+public:
+ enum { header_length = 4 };
+ enum { max_body_length = 512 };
+
+ chat_message()
+ : body_length_(0)
+ {
+ }
+
+ const char* data() const
+ {
+ return data_;
+ }
+
+ char* data()
+ {
+ return data_;
+ }
+
+ std::size_t length() const
+ {
+ return header_length + body_length_;
+ }
+
+ const char* body() const
+ {
+ return data_ + header_length;
+ }
+
+ char* body()
+ {
+ return data_ + header_length;
+ }
+
+ std::size_t body_length() const
+ {
+ return body_length_;
+ }
+
+ void body_length(std::size_t new_length)
+ {
+ body_length_ = new_length;
+ if (body_length_ > max_body_length)
+ body_length_ = max_body_length;
+ }
+
+ bool decode_header()
+ {
+ char header[header_length + 1] = "";
+ std::strncat(header, data_, header_length);
+ body_length_ = std::atoi(header);
+ if (body_length_ > max_body_length)
+ {
+ body_length_ = 0;
+ return false;
+ }
+ return true;
+ }
+
+ void encode_header()
+ {
+ char header[header_length + 1] = "";
+ std::sprintf(header, "%4d", body_length_);
+ std::memcpy(data_, header, header_length);
+ }
+
+private:
+ char data_[header_length + max_body_length];
+ std::size_t body_length_;
+};
+
+#endif // CHAT_MESSAGE_HPP

Added: branches/release/libs/asio/example/cpp11/chat/chat_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/chat/chat_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,229 @@
+//
+// chat_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <deque>
+#include <iostream>
+#include <list>
+#include <memory>
+#include <set>
+#include <utility>
+#include <boost/asio.hpp>
+#include "chat_message.hpp"
+
+using boost::asio::ip::tcp;
+
+//----------------------------------------------------------------------
+
+typedef std::deque<chat_message> chat_message_queue;
+
+//----------------------------------------------------------------------
+
+class chat_participant
+{
+public:
+ virtual ~chat_participant() {}
+ virtual void deliver(const chat_message& msg) = 0;
+};
+
+typedef std::shared_ptr<chat_participant> chat_participant_ptr;
+
+//----------------------------------------------------------------------
+
+class chat_room
+{
+public:
+ void join(chat_participant_ptr participant)
+ {
+ participants_.insert(participant);
+ for (auto msg: recent_msgs_)
+ participant->deliver(msg);
+ }
+
+ void leave(chat_participant_ptr participant)
+ {
+ participants_.erase(participant);
+ }
+
+ void deliver(const chat_message& msg)
+ {
+ recent_msgs_.push_back(msg);
+ while (recent_msgs_.size() > max_recent_msgs)
+ recent_msgs_.pop_front();
+
+ for (auto participant: participants_)
+ participant->deliver(msg);
+ }
+
+private:
+ std::set<chat_participant_ptr> participants_;
+ enum { max_recent_msgs = 100 };
+ chat_message_queue recent_msgs_;
+};
+
+//----------------------------------------------------------------------
+
+class chat_session
+ : public chat_participant,
+ public std::enable_shared_from_this<chat_session>
+{
+public:
+ chat_session(tcp::socket socket, chat_room& room)
+ : socket_(std::move(socket)),
+ room_(room)
+ {
+ }
+
+ void start()
+ {
+ room_.join(shared_from_this());
+ do_read_header();
+ }
+
+ void deliver(const chat_message& msg)
+ {
+ bool write_in_progress = !write_msgs_.empty();
+ write_msgs_.push_back(msg);
+ if (!write_in_progress)
+ {
+ do_write();
+ }
+ }
+
+private:
+ void do_read_header()
+ {
+ auto self(shared_from_this());
+ boost::asio::async_read(socket_,
+ boost::asio::buffer(read_msg_.data(), chat_message::header_length),
+ [this, self](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec && read_msg_.decode_header())
+ {
+ do_read_body();
+ }
+ else
+ {
+ room_.leave(shared_from_this());
+ }
+ });
+ }
+
+ void do_read_body()
+ {
+ auto self(shared_from_this());
+ boost::asio::async_read(socket_,
+ boost::asio::buffer(read_msg_.body(), read_msg_.body_length()),
+ [this, self](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ room_.deliver(read_msg_);
+ do_read_header();
+ }
+ else
+ {
+ room_.leave(shared_from_this());
+ }
+ });
+ }
+
+ void do_write()
+ {
+ auto self(shared_from_this());
+ boost::asio::async_write(socket_,
+ boost::asio::buffer(write_msgs_.front().data(),
+ write_msgs_.front().length()),
+ [this, self](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ write_msgs_.pop_front();
+ if (!write_msgs_.empty())
+ {
+ do_write();
+ }
+ }
+ else
+ {
+ room_.leave(shared_from_this());
+ }
+ });
+ }
+
+ tcp::socket socket_;
+ chat_room& room_;
+ chat_message read_msg_;
+ chat_message_queue write_msgs_;
+};
+
+//----------------------------------------------------------------------
+
+class chat_server
+{
+public:
+ chat_server(boost::asio::io_service& io_service,
+ const tcp::endpoint& endpoint)
+ : acceptor_(io_service, endpoint),
+ socket_(io_service)
+ {
+ do_accept();
+ }
+
+private:
+ void do_accept()
+ {
+ acceptor_.async_accept(socket_,
+ [this](boost::system::error_code ec)
+ {
+ if (!ec)
+ {
+ std::make_shared<chat_session>(std::move(socket_), room_)->start();
+ }
+
+ do_accept();
+ });
+ }
+
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+ chat_room room_;
+};
+
+//----------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc < 2)
+ {
+ std::cerr << "Usage: chat_server <port> [<port> ...]\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ std::list<chat_server> servers;
+ for (int i = 1; i < argc; ++i)
+ {
+ tcp::endpoint endpoint(tcp::v4(), std::atoi(argv[i]));
+ servers.emplace_back(io_service, endpoint);
+ }
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,63 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/echo ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+template asio_echo_example
+ : <lib>@boost/libs/thread/build/boost_thread
+ <lib>@boost/libs/system/build/boost_system
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;
+
+exe async_tcp_echo_server
+ : <template>asio_echo_example
+ async_tcp_echo_server.cpp
+ ;
+
+exe async_udp_echo_server
+ : <template>asio_echo_example
+ async_udp_echo_server.cpp
+ ;
+
+exe blocking_tcp_echo_client
+ : <template>asio_echo_example
+ blocking_tcp_echo_client.cpp
+ ;
+
+exe blocking_tcp_echo_server
+ : <template>asio_echo_example
+ blocking_tcp_echo_server.cpp
+ ;
+
+exe blocking_udp_echo_client
+ : <template>asio_echo_example
+ blocking_udp_echo_client.cpp
+ ;
+
+exe blocking_udp_echo_server
+ : <template>asio_echo_example
+ blocking_udp_echo_server.cpp
+ ;

Added: branches/release/libs/asio/example/cpp11/echo/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+project
+ : requirements
+ <library>/boost/system//boost_system
+ <library>/boost/thread//boost_thread
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;
+
+exe async_tcp_echo_server : async_tcp_echo_server.cpp ;
+exe async_udp_echo_server : async_udp_echo_server.cpp ;
+exe blocking_tcp_echo_client : blocking_tcp_echo_client.cpp ;
+exe blocking_tcp_echo_server : blocking_tcp_echo_server.cpp ;
+exe blocking_udp_echo_client : blocking_udp_echo_client.cpp ;
+exe blocking_udp_echo_server : blocking_udp_echo_server.cpp ;

Added: branches/release/libs/asio/example/cpp11/echo/async_tcp_echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/async_tcp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,116 @@
+//
+// async_tcp_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <iostream>
+#include <memory>
+#include <utility>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::tcp;
+
+class session
+ : public std::enable_shared_from_this<session>
+{
+public:
+ session(tcp::socket socket)
+ : socket_(std::move(socket))
+ {
+ }
+
+ void start()
+ {
+ do_read();
+ }
+
+private:
+ void do_read()
+ {
+ auto self(shared_from_this());
+ socket_.async_read_some(boost::asio::buffer(data_, max_length),
+ [this, self](boost::system::error_code ec, std::size_t length)
+ {
+ if (!ec)
+ {
+ do_write(length);
+ }
+ });
+ }
+
+ void do_write(std::size_t length)
+ {
+ auto self(shared_from_this());
+ boost::asio::async_write(socket_, boost::asio::buffer(data_, length),
+ [this, self](boost::system::error_code ec, std::size_t /*length*/)
+ {
+ if (!ec)
+ {
+ do_read();
+ }
+ });
+ }
+
+ tcp::socket socket_;
+ enum { max_length = 1024 };
+ char data_[max_length];
+};
+
+class server
+{
+public:
+ server(boost::asio::io_service& io_service, short port)
+ : acceptor_(io_service, tcp::endpoint(tcp::v4(), port)),
+ socket_(io_service)
+ {
+ do_accept();
+ }
+
+private:
+ void do_accept()
+ {
+ acceptor_.async_accept(socket_,
+ [this](boost::system::error_code ec)
+ {
+ if (!ec)
+ {
+ std::make_shared<session>(std::move(socket_))->start();
+ }
+
+ do_accept();
+ });
+ }
+
+ tcp::acceptor acceptor_;
+ tcp::socket socket_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: async_tcp_echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ server s(io_service, std::atoi(argv[1]));
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/async_udp_echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/async_udp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,82 @@
+//
+// async_udp_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <iostream>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::udp;
+
+class server
+{
+public:
+ server(boost::asio::io_service& io_service, short port)
+ : socket_(io_service, udp::endpoint(udp::v4(), port))
+ {
+ do_receive();
+ }
+
+ void do_receive()
+ {
+ socket_.async_receive_from(
+ boost::asio::buffer(data_, max_length), sender_endpoint_,
+ [this](boost::system::error_code ec, std::size_t bytes_recvd)
+ {
+ if (!ec && bytes_recvd > 0)
+ {
+ do_send(bytes_recvd);
+ }
+ else
+ {
+ do_receive();
+ }
+ });
+ }
+
+ void do_send(std::size_t length)
+ {
+ socket_.async_send_to(
+ boost::asio::buffer(data_, length), sender_endpoint_,
+ [this](boost::system::error_code /*ec*/, std::size_t /*bytes_sent*/)
+ {
+ do_receive();
+ });
+ }
+
+private:
+ udp::socket socket_;
+ udp::endpoint sender_endpoint_;
+ enum { max_length = 1024 };
+ char data_[max_length];
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: async_udp_echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ server s(io_service, std::atoi(argv[1]));
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_client.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,55 @@
+//
+// blocking_tcp_echo_client.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::tcp;
+
+enum { max_length = 1024 };
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: blocking_tcp_echo_client <host> <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ tcp::socket s(io_service);
+ tcp::resolver resolver(io_service);
+ boost::asio::connect(s, resolver.resolve({argv[1], argv[2]}));
+
+ std::cout << "Enter message: ";
+ char request[max_length];
+ std::cin.getline(request, max_length);
+ size_t request_length = std::strlen(request);
+ boost::asio::write(s, boost::asio::buffer(request, request_length));
+
+ char reply[max_length];
+ size_t reply_length = boost::asio::read(s,
+ boost::asio::buffer(reply, request_length));
+ std::cout << "Reply is: ";
+ std::cout.write(reply, reply_length);
+ std::cout << "\n";
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/blocking_tcp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,76 @@
+//
+// blocking_tcp_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <iostream>
+#include <thread>
+#include <utility>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::tcp;
+
+const int max_length = 1024;
+
+void session(tcp::socket sock)
+{
+ try
+ {
+ for (;;)
+ {
+ char data[max_length];
+
+ boost::system::error_code error;
+ size_t length = sock.read_some(boost::asio::buffer(data), error);
+ if (error == boost::asio::error::eof)
+ break; // Connection closed cleanly by peer.
+ else if (error)
+ throw boost::system::system_error(error); // Some other error.
+
+ boost::asio::write(sock, boost::asio::buffer(data, length));
+ }
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception in thread: " << e.what() << "\n";
+ }
+}
+
+void server(boost::asio::io_service& io_service, unsigned short port)
+{
+ tcp::acceptor a(io_service, tcp::endpoint(tcp::v4(), port));
+ for (;;)
+ {
+ tcp::socket sock(io_service);
+ a.accept(sock);
+ std::thread(session, std::move(sock)).detach();
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: blocking_tcp_echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ server(io_service, std::atoi(argv[1]));
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_client.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,57 @@
+//
+// blocking_udp_echo_client.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::udp;
+
+enum { max_length = 1024 };
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cerr << "Usage: blocking_udp_echo_client <host> <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ udp::socket s(io_service, udp::endpoint(udp::v4(), 0));
+
+ udp::resolver resolver(io_service);
+ udp::endpoint endpoint = *resolver.resolve({udp::v4(), argv[1], argv[2]});
+
+ std::cout << "Enter message: ";
+ char request[max_length];
+ std::cin.getline(request, max_length);
+ size_t request_length = std::strlen(request);
+ s.send_to(boost::asio::buffer(request, request_length), endpoint);
+
+ char reply[max_length];
+ udp::endpoint sender_endpoint;
+ size_t reply_length = s.receive_from(
+ boost::asio::buffer(reply, max_length), sender_endpoint);
+ std::cout << "Reply is: ";
+ std::cout.write(reply, reply_length);
+ std::cout << "\n";
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/echo/blocking_udp_echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,52 @@
+//
+// blocking_udp_echo_server.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <cstdlib>
+#include <iostream>
+#include <boost/asio.hpp>
+
+using boost::asio::ip::udp;
+
+enum { max_length = 1024 };
+
+void server(boost::asio::io_service& io_service, unsigned short port)
+{
+ udp::socket sock(io_service, udp::endpoint(udp::v4(), port));
+ for (;;)
+ {
+ char data[max_length];
+ udp::endpoint sender_endpoint;
+ size_t length = sock.receive_from(
+ boost::asio::buffer(data, max_length), sender_endpoint);
+ sock.send_to(boost::asio::buffer(data, length), sender_endpoint);
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: blocking_udp_echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ server(io_service, std::atoi(argv[1]));
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/futures/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/futures/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/buffers ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+exe server
+ : <lib>@boost/libs/system/build/boost_system
+ daytime_client.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;

Added: branches/release/libs/asio/example/cpp11/futures/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/futures/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,38 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : daytime_client.cpp
+ /boost/system//boost_system
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp11/futures/daytime_client.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/futures/daytime_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,94 @@
+//
+// daytime_client.cpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <array>
+#include <future>
+#include <iostream>
+#include <thread>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include <boost/asio/use_future.hpp>
+
+using boost::asio::ip::udp;
+
+void get_daytime(boost::asio::io_service& io_service, const char* hostname)
+{
+ try
+ {
+ udp::resolver resolver(io_service);
+
+ std::future<udp::resolver::iterator> iter =
+ resolver.async_resolve(
+ {udp::v4(), hostname, "daytime"},
+ boost::asio::use_future);
+
+ // The async_resolve operation above returns the endpoint iterator as a
+ // future value that is not retrieved ...
+
+ udp::socket socket(io_service, udp::v4());
+
+ std::array<char, 1> send_buf = {{ 0 }};
+ std::future<std::size_t> send_length =
+ socket.async_send_to(boost::asio::buffer(send_buf),
+ *iter.get(), // ... until here. This call may block.
+ boost::asio::use_future);
+
+ // Do other things here while the send completes.
+
+ send_length.get(); // Blocks until the send is complete. Throws any errors.
+
+ std::array<char, 128> recv_buf;
+ udp::endpoint sender_endpoint;
+ std::future<std::size_t> recv_length =
+ socket.async_receive_from(
+ boost::asio::buffer(recv_buf),
+ sender_endpoint,
+ boost::asio::use_future);
+
+ // Do other things here while the receive completes.
+
+ std::cout.write(
+ recv_buf.data(),
+ recv_length.get()); // Blocks until receive is complete.
+ }
+ catch (std::system_error& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: daytime_client <host>" << std::endl;
+ return 1;
+ }
+
+ // We run the io_service off in its own thread so that it operates
+ // completely asynchronously with respect to the rest of the program.
+ boost::asio::io_service io_service;
+ boost::asio::io_service::work work(io_service);
+ std::thread thread([&io_service](){ io_service.run(); });
+
+ get_daytime(io_service, argv[1]);
+
+ io_service.stop();
+ thread.join();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/http/server/Jamfile
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/Jamfile 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+subproject libs/asio/example/http/server ;
+
+project boost : $(BOOST_ROOT) ;
+
+if $(UNIX)
+{
+ switch $(JAMUNAME)
+ {
+ case SunOS* :
+ {
+ SOCKET_LIBS = <find-library>socket <find-library>nsl ;
+ }
+ }
+}
+
+exe http_server
+ : <lib>@boost/libs/thread/build/boost_thread
+ <lib>@boost/libs/system/build/boost_system
+ connection.cpp
+ connection_manager.cpp
+ main.cpp
+ mime_types.cpp
+ reply.cpp
+ request_handler.cpp
+ request_parser.cpp
+ server.cpp
+ : <include>$(BOOST_ROOT)
+ <include>../../../../..
+ <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <mingw><*><find-library>ws2_32
+ <mingw><*><find-library>mswsock
+ $(SOCKET_LIBS)
+ ;

Added: branches/release/libs/asio/example/cpp11/http/server/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : connection.cpp
+ connection_manager.cpp
+ main.cpp
+ mime_types.cpp
+ reply.cpp
+ request_handler.cpp
+ request_parser.cpp
+ server.cpp
+ /boost/system//boost_system
+ /boost/thread//boost_thread
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp11/http/server/connection.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/connection.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,94 @@
+//
+// connection.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "connection.hpp"
+#include <utility>
+#include <vector>
+#include "connection_manager.hpp"
+#include "request_handler.hpp"
+
+namespace http {
+namespace server {
+
+connection::connection(boost::asio::ip::tcp::socket socket,
+ connection_manager& manager, request_handler& handler)
+ : socket_(std::move(socket)),
+ connection_manager_(manager),
+ request_handler_(handler)
+{
+}
+
+void connection::start()
+{
+ do_read();
+}
+
+void connection::stop()
+{
+ socket_.close();
+}
+
+void connection::do_read()
+{
+ auto self(shared_from_this());
+ socket_.async_read_some(boost::asio::buffer(buffer_),
+ [this, self](boost::system::error_code ec, std::size_t bytes_transferred)
+ {
+ if (!ec)
+ {
+ request_parser::result_type result;
+ std::tie(result, std::ignore) = request_parser_.parse(
+ request_, buffer_.data(), buffer_.data() + bytes_transferred);
+
+ if (result == request_parser::good)
+ {
+ request_handler_.handle_request(request_, reply_);
+ do_write();
+ }
+ else if (result == request_parser::bad)
+ {
+ reply_ = reply::stock_reply(reply::bad_request);
+ do_write();
+ }
+ else
+ {
+ do_read();
+ }
+ }
+ else if (ec != boost::asio::error::operation_aborted)
+ {
+ connection_manager_.stop(shared_from_this());
+ }
+ });
+}
+
+void connection::do_write()
+{
+ auto self(shared_from_this());
+ boost::asio::async_write(socket_, reply_.to_buffers(),
+ [this, self](boost::system::error_code ec, std::size_t)
+ {
+ if (!ec)
+ {
+ // Initiate graceful connection closure.
+ boost::system::error_code ignored_ec;
+ socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both,
+ ignored_ec);
+ }
+
+ if (ec != boost::asio::error::operation_aborted)
+ {
+ connection_manager_.stop(shared_from_this());
+ }
+ });
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/connection.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/connection.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,79 @@
+//
+// connection.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_CONNECTION_HPP
+#define HTTP_CONNECTION_HPP
+
+#include <array>
+#include <memory>
+#include <boost/asio.hpp>
+#include "reply.hpp"
+#include "request.hpp"
+#include "request_handler.hpp"
+#include "request_parser.hpp"
+
+namespace http {
+namespace server {
+
+class connection_manager;
+
+/// Represents a single connection from a client.
+class connection
+ : public std::enable_shared_from_this<connection>
+{
+public:
+ connection(const connection&) = delete;
+ connection& operator=(const connection&) = delete;
+
+ /// Construct a connection with the given socket.
+ explicit connection(boost::asio::ip::tcp::socket socket,
+ connection_manager& manager, request_handler& handler);
+
+ /// Start the first asynchronous operation for the connection.
+ void start();
+
+ /// Stop all asynchronous operations associated with the connection.
+ void stop();
+
+private:
+ /// Perform an asynchronous read operation.
+ void do_read();
+
+ /// Perform an asynchronous write operation.
+ void do_write();
+
+ /// Socket for the connection.
+ boost::asio::ip::tcp::socket socket_;
+
+ /// The manager for this connection.
+ connection_manager& connection_manager_;
+
+ /// The handler used to process the incoming request.
+ request_handler& request_handler_;
+
+ /// Buffer for incoming data.
+ std::array<char, 8192> buffer_;
+
+ /// The incoming request.
+ request request_;
+
+ /// The parser for the incoming request.
+ request_parser request_parser_;
+
+ /// The reply to be sent back to the client.
+ reply reply_;
+};
+
+typedef std::shared_ptr<connection> connection_ptr;
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_CONNECTION_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/connection_manager.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/connection_manager.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,40 @@
+//
+// connection_manager.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "connection_manager.hpp"
+
+namespace http {
+namespace server {
+
+connection_manager::connection_manager()
+{
+}
+
+void connection_manager::start(connection_ptr c)
+{
+ connections_.insert(c);
+ c->start();
+}
+
+void connection_manager::stop(connection_ptr c)
+{
+ connections_.erase(c);
+ c->stop();
+}
+
+void connection_manager::stop_all()
+{
+ for (auto c: connections_)
+ c->stop();
+ connections_.clear();
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/connection_manager.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/connection_manager.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,48 @@
+//
+// connection_manager.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_CONNECTION_MANAGER_HPP
+#define HTTP_CONNECTION_MANAGER_HPP
+
+#include <set>
+#include "connection.hpp"
+
+namespace http {
+namespace server {
+
+/// Manages open connections so that they may be cleanly stopped when the server
+/// needs to shut down.
+class connection_manager
+{
+public:
+ connection_manager(const connection_manager&) = delete;
+ connection_manager& operator=(const connection_manager&) = delete;
+
+ /// Construct a connection manager.
+ connection_manager();
+
+ /// Add the specified connection to the manager and start it.
+ void start(connection_ptr c);
+
+ /// Stop the specified connection.
+ void stop(connection_ptr c);
+
+ /// Stop all connections.
+ void stop_all();
+
+private:
+ /// The managed connections.
+ std::set<connection_ptr> connections_;
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_CONNECTION_MANAGER_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/header.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/header.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,28 @@
+//
+// header.hpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_HEADER_HPP
+#define HTTP_HEADER_HPP
+
+#include <string>
+
+namespace http {
+namespace server {
+
+struct header
+{
+ std::string name;
+ std::string value;
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_HEADER_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/main.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/main.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,43 @@
+//
+// main.cpp
+// ~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <iostream>
+#include <string>
+#include <boost/asio.hpp>
+#include "server.hpp"
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ // Check command line arguments.
+ if (argc != 4)
+ {
+ std::cerr << "Usage: http_server <address> <port> <doc_root>\n";
+ std::cerr << " For IPv4, try:\n";
+ std::cerr << " receiver 0.0.0.0 80 .\n";
+ std::cerr << " For IPv6, try:\n";
+ std::cerr << " receiver 0::0 80 .\n";
+ return 1;
+ }
+
+ // Initialise the server.
+ http::server::server s(argv[1], argv[2], argv[3]);
+
+ // Run the server until stopped.
+ s.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/example/cpp11/http/server/mime_types.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/mime_types.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,45 @@
+//
+// mime_types.cpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "mime_types.hpp"
+
+namespace http {
+namespace server {
+namespace mime_types {
+
+struct mapping
+{
+ const char* extension;
+ const char* mime_type;
+} mappings[] =
+{
+ { "gif", "image/gif" },
+ { "htm", "text/html" },
+ { "html", "text/html" },
+ { "jpg", "image/jpeg" },
+ { "png", "image/png" }
+};
+
+std::string extension_to_type(const std::string& extension)
+{
+ for (mapping m: mappings)
+ {
+ if (m.extension == extension)
+ {
+ return m.mime_type;
+ }
+ }
+
+ return "text/plain";
+}
+
+} // namespace mime_types
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/mime_types.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/mime_types.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,27 @@
+//
+// mime_types.hpp
+// ~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_MIME_TYPES_HPP
+#define HTTP_MIME_TYPES_HPP
+
+#include <string>
+
+namespace http {
+namespace server {
+namespace mime_types {
+
+/// Convert a file extension into a MIME type.
+std::string extension_to_type(const std::string& extension);
+
+} // namespace mime_types
+} // namespace server
+} // namespace http
+
+#endif // HTTP_MIME_TYPES_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/reply.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/reply.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,255 @@
+//
+// reply.cpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "reply.hpp"
+#include <string>
+
+namespace http {
+namespace server {
+
+namespace status_strings {
+
+const std::string ok =
+ "HTTP/1.0 200 OK\r\n";
+const std::string created =
+ "HTTP/1.0 201 Created\r\n";
+const std::string accepted =
+ "HTTP/1.0 202 Accepted\r\n";
+const std::string no_content =
+ "HTTP/1.0 204 No Content\r\n";
+const std::string multiple_choices =
+ "HTTP/1.0 300 Multiple Choices\r\n";
+const std::string moved_permanently =
+ "HTTP/1.0 301 Moved Permanently\r\n";
+const std::string moved_temporarily =
+ "HTTP/1.0 302 Moved Temporarily\r\n";
+const std::string not_modified =
+ "HTTP/1.0 304 Not Modified\r\n";
+const std::string bad_request =
+ "HTTP/1.0 400 Bad Request\r\n";
+const std::string unauthorized =
+ "HTTP/1.0 401 Unauthorized\r\n";
+const std::string forbidden =
+ "HTTP/1.0 403 Forbidden\r\n";
+const std::string not_found =
+ "HTTP/1.0 404 Not Found\r\n";
+const std::string internal_server_error =
+ "HTTP/1.0 500 Internal Server Error\r\n";
+const std::string not_implemented =
+ "HTTP/1.0 501 Not Implemented\r\n";
+const std::string bad_gateway =
+ "HTTP/1.0 502 Bad Gateway\r\n";
+const std::string service_unavailable =
+ "HTTP/1.0 503 Service Unavailable\r\n";
+
+boost::asio::const_buffer to_buffer(reply::status_type status)
+{
+ switch (status)
+ {
+ case reply::ok:
+ return boost::asio::buffer(ok);
+ case reply::created:
+ return boost::asio::buffer(created);
+ case reply::accepted:
+ return boost::asio::buffer(accepted);
+ case reply::no_content:
+ return boost::asio::buffer(no_content);
+ case reply::multiple_choices:
+ return boost::asio::buffer(multiple_choices);
+ case reply::moved_permanently:
+ return boost::asio::buffer(moved_permanently);
+ case reply::moved_temporarily:
+ return boost::asio::buffer(moved_temporarily);
+ case reply::not_modified:
+ return boost::asio::buffer(not_modified);
+ case reply::bad_request:
+ return boost::asio::buffer(bad_request);
+ case reply::unauthorized:
+ return boost::asio::buffer(unauthorized);
+ case reply::forbidden:
+ return boost::asio::buffer(forbidden);
+ case reply::not_found:
+ return boost::asio::buffer(not_found);
+ case reply::internal_server_error:
+ return boost::asio::buffer(internal_server_error);
+ case reply::not_implemented:
+ return boost::asio::buffer(not_implemented);
+ case reply::bad_gateway:
+ return boost::asio::buffer(bad_gateway);
+ case reply::service_unavailable:
+ return boost::asio::buffer(service_unavailable);
+ default:
+ return boost::asio::buffer(internal_server_error);
+ }
+}
+
+} // namespace status_strings
+
+namespace misc_strings {
+
+const char name_value_separator[] = { ':', ' ' };
+const char crlf[] = { '\r', '\n' };
+
+} // namespace misc_strings
+
+std::vector<boost::asio::const_buffer> reply::to_buffers()
+{
+ std::vector<boost::asio::const_buffer> buffers;
+ buffers.push_back(status_strings::to_buffer(status));
+ for (std::size_t i = 0; i < headers.size(); ++i)
+ {
+ header& h = headers[i];
+ buffers.push_back(boost::asio::buffer(h.name));
+ buffers.push_back(boost::asio::buffer(misc_strings::name_value_separator));
+ buffers.push_back(boost::asio::buffer(h.value));
+ buffers.push_back(boost::asio::buffer(misc_strings::crlf));
+ }
+ buffers.push_back(boost::asio::buffer(misc_strings::crlf));
+ buffers.push_back(boost::asio::buffer(content));
+ return buffers;
+}
+
+namespace stock_replies {
+
+const char ok[] = "";
+const char created[] =
+ "<html>"
+ "<head><title>Created</title></head>"
+ "<body><h1>201 Created</h1></body>"
+ "</html>";
+const char accepted[] =
+ "<html>"
+ "<head><title>Accepted</title></head>"
+ "<body><h1>202 Accepted</h1></body>"
+ "</html>";
+const char no_content[] =
+ "<html>"
+ "<head><title>No Content</title></head>"
+ "<body><h1>204 Content</h1></body>"
+ "</html>";
+const char multiple_choices[] =
+ "<html>"
+ "<head><title>Multiple Choices</title></head>"
+ "<body><h1>300 Multiple Choices</h1></body>"
+ "</html>";
+const char moved_permanently[] =
+ "<html>"
+ "<head><title>Moved Permanently</title></head>"
+ "<body><h1>301 Moved Permanently</h1></body>"
+ "</html>";
+const char moved_temporarily[] =
+ "<html>"
+ "<head><title>Moved Temporarily</title></head>"
+ "<body><h1>302 Moved Temporarily</h1></body>"
+ "</html>";
+const char not_modified[] =
+ "<html>"
+ "<head><title>Not Modified</title></head>"
+ "<body><h1>304 Not Modified</h1></body>"
+ "</html>";
+const char bad_request[] =
+ "<html>"
+ "<head><title>Bad Request</title></head>"
+ "<body><h1>400 Bad Request</h1></body>"
+ "</html>";
+const char unauthorized[] =
+ "<html>"
+ "<head><title>Unauthorized</title></head>"
+ "<body><h1>401 Unauthorized</h1></body>"
+ "</html>";
+const char forbidden[] =
+ "<html>"
+ "<head><title>Forbidden</title></head>"
+ "<body><h1>403 Forbidden</h1></body>"
+ "</html>";
+const char not_found[] =
+ "<html>"
+ "<head><title>Not Found</title></head>"
+ "<body><h1>404 Not Found</h1></body>"
+ "</html>";
+const char internal_server_error[] =
+ "<html>"
+ "<head><title>Internal Server Error</title></head>"
+ "<body><h1>500 Internal Server Error</h1></body>"
+ "</html>";
+const char not_implemented[] =
+ "<html>"
+ "<head><title>Not Implemented</title></head>"
+ "<body><h1>501 Not Implemented</h1></body>"
+ "</html>";
+const char bad_gateway[] =
+ "<html>"
+ "<head><title>Bad Gateway</title></head>"
+ "<body><h1>502 Bad Gateway</h1></body>"
+ "</html>";
+const char service_unavailable[] =
+ "<html>"
+ "<head><title>Service Unavailable</title></head>"
+ "<body><h1>503 Service Unavailable</h1></body>"
+ "</html>";
+
+std::string to_string(reply::status_type status)
+{
+ switch (status)
+ {
+ case reply::ok:
+ return ok;
+ case reply::created:
+ return created;
+ case reply::accepted:
+ return accepted;
+ case reply::no_content:
+ return no_content;
+ case reply::multiple_choices:
+ return multiple_choices;
+ case reply::moved_permanently:
+ return moved_permanently;
+ case reply::moved_temporarily:
+ return moved_temporarily;
+ case reply::not_modified:
+ return not_modified;
+ case reply::bad_request:
+ return bad_request;
+ case reply::unauthorized:
+ return unauthorized;
+ case reply::forbidden:
+ return forbidden;
+ case reply::not_found:
+ return not_found;
+ case reply::internal_server_error:
+ return internal_server_error;
+ case reply::not_implemented:
+ return not_implemented;
+ case reply::bad_gateway:
+ return bad_gateway;
+ case reply::service_unavailable:
+ return service_unavailable;
+ default:
+ return internal_server_error;
+ }
+}
+
+} // namespace stock_replies
+
+reply reply::stock_reply(reply::status_type status)
+{
+ reply rep;
+ rep.status = status;
+ rep.content = stock_replies::to_string(status);
+ rep.headers.resize(2);
+ rep.headers[0].name = "Content-Length";
+ rep.headers[0].value = std::to_string(rep.content.size());
+ rep.headers[1].name = "Content-Type";
+ rep.headers[1].value = "text/html";
+ return rep;
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/reply.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/reply.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,64 @@
+//
+// reply.hpp
+// ~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_REPLY_HPP
+#define HTTP_REPLY_HPP
+
+#include <string>
+#include <vector>
+#include <boost/asio.hpp>
+#include "header.hpp"
+
+namespace http {
+namespace server {
+
+/// A reply to be sent to a client.
+struct reply
+{
+ /// The status of the reply.
+ enum status_type
+ {
+ ok = 200,
+ created = 201,
+ accepted = 202,
+ no_content = 204,
+ multiple_choices = 300,
+ moved_permanently = 301,
+ moved_temporarily = 302,
+ not_modified = 304,
+ bad_request = 400,
+ unauthorized = 401,
+ forbidden = 403,
+ not_found = 404,
+ internal_server_error = 500,
+ not_implemented = 501,
+ bad_gateway = 502,
+ service_unavailable = 503
+ } status;
+
+ /// The headers to be included in the reply.
+ std::vector<header> headers;
+
+ /// The content to be sent in the reply.
+ std::string content;
+
+ /// Convert the reply into a vector of buffers. The buffers do not own the
+ /// underlying memory blocks, therefore the reply object must remain valid and
+ /// not be changed until the write operation has completed.
+ std::vector<boost::asio::const_buffer> to_buffers();
+
+ /// Get a stock reply.
+ static reply stock_reply(status_type status);
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_REPLY_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/request.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/request.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,34 @@
+//
+// request.hpp
+// ~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_REQUEST_HPP
+#define HTTP_REQUEST_HPP
+
+#include <string>
+#include <vector>
+#include "header.hpp"
+
+namespace http {
+namespace server {
+
+/// A request received from a client.
+struct request
+{
+ std::string method;
+ std::string uri;
+ int http_version_major;
+ int http_version_minor;
+ std::vector<header> headers;
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_REQUEST_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/request_handler.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/request_handler.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,121 @@
+//
+// request_handler.cpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "request_handler.hpp"
+#include <fstream>
+#include <sstream>
+#include <string>
+#include "mime_types.hpp"
+#include "reply.hpp"
+#include "request.hpp"
+
+namespace http {
+namespace server {
+
+request_handler::request_handler(const std::string& doc_root)
+ : doc_root_(doc_root)
+{
+}
+
+void request_handler::handle_request(const request& req, reply& rep)
+{
+ // Decode url to path.
+ std::string request_path;
+ if (!url_decode(req.uri, request_path))
+ {
+ rep = reply::stock_reply(reply::bad_request);
+ return;
+ }
+
+ // Request path must be absolute and not contain "..".
+ if (request_path.empty() || request_path[0] != '/'
+ || request_path.find("..") != std::string::npos)
+ {
+ rep = reply::stock_reply(reply::bad_request);
+ return;
+ }
+
+ // If path ends in slash (i.e. is a directory) then add "index.html".
+ if (request_path[request_path.size() - 1] == '/')
+ {
+ request_path += "index.html";
+ }
+
+ // Determine the file extension.
+ std::size_t last_slash_pos = request_path.find_last_of("/");
+ std::size_t last_dot_pos = request_path.find_last_of(".");
+ std::string extension;
+ if (last_dot_pos != std::string::npos && last_dot_pos > last_slash_pos)
+ {
+ extension = request_path.substr(last_dot_pos + 1);
+ }
+
+ // Open the file to send back.
+ std::string full_path = doc_root_ + request_path;
+ std::ifstream is(full_path.c_str(), std::ios::in | std::ios::binary);
+ if (!is)
+ {
+ rep = reply::stock_reply(reply::not_found);
+ return;
+ }
+
+ // Fill out the reply to be sent to the client.
+ rep.status = reply::ok;
+ char buf[512];
+ while (is.read(buf, sizeof(buf)).gcount() > 0)
+ rep.content.append(buf, is.gcount());
+ rep.headers.resize(2);
+ rep.headers[0].name = "Content-Length";
+ rep.headers[0].value = std::to_string(rep.content.size());
+ rep.headers[1].name = "Content-Type";
+ rep.headers[1].value = mime_types::extension_to_type(extension);
+}
+
+bool request_handler::url_decode(const std::string& in, std::string& out)
+{
+ out.clear();
+ out.reserve(in.size());
+ for (std::size_t i = 0; i < in.size(); ++i)
+ {
+ if (in[i] == '%')
+ {
+ if (i + 3 <= in.size())
+ {
+ int value = 0;
+ std::istringstream is(in.substr(i + 1, 2));
+ if (is >> std::hex >> value)
+ {
+ out += static_cast<char>(value);
+ i += 2;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else if (in[i] == '+')
+ {
+ out += ' ';
+ }
+ else
+ {
+ out += in[i];
+ }
+ }
+ return true;
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/request_handler.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/request_handler.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,47 @@
+//
+// request_handler.hpp
+// ~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_REQUEST_HANDLER_HPP
+#define HTTP_REQUEST_HANDLER_HPP
+
+#include <string>
+
+namespace http {
+namespace server {
+
+struct reply;
+struct request;
+
+/// The common handler for all incoming requests.
+class request_handler
+{
+public:
+ request_handler(const request_handler&) = delete;
+ request_handler& operator=(const request_handler&) = delete;
+
+ /// Construct with a directory containing files to be served.
+ explicit request_handler(const std::string& doc_root);
+
+ /// Handle a request and produce a reply.
+ void handle_request(const request& req, reply& rep);
+
+private:
+ /// The directory containing the files to be served.
+ std::string doc_root_;
+
+ /// Perform URL-decoding on a string. Returns false if the encoding was
+ /// invalid.
+ static bool url_decode(const std::string& in, std::string& out);
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_REQUEST_HANDLER_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/request_parser.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/request_parser.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,315 @@
+//
+// request_parser.cpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "request_parser.hpp"
+#include "request.hpp"
+
+namespace http {
+namespace server {
+
+request_parser::request_parser()
+ : state_(method_start)
+{
+}
+
+void request_parser::reset()
+{
+ state_ = method_start;
+}
+
+request_parser::result_type request_parser::consume(request& req, char input)
+{
+ switch (state_)
+ {
+ case method_start:
+ if (!is_char(input) || is_ctl(input) || is_tspecial(input))
+ {
+ return bad;
+ }
+ else
+ {
+ state_ = method;
+ req.method.push_back(input);
+ return indeterminate;
+ }
+ case method:
+ if (input == ' ')
+ {
+ state_ = uri;
+ return indeterminate;
+ }
+ else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
+ {
+ return bad;
+ }
+ else
+ {
+ req.method.push_back(input);
+ return indeterminate;
+ }
+ case uri:
+ if (input == ' ')
+ {
+ state_ = http_version_h;
+ return indeterminate;
+ }
+ else if (is_ctl(input))
+ {
+ return bad;
+ }
+ else
+ {
+ req.uri.push_back(input);
+ return indeterminate;
+ }
+ case http_version_h:
+ if (input == 'H')
+ {
+ state_ = http_version_t_1;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_t_1:
+ if (input == 'T')
+ {
+ state_ = http_version_t_2;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_t_2:
+ if (input == 'T')
+ {
+ state_ = http_version_p;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_p:
+ if (input == 'P')
+ {
+ state_ = http_version_slash;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_slash:
+ if (input == '/')
+ {
+ req.http_version_major = 0;
+ req.http_version_minor = 0;
+ state_ = http_version_major_start;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_major_start:
+ if (is_digit(input))
+ {
+ req.http_version_major = req.http_version_major * 10 + input - '0';
+ state_ = http_version_major;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_major:
+ if (input == '.')
+ {
+ state_ = http_version_minor_start;
+ return indeterminate;
+ }
+ else if (is_digit(input))
+ {
+ req.http_version_major = req.http_version_major * 10 + input - '0';
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_minor_start:
+ if (is_digit(input))
+ {
+ req.http_version_minor = req.http_version_minor * 10 + input - '0';
+ state_ = http_version_minor;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case http_version_minor:
+ if (input == '\r')
+ {
+ state_ = expecting_newline_1;
+ return indeterminate;
+ }
+ else if (is_digit(input))
+ {
+ req.http_version_minor = req.http_version_minor * 10 + input - '0';
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case expecting_newline_1:
+ if (input == '\n')
+ {
+ state_ = header_line_start;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case header_line_start:
+ if (input == '\r')
+ {
+ state_ = expecting_newline_3;
+ return indeterminate;
+ }
+ else if (!req.headers.empty() && (input == ' ' || input == '\t'))
+ {
+ state_ = header_lws;
+ return indeterminate;
+ }
+ else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
+ {
+ return bad;
+ }
+ else
+ {
+ req.headers.push_back(header());
+ req.headers.back().name.push_back(input);
+ state_ = header_name;
+ return indeterminate;
+ }
+ case header_lws:
+ if (input == '\r')
+ {
+ state_ = expecting_newline_2;
+ return indeterminate;
+ }
+ else if (input == ' ' || input == '\t')
+ {
+ return indeterminate;
+ }
+ else if (is_ctl(input))
+ {
+ return bad;
+ }
+ else
+ {
+ state_ = header_value;
+ req.headers.back().value.push_back(input);
+ return indeterminate;
+ }
+ case header_name:
+ if (input == ':')
+ {
+ state_ = space_before_header_value;
+ return indeterminate;
+ }
+ else if (!is_char(input) || is_ctl(input) || is_tspecial(input))
+ {
+ return bad;
+ }
+ else
+ {
+ req.headers.back().name.push_back(input);
+ return indeterminate;
+ }
+ case space_before_header_value:
+ if (input == ' ')
+ {
+ state_ = header_value;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case header_value:
+ if (input == '\r')
+ {
+ state_ = expecting_newline_2;
+ return indeterminate;
+ }
+ else if (is_ctl(input))
+ {
+ return bad;
+ }
+ else
+ {
+ req.headers.back().value.push_back(input);
+ return indeterminate;
+ }
+ case expecting_newline_2:
+ if (input == '\n')
+ {
+ state_ = header_line_start;
+ return indeterminate;
+ }
+ else
+ {
+ return bad;
+ }
+ case expecting_newline_3:
+ return (input == '\n') ? good : bad;
+ default:
+ return bad;
+ }
+}
+
+bool request_parser::is_char(int c)
+{
+ return c >= 0 && c <= 127;
+}
+
+bool request_parser::is_ctl(int c)
+{
+ return (c >= 0 && c <= 31) || (c == 127);
+}
+
+bool request_parser::is_tspecial(int c)
+{
+ switch (c)
+ {
+ case '(': case ')': case '<': case '>': case '@':
+ case ',': case ';': case ':': case '\\': case '"':
+ case '/': case '[': case ']': case '?': case '=':
+ case '{': case '}': case ' ': case '\t':
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool request_parser::is_digit(int c)
+{
+ return c >= '0' && c <= '9';
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/request_parser.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/request_parser.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,96 @@
+//
+// request_parser.hpp
+// ~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_REQUEST_PARSER_HPP
+#define HTTP_REQUEST_PARSER_HPP
+
+#include <tuple>
+
+namespace http {
+namespace server {
+
+struct request;
+
+/// Parser for incoming requests.
+class request_parser
+{
+public:
+ /// Construct ready to parse the request method.
+ request_parser();
+
+ /// Reset to initial parser state.
+ void reset();
+
+ /// Result of parse.
+ enum result_type { good, bad, indeterminate };
+
+ /// Parse some data. The enum return value is good when a complete request has
+ /// been parsed, bad if the data is invalid, indeterminate when more data is
+ /// required. The InputIterator return value indicates how much of the input
+ /// has been consumed.
+ template <typename InputIterator>
+ std::tuple<result_type, InputIterator> parse(request& req,
+ InputIterator begin, InputIterator end)
+ {
+ while (begin != end)
+ {
+ result_type result = consume(req, *begin++);
+ if (result == good || result == bad)
+ return std::make_tuple(result, begin);
+ }
+ return std::make_tuple(indeterminate, begin);
+ }
+
+private:
+ /// Handle the next character of input.
+ result_type consume(request& req, char input);
+
+ /// Check if a byte is an HTTP character.
+ static bool is_char(int c);
+
+ /// Check if a byte is an HTTP control character.
+ static bool is_ctl(int c);
+
+ /// Check if a byte is defined as an HTTP tspecial character.
+ static bool is_tspecial(int c);
+
+ /// Check if a byte is a digit.
+ static bool is_digit(int c);
+
+ /// The current state of the parser.
+ enum state
+ {
+ method_start,
+ method,
+ uri,
+ http_version_h,
+ http_version_t_1,
+ http_version_t_2,
+ http_version_p,
+ http_version_slash,
+ http_version_major_start,
+ http_version_major,
+ http_version_minor_start,
+ http_version_minor,
+ expecting_newline_1,
+ header_line_start,
+ header_lws,
+ header_name,
+ space_before_header_value,
+ header_value,
+ expecting_newline_2,
+ expecting_newline_3
+ } state_;
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_REQUEST_PARSER_HPP

Added: branches/release/libs/asio/example/cpp11/http/server/server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,94 @@
+//
+// server.cpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "server.hpp"
+#include <signal.h>
+#include <utility>
+
+namespace http {
+namespace server {
+
+server::server(const std::string& address, const std::string& port,
+ const std::string& doc_root)
+ : io_service_(),
+ signals_(io_service_),
+ acceptor_(io_service_),
+ connection_manager_(),
+ socket_(io_service_),
+ request_handler_(doc_root)
+{
+ // Register to handle the signals that indicate when the server should exit.
+ // It is safe to register for the same signal multiple times in a program,
+ // provided all registration for the specified signal is made through Asio.
+ signals_.add(SIGINT);
+ signals_.add(SIGTERM);
+#if defined(SIGQUIT)
+ signals_.add(SIGQUIT);
+#endif // defined(SIGQUIT)
+
+ do_await_stop();
+
+ // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
+ boost::asio::ip::tcp::resolver resolver(io_service_);
+ boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve({address, port});
+ acceptor_.open(endpoint.protocol());
+ acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor_.bind(endpoint);
+ acceptor_.listen();
+
+ do_accept();
+}
+
+void server::run()
+{
+ // The io_service::run() call will block until all asynchronous operations
+ // have finished. While the server is running, there is always at least one
+ // asynchronous operation outstanding: the asynchronous accept call waiting
+ // for new incoming connections.
+ io_service_.run();
+}
+
+void server::do_accept()
+{
+ acceptor_.async_accept(socket_,
+ [this](boost::system::error_code ec)
+ {
+ // Check whether the server was stopped by a signal before this
+ // completion handler had a chance to run.
+ if (!acceptor_.is_open())
+ {
+ return;
+ }
+
+ if (!ec)
+ {
+ connection_manager_.start(std::make_shared<connection>(
+ std::move(socket_), connection_manager_, request_handler_));
+ }
+
+ do_accept();
+ });
+}
+
+void server::do_await_stop()
+{
+ signals_.async_wait(
+ [this](boost::system::error_code /*ec*/, int /*signo*/)
+ {
+ // The server is stopped by cancelling all outstanding asynchronous
+ // operations. Once all operations have finished the io_service::run()
+ // call will exit.
+ acceptor_.close();
+ connection_manager_.stop_all();
+ });
+}
+
+} // namespace server
+} // namespace http

Added: branches/release/libs/asio/example/cpp11/http/server/server.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/http/server/server.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,67 @@
+//
+// server.hpp
+// ~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef HTTP_SERVER_HPP
+#define HTTP_SERVER_HPP
+
+#include <boost/asio.hpp>
+#include <string>
+#include "connection.hpp"
+#include "connection_manager.hpp"
+#include "request_handler.hpp"
+
+namespace http {
+namespace server {
+
+/// The top-level class of the HTTP server.
+class server
+{
+public:
+ server(const server&) = delete;
+ server& operator=(const server&) = delete;
+
+ /// Construct the server to listen on the specified TCP address and port, and
+ /// serve up files from the given directory.
+ explicit server(const std::string& address, const std::string& port,
+ const std::string& doc_root);
+
+ /// Run the server's io_service loop.
+ void run();
+
+private:
+ /// Perform an asynchronous accept operation.
+ void do_accept();
+
+ /// Wait for a request to stop the server.
+ void do_await_stop();
+
+ /// The io_service used to perform asynchronous operations.
+ boost::asio::io_service io_service_;
+
+ /// The signal_set is used to register for process termination notifications.
+ boost::asio::signal_set signals_;
+
+ /// Acceptor used to listen for incoming connections.
+ boost::asio::ip::tcp::acceptor acceptor_;
+
+ /// The connection manager which owns all live connections.
+ connection_manager connection_manager_;
+
+ /// The next socket to be accepted.
+ boost::asio::ip::tcp::socket socket_;
+
+ /// The handler for all incoming requests.
+ request_handler request_handler_;
+};
+
+} // namespace server
+} // namespace http
+
+#endif // HTTP_SERVER_HPP

Added: branches/release/libs/asio/example/cpp11/spawn/Jamfile.v2
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/spawn/Jamfile.v2 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#
+
+import os ;
+
+if [ os.name ] = SOLARIS
+{
+ lib socket ;
+ lib nsl ;
+}
+else if [ os.name ] = NT
+{
+ lib ws2_32 ;
+ lib mswsock ;
+}
+else if [ os.name ] = HPUX
+{
+ lib ipv6 ;
+}
+
+exe server
+ : echo_server.cpp
+ /boost/context//boost_context
+ /boost/coroutine//boost_coroutine
+ /boost/system//boost_system
+ : <define>BOOST_ALL_NO_LIB=1
+ <threading>multi
+ <os>SOLARIS:<library>socket
+ <os>SOLARIS:<library>nsl
+ <os>NT:<define>_WIN32_WINNT=0x0501
+ <os>NT,<toolset>gcc:<library>ws2_32
+ <os>NT,<toolset>gcc:<library>mswsock
+ <os>NT,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
+ <os>HPUX,<toolset>gcc:<define>_XOPEN_SOURCE_EXTENDED
+ <os>HPUX:<library>ipv6
+ ;

Added: branches/release/libs/asio/example/cpp11/spawn/echo_server.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/example/cpp11/spawn/echo_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,108 @@
+//
+// echo_server.cpp
+// ~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/asio/spawn.hpp>
+#include <boost/asio/steady_timer.hpp>
+#include <boost/asio/write.hpp>
+#include <iostream>
+#include <memory>
+
+using boost::asio::ip::tcp;
+
+class session : public std::enable_shared_from_this<session>
+{
+public:
+ explicit session(tcp::socket socket)
+ : socket_(std::move(socket)),
+ timer_(socket_.get_io_service()),
+ strand_(socket_.get_io_service())
+ {
+ }
+
+ void go()
+ {
+ auto self(shared_from_this());
+ boost::asio::spawn(strand_,
+ [this, self](boost::asio::yield_context yield)
+ {
+ try
+ {
+ char data[128];
+ for (;;)
+ {
+ timer_.expires_from_now(std::chrono::seconds(10));
+ std::size_t n = socket_.async_read_some(boost::asio::buffer(data), yield);
+ boost::asio::async_write(socket_, boost::asio::buffer(data, n), yield);
+ }
+ }
+ catch (std::exception& e)
+ {
+ socket_.close();
+ timer_.cancel();
+ }
+ });
+
+ boost::asio::spawn(strand_,
+ [this, self](boost::asio::yield_context yield)
+ {
+ while (socket_.is_open())
+ {
+ boost::system::error_code ignored_ec;
+ timer_.async_wait(yield[ignored_ec]);
+ if (timer_.expires_from_now() <= std::chrono::seconds(0))
+ socket_.close();
+ }
+ });
+ }
+
+private:
+ tcp::socket socket_;
+ boost::asio::steady_timer timer_;
+ boost::asio::io_service::strand strand_;
+};
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 2)
+ {
+ std::cerr << "Usage: echo_server <port>\n";
+ return 1;
+ }
+
+ boost::asio::io_service io_service;
+
+ boost::asio::spawn(io_service,
+ [&](boost::asio::yield_context yield)
+ {
+ tcp::acceptor acceptor(io_service,
+ tcp::endpoint(tcp::v4(), std::atoi(argv[1])));
+
+ for (;;)
+ {
+ boost::system::error_code ec;
+ tcp::socket socket(io_service);
+ acceptor.async_accept(socket, yield[ec]);
+ if (!ec) std::make_shared<session>(std::move(socket))->go();
+ }
+ });
+
+ io_service.run();
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Added: branches/release/libs/asio/test/archetypes/async_result.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/archetypes/async_result.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,73 @@
+//
+// async_result.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef ARCHETYPES_ASYNC_RESULT_HPP
+#define ARCHETYPES_ASYNC_RESULT_HPP
+
+#include <boost/asio/async_result.hpp>
+#include <boost/asio/handler_type.hpp>
+
+namespace archetypes {
+
+struct lazy_handler
+{
+};
+
+struct concrete_handler
+{
+ concrete_handler(lazy_handler)
+ {
+ }
+
+ template <typename Arg1>
+ void operator()(Arg1)
+ {
+ }
+
+ template <typename Arg1, typename Arg2>
+ void operator()(Arg1, Arg2)
+ {
+ }
+};
+
+} // namespace archetypes
+
+namespace boost {
+namespace asio {
+
+template <typename Signature>
+struct handler_type<archetypes::lazy_handler, Signature>
+{
+ typedef archetypes::concrete_handler type;
+};
+
+template <>
+class async_result<archetypes::concrete_handler>
+{
+public:
+ // The return type of the initiating function.
+ typedef int type;
+
+ // Construct an async_result from a given handler.
+ explicit async_result(archetypes::concrete_handler&)
+ {
+ }
+
+ // Obtain the value to be returned from the initiating function.
+ type get()
+ {
+ return 42;
+ }
+};
+
+} // namespace asio
+} // namespace boost
+
+#endif // ARCHETYPES_ASYNC_RESULT_HPP

Modified: branches/release/libs/asio/test/archetypes/gettable_socket_option.hpp
==============================================================================
--- branches/release/libs/asio/test/archetypes/gettable_socket_option.hpp (original)
+++ branches/release/libs/asio/test/archetypes/gettable_socket_option.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // gettable_socket_option.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/archetypes/io_control_command.hpp
==============================================================================
--- branches/release/libs/asio/test/archetypes/io_control_command.hpp (original)
+++ branches/release/libs/asio/test/archetypes/io_control_command.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // io_control_command.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/archetypes/settable_socket_option.hpp
==============================================================================
--- branches/release/libs/asio/test/archetypes/settable_socket_option.hpp (original)
+++ branches/release/libs/asio/test/archetypes/settable_socket_option.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // settable_socket_option.hpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/basic_datagram_socket.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_datagram_socket.cpp (original)
+++ branches/release/libs/asio/test/basic_datagram_socket.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_datagram_socket.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_datagram_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_datagram_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_deadline_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_deadline_timer.cpp (original)
+++ branches/release/libs/asio/test/basic_deadline_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_deadline_timer.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_deadline_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_deadline_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_raw_socket.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_raw_socket.cpp (original)
+++ branches/release/libs/asio/test/basic_raw_socket.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_raw_socket.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_raw_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_raw_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_seq_packet_socket.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_seq_packet_socket.cpp (original)
+++ branches/release/libs/asio/test/basic_seq_packet_socket.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_seq_packet_socket.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_seq_packet_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_seq_packet_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_serial_port.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_serial_port.cpp (original)
+++ branches/release/libs/asio/test/basic_serial_port.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_serial_port.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -19,9 +19,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_serial_port");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_serial_port",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_signal_set.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_signal_set.cpp (original)
+++ branches/release/libs/asio/test/basic_signal_set.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_signal_set.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_signal_set");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_signal_set",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_socket_acceptor.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_socket_acceptor.cpp (original)
+++ branches/release/libs/asio/test/basic_socket_acceptor.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_socket_acceptor.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_socket_acceptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_socket_acceptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_stream_socket.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_stream_socket.cpp (original)
+++ branches/release/libs/asio/test/basic_stream_socket.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_stream_socket.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_stream_socket");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_stream_socket",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_streambuf.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_streambuf.cpp (original)
+++ branches/release/libs/asio/test/basic_streambuf.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_streambuf.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_streambuf");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_streambuf",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/basic_waitable_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/basic_waitable_timer.cpp (original)
+++ branches/release/libs/asio/test/basic_waitable_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_waitable_timer.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("basic_waitable_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "basic_waitable_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/buffer.cpp
==============================================================================
--- branches/release/libs/asio/test/buffer.cpp (original)
+++ branches/release/libs/asio/test/buffer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffer.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,9 +16,16 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffer.hpp>
 
-#include <boost/array.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 //------------------------------------------------------------------------------
 
 // buffer_compile test
@@ -38,9 +45,11 @@
     const char const_raw_data[1024] = "";
     void* void_ptr_data = raw_data;
     const void* const_void_ptr_data = const_raw_data;
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
     boost::array<char, 1024> array_data;
     const boost::array<char, 1024>& const_array_data_1 = array_data;
     boost::array<const char, 1024> const_array_data_2 = { { 0 } };
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
     std::array<char, 1024> std_array_data;
     const std::array<char, 1024>& const_std_array_data_1 = std_array_data;
@@ -133,12 +142,14 @@
     mb1 = buffer(raw_data, 1024);
     cb1 = buffer(const_raw_data);
     cb1 = buffer(const_raw_data, 1024);
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
     mb1 = buffer(array_data);
     mb1 = buffer(array_data, 1024);
     cb1 = buffer(const_array_data_1);
     cb1 = buffer(const_array_data_1, 1024);
     cb1 = buffer(const_array_data_2);
     cb1 = buffer(const_array_data_2, 1024);
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
     mb1 = buffer(std_array_data);
     mb1 = buffer(std_array_data, 1024);
@@ -228,9 +239,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffer");
- test->add(BOOST_TEST_CASE(&buffer_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffer",
+ BOOST_ASIO_TEST_CASE(buffer_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_read_stream.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_read_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_read_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -66,9 +70,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -84,31 +88,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,7 +122,7 @@
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -127,14 +131,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -159,8 +171,7 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
   }
@@ -173,23 +184,21 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
   }
@@ -199,24 +208,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_read_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_read_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_stream.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -67,9 +71,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -86,31 +90,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,14 +122,14 @@
 
 void handle_flush(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_read(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -134,14 +138,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -166,12 +178,11 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     client_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -184,27 +195,25 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     server_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -214,24 +223,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffered_write_stream.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,15 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffered_write_stream.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/system/system_error.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 typedef boost::asio::buffered_write_stream<
     boost::asio::ip::tcp::socket> stream_type;
 
@@ -67,9 +71,9 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
@@ -86,31 +90,31 @@
         boost::asio::buffer(read_buf + bytes_read));
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   boost::system::error_code error;
   bytes_read = client_socket.read_some(
       boost::asio::buffer(read_buf), error);
 
- BOOST_CHECK(bytes_read == 0);
- BOOST_CHECK(error == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_read == 0);
+ BOOST_ASIO_CHECK(error == boost::asio::error::eof);
 
   client_socket.close(error);
 }
 
 void handle_accept(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_write(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_written)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_written += bytes_transferred;
@@ -118,14 +122,14 @@
 
 void handle_flush(const boost::system::error_code& e)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
 }
 
 void handle_read(const boost::system::error_code& e,
     std::size_t bytes_transferred,
     std::size_t* total_bytes_read)
 {
- BOOST_CHECK(!e);
+ BOOST_ASIO_CHECK(!e);
   if (e)
     throw boost::system::system_error(e); // Terminate test.
   *total_bytes_read += bytes_transferred;
@@ -134,14 +138,22 @@
 void handle_read_eof(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
- BOOST_CHECK(e == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(e == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_async_operations()
 {
   using namespace std; // For memcmp.
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service io_service;
 
   boost::asio::ip::tcp::acceptor acceptor(io_service,
@@ -166,12 +178,11 @@
   {
     client_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     client_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -184,27 +195,25 @@
   {
     server_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   bytes_written = 0;
   while (bytes_written < sizeof(write_data))
   {
     server_socket.async_write_some(
         boost::asio::buffer(write_buf + bytes_written),
- boost::bind(handle_write, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_written));
+ bindns::bind(handle_write, _1, _2, &bytes_written));
     io_service.run();
     io_service.reset();
     server_socket.async_flush(
- boost::bind(handle_flush, boost::asio::placeholders::error));
+ bindns::bind(handle_flush, _1));
     io_service.run();
     io_service.reset();
   }
@@ -214,24 +223,22 @@
   {
     client_socket.async_read_some(
         boost::asio::buffer(read_buf + bytes_read),
- boost::bind(handle_read, boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred, &bytes_read));
+ bindns::bind(handle_read, _1, _2, &bytes_read));
     io_service.run();
     io_service.reset();
   }
 
- BOOST_CHECK(bytes_written == sizeof(write_data));
- BOOST_CHECK(bytes_read == sizeof(read_data));
- BOOST_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(bytes_written == sizeof(write_data));
+ BOOST_ASIO_CHECK(bytes_read == sizeof(read_data));
+ BOOST_ASIO_CHECK(memcmp(write_data, read_data, sizeof(write_data)) == 0);
 
   server_socket.close();
   client_socket.async_read_some(boost::asio::buffer(read_buf), handle_read_eof);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffered_write_stream");
- test->add(BOOST_TEST_CASE(&test_sync_operations));
- test->add(BOOST_TEST_CASE(&test_async_operations));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffered_write_stream",
+ BOOST_ASIO_TEST_CASE(test_sync_operations)
+ BOOST_ASIO_TEST_CASE(test_async_operations)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // buffers_iterator.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,10 +16,17 @@
 // Test that header file is self-contained.
 #include <boost/asio/buffers_iterator.hpp>
 
-#include <boost/array.hpp>
 #include <boost/asio/buffer.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 //------------------------------------------------------------------------------
 
 // buffers_iterator_compile test
@@ -29,7 +36,11 @@
 
 namespace buffers_iterator_compile {
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 using boost::array;
+#elif defined(BOOST_ASIO_HAS_STD_ARRAY)
+using std::array;
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 using std::vector;
 using namespace boost::asio;
 
@@ -274,9 +285,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("buffers_iterator");
- test->add(BOOST_TEST_CASE(&buffers_iterator_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "buffers_iterator",
+ BOOST_ASIO_TEST_CASE(buffers_iterator_compile::test)
+)

Modified: branches/release/libs/asio/test/completion_condition.cpp
==============================================================================
--- branches/release/libs/asio/test/completion_condition.cpp (original)
+++ branches/release/libs/asio/test/completion_condition.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // completion_condition.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("completion_condition");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "completion_condition",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/connect.cpp
==============================================================================
--- branches/release/libs/asio/test/connect.cpp (original)
+++ branches/release/libs/asio/test/connect.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connect.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("connect");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "connect",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Added: branches/release/libs/asio/test/coroutine.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/coroutine.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,112 @@
+//
+// coroutine.cpp
+// ~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/coroutine.hpp>
+
+#include "unit_test.hpp"
+
+// Must come after all other headers.
+#include <boost/asio/yield.hpp>
+
+//------------------------------------------------------------------------------
+
+// Coroutine completes via yield break.
+
+void yield_break_coro(boost::asio::coroutine& coro)
+{
+ reenter (coro)
+ {
+ yield return;
+ yield break;
+ }
+}
+
+void yield_break_test()
+{
+ boost::asio::coroutine coro;
+ BOOST_ASIO_CHECK(!coro.is_complete());
+ yield_break_coro(coro);
+ BOOST_ASIO_CHECK(!coro.is_complete());
+ yield_break_coro(coro);
+ BOOST_ASIO_CHECK(coro.is_complete());
+}
+
+//------------------------------------------------------------------------------
+
+// Coroutine completes via return.
+
+void return_coro(boost::asio::coroutine& coro)
+{
+ reenter (coro)
+ {
+ return;
+ }
+}
+
+void return_test()
+{
+ boost::asio::coroutine coro;
+ return_coro(coro);
+ BOOST_ASIO_CHECK(coro.is_complete());
+}
+
+//------------------------------------------------------------------------------
+
+// Coroutine completes via exception.
+
+void exception_coro(boost::asio::coroutine& coro)
+{
+ reenter (coro)
+ {
+ throw 1;
+ }
+}
+
+void exception_test()
+{
+ boost::asio::coroutine coro;
+ try { exception_coro(coro); } catch (int) {}
+ BOOST_ASIO_CHECK(coro.is_complete());
+}
+
+//------------------------------------------------------------------------------
+
+// Coroutine completes by falling off the end.
+
+void fall_off_end_coro(boost::asio::coroutine& coro)
+{
+ reenter (coro)
+ {
+ }
+}
+
+void fall_off_end_test()
+{
+ boost::asio::coroutine coro;
+ fall_off_end_coro(coro);
+ BOOST_ASIO_CHECK(coro.is_complete());
+}
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "coroutine",
+ BOOST_ASIO_TEST_CASE(yield_break_test)
+ BOOST_ASIO_TEST_CASE(return_test)
+ BOOST_ASIO_TEST_CASE(exception_test)
+ BOOST_ASIO_TEST_CASE(fall_off_end_test)
+)

Modified: branches/release/libs/asio/test/datagram_socket_service.cpp
==============================================================================
--- branches/release/libs/asio/test/datagram_socket_service.cpp (original)
+++ branches/release/libs/asio/test/datagram_socket_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // datagram_socket_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("datagram_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "datagram_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // deadline_timer.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,11 +16,15 @@
 // Test that header file is self-contained.
 #include <boost/asio/deadline_timer.hpp>
 
+#include "unit_test.hpp"
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 #include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/placeholders.hpp>
-#include "unit_test.hpp"
 
 using namespace boost::posix_time;
 
@@ -41,7 +45,7 @@
     t->async_wait(boost::bind(decrement_to_zero, t, count));
 
     // Completion cannot nest, so count value should remain unchanged.
- BOOST_CHECK(*count == before_value);
+ BOOST_ASIO_CHECK(*count == before_value);
   }
 }
 
@@ -55,13 +59,13 @@
 void cancel_timer(boost::asio::deadline_timer* t)
 {
   std::size_t num_cancelled = t->cancel();
- BOOST_CHECK(num_cancelled == 1);
+ BOOST_ASIO_CHECK(num_cancelled == 1);
 }
 
 void cancel_one_timer(boost::asio::deadline_timer* t)
 {
   std::size_t num_cancelled = t->cancel_one();
- BOOST_CHECK(num_cancelled == 1);
+ BOOST_ASIO_CHECK(num_cancelled == 1);
 }
 
 ptime now()
@@ -86,7 +90,7 @@
   // The timer must block until after its expiry time.
   ptime end = now();
   ptime expected_end = start + seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -96,7 +100,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end = start + seconds(1) + microseconds(500000);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   t2.expires_at(t2.expires_at() + seconds(1));
   t2.wait();
@@ -104,7 +108,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end += seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -114,7 +118,7 @@
   // The timer must block until after its expiry time.
   end = now();
   expected_end = start + seconds(1) + microseconds(200000);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   start = now();
 
@@ -122,16 +126,16 @@
   t3.async_wait(boost::bind(increment, &count));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all operations have finished, and
   // this should not be until after the timer's expiry time.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(1);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 3;
   start = now();
@@ -140,17 +144,17 @@
   t4.async_wait(boost::bind(decrement_to_zero, &t4, &count));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count == 3);
 
   ios.reset();
   ios.run();
 
   // The run() call will not return until all operations have finished, and
   // this should not be until after the timer's final expiry time.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
   end = now();
   expected_end = start + seconds(3);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 0;
   start = now();
@@ -162,7 +166,7 @@
   t6.async_wait(boost::bind(cancel_timer, &t5));
 
   // No completions can be delivered until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.reset();
   ios.run();
@@ -170,10 +174,10 @@
   // The timer should have been cancelled, so count should not have changed.
   // The total run time should not have been much more than 1 second (and
   // certainly far less than 10 seconds).
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
   end = now();
   expected_end = start + seconds(2);
- BOOST_CHECK(end < expected_end);
+ BOOST_ASIO_CHECK(end < expected_end);
 
   // Wait on the timer again without cancelling it. This time the asynchronous
   // wait should run to completion and increment the counter.
@@ -185,10 +189,10 @@
 
   // The timer should not have been cancelled, so count should have changed.
   // The total time since the timer was created should be more than 10 seconds.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(10);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 
   count = 0;
   start = now();
@@ -210,10 +214,10 @@
   // One of the waits should not have been cancelled, so count should have
   // changed. The total time since the timer was created should be more than 3
   // seconds.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
   end = now();
   expected_end = start + seconds(3);
- BOOST_CHECK(expected_end < end || expected_end == end);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
 }
 
 void timer_handler(const boost::system::error_code&)
@@ -234,10 +238,10 @@
   for (int i = 10; i < 20; ++i)
     timers[i].t.async_wait(&timer_handler);
 
- BOOST_CHECK(timers[2].t.cancel() == 1);
- BOOST_CHECK(timers[41].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[2].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[41].t.cancel() == 1);
   for (int i = 10; i < 20; ++i)
- BOOST_CHECK(timers[i].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[i].t.cancel() == 1);
 }
 
 struct custom_allocation_timer_handler
@@ -289,7 +293,7 @@
 
   io_service.run();
 
- BOOST_CHECK(allocation_count == 0);
+ BOOST_ASIO_CHECK(allocation_count == 0);
 }
 
 void io_service_run(boost::asio::io_service* ios)
@@ -319,15 +323,34 @@
   ios.stop();
   th.join();
 
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
+void deadline_timer_async_result_test()
 {
- test_suite* test = BOOST_TEST_SUITE("deadline_timer");
- test->add(BOOST_TEST_CASE(&deadline_timer_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_cancel_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_custom_allocation_test));
- test->add(BOOST_TEST_CASE(&deadline_timer_thread_test));
- return test;
+ boost::asio::io_service ios;
+ boost::asio::deadline_timer t1(ios);
+
+ t1.expires_from_now(boost::posix_time::seconds(1));
+ int i = t1.async_wait(archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+
+ ios.run();
 }
+
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer",
+ BOOST_ASIO_TEST_CASE(deadline_timer_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_cancel_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_custom_allocation_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_thread_test)
+ BOOST_ASIO_TEST_CASE(deadline_timer_async_result_test)
+)
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)

Modified: branches/release/libs/asio/test/deadline_timer_service.cpp
==============================================================================
--- branches/release/libs/asio/test/deadline_timer_service.cpp (original)
+++ branches/release/libs/asio/test/deadline_timer_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // deadline_timer_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("deadline_timer_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "deadline_timer_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/error.cpp
==============================================================================
--- branches/release/libs/asio/test/error.cpp (original)
+++ branches/release/libs/asio/test/error.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // error.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,23 +22,23 @@
 void test_error_code(const boost::system::error_code& code)
 {
   boost::system::error_code error(code);
- BOOST_CHECK(code == error);
+ BOOST_ASIO_CHECK(code == error);
 
- BOOST_CHECK(!code || error);
- BOOST_CHECK(!code || !!error);
+ BOOST_ASIO_CHECK(!code || error);
+ BOOST_ASIO_CHECK(!code || !!error);
 
   boost::system::error_code error2(error);
- BOOST_CHECK(error == error2);
- BOOST_CHECK(!(error != error2));
+ BOOST_ASIO_CHECK(error == error2);
+ BOOST_ASIO_CHECK(!(error != error2));
 
   boost::system::error_code error3;
   error3 = error;
- BOOST_CHECK(error == error3);
- BOOST_CHECK(!(error != error3));
+ BOOST_ASIO_CHECK(error == error3);
+ BOOST_ASIO_CHECK(!(error != error3));
 
   std::ostringstream os;
   os << error;
- BOOST_CHECK(!os.str().empty());
+ BOOST_ASIO_CHECK(!os.str().empty());
 }
 
 void error_test()
@@ -82,9 +82,8 @@
   test_error_code(boost::asio::error::would_block);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("error");
- test->add(BOOST_TEST_CASE(&error_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "error",
+ BOOST_ASIO_TEST_CASE(error_test)
+)

Added: branches/release/libs/asio/test/generic/basic_endpoint.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/generic/basic_endpoint.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,25 @@
+//
+// generic/basic_endpoint.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/generic/basic_endpoint.hpp>
+
+#include "../unit_test.hpp"
+
+BOOST_ASIO_TEST_SUITE
+(
+ "generic/basic_endpoint",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Added: branches/release/libs/asio/test/generic/datagram_protocol.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/generic/datagram_protocol.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,243 @@
+//
+// generic/datagram_protocol.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/generic/datagram_protocol.hpp>
+
+#include <cstring>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
+#include "../unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// generic_datagram_protocol_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// generic::datagram_socket::socket compile and link correctly. Runtime
+// failures are ignored.
+
+namespace generic_datagram_protocol_socket_compile {
+
+void connect_handler(const boost::system::error_code&)
+{
+}
+
+void send_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace generic = boost::asio::generic;
+ typedef generic::datagram_protocol dp;
+
+ try
+ {
+ io_service ios;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ socket_base::message_flags in_flags = 0;
+ socket_base::send_buffer_size socket_option;
+ socket_base::bytes_readable io_control_command;
+ boost::system::error_code ec;
+
+ // basic_datagram_socket constructors.
+
+ dp::socket socket1(ios);
+ dp::socket socket2(ios, dp(AF_INET, IPPROTO_UDP));
+ dp::socket socket3(ios, dp::endpoint());
+ int native_socket1 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ dp::socket socket4(ios, dp(AF_INET, IPPROTO_UDP), native_socket1);
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ dp::socket socket5(std::move(socket4));
+ dp::socket socket6(boost::asio::ip::udp::socket(ios));
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_datagram_socket operators.
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ socket1 = dp::socket(ios);
+ socket1 = std::move(socket2);
+ socket1 = boost::asio::ip::udp::socket(ios);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = socket1.get_io_service();
+ (void)ios_ref;
+
+ // basic_socket functions.
+
+ dp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ socket1.open(dp(AF_INET, IPPROTO_UDP));
+ socket1.open(dp(AF_INET, IPPROTO_UDP), ec);
+
+ int native_socket2 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ socket1.assign(dp(AF_INET, IPPROTO_UDP), native_socket2);
+ int native_socket3 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ socket1.assign(dp(AF_INET, IPPROTO_UDP), native_socket3, ec);
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ dp::socket::native_type native_socket4 = socket1.native();
+ (void)native_socket4;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(dp::endpoint());
+ socket1.bind(dp::endpoint(), ec);
+
+ socket1.connect(dp::endpoint());
+ socket1.connect(dp::endpoint(), ec);
+
+ socket1.async_connect(dp::endpoint(), connect_handler);
+
+ socket1.set_option(socket_option);
+ socket1.set_option(socket_option, ec);
+
+ socket1.get_option(socket_option);
+ socket1.get_option(socket_option, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ dp::endpoint endpoint1 = socket1.local_endpoint();
+ dp::endpoint endpoint2 = socket1.local_endpoint(ec);
+
+ dp::endpoint endpoint3 = socket1.remote_endpoint();
+ dp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_datagram_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer));
+ socket1.send(buffer(const_char_buffer));
+ socket1.send(null_buffers());
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), send_handler);
+ socket1.async_send(buffer(const_char_buffer), send_handler);
+ socket1.async_send(null_buffers(), send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
+ socket1.async_send(null_buffers(), in_flags, send_handler);
+
+ socket1.send_to(buffer(mutable_char_buffer),
+ dp::endpoint());
+ socket1.send_to(buffer(const_char_buffer),
+ dp::endpoint());
+ socket1.send_to(null_buffers(),
+ dp::endpoint());
+ socket1.send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), in_flags);
+ socket1.send_to(buffer(const_char_buffer),
+ dp::endpoint(), in_flags);
+ socket1.send_to(null_buffers(),
+ dp::endpoint(), in_flags);
+ socket1.send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), in_flags, ec);
+ socket1.send_to(buffer(const_char_buffer),
+ dp::endpoint(), in_flags, ec);
+ socket1.send_to(null_buffers(),
+ dp::endpoint(), in_flags, ec);
+
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ dp::endpoint(), send_handler);
+ socket1.async_send_to(null_buffers(),
+ dp::endpoint(), send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ dp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ dp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(null_buffers(),
+ dp::endpoint(), in_flags, send_handler);
+
+ socket1.receive(buffer(mutable_char_buffer));
+ socket1.receive(null_buffers());
+ socket1.receive(buffer(mutable_char_buffer), in_flags);
+ socket1.receive(null_buffers(), in_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.receive(null_buffers(), in_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
+ socket1.async_receive(null_buffers(), receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, receive_handler);
+
+ dp::endpoint endpoint;
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint);
+ socket1.receive_from(null_buffers(), endpoint);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
+ socket1.receive_from(null_buffers(), endpoint, in_flags);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
+ socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
+
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, receive_handler);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, receive_handler);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace generic_datagram_protocol_socket_compile
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "generic/datagram_protocol",
+ BOOST_ASIO_TEST_CASE(generic_datagram_protocol_socket_compile::test)
+)

Added: branches/release/libs/asio/test/generic/raw_protocol.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/generic/raw_protocol.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,243 @@
+//
+// generic/raw_protocol.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/generic/raw_protocol.hpp>
+
+#include <cstring>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/icmp.hpp>
+#include "../unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// generic_raw_protocol_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// generic::raw_socket::socket compile and link correctly. Runtime failures
+// are ignored.
+
+namespace generic_raw_protocol_socket_compile {
+
+void connect_handler(const boost::system::error_code&)
+{
+}
+
+void send_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace generic = boost::asio::generic;
+ typedef generic::raw_protocol rp;
+
+ try
+ {
+ io_service ios;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ socket_base::message_flags in_flags = 0;
+ socket_base::send_buffer_size socket_option;
+ socket_base::bytes_readable io_control_command;
+ boost::system::error_code ec;
+
+ // basic_raw_socket constructors.
+
+ rp::socket socket1(ios);
+ rp::socket socket2(ios, rp(AF_INET, IPPROTO_ICMP));
+ rp::socket socket3(ios, rp::endpoint());
+ int native_socket1 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ rp::socket socket4(ios, rp(AF_INET, IPPROTO_ICMP), native_socket1);
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ rp::socket socket5(std::move(socket4));
+ rp::socket socket6(boost::asio::ip::icmp::socket(ios));
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_datagram_socket operators.
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ socket1 = rp::socket(ios);
+ socket1 = std::move(socket2);
+ socket1 = boost::asio::ip::icmp::socket(ios);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = socket1.get_io_service();
+ (void)ios_ref;
+
+ // basic_socket functions.
+
+ rp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ socket1.open(rp(AF_INET, IPPROTO_ICMP));
+ socket1.open(rp(AF_INET, IPPROTO_ICMP), ec);
+
+ int native_socket2 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ socket1.assign(rp(AF_INET, IPPROTO_ICMP), native_socket2);
+ int native_socket3 = ::socket(AF_INET, SOCK_DGRAM, 0);
+ socket1.assign(rp(AF_INET, IPPROTO_ICMP), native_socket3, ec);
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ rp::socket::native_type native_socket4 = socket1.native();
+ (void)native_socket4;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(rp::endpoint());
+ socket1.bind(rp::endpoint(), ec);
+
+ socket1.connect(rp::endpoint());
+ socket1.connect(rp::endpoint(), ec);
+
+ socket1.async_connect(rp::endpoint(), connect_handler);
+
+ socket1.set_option(socket_option);
+ socket1.set_option(socket_option, ec);
+
+ socket1.get_option(socket_option);
+ socket1.get_option(socket_option, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ rp::endpoint endpoint1 = socket1.local_endpoint();
+ rp::endpoint endpoint2 = socket1.local_endpoint(ec);
+
+ rp::endpoint endpoint3 = socket1.remote_endpoint();
+ rp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_raw_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer));
+ socket1.send(buffer(const_char_buffer));
+ socket1.send(null_buffers());
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), send_handler);
+ socket1.async_send(buffer(const_char_buffer), send_handler);
+ socket1.async_send(null_buffers(), send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
+ socket1.async_send(null_buffers(), in_flags, send_handler);
+
+ socket1.send_to(buffer(mutable_char_buffer),
+ rp::endpoint());
+ socket1.send_to(buffer(const_char_buffer),
+ rp::endpoint());
+ socket1.send_to(null_buffers(),
+ rp::endpoint());
+ socket1.send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), in_flags);
+ socket1.send_to(buffer(const_char_buffer),
+ rp::endpoint(), in_flags);
+ socket1.send_to(null_buffers(),
+ rp::endpoint(), in_flags);
+ socket1.send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), in_flags, ec);
+ socket1.send_to(buffer(const_char_buffer),
+ rp::endpoint(), in_flags, ec);
+ socket1.send_to(null_buffers(),
+ rp::endpoint(), in_flags, ec);
+
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ rp::endpoint(), send_handler);
+ socket1.async_send_to(null_buffers(),
+ rp::endpoint(), send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ rp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ rp::endpoint(), in_flags, send_handler);
+ socket1.async_send_to(null_buffers(),
+ rp::endpoint(), in_flags, send_handler);
+
+ socket1.receive(buffer(mutable_char_buffer));
+ socket1.receive(null_buffers());
+ socket1.receive(buffer(mutable_char_buffer), in_flags);
+ socket1.receive(null_buffers(), in_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.receive(null_buffers(), in_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
+ socket1.async_receive(null_buffers(), receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, receive_handler);
+
+ rp::endpoint endpoint;
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint);
+ socket1.receive_from(null_buffers(), endpoint);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
+ socket1.receive_from(null_buffers(), endpoint, in_flags);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
+ socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
+
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, receive_handler);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, receive_handler);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace generic_raw_protocol_socket_compile
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "generic/raw_protocol",
+ BOOST_ASIO_TEST_CASE(generic_raw_protocol_socket_compile::test)
+)

Added: branches/release/libs/asio/test/generic/seq_packet_protocol.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/generic/seq_packet_protocol.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,187 @@
+//
+// generic/seq_packet_protocol.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/generic/seq_packet_protocol.hpp>
+
+#include <cstring>
+#include <boost/asio/io_service.hpp>
+#include "../unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// generic_seq_packet_protocol_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// generic::seq_packet_socket::socket compile and link correctly. Runtime
+// failures are ignored.
+
+namespace generic_seq_packet_protocol_socket_compile {
+
+void connect_handler(const boost::system::error_code&)
+{
+}
+
+void send_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace generic = boost::asio::generic;
+ typedef generic::seq_packet_protocol spp;
+
+ try
+ {
+ io_service ios;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ const socket_base::message_flags in_flags = 0;
+ socket_base::message_flags out_flags = 0;
+ socket_base::send_buffer_size socket_option;
+ socket_base::bytes_readable io_control_command;
+ boost::system::error_code ec;
+
+ // basic_seq_packet_socket constructors.
+
+ spp::socket socket1(ios);
+ spp::socket socket2(ios, spp(AF_INET, 0));
+ spp::socket socket3(ios, spp::endpoint());
+ int native_socket1 = ::socket(AF_INET, SOCK_SEQPACKET, 0);
+ spp::socket socket4(ios, spp(AF_INET, 0), native_socket1);
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ spp::socket socket5(std::move(socket4));
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_seq_packet_socket operators.
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ socket1 = spp::socket(ios);
+ socket1 = std::move(socket2);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = socket1.get_io_service();
+ (void)ios_ref;
+
+ // basic_socket functions.
+
+ spp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ socket1.open(spp(AF_INET, 0));
+ socket1.open(spp(AF_INET, 0), ec);
+
+ int native_socket2 = ::socket(AF_INET, SOCK_SEQPACKET, 0);
+ socket1.assign(spp(AF_INET, 0), native_socket2);
+ int native_socket3 = ::socket(AF_INET, SOCK_SEQPACKET, 0);
+ socket1.assign(spp(AF_INET, 0), native_socket3, ec);
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ spp::socket::native_type native_socket4 = socket1.native();
+ (void)native_socket4;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(spp::endpoint());
+ socket1.bind(spp::endpoint(), ec);
+
+ socket1.connect(spp::endpoint());
+ socket1.connect(spp::endpoint(), ec);
+
+ socket1.async_connect(spp::endpoint(), connect_handler);
+
+ socket1.set_option(socket_option);
+ socket1.set_option(socket_option, ec);
+
+ socket1.get_option(socket_option);
+ socket1.get_option(socket_option, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ spp::endpoint endpoint1 = socket1.local_endpoint();
+ spp::endpoint endpoint2 = socket1.local_endpoint(ec);
+
+ spp::endpoint endpoint3 = socket1.remote_endpoint();
+ spp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_seq_packet_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
+ socket1.async_send(null_buffers(), in_flags, send_handler);
+
+ socket1.receive(buffer(mutable_char_buffer), out_flags);
+ socket1.receive(null_buffers(), out_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags);
+ socket1.receive(null_buffers(), in_flags, out_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags, ec);
+ socket1.receive(null_buffers(), in_flags, out_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), out_flags,
+ receive_handler);
+ socket1.async_receive(null_buffers(), out_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ out_flags, receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace generic_seq_packet_protocol_socket_compile
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "generic/seq_packet_protocol",
+ BOOST_ASIO_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
+)

Added: branches/release/libs/asio/test/generic/stream_protocol.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/generic/stream_protocol.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,220 @@
+//
+// generic/stream_protocol.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/generic/stream_protocol.hpp>
+
+#include <cstring>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include "../unit_test.hpp"
+
+//------------------------------------------------------------------------------
+
+// generic_stream_protocol_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// generic::stream_protocol::socket compile and link correctly. Runtime
+// failures are ignored.
+
+namespace generic_stream_protocol_socket_compile {
+
+void connect_handler(const boost::system::error_code&)
+{
+}
+
+void send_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void write_some_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void read_some_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace generic = boost::asio::generic;
+ typedef generic::stream_protocol sp;
+
+ try
+ {
+ io_service ios;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ socket_base::message_flags in_flags = 0;
+ socket_base::keep_alive socket_option;
+ socket_base::bytes_readable io_control_command;
+ boost::system::error_code ec;
+
+ // basic_stream_socket constructors.
+
+ sp::socket socket1(ios);
+ sp::socket socket2(ios, sp(AF_INET, IPPROTO_TCP));
+ sp::socket socket3(ios, sp::endpoint());
+ int native_socket1 = ::socket(AF_INET, SOCK_STREAM, 0);
+ sp::socket socket4(ios, sp(AF_INET, IPPROTO_TCP), native_socket1);
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ sp::socket socket5(std::move(socket4));
+ sp::socket socket6(boost::asio::ip::tcp::socket(ios));
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_stream_socket operators.
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ socket1 = sp::socket(ios);
+ socket1 = std::move(socket2);
+ socket1 = boost::asio::ip::tcp::socket(ios);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = socket1.get_io_service();
+ (void)ios_ref;
+
+ // basic_socket functions.
+
+ sp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ socket1.open(sp(AF_INET, IPPROTO_TCP));
+ socket1.open(sp(AF_INET, IPPROTO_TCP), ec);
+
+ int native_socket2 = ::socket(AF_INET, SOCK_STREAM, 0);
+ socket1.assign(sp(AF_INET, IPPROTO_TCP), native_socket2);
+ int native_socket3 = ::socket(AF_INET, SOCK_STREAM, 0);
+ socket1.assign(sp(AF_INET, IPPROTO_TCP), native_socket3, ec);
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ sp::socket::native_type native_socket4 = socket1.native();
+ (void)native_socket4;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(sp::endpoint());
+ socket1.bind(sp::endpoint(), ec);
+
+ socket1.connect(sp::endpoint());
+ socket1.connect(sp::endpoint(), ec);
+
+ socket1.async_connect(sp::endpoint(), connect_handler);
+
+ socket1.set_option(socket_option);
+ socket1.set_option(socket_option, ec);
+
+ socket1.get_option(socket_option);
+ socket1.get_option(socket_option, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ sp::endpoint endpoint1 = socket1.local_endpoint();
+ sp::endpoint endpoint2 = socket1.local_endpoint(ec);
+
+ sp::endpoint endpoint3 = socket1.remote_endpoint();
+ sp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_stream_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer));
+ socket1.send(buffer(const_char_buffer));
+ socket1.send(null_buffers());
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), send_handler);
+ socket1.async_send(buffer(const_char_buffer), send_handler);
+ socket1.async_send(null_buffers(), send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
+ socket1.async_send(null_buffers(), in_flags, send_handler);
+
+ socket1.receive(buffer(mutable_char_buffer));
+ socket1.receive(null_buffers());
+ socket1.receive(buffer(mutable_char_buffer), in_flags);
+ socket1.receive(null_buffers(), in_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.receive(null_buffers(), in_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
+ socket1.async_receive(null_buffers(), receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, receive_handler);
+
+ socket1.write_some(buffer(mutable_char_buffer));
+ socket1.write_some(buffer(const_char_buffer));
+ socket1.write_some(null_buffers());
+ socket1.write_some(buffer(mutable_char_buffer), ec);
+ socket1.write_some(buffer(const_char_buffer), ec);
+ socket1.write_some(null_buffers(), ec);
+
+ socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
+ socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
+ socket1.async_write_some(null_buffers(), write_some_handler);
+
+ socket1.read_some(buffer(mutable_char_buffer));
+ socket1.read_some(buffer(mutable_char_buffer), ec);
+ socket1.read_some(null_buffers(), ec);
+
+ socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
+ socket1.async_read_some(null_buffers(), read_some_handler);
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace generic_stream_protocol_socket_compile
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "generic/stream_protocol",
+ BOOST_ASIO_TEST_CASE(generic_stream_protocol_socket_compile::test)
+)

Modified: branches/release/libs/asio/test/high_resolution_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/high_resolution_timer.cpp (original)
+++ branches/release/libs/asio/test/high_resolution_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // high_resolution_timer.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,9 +23,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("high_resolution_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "high_resolution_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // io_service.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,13 +17,40 @@
 #include <boost/asio/io_service.hpp>
 
 #include <sstream>
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/asio/deadline_timer.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 using namespace boost::asio;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+typedef deadline_timer timer;
+namespace chronons = boost::posix_time;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+typedef steady_timer timer;
+namespace chronons = std::chrono;
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+typedef steady_timer timer;
+namespace chronons = boost::chrono;
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 void increment(int* count)
 {
   ++(*count);
@@ -36,10 +63,10 @@
     --(*count);
 
     int before_value = *count;
- ios->post(boost::bind(decrement_to_zero, ios, count));
+ ios->post(bindns::bind(decrement_to_zero, ios, count));
 
     // Handler execution cannot nest, so count value should remain unchanged.
- BOOST_CHECK(*count == before_value);
+ BOOST_ASIO_CHECK(*count == before_value);
   }
 }
 
@@ -49,30 +76,30 @@
   {
     --(*count);
 
- ios->dispatch(boost::bind(nested_decrement_to_zero, ios, count));
+ ios->dispatch(bindns::bind(nested_decrement_to_zero, ios, count));
 
     // Handler execution is nested, so count value should now be zero.
- BOOST_CHECK(*count == 0);
+ BOOST_ASIO_CHECK(*count == 0);
   }
 }
 
 void sleep_increment(io_service* ios, int* count)
 {
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   if (++(*count) < 3)
- ios->post(boost::bind(sleep_increment, ios, count));
+ ios->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void start_sleep_increments(io_service* ios, int* count)
 {
   // Give all threads a chance to start.
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   // Start the first of three increments.
- ios->post(boost::bind(sleep_increment, ios, count));
+ ios->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void throw_exception()
@@ -90,150 +117,150 @@
   io_service ios;
   int count = 0;
 
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 5);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 5);
 
   count = 0;
   ios.reset();
   io_service::work* w = new io_service::work(ios);
- ios.post(boost::bind(&io_service::stop, &ios));
- BOOST_CHECK(!ios.stopped());
+ ios.post(bindns::bind(&io_service::stop, &ios));
+ BOOST_ASIO_CHECK(!ios.stopped());
   ios.run();
 
   // The only operation executed should have been to stop run().
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.reset();
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
   delete w;
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 10;
   ios.reset();
- ios.post(boost::bind(decrement_to_zero, &ios, &count));
+ ios.post(bindns::bind(decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 10;
   ios.reset();
- ios.post(boost::bind(nested_decrement_to_zero, &ios, &count));
+ ios.post(bindns::bind(nested_decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 10;
   ios.reset();
- ios.dispatch(boost::bind(nested_decrement_to_zero, &ios, &count));
+ ios.dispatch(bindns::bind(nested_decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called, even though nested
   // delivery was specifically allowed in the previous call.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 0;
   int count2 = 0;
   ios.reset();
- BOOST_CHECK(!ios.stopped());
- ios.post(boost::bind(start_sleep_increments, &ios, &count));
- ios.post(boost::bind(start_sleep_increments, &ios, &count2));
- boost::thread thread1(boost::bind(io_service_run, &ios));
- boost::thread thread2(boost::bind(io_service_run, &ios));
+ BOOST_ASIO_CHECK(!ios.stopped());
+ ios.post(bindns::bind(start_sleep_increments, &ios, &count));
+ ios.post(bindns::bind(start_sleep_increments, &ios, &count2));
+ boost::thread thread1(bindns::bind(io_service_run, &ios));
+ boost::thread thread2(bindns::bind(io_service_run, &ios));
   thread1.join();
   thread2.join();
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 3);
- BOOST_CHECK(count2 == 3);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count2 == 3);
 
   count = 10;
   io_service ios2;
- ios.dispatch(ios2.wrap(boost::bind(decrement_to_zero, &ios2, &count)));
+ ios.dispatch(ios2.wrap(bindns::bind(decrement_to_zero, &ios2, &count)));
   ios.reset();
- BOOST_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(!ios.stopped());
   ios.run();
 
   // No decrement_to_zero handlers can be called until run() is called on the
   // second io_service object.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 10);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 10);
 
   ios2.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   count = 0;
   int exception_count = 0;
   ios.reset();
   ios.post(&throw_exception);
- ios.post(boost::bind(increment, &count));
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
   ios.post(&throw_exception);
- ios.post(boost::bind(increment, &count));
+ ios.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(!ios.stopped());
- BOOST_CHECK(count == 0);
- BOOST_CHECK(exception_count == 0);
+ BOOST_ASIO_CHECK(!ios.stopped());
+ BOOST_ASIO_CHECK(count == 0);
+ BOOST_ASIO_CHECK(exception_count == 0);
 
   for (;;)
   {
@@ -249,9 +276,9 @@
   }
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(ios.stopped());
- BOOST_CHECK(count == 3);
- BOOST_CHECK(exception_count == 2);
+ BOOST_ASIO_CHECK(ios.stopped());
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(exception_count == 2);
 }
 
 class test_service : public boost::asio::io_service::service
@@ -276,13 +303,13 @@
 
   boost::asio::use_service<test_service>(ios1);
 
- BOOST_CHECK(boost::asio::has_service<test_service>(ios1));
+ BOOST_ASIO_CHECK(boost::asio::has_service<test_service>(ios1));
 
   test_service* svc1 = new test_service(ios1);
   try
   {
     boost::asio::add_service(ios1, svc1);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::service_already_exists&)
   {
@@ -294,14 +321,14 @@
   test_service* svc2 = new test_service(ios2);
   boost::asio::add_service(ios2, svc2);
 
- BOOST_CHECK(boost::asio::has_service<test_service>(ios2));
- BOOST_CHECK(&boost::asio::use_service<test_service>(ios2) == svc2);
+ BOOST_ASIO_CHECK(boost::asio::has_service<test_service>(ios2));
+ BOOST_ASIO_CHECK(&boost::asio::use_service<test_service>(ios2) == svc2);
 
   test_service* svc3 = new test_service(ios2);
   try
   {
     boost::asio::add_service(ios2, svc3);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::service_already_exists&)
   {
@@ -314,20 +341,19 @@
   try
   {
     boost::asio::add_service(ios3, svc4);
- BOOST_ERROR("add_service did not throw");
+ BOOST_ASIO_ERROR("add_service did not throw");
   }
   catch (boost::asio::invalid_service_owner&)
   {
   }
   delete svc4;
 
- BOOST_CHECK(!boost::asio::has_service<test_service>(ios3));
+ BOOST_ASIO_CHECK(!boost::asio::has_service<test_service>(ios3));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("io_service");
- test->add(BOOST_TEST_CASE(&io_service_test));
- test->add(BOOST_TEST_CASE(&io_service_service_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "io_service",
+ BOOST_ASIO_TEST_CASE(io_service_test)
+ BOOST_ASIO_TEST_CASE(io_service_service_test)
+)

Modified: branches/release/libs/asio/test/ip/address.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/address.cpp (original)
+++ branches/release/libs/asio/test/ip/address.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // address.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/ip/address.hpp>
 
 #include "../unit_test.hpp"
+#include <sstream>
 
 //------------------------------------------------------------------------------
 
@@ -116,9 +117,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address");
- test->add(BOOST_TEST_CASE(&ip_address_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address",
+ BOOST_ASIO_TEST_CASE(ip_address_compile::test)
+)

Modified: branches/release/libs/asio/test/ip/address_v4.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/address_v4.cpp (original)
+++ branches/release/libs/asio/test/ip/address_v4.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // address_v4.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -142,128 +142,127 @@
   using boost::asio::ip::address_v4;
 
   address_v4 a1;
- BOOST_CHECK(a1.to_bytes()[0] == 0);
- BOOST_CHECK(a1.to_bytes()[1] == 0);
- BOOST_CHECK(a1.to_bytes()[2] == 0);
- BOOST_CHECK(a1.to_bytes()[3] == 0);
- BOOST_CHECK(a1.to_ulong() == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[0] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a1.to_bytes()[3] == 0);
+ BOOST_ASIO_CHECK(a1.to_ulong() == 0);
 
   address_v4::bytes_type b1 = {{ 1, 2, 3, 4 }};
   address_v4 a2(b1);
- BOOST_CHECK(a2.to_bytes()[0] == 1);
- BOOST_CHECK(a2.to_bytes()[1] == 2);
- BOOST_CHECK(a2.to_bytes()[2] == 3);
- BOOST_CHECK(a2.to_bytes()[3] == 4);
- BOOST_CHECK(((a2.to_ulong() >> 24) & 0xFF) == b1[0]);
- BOOST_CHECK(((a2.to_ulong() >> 16) & 0xFF) == b1[1]);
- BOOST_CHECK(((a2.to_ulong() >> 8) & 0xFF) == b1[2]);
- BOOST_CHECK((a2.to_ulong() & 0xFF) == b1[3]);
+ BOOST_ASIO_CHECK(a2.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a2.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a2.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a2.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 24) & 0xFF) == b1[0]);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 16) & 0xFF) == b1[1]);
+ BOOST_ASIO_CHECK(((a2.to_ulong() >> 8) & 0xFF) == b1[2]);
+ BOOST_ASIO_CHECK((a2.to_ulong() & 0xFF) == b1[3]);
 
   address_v4 a3(0x01020304);
- BOOST_CHECK(a3.to_bytes()[0] == 1);
- BOOST_CHECK(a3.to_bytes()[1] == 2);
- BOOST_CHECK(a3.to_bytes()[2] == 3);
- BOOST_CHECK(a3.to_bytes()[3] == 4);
- BOOST_CHECK(a3.to_ulong() == 0x01020304);
-
- BOOST_CHECK(address_v4(0x7F000001).is_loopback());
- BOOST_CHECK(address_v4(0x7F000002).is_loopback());
- BOOST_CHECK(!address_v4(0x00000000).is_loopback());
- BOOST_CHECK(!address_v4(0x01020304).is_loopback());
-
- BOOST_CHECK(address_v4(0x00000000).is_unspecified());
- BOOST_CHECK(!address_v4(0x7F000001).is_unspecified());
- BOOST_CHECK(!address_v4(0x01020304).is_unspecified());
-
- BOOST_CHECK(address_v4(0x01000000).is_class_a());
- BOOST_CHECK(address_v4(0x7F000000).is_class_a());
- BOOST_CHECK(!address_v4(0x80000000).is_class_a());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_class_a());
- BOOST_CHECK(!address_v4(0xC0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_class_a());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_a());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_a());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_a());
-
- BOOST_CHECK(!address_v4(0x01000000).is_class_b());
- BOOST_CHECK(!address_v4(0x7F000000).is_class_b());
- BOOST_CHECK(address_v4(0x80000000).is_class_b());
- BOOST_CHECK(address_v4(0xBFFF0000).is_class_b());
- BOOST_CHECK(!address_v4(0xC0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_class_b());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_b());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_b());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_b());
-
- BOOST_CHECK(!address_v4(0x01000000).is_class_c());
- BOOST_CHECK(!address_v4(0x7F000000).is_class_c());
- BOOST_CHECK(!address_v4(0x80000000).is_class_c());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_class_c());
- BOOST_CHECK(address_v4(0xC0000000).is_class_c());
- BOOST_CHECK(address_v4(0xDFFFFF00).is_class_c());
- BOOST_CHECK(!address_v4(0xE0000000).is_class_c());
- BOOST_CHECK(!address_v4(0xEFFFFFFF).is_class_c());
- BOOST_CHECK(!address_v4(0xF0000000).is_class_c());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_class_c());
-
- BOOST_CHECK(!address_v4(0x01000000).is_multicast());
- BOOST_CHECK(!address_v4(0x7F000000).is_multicast());
- BOOST_CHECK(!address_v4(0x80000000).is_multicast());
- BOOST_CHECK(!address_v4(0xBFFF0000).is_multicast());
- BOOST_CHECK(!address_v4(0xC0000000).is_multicast());
- BOOST_CHECK(!address_v4(0xDFFFFF00).is_multicast());
- BOOST_CHECK(address_v4(0xE0000000).is_multicast());
- BOOST_CHECK(address_v4(0xEFFFFFFF).is_multicast());
- BOOST_CHECK(!address_v4(0xF0000000).is_multicast());
- BOOST_CHECK(!address_v4(0xFFFFFFFF).is_multicast());
+ BOOST_ASIO_CHECK(a3.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a3.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a3.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a3.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(a3.to_ulong() == 0x01020304);
+
+ BOOST_ASIO_CHECK(address_v4(0x7F000001).is_loopback());
+ BOOST_ASIO_CHECK(address_v4(0x7F000002).is_loopback());
+ BOOST_ASIO_CHECK(!address_v4(0x00000000).is_loopback());
+ BOOST_ASIO_CHECK(!address_v4(0x01020304).is_loopback());
+
+ BOOST_ASIO_CHECK(address_v4(0x00000000).is_unspecified());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000001).is_unspecified());
+ BOOST_ASIO_CHECK(!address_v4(0x01020304).is_unspecified());
+
+ BOOST_ASIO_CHECK(address_v4(0x01000000).is_class_a());
+ BOOST_ASIO_CHECK(address_v4(0x7F000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_a());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_a());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_class_b());
+ BOOST_ASIO_CHECK(address_v4(0x80000000).is_class_b());
+ BOOST_ASIO_CHECK(address_v4(0xBFFF0000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_b());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_b());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_class_c());
+ BOOST_ASIO_CHECK(address_v4(0xC0000000).is_class_c());
+ BOOST_ASIO_CHECK(address_v4(0xDFFFFF00).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xE0000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xEFFFFFFF).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_class_c());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_class_c());
+
+ BOOST_ASIO_CHECK(!address_v4(0x01000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0x7F000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0x80000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xBFFF0000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xC0000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xDFFFFF00).is_multicast());
+ BOOST_ASIO_CHECK(address_v4(0xE0000000).is_multicast());
+ BOOST_ASIO_CHECK(address_v4(0xEFFFFFFF).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xF0000000).is_multicast());
+ BOOST_ASIO_CHECK(!address_v4(0xFFFFFFFF).is_multicast());
 
   address_v4 a4 = address_v4::any();
- BOOST_CHECK(a4.to_bytes()[0] == 0);
- BOOST_CHECK(a4.to_bytes()[1] == 0);
- BOOST_CHECK(a4.to_bytes()[2] == 0);
- BOOST_CHECK(a4.to_bytes()[3] == 0);
- BOOST_CHECK(a4.to_ulong() == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[0] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a4.to_bytes()[3] == 0);
+ BOOST_ASIO_CHECK(a4.to_ulong() == 0);
 
   address_v4 a5 = address_v4::loopback();
- BOOST_CHECK(a5.to_bytes()[0] == 0x7F);
- BOOST_CHECK(a5.to_bytes()[1] == 0);
- BOOST_CHECK(a5.to_bytes()[2] == 0);
- BOOST_CHECK(a5.to_bytes()[3] == 0x01);
- BOOST_CHECK(a5.to_ulong() == 0x7F000001);
+ BOOST_ASIO_CHECK(a5.to_bytes()[0] == 0x7F);
+ BOOST_ASIO_CHECK(a5.to_bytes()[1] == 0);
+ BOOST_ASIO_CHECK(a5.to_bytes()[2] == 0);
+ BOOST_ASIO_CHECK(a5.to_bytes()[3] == 0x01);
+ BOOST_ASIO_CHECK(a5.to_ulong() == 0x7F000001);
 
   address_v4 a6 = address_v4::broadcast();
- BOOST_CHECK(a6.to_bytes()[0] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[1] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[2] == 0xFF);
- BOOST_CHECK(a6.to_bytes()[3] == 0xFF);
- BOOST_CHECK(a6.to_ulong() == 0xFFFFFFFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[0] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[1] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[2] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_bytes()[3] == 0xFF);
+ BOOST_ASIO_CHECK(a6.to_ulong() == 0xFFFFFFFF);
 
   address_v4 class_a_net(0xFF000000);
   address_v4 class_b_net(0xFFFF0000);
   address_v4 class_c_net(0xFFFFFF00);
   address_v4 other_net(0xFFFFFFFF);
- BOOST_CHECK(address_v4::netmask(address_v4(0x01000000)) == class_a_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0x7F000000)) == class_a_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0x80000000)) == class_b_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xBFFF0000)) == class_b_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xC0000000)) == class_c_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xDFFFFF00)) == class_c_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xE0000000)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xEFFFFFFF)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xF0000000)) == other_net);
- BOOST_CHECK(address_v4::netmask(address_v4(0xFFFFFFFF)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x01000000)) == class_a_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x7F000000)) == class_a_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x80000000)) == class_b_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xBFFF0000)) == class_b_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xC0000000)) == class_c_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xDFFFFF00)) == class_c_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xE0000000)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xEFFFFFFF)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xF0000000)) == other_net);
+ BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xFFFFFFFF)) == other_net);
 }
 
 } // namespace ip_address_v4_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address_v4");
- test->add(BOOST_TEST_CASE(&ip_address_v4_compile::test));
- test->add(BOOST_TEST_CASE(&ip_address_v4_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address_v4",
+ BOOST_ASIO_TEST_CASE(ip_address_v4_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_address_v4_runtime::test)
+)

Modified: branches/release/libs/asio/test/ip/address_v6.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/address_v6.cpp (original)
+++ branches/release/libs/asio/test/ip/address_v6.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // address_v6.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/ip/address_v6.hpp>
 
 #include "../unit_test.hpp"
+#include <sstream>
 
 //------------------------------------------------------------------------------
 
@@ -157,33 +158,33 @@
   using boost::asio::ip::address_v6;
 
   address_v6 a1;
- BOOST_CHECK(a1.is_unspecified());
- BOOST_CHECK(a1.scope_id() == 0);
+ BOOST_ASIO_CHECK(a1.is_unspecified());
+ BOOST_ASIO_CHECK(a1.scope_id() == 0);
 
   address_v6::bytes_type b1 = {{ 1, 2, 3, 4, 5,
     6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }};
   address_v6 a2(b1, 12345);
- BOOST_CHECK(a2.to_bytes()[0] == 1);
- BOOST_CHECK(a2.to_bytes()[1] == 2);
- BOOST_CHECK(a2.to_bytes()[2] == 3);
- BOOST_CHECK(a2.to_bytes()[3] == 4);
- BOOST_CHECK(a2.to_bytes()[4] == 5);
- BOOST_CHECK(a2.to_bytes()[5] == 6);
- BOOST_CHECK(a2.to_bytes()[6] == 7);
- BOOST_CHECK(a2.to_bytes()[7] == 8);
- BOOST_CHECK(a2.to_bytes()[8] == 9);
- BOOST_CHECK(a2.to_bytes()[9] == 10);
- BOOST_CHECK(a2.to_bytes()[10] == 11);
- BOOST_CHECK(a2.to_bytes()[11] == 12);
- BOOST_CHECK(a2.to_bytes()[12] == 13);
- BOOST_CHECK(a2.to_bytes()[13] == 14);
- BOOST_CHECK(a2.to_bytes()[14] == 15);
- BOOST_CHECK(a2.to_bytes()[15] == 16);
- BOOST_CHECK(a2.scope_id() == 12345);
+ BOOST_ASIO_CHECK(a2.to_bytes()[0] == 1);
+ BOOST_ASIO_CHECK(a2.to_bytes()[1] == 2);
+ BOOST_ASIO_CHECK(a2.to_bytes()[2] == 3);
+ BOOST_ASIO_CHECK(a2.to_bytes()[3] == 4);
+ BOOST_ASIO_CHECK(a2.to_bytes()[4] == 5);
+ BOOST_ASIO_CHECK(a2.to_bytes()[5] == 6);
+ BOOST_ASIO_CHECK(a2.to_bytes()[6] == 7);
+ BOOST_ASIO_CHECK(a2.to_bytes()[7] == 8);
+ BOOST_ASIO_CHECK(a2.to_bytes()[8] == 9);
+ BOOST_ASIO_CHECK(a2.to_bytes()[9] == 10);
+ BOOST_ASIO_CHECK(a2.to_bytes()[10] == 11);
+ BOOST_ASIO_CHECK(a2.to_bytes()[11] == 12);
+ BOOST_ASIO_CHECK(a2.to_bytes()[12] == 13);
+ BOOST_ASIO_CHECK(a2.to_bytes()[13] == 14);
+ BOOST_ASIO_CHECK(a2.to_bytes()[14] == 15);
+ BOOST_ASIO_CHECK(a2.to_bytes()[15] == 16);
+ BOOST_ASIO_CHECK(a2.scope_id() == 12345);
 
   address_v6 a3;
   a3.scope_id(12345);
- BOOST_CHECK(a3.scope_id() == 12345);
+ BOOST_ASIO_CHECK(a3.scope_id() == 12345);
 
   address_v6 unspecified_address;
   address_v6::bytes_type loopback_bytes = {{ 0 }};
@@ -213,161 +214,160 @@
   address_v6::bytes_type mcast_site_local_bytes = {{ 0xFF, 0x05, 1 }};
   address_v6 mcast_site_local_address(mcast_site_local_bytes);
 
- BOOST_CHECK(!unspecified_address.is_loopback());
- BOOST_CHECK(loopback_address.is_loopback());
- BOOST_CHECK(!link_local_address.is_loopback());
- BOOST_CHECK(!site_local_address.is_loopback());
- BOOST_CHECK(!v4_mapped_address.is_loopback());
- BOOST_CHECK(!v4_compat_address.is_loopback());
- BOOST_CHECK(!mcast_global_address.is_loopback());
- BOOST_CHECK(!mcast_link_local_address.is_loopback());
- BOOST_CHECK(!mcast_node_local_address.is_loopback());
- BOOST_CHECK(!mcast_org_local_address.is_loopback());
- BOOST_CHECK(!mcast_site_local_address.is_loopback());
-
- BOOST_CHECK(unspecified_address.is_unspecified());
- BOOST_CHECK(!loopback_address.is_unspecified());
- BOOST_CHECK(!link_local_address.is_unspecified());
- BOOST_CHECK(!site_local_address.is_unspecified());
- BOOST_CHECK(!v4_mapped_address.is_unspecified());
- BOOST_CHECK(!v4_compat_address.is_unspecified());
- BOOST_CHECK(!mcast_global_address.is_unspecified());
- BOOST_CHECK(!mcast_link_local_address.is_unspecified());
- BOOST_CHECK(!mcast_node_local_address.is_unspecified());
- BOOST_CHECK(!mcast_org_local_address.is_unspecified());
- BOOST_CHECK(!mcast_site_local_address.is_unspecified());
-
- BOOST_CHECK(!unspecified_address.is_link_local());
- BOOST_CHECK(!loopback_address.is_link_local());
- BOOST_CHECK(link_local_address.is_link_local());
- BOOST_CHECK(!site_local_address.is_link_local());
- BOOST_CHECK(!v4_mapped_address.is_link_local());
- BOOST_CHECK(!v4_compat_address.is_link_local());
- BOOST_CHECK(!mcast_global_address.is_link_local());
- BOOST_CHECK(!mcast_link_local_address.is_link_local());
- BOOST_CHECK(!mcast_node_local_address.is_link_local());
- BOOST_CHECK(!mcast_org_local_address.is_link_local());
- BOOST_CHECK(!mcast_site_local_address.is_link_local());
-
- BOOST_CHECK(!unspecified_address.is_site_local());
- BOOST_CHECK(!loopback_address.is_site_local());
- BOOST_CHECK(!link_local_address.is_site_local());
- BOOST_CHECK(site_local_address.is_site_local());
- BOOST_CHECK(!v4_mapped_address.is_site_local());
- BOOST_CHECK(!v4_compat_address.is_site_local());
- BOOST_CHECK(!mcast_global_address.is_site_local());
- BOOST_CHECK(!mcast_link_local_address.is_site_local());
- BOOST_CHECK(!mcast_node_local_address.is_site_local());
- BOOST_CHECK(!mcast_org_local_address.is_site_local());
- BOOST_CHECK(!mcast_site_local_address.is_site_local());
-
- BOOST_CHECK(!unspecified_address.is_v4_mapped());
- BOOST_CHECK(!loopback_address.is_v4_mapped());
- BOOST_CHECK(!link_local_address.is_v4_mapped());
- BOOST_CHECK(!site_local_address.is_v4_mapped());
- BOOST_CHECK(v4_mapped_address.is_v4_mapped());
- BOOST_CHECK(!v4_compat_address.is_v4_mapped());
- BOOST_CHECK(!mcast_global_address.is_v4_mapped());
- BOOST_CHECK(!mcast_link_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_node_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_org_local_address.is_v4_mapped());
- BOOST_CHECK(!mcast_site_local_address.is_v4_mapped());
-
- BOOST_CHECK(!unspecified_address.is_v4_compatible());
- BOOST_CHECK(!loopback_address.is_v4_compatible());
- BOOST_CHECK(!link_local_address.is_v4_compatible());
- BOOST_CHECK(!site_local_address.is_v4_compatible());
- BOOST_CHECK(!v4_mapped_address.is_v4_compatible());
- BOOST_CHECK(v4_compat_address.is_v4_compatible());
- BOOST_CHECK(!mcast_global_address.is_v4_compatible());
- BOOST_CHECK(!mcast_link_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_node_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_org_local_address.is_v4_compatible());
- BOOST_CHECK(!mcast_site_local_address.is_v4_compatible());
-
- BOOST_CHECK(!unspecified_address.is_multicast());
- BOOST_CHECK(!loopback_address.is_multicast());
- BOOST_CHECK(!link_local_address.is_multicast());
- BOOST_CHECK(!site_local_address.is_multicast());
- BOOST_CHECK(!v4_mapped_address.is_multicast());
- BOOST_CHECK(!v4_compat_address.is_multicast());
- BOOST_CHECK(mcast_global_address.is_multicast());
- BOOST_CHECK(mcast_link_local_address.is_multicast());
- BOOST_CHECK(mcast_node_local_address.is_multicast());
- BOOST_CHECK(mcast_org_local_address.is_multicast());
- BOOST_CHECK(mcast_site_local_address.is_multicast());
-
- BOOST_CHECK(!unspecified_address.is_multicast_global());
- BOOST_CHECK(!loopback_address.is_multicast_global());
- BOOST_CHECK(!link_local_address.is_multicast_global());
- BOOST_CHECK(!site_local_address.is_multicast_global());
- BOOST_CHECK(!v4_mapped_address.is_multicast_global());
- BOOST_CHECK(!v4_compat_address.is_multicast_global());
- BOOST_CHECK(mcast_global_address.is_multicast_global());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_global());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_global());
-
- BOOST_CHECK(!unspecified_address.is_multicast_link_local());
- BOOST_CHECK(!loopback_address.is_multicast_link_local());
- BOOST_CHECK(!link_local_address.is_multicast_link_local());
- BOOST_CHECK(!site_local_address.is_multicast_link_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_link_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_link_local());
- BOOST_CHECK(mcast_link_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_link_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_link_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_node_local());
- BOOST_CHECK(!loopback_address.is_multicast_node_local());
- BOOST_CHECK(!link_local_address.is_multicast_node_local());
- BOOST_CHECK(!site_local_address.is_multicast_node_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_node_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_node_local());
- BOOST_CHECK(mcast_node_local_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_node_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_node_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_org_local());
- BOOST_CHECK(!loopback_address.is_multicast_org_local());
- BOOST_CHECK(!link_local_address.is_multicast_org_local());
- BOOST_CHECK(!site_local_address.is_multicast_org_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_org_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_org_local());
- BOOST_CHECK(mcast_org_local_address.is_multicast_org_local());
- BOOST_CHECK(!mcast_site_local_address.is_multicast_org_local());
-
- BOOST_CHECK(!unspecified_address.is_multicast_site_local());
- BOOST_CHECK(!loopback_address.is_multicast_site_local());
- BOOST_CHECK(!link_local_address.is_multicast_site_local());
- BOOST_CHECK(!site_local_address.is_multicast_site_local());
- BOOST_CHECK(!v4_mapped_address.is_multicast_site_local());
- BOOST_CHECK(!v4_compat_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_global_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_link_local_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_node_local_address.is_multicast_site_local());
- BOOST_CHECK(!mcast_org_local_address.is_multicast_site_local());
- BOOST_CHECK(mcast_site_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!unspecified_address.is_loopback());
+ BOOST_ASIO_CHECK(loopback_address.is_loopback());
+ BOOST_ASIO_CHECK(!link_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!site_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_loopback());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_loopback());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_loopback());
+
+ BOOST_ASIO_CHECK(unspecified_address.is_unspecified());
+ BOOST_ASIO_CHECK(!loopback_address.is_unspecified());
+ BOOST_ASIO_CHECK(!link_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!site_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_unspecified());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_unspecified());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_unspecified());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_link_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_link_local());
+ BOOST_ASIO_CHECK(link_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_link_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_link_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_link_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_site_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_site_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_site_local());
+ BOOST_ASIO_CHECK(site_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_site_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_site_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_site_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!loopback_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!link_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!site_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(v4_mapped_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_mapped());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_mapped());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!loopback_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!link_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!site_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(v4_compat_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_compatible());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_compatible());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_global_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_link_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_node_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_org_local_address.is_multicast());
+ BOOST_ASIO_CHECK(mcast_site_local_address.is_multicast());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_global());
+ BOOST_ASIO_CHECK(mcast_global_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_global());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_global());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(mcast_link_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_link_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_link_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(mcast_node_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_node_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_node_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(mcast_org_local_address.is_multicast_org_local());
+ BOOST_ASIO_CHECK(!mcast_site_local_address.is_multicast_org_local());
+
+ BOOST_ASIO_CHECK(!unspecified_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!loopback_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!link_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!site_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!v4_mapped_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!v4_compat_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_global_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_link_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_node_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(!mcast_org_local_address.is_multicast_site_local());
+ BOOST_ASIO_CHECK(mcast_site_local_address.is_multicast_site_local());
 
- BOOST_CHECK(address_v6::loopback().is_loopback());
+ BOOST_ASIO_CHECK(address_v6::loopback().is_loopback());
 }
 
 } // namespace ip_address_v6_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/address_v6");
- test->add(BOOST_TEST_CASE(&ip_address_v6_compile::test));
- test->add(BOOST_TEST_CASE(&ip_address_v6_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/address_v6",
+ BOOST_ASIO_TEST_CASE(ip_address_v6_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_address_v6_runtime::test)
+)

Modified: branches/release/libs/asio/test/ip/basic_endpoint.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/basic_endpoint.cpp (original)
+++ branches/release/libs/asio/test/ip/basic_endpoint.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_endpoint.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_endpoint");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_endpoint",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ip/basic_resolver.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/basic_resolver.cpp (original)
+++ branches/release/libs/asio/test/ip/basic_resolver.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_resolver.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ip/basic_resolver_entry.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/basic_resolver_entry.cpp (original)
+++ branches/release/libs/asio/test/ip/basic_resolver_entry.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_resolver_entry.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_entry");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_entry",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ip/basic_resolver_iterator.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/basic_resolver_iterator.cpp (original)
+++ branches/release/libs/asio/test/ip/basic_resolver_iterator.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_resolver_iterator.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_iterator");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_iterator",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ip/basic_resolver_query.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/basic_resolver_query.cpp (original)
+++ branches/release/libs/asio/test/ip/basic_resolver_query.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_resolver_query.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/basic_resolver_query");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/basic_resolver_query",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // host_name.cpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -48,9 +48,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/host_name");
- test->add(BOOST_TEST_CASE(&ip_host_name_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/host_name",
+ BOOST_ASIO_TEST_CASE(ip_host_name_compile::test)
+)

Added: branches/release/libs/asio/test/ip/icmp.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/asio/test/ip/icmp.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -0,0 +1,458 @@
+//
+// icmp.cpp
+// ~~~~~~~~
+//
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Disable autolinking for unit tests.
+#if !defined(BOOST_ALL_NO_LIB)
+#define BOOST_ALL_NO_LIB 1
+#endif // !defined(BOOST_ALL_NO_LIB)
+
+// Test that header file is self-contained.
+#include <boost/asio/ip/icmp.hpp>
+
+#include <cstring>
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/placeholders.hpp>
+#include "../unit_test.hpp"
+#include "../archetypes/gettable_socket_option.hpp"
+#include "../archetypes/async_result.hpp"
+#include "../archetypes/io_control_command.hpp"
+#include "../archetypes/settable_socket_option.hpp"
+
+//------------------------------------------------------------------------------
+
+// ip_icmp_socket_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// ip::icmp::socket compile and link correctly. Runtime failures are ignored.
+
+namespace ip_icmp_socket_compile {
+
+void connect_handler(const boost::system::error_code&)
+{
+}
+
+void send_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void receive_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace ip = boost::asio::ip;
+
+ try
+ {
+ io_service ios;
+ char mutable_char_buffer[128] = "";
+ const char const_char_buffer[128] = "";
+ socket_base::message_flags in_flags = 0;
+ archetypes::settable_socket_option<void> settable_socket_option1;
+ archetypes::settable_socket_option<int> settable_socket_option2;
+ archetypes::settable_socket_option<double> settable_socket_option3;
+ archetypes::gettable_socket_option<void> gettable_socket_option1;
+ archetypes::gettable_socket_option<int> gettable_socket_option2;
+ archetypes::gettable_socket_option<double> gettable_socket_option3;
+ archetypes::io_control_command io_control_command;
+ archetypes::lazy_handler lazy;
+ boost::system::error_code ec;
+
+ // basic_datagram_socket constructors.
+
+ ip::icmp::socket socket1(ios);
+ ip::icmp::socket socket2(ios, ip::icmp::v4());
+ ip::icmp::socket socket3(ios, ip::icmp::v6());
+ ip::icmp::socket socket4(ios, ip::icmp::endpoint(ip::icmp::v4(), 0));
+ ip::icmp::socket socket5(ios, ip::icmp::endpoint(ip::icmp::v6(), 0));
+ int native_socket1 = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ ip::icmp::socket socket6(ios, ip::icmp::v4(), native_socket1);
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ ip::icmp::socket socket7(std::move(socket6));
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_datagram_socket operators.
+
+#if defined(BOOST_ASIO_HAS_MOVE)
+ socket1 = ip::icmp::socket(ios);
+ socket1 = std::move(socket2);
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = socket1.get_io_service();
+ (void)ios_ref;
+
+ // basic_socket functions.
+
+ ip::icmp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
+ (void)lowest_layer;
+
+ const ip::icmp::socket& socket8 = socket1;
+ const ip::icmp::socket::lowest_layer_type& lowest_layer2
+ = socket8.lowest_layer();
+ (void)lowest_layer2;
+
+ socket1.open(ip::icmp::v4());
+ socket1.open(ip::icmp::v6());
+ socket1.open(ip::icmp::v4(), ec);
+ socket1.open(ip::icmp::v6(), ec);
+
+ int native_socket2 = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ socket1.assign(ip::icmp::v4(), native_socket2);
+ int native_socket3 = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ socket1.assign(ip::icmp::v4(), native_socket3, ec);
+
+ bool is_open = socket1.is_open();
+ (void)is_open;
+
+ socket1.close();
+ socket1.close(ec);
+
+ ip::icmp::socket::native_type native_socket4 = socket1.native();
+ (void)native_socket4;
+
+ ip::icmp::socket::native_handle_type native_socket5
+ = socket1.native_handle();
+ (void)native_socket5;
+
+ socket1.cancel();
+ socket1.cancel(ec);
+
+ bool at_mark1 = socket1.at_mark();
+ (void)at_mark1;
+ bool at_mark2 = socket1.at_mark(ec);
+ (void)at_mark2;
+
+ std::size_t available1 = socket1.available();
+ (void)available1;
+ std::size_t available2 = socket1.available(ec);
+ (void)available2;
+
+ socket1.bind(ip::icmp::endpoint(ip::icmp::v4(), 0));
+ socket1.bind(ip::icmp::endpoint(ip::icmp::v6(), 0));
+ socket1.bind(ip::icmp::endpoint(ip::icmp::v4(), 0), ec);
+ socket1.bind(ip::icmp::endpoint(ip::icmp::v6(), 0), ec);
+
+ socket1.connect(ip::icmp::endpoint(ip::icmp::v4(), 0));
+ socket1.connect(ip::icmp::endpoint(ip::icmp::v6(), 0));
+ socket1.connect(ip::icmp::endpoint(ip::icmp::v4(), 0), ec);
+ socket1.connect(ip::icmp::endpoint(ip::icmp::v6(), 0), ec);
+
+ socket1.async_connect(ip::icmp::endpoint(ip::icmp::v4(), 0),
+ &connect_handler);
+ socket1.async_connect(ip::icmp::endpoint(ip::icmp::v6(), 0),
+ &connect_handler);
+ int i1 = socket1.async_connect(ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
+ (void)i1;
+ int i2 = socket1.async_connect(ip::icmp::endpoint(ip::icmp::v6(), 0), lazy);
+ (void)i2;
+
+ socket1.set_option(settable_socket_option1);
+ socket1.set_option(settable_socket_option1, ec);
+ socket1.set_option(settable_socket_option2);
+ socket1.set_option(settable_socket_option2, ec);
+ socket1.set_option(settable_socket_option3);
+ socket1.set_option(settable_socket_option3, ec);
+
+ socket1.get_option(gettable_socket_option1);
+ socket1.get_option(gettable_socket_option1, ec);
+ socket1.get_option(gettable_socket_option2);
+ socket1.get_option(gettable_socket_option2, ec);
+ socket1.get_option(gettable_socket_option3);
+ socket1.get_option(gettable_socket_option3, ec);
+
+ socket1.io_control(io_control_command);
+ socket1.io_control(io_control_command, ec);
+
+ bool non_blocking1 = socket1.non_blocking();
+ (void)non_blocking1;
+ socket1.non_blocking(true);
+ socket1.non_blocking(false, ec);
+
+ bool non_blocking2 = socket1.native_non_blocking();
+ (void)non_blocking2;
+ socket1.native_non_blocking(true);
+ socket1.native_non_blocking(false, ec);
+
+ ip::icmp::endpoint endpoint1 = socket1.local_endpoint();
+ ip::icmp::endpoint endpoint2 = socket1.local_endpoint(ec);
+
+ ip::icmp::endpoint endpoint3 = socket1.remote_endpoint();
+ ip::icmp::endpoint endpoint4 = socket1.remote_endpoint(ec);
+
+ socket1.shutdown(socket_base::shutdown_both);
+ socket1.shutdown(socket_base::shutdown_both, ec);
+
+ // basic_datagram_socket functions.
+
+ socket1.send(buffer(mutable_char_buffer));
+ socket1.send(buffer(const_char_buffer));
+ socket1.send(null_buffers());
+ socket1.send(buffer(mutable_char_buffer), in_flags);
+ socket1.send(buffer(const_char_buffer), in_flags);
+ socket1.send(null_buffers(), in_flags);
+ socket1.send(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.send(buffer(const_char_buffer), in_flags, ec);
+ socket1.send(null_buffers(), in_flags, ec);
+
+ socket1.async_send(buffer(mutable_char_buffer), &send_handler);
+ socket1.async_send(buffer(const_char_buffer), &send_handler);
+ socket1.async_send(null_buffers(), &send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, &send_handler);
+ socket1.async_send(buffer(const_char_buffer), in_flags, &send_handler);
+ socket1.async_send(null_buffers(), in_flags, &send_handler);
+ int i3 = socket1.async_send(buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ int i4 = socket1.async_send(buffer(const_char_buffer), lazy);
+ (void)i4;
+ int i5 = socket1.async_send(null_buffers(), lazy);
+ (void)i5;
+ int i6 = socket1.async_send(buffer(mutable_char_buffer), in_flags, lazy);
+ (void)i6;
+ int i7 = socket1.async_send(buffer(const_char_buffer), in_flags, lazy);
+ (void)i7;
+ int i8 = socket1.async_send(null_buffers(), in_flags, lazy);
+ (void)i8;
+
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0));
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0));
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0));
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0));
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0));
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0));
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags);
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags);
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags);
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags);
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags);
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags);
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, ec);
+ socket1.send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, ec);
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, ec);
+ socket1.send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, ec);
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, ec);
+ socket1.send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, ec);
+
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), &send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), &send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), &send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), &send_handler);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), &send_handler);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), &send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, &send_handler);
+ socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, &send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, &send_handler);
+ socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, &send_handler);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, &send_handler);
+ socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, &send_handler);
+ int i9 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
+ (void)i9;
+ int i10 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), lazy);
+ (void)i10;
+ int i11 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
+ (void)i11;
+ int i12 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), lazy);
+ (void)i12;
+ int i13 = socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), lazy);
+ (void)i13;
+ int i14 = socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), lazy);
+ (void)i14;
+ int i15 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, lazy);
+ (void)i15;
+ int i16 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, lazy);
+ (void)i16;
+ int i17 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, lazy);
+ (void)i17;
+ int i18 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, lazy);
+ (void)i18;
+ int i19 = socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v4(), 0), in_flags, lazy);
+ (void)i19;
+ int i20 = socket1.async_send_to(null_buffers(),
+ ip::icmp::endpoint(ip::icmp::v6(), 0), in_flags, lazy);
+ (void)i20;
+
+ socket1.receive(buffer(mutable_char_buffer));
+ socket1.receive(null_buffers());
+ socket1.receive(buffer(mutable_char_buffer), in_flags);
+ socket1.receive(null_buffers(), in_flags);
+ socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
+ socket1.receive(null_buffers(), in_flags, ec);
+
+ socket1.async_receive(buffer(mutable_char_buffer), &receive_handler);
+ socket1.async_receive(null_buffers(), &receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ &receive_handler);
+ socket1.async_receive(null_buffers(), in_flags, &receive_handler);
+ int i21 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
+ (void)i21;
+ int i22 = socket1.async_receive(null_buffers(), lazy);
+ (void)i22;
+ int i23 = socket1.async_receive(buffer(mutable_char_buffer),
+ in_flags, lazy);
+ (void)i23;
+ int i24 = socket1.async_receive(null_buffers(), in_flags, lazy);
+ (void)i24;
+
+ ip::icmp::endpoint endpoint;
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint);
+ socket1.receive_from(null_buffers(), endpoint);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
+ socket1.receive_from(null_buffers(), endpoint, in_flags);
+ socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
+ socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
+
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, &receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, &receive_handler);
+ socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, &receive_handler);
+ socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, &receive_handler);
+ int i25 = socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, lazy);
+ (void)i25;
+ int i26 = socket1.async_receive_from(null_buffers(),
+ endpoint, lazy);
+ (void)i26;
+ int i27 = socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, lazy);
+ (void)i27;
+ int i28 = socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, lazy);
+ (void)i28;
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace ip_icmp_socket_compile
+
+//------------------------------------------------------------------------------
+
+// ip_icmp_resolver_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// ip::icmp::resolver compile and link correctly. Runtime failures are ignored.
+
+namespace ip_icmp_resolver_compile {
+
+void resolve_handler(const boost::system::error_code&,
+ boost::asio::ip::icmp::resolver::iterator)
+{
+}
+
+void test()
+{
+ using namespace boost::asio;
+ namespace ip = boost::asio::ip;
+
+ try
+ {
+ io_service ios;
+ archetypes::lazy_handler lazy;
+ boost::system::error_code ec;
+ ip::icmp::resolver::query q(ip::icmp::v4(), "localhost", "0");
+ ip::icmp::endpoint e(ip::address_v4::loopback(), 0);
+
+ // basic_resolver constructors.
+
+ ip::icmp::resolver resolver(ios);
+
+ // basic_io_object functions.
+
+ io_service& ios_ref = resolver.get_io_service();
+ (void)ios_ref;
+
+ // basic_resolver functions.
+
+ resolver.cancel();
+
+ ip::icmp::resolver::iterator iter1 = resolver.resolve(q);
+ (void)iter1;
+
+ ip::icmp::resolver::iterator iter2 = resolver.resolve(q, ec);
+ (void)iter2;
+
+ ip::icmp::resolver::iterator iter3 = resolver.resolve(e);
+ (void)iter3;
+
+ ip::icmp::resolver::iterator iter4 = resolver.resolve(e, ec);
+ (void)iter4;
+
+ resolver.async_resolve(q, &resolve_handler);
+ int i1 = resolver.async_resolve(q, lazy);
+ (void)i1;
+
+ resolver.async_resolve(e, &resolve_handler);
+ int i2 = resolver.async_resolve(e, lazy);
+ (void)i2;
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace ip_icmp_resolver_compile
+
+//------------------------------------------------------------------------------
+
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/icmp",
+ BOOST_ASIO_TEST_CASE(ip_icmp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_icmp_resolver_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // multicast.cpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -131,23 +131,23 @@
   sock_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
 
- BOOST_CHECK(have_v4 || have_v6);
+ BOOST_ASIO_CHECK(have_v4 || have_v6);
 
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Windows CE seems to have problems with some multicast group addresses.
   // The following address works on CE, but as it is not a private multicast
   // address it will not be used on other platforms.
   const ip::address multicast_address_v4 =
     ip::address::from_string("239.0.0.4", ec);
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   const ip::address multicast_address_v4 =
     ip::address::from_string("239.255.0.1", ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!have_v4 || !ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!have_v4 || !ec);
 
   const ip::address multicast_address_v6 =
     ip::address::from_string("ff01::1", ec);
- BOOST_CHECK(!have_v6 || !ec);
+ BOOST_ASIO_CHECK(!have_v6 || !ec);
 
   // join_group class.
 
@@ -155,14 +155,14 @@
   {
     ip::multicast::join_group join_group(multicast_address_v4);
     sock_v4.set_option(join_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
   {
     ip::multicast::join_group join_group(multicast_address_v6);
     sock_v6.set_option(join_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // leave_group class.
@@ -171,14 +171,14 @@
   {
     ip::multicast::leave_group leave_group(multicast_address_v4);
     sock_v4.set_option(leave_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
   {
     ip::multicast::leave_group leave_group(multicast_address_v6);
     sock_v6.set_option(leave_group, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // outbound_interface class.
@@ -188,7 +188,7 @@
     ip::multicast::outbound_interface outbound_interface(
         ip::address_v4::loopback());
     sock_v4.set_option(outbound_interface, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   if (have_v6)
@@ -199,7 +199,7 @@
     ip::multicast::outbound_interface outbound_interface(1);
 #endif
     sock_v6.set_option(outbound_interface, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
   }
 
   // hops class.
@@ -207,47 +207,47 @@
   if (have_v4)
   {
     ip::multicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v4.set_option(hops1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops2;
     sock_v4.get_option(hops2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::multicast::hops hops3(0);
- BOOST_CHECK(hops3.value() == 0);
+ BOOST_ASIO_CHECK(hops3.value() == 0);
     sock_v4.set_option(hops3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops4;
     sock_v4.get_option(hops4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops4.value() == 0);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops4.value() == 0);
   }
 
   if (have_v6)
   {
     ip::multicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v6.set_option(hops1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops2;
     sock_v6.get_option(hops2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::multicast::hops hops3(0);
- BOOST_CHECK(hops3.value() == 0);
+ BOOST_ASIO_CHECK(hops3.value() == 0);
     sock_v6.set_option(hops3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::hops hops4;
     sock_v6.get_option(hops4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(hops4.value() == 0);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(hops4.value() == 0);
   }
 
   // enable_loopback class.
@@ -255,85 +255,85 @@
   if (have_v4)
   {
     ip::multicast::enable_loopback enable_loopback1(true);
- BOOST_CHECK(enable_loopback1.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback1));
- BOOST_CHECK(!!enable_loopback1);
+ BOOST_ASIO_CHECK(enable_loopback1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback1));
+ BOOST_ASIO_CHECK(!!enable_loopback1);
     sock_v4.set_option(enable_loopback1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback2;
     sock_v4.get_option(enable_loopback2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Not supported under Windows CE but can get value.
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_loopback2.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback2));
- BOOST_CHECK(!!enable_loopback2);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_loopback2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback2));
+ BOOST_ASIO_CHECK(!!enable_loopback2);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback3(false);
- BOOST_CHECK(!enable_loopback3.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback3));
- BOOST_CHECK(!enable_loopback3);
+ BOOST_ASIO_CHECK(!enable_loopback3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback3));
+ BOOST_ASIO_CHECK(!enable_loopback3);
     sock_v4.set_option(enable_loopback3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::multicast::enable_loopback enable_loopback4;
     sock_v4.get_option(enable_loopback4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Not supported under Windows CE but can get value.
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_loopback4.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback4));
- BOOST_CHECK(!enable_loopback4);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_loopback4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback4));
+ BOOST_ASIO_CHECK(!enable_loopback4);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)
   {
     ip::multicast::enable_loopback enable_loopback1(true);
- BOOST_CHECK(enable_loopback1.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback1));
- BOOST_CHECK(!!enable_loopback1);
+ BOOST_ASIO_CHECK(enable_loopback1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback1));
+ BOOST_ASIO_CHECK(!!enable_loopback1);
     sock_v6.set_option(enable_loopback1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::enable_loopback enable_loopback2;
     sock_v6.get_option(enable_loopback2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_loopback2.value());
- BOOST_CHECK(static_cast<bool>(enable_loopback2));
- BOOST_CHECK(!!enable_loopback2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_loopback2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_loopback2));
+ BOOST_ASIO_CHECK(!!enable_loopback2);
 
     ip::multicast::enable_loopback enable_loopback3(false);
- BOOST_CHECK(!enable_loopback3.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback3));
- BOOST_CHECK(!enable_loopback3);
+ BOOST_ASIO_CHECK(!enable_loopback3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback3));
+ BOOST_ASIO_CHECK(!enable_loopback3);
     sock_v6.set_option(enable_loopback3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
     ip::multicast::enable_loopback enable_loopback4;
     sock_v6.get_option(enable_loopback4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_loopback4.value());
- BOOST_CHECK(!static_cast<bool>(enable_loopback4));
- BOOST_CHECK(!enable_loopback4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_loopback4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_loopback4));
+ BOOST_ASIO_CHECK(!enable_loopback4);
   }
 }
 
@@ -341,10 +341,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/multicast");
- test->add(BOOST_TEST_CASE(&ip_multicast_compile::test));
- test->add(BOOST_TEST_CASE(&ip_multicast_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/multicast",
+ BOOST_ASIO_TEST_CASE(ip_multicast_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_multicast_runtime::test)
+)

Modified: branches/release/libs/asio/test/ip/resolver_query_base.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/resolver_query_base.cpp (original)
+++ branches/release/libs/asio/test/ip/resolver_query_base.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // resolver_query_base.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/resolver_query_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/resolver_query_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ip/resolver_service.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/resolver_service.cpp (original)
+++ branches/release/libs/asio/test/ip/resolver_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // resolver_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/resolver_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/resolver_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // tcp.cpp
 // ~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,18 +19,28 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/tcp.hpp>
 
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/read.hpp>
 #include <boost/asio/write.hpp>
 #include "../unit_test.hpp"
 #include "../archetypes/gettable_socket_option.hpp"
+#include "../archetypes/async_result.hpp"
 #include "../archetypes/io_control_command.hpp"
 #include "../archetypes/settable_socket_option.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <boost/array.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 //------------------------------------------------------------------------------
 
 // ip_tcp_compile test
@@ -88,32 +98,32 @@
   // no_delay class.
 
   ip::tcp::no_delay no_delay1(true);
- BOOST_CHECK(no_delay1.value());
- BOOST_CHECK(static_cast<bool>(no_delay1));
- BOOST_CHECK(!!no_delay1);
+ BOOST_ASIO_CHECK(no_delay1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(no_delay1));
+ BOOST_ASIO_CHECK(!!no_delay1);
   sock.set_option(no_delay1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
   ip::tcp::no_delay no_delay2;
   sock.get_option(no_delay2, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(no_delay2.value());
- BOOST_CHECK(static_cast<bool>(no_delay2));
- BOOST_CHECK(!!no_delay2);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(no_delay2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(no_delay2));
+ BOOST_ASIO_CHECK(!!no_delay2);
 
   ip::tcp::no_delay no_delay3(false);
- BOOST_CHECK(!no_delay3.value());
- BOOST_CHECK(!static_cast<bool>(no_delay3));
- BOOST_CHECK(!no_delay3);
+ BOOST_ASIO_CHECK(!no_delay3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(no_delay3));
+ BOOST_ASIO_CHECK(!no_delay3);
   sock.set_option(no_delay3, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
   ip::tcp::no_delay no_delay4;
   sock.get_option(no_delay4, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(!no_delay4.value());
- BOOST_CHECK(!static_cast<bool>(no_delay4));
- BOOST_CHECK(!no_delay4);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(!no_delay4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(no_delay4));
+ BOOST_ASIO_CHECK(!no_delay4);
 }
 
 } // namespace ip_tcp_runtime
@@ -149,6 +159,12 @@
 
 void test()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+ using boost::array;
+#else // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+ using std::array;
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
@@ -157,10 +173,10 @@
     io_service ios;
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
- boost::array<boost::asio::mutable_buffer, 2> mutable_buffers = {{
+ array<boost::asio::mutable_buffer, 2> mutable_buffers = {{
         boost::asio::buffer(mutable_char_buffer, 10),
         boost::asio::buffer(mutable_char_buffer + 10, 10) }};
- boost::array<boost::asio::const_buffer, 2> const_buffers = {{
+ array<boost::asio::const_buffer, 2> const_buffers = {{
         boost::asio::buffer(const_char_buffer, 10),
         boost::asio::buffer(const_char_buffer + 10, 10) }};
     socket_base::message_flags in_flags = 0;
@@ -171,6 +187,7 @@
     archetypes::gettable_socket_option<int> gettable_socket_option2;
     archetypes::gettable_socket_option<double> gettable_socket_option3;
     archetypes::io_control_command io_control_command;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_stream_socket constructors.
@@ -259,6 +276,10 @@
         &connect_handler);
     socket1.async_connect(ip::tcp::endpoint(ip::tcp::v6(), 0),
         &connect_handler);
+ int i1 = socket1.async_connect(ip::tcp::endpoint(ip::tcp::v4(), 0), lazy);
+ (void)i1;
+ int i2 = socket1.async_connect(ip::tcp::endpoint(ip::tcp::v6(), 0), lazy);
+ (void)i2;
 
     socket1.set_option(settable_socket_option1);
     socket1.set_option(settable_socket_option1, ec);
@@ -324,6 +345,26 @@
     socket1.async_send(mutable_buffers, in_flags, &send_handler);
     socket1.async_send(const_buffers, in_flags, &send_handler);
     socket1.async_send(null_buffers(), in_flags, &send_handler);
+ int i3 = socket1.async_send(buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ int i4 = socket1.async_send(buffer(const_char_buffer), lazy);
+ (void)i4;
+ int i5 = socket1.async_send(mutable_buffers, lazy);
+ (void)i5;
+ int i6 = socket1.async_send(const_buffers, lazy);
+ (void)i6;
+ int i7 = socket1.async_send(null_buffers(), lazy);
+ (void)i7;
+ int i8 = socket1.async_send(buffer(mutable_char_buffer), in_flags, lazy);
+ (void)i8;
+ int i9 = socket1.async_send(buffer(const_char_buffer), in_flags, lazy);
+ (void)i9;
+ int i10 = socket1.async_send(mutable_buffers, in_flags, lazy);
+ (void)i10;
+ int i11 = socket1.async_send(const_buffers, in_flags, lazy);
+ (void)i11;
+ int i12 = socket1.async_send(null_buffers(), in_flags, lazy);
+ (void)i12;
 
     socket1.receive(buffer(mutable_char_buffer));
     socket1.receive(mutable_buffers);
@@ -342,6 +383,19 @@
         &receive_handler);
     socket1.async_receive(mutable_buffers, in_flags, &receive_handler);
     socket1.async_receive(null_buffers(), in_flags, &receive_handler);
+ int i13 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
+ (void)i13;
+ int i14 = socket1.async_receive(mutable_buffers, lazy);
+ (void)i14;
+ int i15 = socket1.async_receive(null_buffers(), lazy);
+ (void)i15;
+ int i16 = socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ lazy);
+ (void)i16;
+ int i17 = socket1.async_receive(mutable_buffers, in_flags, lazy);
+ (void)i17;
+ int i18 = socket1.async_receive(null_buffers(), in_flags, lazy);
+ (void)i18;
 
     socket1.write_some(buffer(mutable_char_buffer));
     socket1.write_some(buffer(const_char_buffer));
@@ -359,6 +413,16 @@
     socket1.async_write_some(mutable_buffers, &write_some_handler);
     socket1.async_write_some(const_buffers, &write_some_handler);
     socket1.async_write_some(null_buffers(), &write_some_handler);
+ int i19 = socket1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i19;
+ int i20 = socket1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i20;
+ int i21 = socket1.async_write_some(mutable_buffers, lazy);
+ (void)i21;
+ int i22 = socket1.async_write_some(const_buffers, lazy);
+ (void)i22;
+ int i23 = socket1.async_write_some(null_buffers(), lazy);
+ (void)i23;
 
     socket1.read_some(buffer(mutable_char_buffer));
     socket1.read_some(mutable_buffers);
@@ -370,6 +434,12 @@
     socket1.async_read_some(buffer(mutable_char_buffer), &read_some_handler);
     socket1.async_read_some(mutable_buffers, &read_some_handler);
     socket1.async_read_some(null_buffers(), &read_some_handler);
+ int i24 = socket1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i24;
+ int i25 = socket1.async_read_some(mutable_buffers, lazy);
+ (void)i25;
+ int i26 = socket1.async_read_some(null_buffers(), lazy);
+ (void)i26;
   }
   catch (std::exception&)
   {
@@ -393,48 +463,48 @@
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_write_noop(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_read(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
 }
 
 void handle_write(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!err);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
 }
 
 void handle_read_cancel(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(err == boost::asio::error::operation_aborted);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(err == boost::asio::error::operation_aborted);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void handle_read_eof(const boost::system::error_code& err,
     size_t bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(err == boost::asio::error::eof);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(err == boost::asio::error::eof);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test()
@@ -443,6 +513,14 @@
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   io_service ios;
 
   ip::tcp::acceptor acceptor(ios, ip::tcp::endpoint(ip::tcp::v4(), 0));
@@ -460,27 +538,23 @@
   bool read_noop_completed = false;
   client_side_socket.async_read_some(
       boost::asio::mutable_buffers_1(0, 0),
- boost::bind(handle_read_noop,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_noop_completed));
+ bindns::bind(handle_read_noop,
+ _1, _2, &read_noop_completed));
 
   ios.run();
- BOOST_CHECK(read_noop_completed);
+ BOOST_ASIO_CHECK(read_noop_completed);
 
   // No-op write.
 
   bool write_noop_completed = false;
   client_side_socket.async_write_some(
       boost::asio::const_buffers_1(0, 0),
- boost::bind(handle_write_noop,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &write_noop_completed));
+ bindns::bind(handle_write_noop,
+ _1, _2, &write_noop_completed));
 
   ios.reset();
   ios.run();
- BOOST_CHECK(write_noop_completed);
+ BOOST_ASIO_CHECK(write_noop_completed);
 
   // Read and write to transfer data.
 
@@ -488,60 +562,52 @@
   bool read_completed = false;
   boost::asio::async_read(client_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_completed));
+ bindns::bind(handle_read,
+ _1, _2, &read_completed));
 
   bool write_completed = false;
   boost::asio::async_write(server_side_socket,
       boost::asio::buffer(write_data),
- boost::bind(handle_write,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &write_completed));
+ bindns::bind(handle_write,
+ _1, _2, &write_completed));
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_completed);
- BOOST_CHECK(write_completed);
- BOOST_CHECK(memcmp(read_buffer, write_data, sizeof(write_data)) == 0);
+ BOOST_ASIO_CHECK(read_completed);
+ BOOST_ASIO_CHECK(write_completed);
+ BOOST_ASIO_CHECK(memcmp(read_buffer, write_data, sizeof(write_data)) == 0);
 
   // Cancelled read.
 
   bool read_cancel_completed = false;
   boost::asio::async_read(server_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read_cancel,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_cancel_completed));
+ bindns::bind(handle_read_cancel,
+ _1, _2, &read_cancel_completed));
 
   ios.reset();
   ios.poll();
- BOOST_CHECK(!read_cancel_completed);
+ BOOST_ASIO_CHECK(!read_cancel_completed);
 
   server_side_socket.cancel();
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_cancel_completed);
+ BOOST_ASIO_CHECK(read_cancel_completed);
 
   // A read when the peer closes socket should fail with eof.
 
   bool read_eof_completed = false;
   boost::asio::async_read(client_side_socket,
       boost::asio::buffer(read_buffer),
- boost::bind(handle_read_eof,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- &read_eof_completed));
+ bindns::bind(handle_read_eof,
+ _1, _2, &read_eof_completed));
 
   server_side_socket.close();
 
   ios.reset();
   ios.run();
- BOOST_CHECK(read_eof_completed);
+ BOOST_ASIO_CHECK(read_eof_completed);
 }
 
 } // namespace ip_tcp_socket_runtime
@@ -576,6 +642,7 @@
     archetypes::gettable_socket_option<int> gettable_socket_option2;
     archetypes::gettable_socket_option<double> gettable_socket_option3;
     archetypes::io_control_command io_control_command;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_socket_acceptor constructors.
@@ -674,6 +741,10 @@
 
     acceptor1.async_accept(peer_socket, &accept_handler);
     acceptor1.async_accept(peer_socket, peer_endpoint, &accept_handler);
+ int i1 = acceptor1.async_accept(peer_socket, lazy);
+ (void)i1;
+ int i2 = acceptor1.async_accept(peer_socket, peer_endpoint, lazy);
+ (void)i2;
   }
   catch (std::exception&)
   {
@@ -693,12 +764,12 @@
 
 void handle_accept(const boost::system::error_code& err)
 {
- BOOST_CHECK(!err);
+ BOOST_ASIO_CHECK(!err);
 }
 
 void handle_connect(const boost::system::error_code& err)
 {
- BOOST_CHECK(!err);
+ BOOST_ASIO_CHECK(!err);
 }
 
 void test()
@@ -730,11 +801,12 @@
 
   ip::tcp::endpoint client_side_local_endpoint
     = client_side_socket.local_endpoint();
- BOOST_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
 
   ip::tcp::endpoint server_side_remote_endpoint
     = server_side_socket.remote_endpoint();
- BOOST_CHECK(server_side_remote_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(server_side_remote_endpoint.port()
+ == client_endpoint.port());
 
   client_side_socket.close();
   server_side_socket.close();
@@ -754,10 +826,11 @@
   ios.run();
 
   client_side_local_endpoint = client_side_socket.local_endpoint();
- BOOST_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
 
   server_side_remote_endpoint = server_side_socket.remote_endpoint();
- BOOST_CHECK(server_side_remote_endpoint.port() == client_endpoint.port());
+ BOOST_ASIO_CHECK(server_side_remote_endpoint.port()
+ == client_endpoint.port());
 }
 
 } // namespace ip_tcp_acceptor_runtime
@@ -784,6 +857,7 @@
   try
   {
     io_service ios;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
     ip::tcp::resolver::query q(ip::tcp::v4(), "localhost", "0");
     ip::tcp::endpoint e(ip::address_v4::loopback(), 0);
@@ -814,8 +888,12 @@
     (void)iter4;
 
     resolver.async_resolve(q, &resolve_handler);
+ int i1 = resolver.async_resolve(q, lazy);
+ (void)i1;
 
     resolver.async_resolve(e, &resolve_handler);
+ int i2 = resolver.async_resolve(e, lazy);
+ (void)i2;
   }
   catch (std::exception&)
   {
@@ -826,15 +904,14 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/tcp");
- test->add(BOOST_TEST_CASE(&ip_tcp_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_socket_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_socket_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_acceptor_compile::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_acceptor_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_tcp_resolver_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/tcp",
+ BOOST_ASIO_TEST_CASE(ip_tcp_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_socket_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_tcp_resolver_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // udp.cpp
 // ~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,15 +16,20 @@
 // Test that header file is self-contained.
 #include <boost/asio/ip/udp.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include "../unit_test.hpp"
 #include "../archetypes/gettable_socket_option.hpp"
+#include "../archetypes/async_result.hpp"
 #include "../archetypes/io_control_command.hpp"
 #include "../archetypes/settable_socket_option.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 //------------------------------------------------------------------------------
 
 // ip_udp_socket_compile test
@@ -64,6 +69,7 @@
     archetypes::gettable_socket_option<int> gettable_socket_option2;
     archetypes::gettable_socket_option<double> gettable_socket_option3;
     archetypes::io_control_command io_control_command;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_datagram_socket constructors.
@@ -152,6 +158,10 @@
         &connect_handler);
     socket1.async_connect(ip::udp::endpoint(ip::udp::v6(), 0),
         &connect_handler);
+ int i1 = socket1.async_connect(ip::udp::endpoint(ip::udp::v4(), 0), lazy);
+ (void)i1;
+ int i2 = socket1.async_connect(ip::udp::endpoint(ip::udp::v6(), 0), lazy);
+ (void)i2;
 
     socket1.set_option(settable_socket_option1);
     socket1.set_option(settable_socket_option1, ec);
@@ -207,6 +217,18 @@
     socket1.async_send(buffer(mutable_char_buffer), in_flags, &send_handler);
     socket1.async_send(buffer(const_char_buffer), in_flags, &send_handler);
     socket1.async_send(null_buffers(), in_flags, &send_handler);
+ int i3 = socket1.async_send(buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ int i4 = socket1.async_send(buffer(const_char_buffer), lazy);
+ (void)i4;
+ int i5 = socket1.async_send(null_buffers(), lazy);
+ (void)i5;
+ int i6 = socket1.async_send(buffer(mutable_char_buffer), in_flags, lazy);
+ (void)i6;
+ int i7 = socket1.async_send(buffer(const_char_buffer), in_flags, lazy);
+ (void)i7;
+ int i8 = socket1.async_send(null_buffers(), in_flags, lazy);
+ (void)i8;
 
     socket1.send_to(buffer(mutable_char_buffer),
         ip::udp::endpoint(ip::udp::v4(), 0));
@@ -269,6 +291,42 @@
         ip::udp::endpoint(ip::udp::v4(), 0), in_flags, &send_handler);
     socket1.async_send_to(null_buffers(),
         ip::udp::endpoint(ip::udp::v6(), 0), in_flags, &send_handler);
+ int i9 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), lazy);
+ (void)i9;
+ int i10 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), lazy);
+ (void)i10;
+ int i11 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), lazy);
+ (void)i11;
+ int i12 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), lazy);
+ (void)i12;
+ int i13 = socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v4(), 0), lazy);
+ (void)i13;
+ int i14 = socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v6(), 0), lazy);
+ (void)i14;
+ int i15 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, lazy);
+ (void)i15;
+ int i16 = socket1.async_send_to(buffer(mutable_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, lazy);
+ (void)i16;
+ int i17 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, lazy);
+ (void)i17;
+ int i18 = socket1.async_send_to(buffer(const_char_buffer),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, lazy);
+ (void)i18;
+ int i19 = socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v4(), 0), in_flags, lazy);
+ (void)i19;
+ int i20 = socket1.async_send_to(null_buffers(),
+ ip::udp::endpoint(ip::udp::v6(), 0), in_flags, lazy);
+ (void)i20;
 
     socket1.receive(buffer(mutable_char_buffer));
     socket1.receive(null_buffers());
@@ -282,6 +340,15 @@
     socket1.async_receive(buffer(mutable_char_buffer), in_flags,
         &receive_handler);
     socket1.async_receive(null_buffers(), in_flags, &receive_handler);
+ int i21 = socket1.async_receive(buffer(mutable_char_buffer), lazy);
+ (void)i21;
+ int i22 = socket1.async_receive(null_buffers(), lazy);
+ (void)i22;
+ int i23 = socket1.async_receive(buffer(mutable_char_buffer),
+ in_flags, lazy);
+ (void)i23;
+ int i24 = socket1.async_receive(null_buffers(), in_flags, lazy);
+ (void)i24;
 
     ip::udp::endpoint endpoint;
     socket1.receive_from(buffer(mutable_char_buffer), endpoint);
@@ -299,6 +366,18 @@
         endpoint, in_flags, &receive_handler);
     socket1.async_receive_from(null_buffers(),
         endpoint, in_flags, &receive_handler);
+ int i25 = socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, lazy);
+ (void)i25;
+ int i26 = socket1.async_receive_from(null_buffers(),
+ endpoint, lazy);
+ (void)i26;
+ int i27 = socket1.async_receive_from(buffer(mutable_char_buffer),
+ endpoint, in_flags, lazy);
+ (void)i27;
+ int i28 = socket1.async_receive_from(null_buffers(),
+ endpoint, in_flags, lazy);
+ (void)i28;
   }
   catch (std::exception&)
   {
@@ -318,15 +397,15 @@
 void handle_send(size_t expected_bytes_sent,
     const boost::system::error_code& err, size_t bytes_sent)
 {
- BOOST_CHECK(!err);
- BOOST_CHECK(expected_bytes_sent == bytes_sent);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(expected_bytes_sent == bytes_sent);
 }
 
 void handle_recv(size_t expected_bytes_recvd,
     const boost::system::error_code& err, size_t bytes_recvd)
 {
- BOOST_CHECK(!err);
- BOOST_CHECK(expected_bytes_recvd == bytes_recvd);
+ BOOST_ASIO_CHECK(!err);
+ BOOST_ASIO_CHECK(expected_bytes_recvd == bytes_recvd);
 }
 
 void test()
@@ -335,6 +414,14 @@
   using namespace boost::asio;
   namespace ip = boost::asio::ip;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   io_service ios;
 
   ip::udp::socket s1(ios, ip::udp::endpoint(ip::udp::v4(), 0));
@@ -352,24 +439,20 @@
   size_t bytes_recvd = s1.receive_from(buffer(recv_msg, sizeof(recv_msg)),
       sender_endpoint);
 
- BOOST_CHECK(bytes_recvd == sizeof(send_msg));
- BOOST_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
+ BOOST_ASIO_CHECK(bytes_recvd == sizeof(send_msg));
+ BOOST_ASIO_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
 
   memset(recv_msg, 0, sizeof(recv_msg));
 
   target_endpoint = sender_endpoint;
   s1.async_send_to(buffer(send_msg, sizeof(send_msg)), target_endpoint,
- boost::bind(handle_send, sizeof(send_msg),
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
+ bindns::bind(handle_send, sizeof(send_msg), _1, _2));
   s2.async_receive_from(buffer(recv_msg, sizeof(recv_msg)), sender_endpoint,
- boost::bind(handle_recv, sizeof(recv_msg),
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred));
+ bindns::bind(handle_recv, sizeof(recv_msg), _1, _2));
 
   ios.run();
 
- BOOST_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
+ BOOST_ASIO_CHECK(memcmp(send_msg, recv_msg, sizeof(send_msg)) == 0);
 }
 
 } // namespace ip_udp_socket_runtime
@@ -396,6 +479,7 @@
   try
   {
     io_service ios;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
     ip::udp::resolver::query q(ip::udp::v4(), "localhost", "0");
     ip::udp::endpoint e(ip::address_v4::loopback(), 0);
@@ -426,8 +510,12 @@
     (void)iter4;
 
     resolver.async_resolve(q, &resolve_handler);
+ int i1 = resolver.async_resolve(q, lazy);
+ (void)i1;
 
     resolver.async_resolve(e, &resolve_handler);
+ int i2 = resolver.async_resolve(e, lazy);
+ (void)i2;
   }
   catch (std::exception&)
   {
@@ -438,11 +526,10 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/udp");
- test->add(BOOST_TEST_CASE(&ip_udp_socket_compile::test));
- test->add(BOOST_TEST_CASE(&ip_udp_socket_runtime::test));
- test->add(BOOST_TEST_CASE(&ip_udp_resolver_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/udp",
+ BOOST_ASIO_TEST_CASE(ip_udp_socket_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_udp_socket_runtime::test)
+ BOOST_ASIO_TEST_CASE(ip_udp_resolver_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // unicast.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -84,78 +84,78 @@
   sock_v6.bind(ep_v6, ec);
   bool have_v6 = !ec;
 
- BOOST_CHECK(have_v4 || have_v6);
+ BOOST_ASIO_CHECK(have_v4 || have_v6);
 
   // hops class.
 
   if (have_v4)
   {
     ip::unicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v4.set_option(hops1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops2;
     sock_v4.get_option(hops2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops2.value() == 1);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops2.value() == 1);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops3(255);
- BOOST_CHECK(hops3.value() == 255);
+ BOOST_ASIO_CHECK(hops3.value() == 255);
     sock_v4.set_option(hops3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
     ip::unicast::hops hops4;
     sock_v4.get_option(hops4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
     // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
         ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops4.value() == 255);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops4.value() == 255);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   }
 
   if (have_v6)
   {
     ip::unicast::hops hops1(1);
- BOOST_CHECK(hops1.value() == 1);
+ BOOST_ASIO_CHECK(hops1.value() == 1);
     sock_v6.set_option(hops1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
     ip::unicast::hops hops2;
     sock_v6.get_option(hops2, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops2.value() == 1);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops2.value() == 1);
 
     ip::unicast::hops hops3(255);
- BOOST_CHECK(hops3.value() == 255);
+ BOOST_ASIO_CHECK(hops3.value() == 255);
     sock_v6.set_option(hops3, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
     ip::unicast::hops hops4;
     sock_v6.get_option(hops4, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(hops4.value() == 255);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(hops4.value() == 255);
   }
 }
 
@@ -163,10 +163,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/unicast");
- test->add(BOOST_TEST_CASE(&ip_unicast_compile::test));
- test->add(BOOST_TEST_CASE(&ip_unicast_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/unicast",
+ BOOST_ASIO_TEST_CASE(ip_unicast_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_unicast_runtime::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // v6_only.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -87,38 +87,38 @@
   {
     ip::v6_only v6_only1;
     acceptor_v6.get_option(v6_only1, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
     bool have_dual_stack = !v6_only1.value();
 
     if (have_dual_stack)
     {
       ip::v6_only v6_only2(false);
- BOOST_CHECK(!v6_only2.value());
- BOOST_CHECK(!static_cast<bool>(v6_only2));
- BOOST_CHECK(!v6_only2);
+ BOOST_ASIO_CHECK(!v6_only2.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(v6_only2));
+ BOOST_ASIO_CHECK(!v6_only2);
       acceptor_v6.set_option(v6_only2, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
       ip::v6_only v6_only3;
       acceptor_v6.get_option(v6_only3, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(!v6_only3.value());
- BOOST_CHECK(!static_cast<bool>(v6_only3));
- BOOST_CHECK(!v6_only3);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(!v6_only3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(v6_only3));
+ BOOST_ASIO_CHECK(!v6_only3);
 
       ip::v6_only v6_only4(true);
- BOOST_CHECK(v6_only4.value());
- BOOST_CHECK(static_cast<bool>(v6_only4));
- BOOST_CHECK(!!v6_only4);
+ BOOST_ASIO_CHECK(v6_only4.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(v6_only4));
+ BOOST_ASIO_CHECK(!!v6_only4);
       acceptor_v6.set_option(v6_only4, ec);
- BOOST_CHECK(!ec);
+ BOOST_ASIO_CHECK(!ec);
 
       ip::v6_only v6_only5;
       acceptor_v6.get_option(v6_only5, ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(v6_only5.value());
- BOOST_CHECK(static_cast<bool>(v6_only5));
- BOOST_CHECK(!!v6_only5);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(v6_only5.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(v6_only5));
+ BOOST_ASIO_CHECK(!!v6_only5);
     }
   }
 }
@@ -127,10 +127,9 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ip/v6_only");
- test->add(BOOST_TEST_CASE(&ip_v6_only_compile::test));
- test->add(BOOST_TEST_CASE(&ip_v6_only_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ip/v6_only",
+ BOOST_ASIO_TEST_CASE(ip_v6_only_compile::test)
+ BOOST_ASIO_TEST_CASE(ip_v6_only_runtime::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // is_read_buffered.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/is_read_buffered.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/asio/buffered_read_stream.hpp>
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/io_service.hpp>
@@ -27,7 +25,6 @@
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -95,35 +92,34 @@
 
 void is_read_buffered_test()
 {
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::ip::tcp::socket>::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_read_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::buffered_write_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_stream<boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<test_stream>::value);
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<test_stream>::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_read_stream<test_stream> >::value);
 
- BOOST_CHECK(!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_read_buffered<
       boost::asio::buffered_write_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_read_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_read_buffered<
       boost::asio::buffered_stream<test_stream> >::value);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("is_read_buffered");
- test->add(BOOST_TEST_CASE(&is_read_buffered_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "is_read_buffered",
+ BOOST_ASIO_TEST_CASE(is_read_buffered_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // is_write_buffered.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/is_write_buffered.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/asio/buffered_read_stream.hpp>
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/io_service.hpp>
@@ -27,7 +25,6 @@
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -95,35 +92,34 @@
 
 void is_write_buffered_test()
 {
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::ip::tcp::socket>::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::buffered_read_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_write_stream<
         boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_stream<boost::asio::ip::tcp::socket> >::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<test_stream>::value);
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<test_stream>::value);
 
- BOOST_CHECK(!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!boost::asio::is_write_buffered<
       boost::asio::buffered_read_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_write_stream<test_stream> >::value);
 
- BOOST_CHECK(!!boost::asio::is_write_buffered<
+ BOOST_ASIO_CHECK(!!boost::asio::is_write_buffered<
       boost::asio::buffered_stream<test_stream> >::value);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("is_write_buffered");
- test->add(BOOST_TEST_CASE(&is_write_buffered_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "is_write_buffered",
+ BOOST_ASIO_TEST_CASE(is_write_buffered_test)
+)

Modified: branches/release/libs/asio/test/latency/allocator.hpp
==============================================================================
--- branches/release/libs/asio/test/latency/allocator.hpp (original)
+++ branches/release/libs/asio/test/latency/allocator.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // allocator.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/coroutine.hpp
==============================================================================
--- branches/release/libs/asio/test/latency/coroutine.hpp (original)
+++ branches/release/libs/asio/test/latency/coroutine.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // coroutine.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/high_res_clock.hpp
==============================================================================
--- branches/release/libs/asio/test/latency/high_res_clock.hpp (original)
+++ branches/release/libs/asio/test/latency/high_res_clock.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // high_res_clock.hpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
 #include <boost/config.hpp>
 #include <boost/cstdint.hpp>
 
-#if defined(BOOST_WINDOWS)
+#if defined(BOOST_ASIO_WINDOWS)
 
 inline boost::uint64_t high_res_clock()
 {

Modified: branches/release/libs/asio/test/latency/tcp_client.cpp
==============================================================================
--- branches/release/libs/asio/test/latency/tcp_client.cpp (original)
+++ branches/release/libs/asio/test/latency/tcp_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // tcp_client.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/tcp_server.cpp
==============================================================================
--- branches/release/libs/asio/test/latency/tcp_server.cpp (original)
+++ branches/release/libs/asio/test/latency/tcp_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // tcp_server.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/udp_client.cpp
==============================================================================
--- branches/release/libs/asio/test/latency/udp_client.cpp (original)
+++ branches/release/libs/asio/test/latency/udp_client.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // udp_client.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/udp_server.cpp
==============================================================================
--- branches/release/libs/asio/test/latency/udp_server.cpp (original)
+++ branches/release/libs/asio/test/latency/udp_server.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // udp_server.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/unyield.hpp
==============================================================================
--- branches/release/libs/asio/test/latency/unyield.hpp (original)
+++ branches/release/libs/asio/test/latency/unyield.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // unyield.hpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/latency/yield.hpp
==============================================================================
--- branches/release/libs/asio/test/latency/yield.hpp (original)
+++ branches/release/libs/asio/test/latency/yield.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // yield.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Modified: branches/release/libs/asio/test/local/basic_endpoint.cpp
==============================================================================
--- branches/release/libs/asio/test/local/basic_endpoint.cpp (original)
+++ branches/release/libs/asio/test/local/basic_endpoint.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_endpoint.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/basic_endpoint");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/basic_endpoint",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // connect_pair.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -70,9 +70,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/connect_pair");
- test->add(BOOST_TEST_CASE(&local_connect_pair_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/connect_pair",
+ BOOST_ASIO_TEST_CASE(local_connect_pair_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // datagram_protocol.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/local/datagram_protocol.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
 #include "../unit_test.hpp"
@@ -225,9 +224,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/datagram_protocol");
- test->add(BOOST_TEST_CASE(&local_datagram_protocol_socket_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/datagram_protocol",
+ BOOST_ASIO_TEST_CASE(local_datagram_protocol_socket_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_protocol.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
 // Test that header file is self-contained.
 #include <boost/asio/local/stream_protocol.hpp>
 
-#include <boost/bind.hpp>
 #include <cstring>
 #include <boost/asio/io_service.hpp>
 #include "../unit_test.hpp"
@@ -202,9 +201,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("local/stream_protocol");
- test->add(BOOST_TEST_CASE(&local_stream_protocol_socket_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "local/stream_protocol",
+ BOOST_ASIO_TEST_CASE(local_stream_protocol_socket_compile::test)
+)

Modified: branches/release/libs/asio/test/placeholders.cpp
==============================================================================
--- branches/release/libs/asio/test/placeholders.cpp (original)
+++ branches/release/libs/asio/test/placeholders.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // placeholders.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("placeholders");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "placeholders",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_descriptor.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/basic_descriptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/basic_descriptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_stream_descriptor.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/basic_stream_descriptor");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/basic_stream_descriptor",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // descriptor_base.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/descriptor_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/descriptor_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_descriptor.cpp
 // ~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/posix/stream_descriptor.hpp>
 
 #include <boost/asio/io_service.hpp>
+#include "../archetypes/async_result.hpp"
 #include "../unit_test.hpp"
 
 //------------------------------------------------------------------------------
@@ -49,6 +50,7 @@
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
     posix::descriptor_base::bytes_readable io_control_command;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_stream_descriptor constructors.
@@ -136,6 +138,12 @@
         write_some_handler);
     descriptor1.async_write_some(null_buffers(),
         write_some_handler);
+ int i1 = descriptor1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = descriptor1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i2;
+ int i3 = descriptor1.async_write_some(null_buffers(), lazy);
+ (void)i3;
 
     descriptor1.read_some(buffer(mutable_char_buffer));
     descriptor1.read_some(buffer(mutable_char_buffer), ec);
@@ -143,6 +151,10 @@
 
     descriptor1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
     descriptor1.async_read_some(null_buffers(), read_some_handler);
+ int i4 = descriptor1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i4;
+ int i5 = descriptor1.async_read_some(null_buffers(), lazy);
+ (void)i5;
   }
   catch (std::exception&)
   {
@@ -153,9 +165,9 @@
 } // namespace posix_stream_descriptor_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/stream_descriptor");
- test->add(BOOST_TEST_CASE(&posix_stream_descriptor_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/stream_descriptor",
+ BOOST_ASIO_TEST_CASE(posix_stream_descriptor_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_descriptor_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("posix/stream_descriptor_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "posix/stream_descriptor_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/raw_socket_service.cpp
==============================================================================
--- branches/release/libs/asio/test/raw_socket_service.cpp (original)
+++ branches/release/libs/asio/test/raw_socket_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // raw_socket_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("raw_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "raw_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/read.cpp
==============================================================================
--- branches/release/libs/asio/test/read.cpp (original)
+++ branches/release/libs/asio/test/read.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read.cpp
 // ~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,23 +16,30 @@
 // Test that header file is self-contained.
 #include <boost/asio/read.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include <vector>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -52,7 +59,7 @@
 
   void reset(const void* data, size_t length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memcpy(data_, data, length);
     length_ = length;
@@ -133,7 +140,7 @@
   std::vector<boost::asio::mutable_buffer> buffers;
 
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_2_arg_mutable_buffers_1_read()
@@ -147,22 +154,22 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_2_arg_vector_buffers_read()
@@ -177,22 +184,22 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_2_arg_streambuf_read()
@@ -204,25 +211,25 @@
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_3_arg_nothrow_zero_buffers_read()
@@ -233,8 +240,8 @@
 
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == 0);
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_mutable_buffers_1_read()
@@ -249,25 +256,25 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_vector_buffers_read()
@@ -283,25 +290,25 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_streambuf_read()
@@ -314,28 +321,28 @@
   sb.consume(sb.size());
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -362,202 +369,202 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_vector_buffers_read()
@@ -573,202 +580,202 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_read()
@@ -781,229 +788,229 @@
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_mutable_buffers_1_read()
@@ -1019,9 +1026,9 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1029,9 +1036,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1039,18 +1046,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1058,9 +1065,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1068,18 +1075,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1087,9 +1094,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1097,18 +1104,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1116,9 +1123,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1126,18 +1133,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1145,9 +1152,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1155,18 +1162,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1174,9 +1181,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1184,18 +1191,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1203,9 +1210,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1213,17 +1220,17 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1231,9 +1238,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1241,34 +1248,34 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_vector_buffers_read()
@@ -1285,9 +1292,9 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1295,9 +1302,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1305,18 +1312,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1324,9 +1331,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1334,18 +1341,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1353,9 +1360,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1363,18 +1370,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1382,9 +1389,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1392,18 +1399,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1411,9 +1418,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1421,18 +1428,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1440,9 +1447,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1450,18 +1457,18 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1469,9 +1476,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1479,17 +1486,17 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1497,9 +1504,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1507,34 +1514,34 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_streambuf_read()
@@ -1548,10 +1555,10 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1559,10 +1566,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1570,20 +1577,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1591,10 +1598,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1602,20 +1609,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1623,10 +1630,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1634,20 +1641,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1655,10 +1662,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1666,20 +1673,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1687,10 +1694,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1698,20 +1705,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1719,10 +1726,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1730,20 +1737,20 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1751,10 +1758,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1762,19 +1769,19 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1782,10 +1789,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1793,50 +1800,58 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read(s, sb, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_read_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_3_arg_mutable_buffers_1_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -1847,46 +1862,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_boost_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -1898,46 +1924,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_3_arg_std_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -1950,47 +1987,57 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_3_arg_vector_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2002,46 +2049,56 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -2050,49 +2107,60 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ sb.consume(sb.size());
+ int i = boost::asio::async_read(s, sb, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2103,374 +2171,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -2482,374 +2514,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -2862,375 +2858,338 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   char read_buf[sizeof(read_data)];
@@ -3242,374 +3201,337 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read(s, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read(s, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_async_read()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -3618,425 +3540,380 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read(s, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
- ios.reset();
- ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
-}
-
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read");
- test->add(BOOST_TEST_CASE(&test_2_arg_zero_buffers_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_2_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_zero_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_boost_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_std_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_read));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_read));
- return test;
-}
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ sb.consume(sb.size());
+ int i = boost::asio::async_read(s, sb,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
+}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "read",
+ BOOST_ASIO_TEST_CASE(test_2_arg_zero_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_2_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_zero_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_boost_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_std_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_read)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_read)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read_at.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,22 +16,29 @@
 // Test that header file is self-contained.
 #include <boost/asio/read_at.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_random_access_device
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -50,7 +57,7 @@
 
   void reset(const void* data, size_t length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     length_ = 0;
     while (length_ + length < max_length)
@@ -68,7 +75,7 @@
   }
 
   template <typename Const_Buffers>
- bool check_buffers(boost::uint64_t offset,
+ bool check_buffers(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, size_t length)
   {
     if (offset + length > max_length)
@@ -92,7 +99,8 @@
   }
 
   template <typename Mutable_Buffers>
- size_t read_some_at(boost::uint64_t offset, const Mutable_Buffers& buffers)
+ size_t read_some_at(boost::asio::uint64_t offset,
+ const Mutable_Buffers& buffers)
   {
     return boost::asio::buffer_copy(buffers,
         boost::asio::buffer(data_, length_) + offset,
@@ -100,7 +108,7 @@
   }
 
   template <typename Mutable_Buffers>
- size_t read_some_at(boost::uint64_t offset,
+ size_t read_some_at(boost::asio::uint64_t offset,
       const Mutable_Buffers& buffers, boost::system::error_code& ec)
   {
     ec = boost::system::error_code();
@@ -108,7 +116,7 @@
   }
 
   template <typename Mutable_Buffers, typename Handler>
- void async_read_some_at(boost::uint64_t offset,
+ void async_read_some_at(boost::asio::uint64_t offset,
       const Mutable_Buffers& buffers, Handler handler)
   {
     size_t bytes_transferred = read_some_at(offset, buffers);
@@ -138,42 +146,42 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_3_arg_vector_buffers_read_at()
@@ -188,42 +196,42 @@
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_3_arg_streambuf_read_at()
@@ -235,48 +243,48 @@
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_4_arg_nothrow_mutable_buffers_1_read_at()
@@ -291,48 +299,48 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_vector_buffers_read_at()
@@ -348,48 +356,48 @@
   memset(read_buf, 0, sizeof(read_buf));
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_streambuf_read_at()
@@ -402,54 +410,54 @@
   sb.consume(sb.size());
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -476,409 +484,409 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_vector_buffers_read_at()
@@ -894,409 +902,409 @@
   memset(read_buf, 0, sizeof(read_buf));
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_read_at()
@@ -1309,463 +1317,463 @@
   sb.consume(sb.size());
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_5_arg_mutable_buffers_1_read_at()
@@ -1781,17 +1789,17 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1799,9 +1807,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1809,9 +1817,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1819,9 +1827,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1829,27 +1837,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1857,9 +1865,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1867,9 +1875,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1877,9 +1885,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1887,27 +1895,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1915,9 +1923,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1925,9 +1933,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1935,9 +1943,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1945,27 +1953,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1973,9 +1981,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -1983,9 +1991,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -1993,9 +2001,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2003,27 +2011,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2031,9 +2039,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2041,9 +2049,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2051,9 +2059,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2061,27 +2069,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2089,9 +2097,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2099,9 +2107,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2109,9 +2117,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2119,27 +2127,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2147,9 +2155,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2157,9 +2165,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2167,9 +2175,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2177,25 +2185,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2203,9 +2211,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2213,9 +2221,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2223,9 +2231,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2233,25 +2241,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2259,9 +2267,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2269,9 +2277,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2279,9 +2287,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2289,9 +2297,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_vector_buffers_read_at()
@@ -2308,17 +2316,17 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2326,9 +2334,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2336,9 +2344,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2346,9 +2354,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2356,27 +2364,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2384,9 +2392,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2394,9 +2402,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2404,9 +2412,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2414,27 +2422,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2442,9 +2450,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2452,9 +2460,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2462,9 +2470,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2472,27 +2480,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2500,9 +2508,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2510,9 +2518,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2520,9 +2528,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2530,27 +2538,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2558,9 +2566,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2568,9 +2576,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2578,9 +2586,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2588,27 +2596,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2616,9 +2624,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2626,9 +2634,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2636,9 +2644,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2646,27 +2654,27 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2674,9 +2682,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2684,9 +2692,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2694,9 +2702,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2704,25 +2712,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2730,9 +2738,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2740,9 +2748,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2750,9 +2758,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2760,25 +2768,25 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2786,9 +2794,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2796,9 +2804,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2806,9 +2814,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2816,9 +2824,9 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_streambuf_read_at()
@@ -2832,19 +2840,19 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2852,10 +2860,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2863,10 +2871,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2874,10 +2882,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2885,30 +2893,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2916,10 +2924,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2927,10 +2935,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2938,10 +2946,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -2949,30 +2957,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2980,10 +2988,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -2991,10 +2999,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3002,10 +3010,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3013,30 +3021,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3044,10 +3052,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3055,10 +3063,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3066,10 +3074,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3077,30 +3085,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3108,10 +3116,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3119,10 +3127,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3130,10 +3138,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3141,30 +3149,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3172,10 +3180,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3183,10 +3191,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3194,10 +3202,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3205,30 +3213,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3236,10 +3244,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3247,10 +3255,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3258,10 +3266,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3269,28 +3277,28 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3298,10 +3306,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3309,10 +3317,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3320,10 +3328,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3331,28 +3339,28 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3360,10 +3368,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3371,10 +3379,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3382,10 +3390,10 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 0, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3393,22 +3401,30 @@
   error = boost::system::error_code();
   bytes_transferred = boost::asio::read_at(s, 1234, sb,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_read_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_4_arg_mutable_buffers_1_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3419,87 +3435,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3511,87 +3533,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -3604,88 +3632,93 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3697,87 +3730,92 @@
   memset(read_buf, 0, sizeof(read_buf));
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_4_arg_streambuf_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -3786,93 +3824,98 @@
   sb.consume(sb.size());
   bool called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ sb.consume(sb.size());
+ int i = boost::asio::async_read_at(s, 1234, sb,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
 void test_5_arg_mutable_buffers_1_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -3884,28 +3927,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3913,14 +3952,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -3928,14 +3965,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3943,14 +3978,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -3958,42 +3991,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4001,14 +4028,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4016,14 +4041,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4031,14 +4054,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4046,42 +4067,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4089,14 +4104,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4104,14 +4117,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4119,14 +4130,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4134,42 +4143,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4177,14 +4180,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4192,14 +4193,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4207,14 +4206,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4222,42 +4219,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4265,14 +4256,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4280,14 +4269,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4295,14 +4282,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4310,42 +4295,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4353,14 +4332,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4368,14 +4345,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4383,14 +4358,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4398,42 +4371,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4441,14 +4408,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4456,14 +4421,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4471,14 +4434,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4486,182 +4447,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_5_arg_boost_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -4674,28 +4627,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4703,14 +4652,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4718,14 +4665,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4733,14 +4678,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4748,42 +4691,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4791,14 +4728,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4806,14 +4741,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4821,14 +4754,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4836,42 +4767,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4879,14 +4804,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4894,14 +4817,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4909,14 +4830,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4924,42 +4843,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4967,14 +4880,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -4982,14 +4893,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -4997,14 +4906,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5012,42 +4919,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5055,14 +4956,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5070,14 +4969,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5085,14 +4982,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5100,42 +4995,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5143,14 +5032,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5158,14 +5045,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5173,14 +5058,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5188,42 +5071,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5231,14 +5108,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5246,14 +5121,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5261,14 +5134,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5276,182 +5147,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_5_arg_std_array_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -5465,28 +5328,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5494,14 +5353,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5509,14 +5366,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5524,14 +5379,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5539,42 +5392,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5582,14 +5429,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5597,14 +5442,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5612,14 +5455,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5627,42 +5468,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5670,14 +5505,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5685,14 +5518,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5700,14 +5531,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5715,42 +5544,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5758,14 +5581,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5773,14 +5594,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5788,14 +5607,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5803,42 +5620,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5846,14 +5657,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5861,14 +5670,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5876,14 +5683,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5891,42 +5696,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5934,14 +5733,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -5949,14 +5746,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5964,14 +5759,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -5979,42 +5772,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6022,14 +5809,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6037,14 +5822,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6052,14 +5835,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6067,183 +5848,174 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_5_arg_vector_buffers_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
@@ -6256,28 +6028,24 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6285,14 +6053,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6300,14 +6066,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6315,14 +6079,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6330,42 +6092,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6373,14 +6129,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6388,14 +6142,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6403,14 +6155,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6418,42 +6168,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6461,14 +6205,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6476,14 +6218,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6491,14 +6231,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6506,42 +6244,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6549,14 +6281,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6564,14 +6294,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6579,14 +6307,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6594,42 +6320,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6637,14 +6357,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6652,14 +6370,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6667,14 +6383,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6682,42 +6396,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6725,14 +6433,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6740,14 +6446,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6755,14 +6459,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6770,42 +6472,36 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6813,14 +6509,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -6828,14 +6522,12 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6843,14 +6535,12 @@
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -6858,182 +6548,173 @@
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 0, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ int i = boost::asio::async_read_at(s, 1234, buffers,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
 void test_5_arg_streambuf_async_read_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::streambuf sb(sizeof(read_data));
@@ -7043,30 +6724,26 @@
   bool called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7074,15 +6751,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7090,15 +6765,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7106,15 +6779,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7122,45 +6793,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_all(),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7168,15 +6833,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7184,15 +6847,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7200,15 +6861,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7216,45 +6875,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7262,15 +6915,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7278,15 +6929,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7294,15 +6943,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7310,45 +6957,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7356,15 +6997,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7372,15 +7011,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7388,15 +7025,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7404,45 +7039,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_at_least(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 50));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7450,15 +7079,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7466,15 +7093,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7482,15 +7107,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7498,45 +7121,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(1),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 1);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7544,15 +7161,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7560,15 +7175,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7576,15 +7189,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7592,45 +7203,39 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(10),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7638,15 +7243,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -7654,15 +7257,13 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7670,15 +7271,13 @@
   called = false;
   boost::asio::async_read_at(s, 0, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -7686,217 +7285,199 @@
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
       boost::asio::transfer_exactly(42),
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_read_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 42);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, old_style_transfer_all,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb, short_transfer,
- boost::bind(async_read_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ bindns::bind(async_read_handler,
+ _1, _2, sizeof(read_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
-}
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(sb.size() == sizeof(read_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read_at");
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_streambuf_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_boost_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_std_array_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_async_read_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_streambuf_async_read_at));
- return test;
+ s.reset(read_data, sizeof(read_data));
+ sb.consume(sb.size());
+ int i = boost::asio::async_read_at(s, 1234, sb,
+ short_transfer, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
+
+BOOST_ASIO_TEST_SUITE
+(
+ "read_at",
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_boost_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_std_array_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_async_read_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_async_read_at)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // read_until.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,16 +16,19 @@
 // Test that header file is self-contained.
 #include <boost/asio/read_until.hpp>
 
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
 #include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -47,7 +50,7 @@
   {
     using namespace std; // For memcpy.
 
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memcpy(data_, data, length);
     length_ = length;
@@ -109,79 +112,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z');
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, 'Z', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Z', ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, 'Y', ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 void test_string_read_until()
@@ -195,79 +198,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ");
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, "XYZ", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "XYZ", ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, "WXY", ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 class match_char
@@ -293,7 +296,9 @@
 namespace boost {
 namespace asio {
   template <> struct is_match_condition<match_char>
- : public boost::true_type {};
+ {
+ enum { value = true };
+ };
 } // namespace asio
 } // namespace boost
 
@@ -308,79 +313,79 @@
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   std::size_t length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'));
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb1.consume(sb1.size());
   length = boost::asio::read_until(s, sb1, match_char('Z'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Z'), ec);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb2.consume(sb2.size());
   length = boost::asio::read_until(s, sb2, match_char('Y'), ec);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 }
 
 void async_read_handler(
@@ -394,6 +399,14 @@
 
 void test_char_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -408,13 +421,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -423,13 +436,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -438,13 +451,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -452,13 +465,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -467,13 +480,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -482,13 +495,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Z',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -496,13 +509,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -511,13 +524,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -526,17 +539,33 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, 'Y',
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
+
+ s.reset(read_data, sizeof(read_data));
+ sb2.consume(sb2.size());
+ int i = boost::asio::async_read_until(s, sb2, 'Y',
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
 }
 
 void test_string_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -551,13 +580,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -566,13 +595,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -581,13 +610,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -595,13 +624,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -610,13 +639,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -625,13 +654,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "XYZ",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -639,13 +668,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -654,13 +683,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -669,17 +698,33 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, "WXY",
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
+
+ s.reset(read_data, sizeof(read_data));
+ sb2.consume(sb2.size());
+ int i = boost::asio::async_read_until(s, sb2, "WXY",
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
 }
 
 void test_match_condition_async_read_until()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::streambuf sb1;
@@ -694,13 +739,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -709,13 +754,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -724,13 +769,13 @@
   called = false;
   sb1.consume(sb1.size());
   boost::asio::async_read_until(s, sb1, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 26);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 26);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -738,13 +783,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -753,13 +798,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -768,13 +813,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Z'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(ec == boost::asio::error::not_found);
- BOOST_CHECK(length == 0);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(ec == boost::asio::error::not_found);
+ BOOST_ASIO_CHECK(length == 0);
 
   s.reset(read_data, sizeof(read_data));
   ec = boost::system::error_code();
@@ -782,13 +827,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
@@ -797,13 +842,13 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
@@ -812,23 +857,30 @@
   called = false;
   sb2.consume(sb2.size());
   boost::asio::async_read_until(s, sb2, match_char('Y'),
- boost::bind(async_read_handler, boost::asio::placeholders::error, &ec,
- boost::asio::placeholders::bytes_transferred, &length, &called));
+ bindns::bind(async_read_handler, _1, &ec,
+ _2, &length, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(!ec);
- BOOST_CHECK(length == 25);
-}
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(!ec);
+ BOOST_ASIO_CHECK(length == 25);
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("read_until");
- test->add(BOOST_TEST_CASE(&test_char_read_until));
- test->add(BOOST_TEST_CASE(&test_string_read_until));
- test->add(BOOST_TEST_CASE(&test_match_condition_read_until));
- test->add(BOOST_TEST_CASE(&test_char_async_read_until));
- test->add(BOOST_TEST_CASE(&test_string_async_read_until));
- test->add(BOOST_TEST_CASE(&test_match_condition_async_read_until));
- return test;
+ s.reset(read_data, sizeof(read_data));
+ sb2.consume(sb2.size());
+ int i = boost::asio::async_read_until(s, sb2, match_char('Y'),
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
 }
+
+BOOST_ASIO_TEST_SUITE
+(
+ "read_until",
+ BOOST_ASIO_TEST_CASE(test_char_read_until)
+ BOOST_ASIO_TEST_CASE(test_string_read_until)
+ BOOST_ASIO_TEST_CASE(test_match_condition_read_until)
+ BOOST_ASIO_TEST_CASE(test_char_async_read_until)
+ BOOST_ASIO_TEST_CASE(test_string_async_read_until)
+ BOOST_ASIO_TEST_CASE(test_match_condition_async_read_until)
+)

Modified: branches/release/libs/asio/test/seq_packet_socket_service.cpp
==============================================================================
--- branches/release/libs/asio/test/seq_packet_socket_service.cpp (original)
+++ branches/release/libs/asio/test/seq_packet_socket_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // seq_packet_socket_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("seq_packet_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "seq_packet_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -17,6 +17,7 @@
 // Test that header file is self-contained.
 #include <boost/asio/serial_port.hpp>
 
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
 #include "unit_test.hpp"
 
@@ -48,6 +49,7 @@
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
     serial_port::baud_rate serial_port_option;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_serial_port constructors.
@@ -121,11 +123,17 @@
 
     port1.async_write_some(buffer(mutable_char_buffer), &write_some_handler);
     port1.async_write_some(buffer(const_char_buffer), &write_some_handler);
+ int i1 = port1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = port1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i2;
 
     port1.read_some(buffer(mutable_char_buffer));
     port1.read_some(buffer(mutable_char_buffer), ec);
 
     port1.async_read_some(buffer(mutable_char_buffer), &read_some_handler);
+ int i3 = port1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i3;
   }
   catch (std::exception&)
   {
@@ -137,9 +145,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port");
- test->add(BOOST_TEST_CASE(&serial_port_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port",
+ BOOST_ASIO_TEST_CASE(serial_port_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port_base.cpp
 // ~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -92,9 +92,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port_base");
- test->add(BOOST_TEST_CASE(&serial_port_base_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port_base",
+ BOOST_ASIO_TEST_CASE(serial_port_base_compile::test)
+)

Modified: branches/release/libs/asio/test/serial_port_service.cpp
==============================================================================
--- branches/release/libs/asio/test/serial_port_service.cpp (original)
+++ branches/release/libs/asio/test/serial_port_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // serial_port_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 // Copyright (c) 2008 Rep Invariant Systems, Inc. (info_at_[hidden])
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -19,9 +19,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("serial_port_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "serial_port_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/signal_set.cpp
==============================================================================
--- branches/release/libs/asio/test/signal_set.cpp (original)
+++ branches/release/libs/asio/test/signal_set.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // signal_set.cpp
 // ~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +16,7 @@
 // Test that header file is self-contained.
 #include <boost/asio/signal_set.hpp>
 
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
 #include "unit_test.hpp"
 
@@ -39,6 +40,7 @@
   try
   {
     io_service ios;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_signal_set constructors.
@@ -68,6 +70,8 @@
     set1.cancel(ec);
 
     set1.async_wait(&signal_handler);
+ int i = set1.async_wait(lazy);
+ (void)i;
   }
   catch (std::exception&)
   {
@@ -78,9 +82,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("signal_set");
- test->add(BOOST_TEST_CASE(&signal_set_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "signal_set",
+ BOOST_ASIO_TEST_CASE(signal_set_compile::test)
+)

Modified: branches/release/libs/asio/test/signal_set_service.cpp
==============================================================================
--- branches/release/libs/asio/test/signal_set_service.cpp (original)
+++ branches/release/libs/asio/test/signal_set_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // signal_set_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("signal_set_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "signal_set_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/socket_acceptor_service.cpp
==============================================================================
--- branches/release/libs/asio/test/socket_acceptor_service.cpp (original)
+++ branches/release/libs/asio/test/socket_acceptor_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // socket_acceptor_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("socket_acceptor_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "socket_acceptor_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // socket_base.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -208,448 +208,447 @@
   // broadcast class.
 
   socket_base::broadcast broadcast1(true);
- BOOST_CHECK(broadcast1.value());
- BOOST_CHECK(static_cast<bool>(broadcast1));
- BOOST_CHECK(!!broadcast1);
+ BOOST_ASIO_CHECK(broadcast1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(broadcast1));
+ BOOST_ASIO_CHECK(!!broadcast1);
   udp_sock.set_option(broadcast1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::broadcast broadcast2;
   udp_sock.get_option(broadcast2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(broadcast2.value());
- BOOST_CHECK(static_cast<bool>(broadcast2));
- BOOST_CHECK(!!broadcast2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(broadcast2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(broadcast2));
+ BOOST_ASIO_CHECK(!!broadcast2);
 
   socket_base::broadcast broadcast3(false);
- BOOST_CHECK(!broadcast3.value());
- BOOST_CHECK(!static_cast<bool>(broadcast3));
- BOOST_CHECK(!broadcast3);
+ BOOST_ASIO_CHECK(!broadcast3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(broadcast3));
+ BOOST_ASIO_CHECK(!broadcast3);
   udp_sock.set_option(broadcast3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::broadcast broadcast4;
   udp_sock.get_option(broadcast4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!broadcast4.value());
- BOOST_CHECK(!static_cast<bool>(broadcast4));
- BOOST_CHECK(!broadcast4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!broadcast4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(broadcast4));
+ BOOST_ASIO_CHECK(!broadcast4);
 
   // debug class.
 
   socket_base::debug debug1(true);
- BOOST_CHECK(debug1.value());
- BOOST_CHECK(static_cast<bool>(debug1));
- BOOST_CHECK(!!debug1);
+ BOOST_ASIO_CHECK(debug1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(debug1));
+ BOOST_ASIO_CHECK(!!debug1);
   udp_sock.set_option(debug1, ec);
 #if defined(__linux__)
   // On Linux, only root can set SO_DEBUG.
   bool not_root = (ec == boost::asio::error::access_denied);
- BOOST_CHECK(!ec || not_root);
- BOOST_WARN_MESSAGE(!ec, "Must be root to set debug socket option");
+ BOOST_ASIO_CHECK(!ec || not_root);
+ BOOST_ASIO_WARN_MESSAGE(!ec, "Must be root to set debug socket option");
 #else // defined(__linux__)
-# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug2;
   udp_sock.get_option(debug2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 # if defined(__linux__)
- BOOST_CHECK(debug2.value() || not_root);
- BOOST_CHECK(static_cast<bool>(debug2) || not_root);
- BOOST_CHECK(!!debug2 || not_root);
+ BOOST_ASIO_CHECK(debug2.value() || not_root);
+ BOOST_ASIO_CHECK(static_cast<bool>(debug2) || not_root);
+ BOOST_ASIO_CHECK(!!debug2 || not_root);
 # else // defined(__linux__)
- BOOST_CHECK(debug2.value());
- BOOST_CHECK(static_cast<bool>(debug2));
- BOOST_CHECK(!!debug2);
+ BOOST_ASIO_CHECK(debug2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(debug2));
+ BOOST_ASIO_CHECK(!!debug2);
 # endif // defined(__linux__)
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::debug debug3(false);
- BOOST_CHECK(!debug3.value());
- BOOST_CHECK(!static_cast<bool>(debug3));
- BOOST_CHECK(!debug3);
+ BOOST_ASIO_CHECK(!debug3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug3));
+ BOOST_ASIO_CHECK(!debug3);
   udp_sock.set_option(debug3, ec);
 #if defined(__linux__)
- BOOST_CHECK(!ec || not_root);
+ BOOST_ASIO_CHECK(!ec || not_root);
 #else // defined(__linux__)
-# if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-# else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-# endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+# else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+# endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 #endif // defined(__linux__)
 
   socket_base::debug debug4;
   udp_sock.get_option(debug4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 # if defined(__linux__)
- BOOST_CHECK(!debug4.value() || not_root);
- BOOST_CHECK(!static_cast<bool>(debug4) || not_root);
- BOOST_CHECK(!debug4 || not_root);
+ BOOST_ASIO_CHECK(!debug4.value() || not_root);
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug4) || not_root);
+ BOOST_ASIO_CHECK(!debug4 || not_root);
 # else // defined(__linux__)
- BOOST_CHECK(!debug4.value());
- BOOST_CHECK(!static_cast<bool>(debug4));
- BOOST_CHECK(!debug4);
+ BOOST_ASIO_CHECK(!debug4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(debug4));
+ BOOST_ASIO_CHECK(!debug4);
 # endif // defined(__linux__)
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // do_not_route class.
 
   socket_base::do_not_route do_not_route1(true);
- BOOST_CHECK(do_not_route1.value());
- BOOST_CHECK(static_cast<bool>(do_not_route1));
- BOOST_CHECK(!!do_not_route1);
+ BOOST_ASIO_CHECK(do_not_route1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(do_not_route1));
+ BOOST_ASIO_CHECK(!!do_not_route1);
   udp_sock.set_option(do_not_route1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route2;
   udp_sock.get_option(do_not_route2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(do_not_route2.value());
- BOOST_CHECK(static_cast<bool>(do_not_route2));
- BOOST_CHECK(!!do_not_route2);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(do_not_route2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(do_not_route2));
+ BOOST_ASIO_CHECK(!!do_not_route2);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route3(false);
- BOOST_CHECK(!do_not_route3.value());
- BOOST_CHECK(!static_cast<bool>(do_not_route3));
- BOOST_CHECK(!do_not_route3);
+ BOOST_ASIO_CHECK(!do_not_route3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(do_not_route3));
+ BOOST_ASIO_CHECK(!do_not_route3);
   udp_sock.set_option(do_not_route3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::do_not_route do_not_route4;
   udp_sock.get_option(do_not_route4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!do_not_route4.value());
- BOOST_CHECK(!static_cast<bool>(do_not_route4));
- BOOST_CHECK(!do_not_route4);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!do_not_route4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(do_not_route4));
+ BOOST_ASIO_CHECK(!do_not_route4);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // keep_alive class.
 
   socket_base::keep_alive keep_alive1(true);
- BOOST_CHECK(keep_alive1.value());
- BOOST_CHECK(static_cast<bool>(keep_alive1));
- BOOST_CHECK(!!keep_alive1);
+ BOOST_ASIO_CHECK(keep_alive1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(keep_alive1));
+ BOOST_ASIO_CHECK(!!keep_alive1);
   tcp_sock.set_option(keep_alive1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::keep_alive keep_alive2;
   tcp_sock.get_option(keep_alive2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(keep_alive2.value());
- BOOST_CHECK(static_cast<bool>(keep_alive2));
- BOOST_CHECK(!!keep_alive2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(keep_alive2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(keep_alive2));
+ BOOST_ASIO_CHECK(!!keep_alive2);
 
   socket_base::keep_alive keep_alive3(false);
- BOOST_CHECK(!keep_alive3.value());
- BOOST_CHECK(!static_cast<bool>(keep_alive3));
- BOOST_CHECK(!keep_alive3);
+ BOOST_ASIO_CHECK(!keep_alive3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(keep_alive3));
+ BOOST_ASIO_CHECK(!keep_alive3);
   tcp_sock.set_option(keep_alive3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::keep_alive keep_alive4;
   tcp_sock.get_option(keep_alive4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!keep_alive4.value());
- BOOST_CHECK(!static_cast<bool>(keep_alive4));
- BOOST_CHECK(!keep_alive4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!keep_alive4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(keep_alive4));
+ BOOST_ASIO_CHECK(!keep_alive4);
 
   // send_buffer_size class.
 
   socket_base::send_buffer_size send_buffer_size1(4096);
- BOOST_CHECK(send_buffer_size1.value() == 4096);
+ BOOST_ASIO_CHECK(send_buffer_size1.value() == 4096);
   tcp_sock.set_option(send_buffer_size1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::send_buffer_size send_buffer_size2;
   tcp_sock.get_option(send_buffer_size2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_buffer_size2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_buffer_size2.value() == 4096);
 
   socket_base::send_buffer_size send_buffer_size3(16384);
- BOOST_CHECK(send_buffer_size3.value() == 16384);
+ BOOST_ASIO_CHECK(send_buffer_size3.value() == 16384);
   tcp_sock.set_option(send_buffer_size3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::send_buffer_size send_buffer_size4;
   tcp_sock.get_option(send_buffer_size4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_buffer_size4.value() == 16384);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_buffer_size4.value() == 16384);
 
   // send_low_watermark class.
 
   socket_base::send_low_watermark send_low_watermark1(4096);
- BOOST_CHECK(send_low_watermark1.value() == 4096);
+ BOOST_ASIO_CHECK(send_low_watermark1.value() == 4096);
   tcp_sock.set_option(send_low_watermark1, ec);
 #if defined(WIN32) || defined(__linux__) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::send_low_watermark send_low_watermark2;
   tcp_sock.get_option(send_low_watermark2, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #elif defined(__linux__)
- BOOST_CHECK(!ec); // Not supported on Linux but can get value.
+ BOOST_ASIO_CHECK(!ec); // Not supported on Linux but can get value.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_low_watermark2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_low_watermark2.value() == 4096);
 #endif
 
   socket_base::send_low_watermark send_low_watermark3(8192);
- BOOST_CHECK(send_low_watermark3.value() == 8192);
+ BOOST_ASIO_CHECK(send_low_watermark3.value() == 8192);
   tcp_sock.set_option(send_low_watermark3, ec);
 #if defined(WIN32) || defined(__linux__) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows, Linux or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::send_low_watermark send_low_watermark4;
   tcp_sock.get_option(send_low_watermark4, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #elif defined(__linux__)
- BOOST_CHECK(!ec); // Not supported on Linux but can get value.
+ BOOST_ASIO_CHECK(!ec); // Not supported on Linux but can get value.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(send_low_watermark4.value() == 8192);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(send_low_watermark4.value() == 8192);
 #endif
 
   // receive_buffer_size class.
 
   socket_base::receive_buffer_size receive_buffer_size1(4096);
- BOOST_CHECK(receive_buffer_size1.value() == 4096);
+ BOOST_ASIO_CHECK(receive_buffer_size1.value() == 4096);
   tcp_sock.set_option(receive_buffer_size1, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size2;
   tcp_sock.get_option(receive_buffer_size2, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_buffer_size2.value() == 4096);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_buffer_size2.value() == 4096);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size3(16384);
- BOOST_CHECK(receive_buffer_size3.value() == 16384);
+ BOOST_ASIO_CHECK(receive_buffer_size3.value() == 16384);
   tcp_sock.set_option(receive_buffer_size3, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
   // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
+ BOOST_ASIO_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
       ec.value() << ", " << ec.message());
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   socket_base::receive_buffer_size receive_buffer_size4;
   tcp_sock.get_option(receive_buffer_size4, ec);
-#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK(!ec); // Not supported under Windows CE but can get value.
-#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_buffer_size4.value() == 16384);
-#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
+#if defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK(!ec); // Not supported under Windows CE but can get value.
+#else // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_buffer_size4.value() == 16384);
+#endif // defined(BOOST_ASIO_WINDOWS) && defined(UNDER_CE)
 
   // receive_low_watermark class.
 
   socket_base::receive_low_watermark receive_low_watermark1(4096);
- BOOST_CHECK(receive_low_watermark1.value() == 4096);
+ BOOST_ASIO_CHECK(receive_low_watermark1.value() == 4096);
   tcp_sock.set_option(receive_low_watermark1, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark2;
   tcp_sock.get_option(receive_low_watermark2, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_low_watermark2.value() == 4096);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_low_watermark2.value() == 4096);
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark3(8192);
- BOOST_CHECK(receive_low_watermark3.value() == 8192);
+ BOOST_ASIO_CHECK(receive_low_watermark3.value() == 8192);
   tcp_sock.set_option(receive_low_watermark3, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 #endif
 
   socket_base::receive_low_watermark receive_low_watermark4;
   tcp_sock.get_option(receive_low_watermark4, ec);
 #if defined(WIN32) || defined(__sun)
- BOOST_CHECK(!!ec); // Not supported on Windows or Solaris.
+ BOOST_ASIO_CHECK(!!ec); // Not supported on Windows or Solaris.
 #else
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(receive_low_watermark4.value() == 8192);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(receive_low_watermark4.value() == 8192);
 #endif
 
   // reuse_address class.
 
   socket_base::reuse_address reuse_address1(true);
- BOOST_CHECK(reuse_address1.value());
- BOOST_CHECK(static_cast<bool>(reuse_address1));
- BOOST_CHECK(!!reuse_address1);
+ BOOST_ASIO_CHECK(reuse_address1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(reuse_address1));
+ BOOST_ASIO_CHECK(!!reuse_address1);
   udp_sock.set_option(reuse_address1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::reuse_address reuse_address2;
   udp_sock.get_option(reuse_address2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(reuse_address2.value());
- BOOST_CHECK(static_cast<bool>(reuse_address2));
- BOOST_CHECK(!!reuse_address2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(reuse_address2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(reuse_address2));
+ BOOST_ASIO_CHECK(!!reuse_address2);
 
   socket_base::reuse_address reuse_address3(false);
- BOOST_CHECK(!reuse_address3.value());
- BOOST_CHECK(!static_cast<bool>(reuse_address3));
- BOOST_CHECK(!reuse_address3);
+ BOOST_ASIO_CHECK(!reuse_address3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(reuse_address3));
+ BOOST_ASIO_CHECK(!reuse_address3);
   udp_sock.set_option(reuse_address3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::reuse_address reuse_address4;
   udp_sock.get_option(reuse_address4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!reuse_address4.value());
- BOOST_CHECK(!static_cast<bool>(reuse_address4));
- BOOST_CHECK(!reuse_address4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!reuse_address4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(reuse_address4));
+ BOOST_ASIO_CHECK(!reuse_address4);
 
   // linger class.
 
   socket_base::linger linger1(true, 60);
- BOOST_CHECK(linger1.enabled());
- BOOST_CHECK(linger1.timeout() == 60);
+ BOOST_ASIO_CHECK(linger1.enabled());
+ BOOST_ASIO_CHECK(linger1.timeout() == 60);
   tcp_sock.set_option(linger1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::linger linger2;
   tcp_sock.get_option(linger2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(linger2.enabled());
- BOOST_CHECK(linger2.timeout() == 60);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(linger2.enabled());
+ BOOST_ASIO_CHECK(linger2.timeout() == 60);
 
   socket_base::linger linger3(false, 0);
- BOOST_CHECK(!linger3.enabled());
- BOOST_CHECK(linger3.timeout() == 0);
+ BOOST_ASIO_CHECK(!linger3.enabled());
+ BOOST_ASIO_CHECK(linger3.timeout() == 0);
   tcp_sock.set_option(linger3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::linger linger4;
   tcp_sock.get_option(linger4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!linger4.enabled());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!linger4.enabled());
 
   // enable_connection_aborted class.
 
   socket_base::enable_connection_aborted enable_connection_aborted1(true);
- BOOST_CHECK(enable_connection_aborted1.value());
- BOOST_CHECK(static_cast<bool>(enable_connection_aborted1));
- BOOST_CHECK(!!enable_connection_aborted1);
+ BOOST_ASIO_CHECK(enable_connection_aborted1.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_connection_aborted1));
+ BOOST_ASIO_CHECK(!!enable_connection_aborted1);
   tcp_acceptor.set_option(enable_connection_aborted1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::enable_connection_aborted enable_connection_aborted2;
   tcp_acceptor.get_option(enable_connection_aborted2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(enable_connection_aborted2.value());
- BOOST_CHECK(static_cast<bool>(enable_connection_aborted2));
- BOOST_CHECK(!!enable_connection_aborted2);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(enable_connection_aborted2.value());
+ BOOST_ASIO_CHECK(static_cast<bool>(enable_connection_aborted2));
+ BOOST_ASIO_CHECK(!!enable_connection_aborted2);
 
   socket_base::enable_connection_aborted enable_connection_aborted3(false);
- BOOST_CHECK(!enable_connection_aborted3.value());
- BOOST_CHECK(!static_cast<bool>(enable_connection_aborted3));
- BOOST_CHECK(!enable_connection_aborted3);
+ BOOST_ASIO_CHECK(!enable_connection_aborted3.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_connection_aborted3));
+ BOOST_ASIO_CHECK(!enable_connection_aborted3);
   tcp_acceptor.set_option(enable_connection_aborted3, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::enable_connection_aborted enable_connection_aborted4;
   tcp_acceptor.get_option(enable_connection_aborted4, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
- BOOST_CHECK(!enable_connection_aborted4.value());
- BOOST_CHECK(!static_cast<bool>(enable_connection_aborted4));
- BOOST_CHECK(!enable_connection_aborted4);
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK(!enable_connection_aborted4.value());
+ BOOST_ASIO_CHECK(!static_cast<bool>(enable_connection_aborted4));
+ BOOST_ASIO_CHECK(!enable_connection_aborted4);
 
   // non_blocking_io class.
 
   socket_base::non_blocking_io non_blocking_io1(true);
   tcp_sock.io_control(non_blocking_io1, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   socket_base::non_blocking_io non_blocking_io2(false);
   tcp_sock.io_control(non_blocking_io2, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 
   // bytes_readable class.
 
   socket_base::bytes_readable bytes_readable;
   udp_sock.io_control(bytes_readable, ec);
- BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
+ BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
 }
 
 } // namespace socket_base_runtime
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("socket_base");
- test->add(BOOST_TEST_CASE(&socket_base_compile::test));
- test->add(BOOST_TEST_CASE(&socket_base_runtime::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "socket_base",
+ BOOST_ASIO_TEST_CASE(socket_base_compile::test)
+ BOOST_ASIO_TEST_CASE(socket_base_runtime::test)
+)

Modified: branches/release/libs/asio/test/ssl/basic_context.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/basic_context.cpp (original)
+++ branches/release/libs/asio/test/ssl/basic_context.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_context.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/basic_context");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/basic_context",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/context.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/context.cpp (original)
+++ branches/release/libs/asio/test/ssl/context.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // context.cpp
 // ~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/context_base.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/context_base.cpp (original)
+++ branches/release/libs/asio/test/ssl/context_base.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // context_base.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/context_service.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/context_service.cpp (original)
+++ branches/release/libs/asio/test/ssl/context_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // context_service.cpp
 // ~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/context_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/context_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/rfc2818_verification.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/rfc2818_verification.cpp (original)
+++ branches/release/libs/asio/test/ssl/rfc2818_verification.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // rfc2818_verification.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/rfc2818_verification");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/rfc2818_verification",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/stream.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/stream.cpp (original)
+++ branches/release/libs/asio/test/ssl/stream.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,6 +18,7 @@
 
 #include <boost/asio.hpp>
 #include <boost/asio/ssl.hpp>
+#include "../archetypes/async_result.hpp"
 #include "../unit_test.hpp"
 
 //------------------------------------------------------------------------------
@@ -40,6 +41,10 @@
 {
 }
 
+void buffered_handshake_handler(const boost::system::error_code&, std::size_t)
+{
+}
+
 void shutdown_handler(const boost::system::error_code&)
 {
 }
@@ -63,6 +68,7 @@
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
     boost::asio::ssl::context context(ios, boost::asio::ssl::context::sslv23);
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // ssl::stream constructors.
@@ -99,6 +105,9 @@
     stream1.set_verify_mode(ssl::verify_none);
     stream1.set_verify_mode(ssl::verify_none, ec);
 
+ stream1.set_verify_depth(1);
+ stream1.set_verify_depth(1, ec);
+
     stream1.set_verify_callback(verify_callback);
     stream1.set_verify_callback(verify_callback, ec);
 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
@@ -108,13 +117,57 @@
     stream1.handshake(ssl::stream_base::client, ec);
     stream1.handshake(ssl::stream_base::server, ec);
 
+#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+ stream1.handshake(ssl::stream_base::client, buffer(mutable_char_buffer));
+ stream1.handshake(ssl::stream_base::server, buffer(mutable_char_buffer));
+ stream1.handshake(ssl::stream_base::client, buffer(const_char_buffer));
+ stream1.handshake(ssl::stream_base::server, buffer(const_char_buffer));
+ stream1.handshake(ssl::stream_base::client,
+ buffer(mutable_char_buffer), ec);
+ stream1.handshake(ssl::stream_base::server,
+ buffer(mutable_char_buffer), ec);
+ stream1.handshake(ssl::stream_base::client,
+ buffer(const_char_buffer), ec);
+ stream1.handshake(ssl::stream_base::server,
+ buffer(const_char_buffer), ec);
+#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+
     stream1.async_handshake(ssl::stream_base::client, handshake_handler);
     stream1.async_handshake(ssl::stream_base::server, handshake_handler);
+ int i1 = stream1.async_handshake(ssl::stream_base::client, lazy);
+ (void)i1;
+ int i2 = stream1.async_handshake(ssl::stream_base::server, lazy);
+ (void)i2;
+
+#if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
+ stream1.async_handshake(ssl::stream_base::client,
+ buffer(mutable_char_buffer), buffered_handshake_handler);
+ stream1.async_handshake(ssl::stream_base::server,
+ buffer(mutable_char_buffer), buffered_handshake_handler);
+ stream1.async_handshake(ssl::stream_base::client,
+ buffer(const_char_buffer), buffered_handshake_handler);
+ stream1.async_handshake(ssl::stream_base::server,
+ buffer(const_char_buffer), buffered_handshake_handler);
+ int i3 = stream1.async_handshake(ssl::stream_base::client,
+ buffer(mutable_char_buffer), lazy);
+ (void)i3;
+ int i4 = stream1.async_handshake(ssl::stream_base::server,
+ buffer(mutable_char_buffer), lazy);
+ (void)i4;
+ int i5 = stream1.async_handshake(ssl::stream_base::client,
+ buffer(const_char_buffer), lazy);
+ (void)i5;
+ int i6 = stream1.async_handshake(ssl::stream_base::server,
+ buffer(const_char_buffer), lazy);
+ (void)i6;
+#endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
 
     stream1.shutdown();
     stream1.shutdown(ec);
 
     stream1.async_shutdown(shutdown_handler);
+ int i7 = stream1.async_shutdown(lazy);
+ (void)i7;
 
     stream1.write_some(buffer(mutable_char_buffer));
     stream1.write_some(buffer(const_char_buffer));
@@ -123,11 +176,17 @@
 
     stream1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
     stream1.async_write_some(buffer(const_char_buffer), write_some_handler);
+ int i8 = stream1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i8;
+ int i9 = stream1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i9;
 
     stream1.read_some(buffer(mutable_char_buffer));
     stream1.read_some(buffer(mutable_char_buffer), ec);
 
     stream1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
+ int i10 = stream1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i10;
 
 #if defined(BOOST_ASIO_ENABLE_OLD_SSL)
     stream1.peek(buffer(mutable_char_buffer));
@@ -148,9 +207,8 @@
 
 //------------------------------------------------------------------------------
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream");
- test->add(BOOST_TEST_CASE(&ssl_stream_compile::test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream",
+ BOOST_ASIO_TEST_CASE(ssl_stream_compile::test)
+)

Modified: branches/release/libs/asio/test/ssl/stream_base.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/stream_base.cpp (original)
+++ branches/release/libs/asio/test/ssl/stream_base.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_base.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream_base");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream_base",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/ssl/stream_service.cpp
==============================================================================
--- branches/release/libs/asio/test/ssl/stream_service.cpp (original)
+++ branches/release/libs/asio/test/ssl/stream_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_service.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("ssl/stream_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "ssl/stream_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/steady_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/steady_timer.cpp (original)
+++ branches/release/libs/asio/test/steady_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // steady_timer.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,9 +23,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("steady_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "steady_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/strand.cpp
==============================================================================
--- branches/release/libs/asio/test/strand.cpp (original)
+++ branches/release/libs/asio/test/strand.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // strand.cpp
 // ~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,14 +17,41 @@
 #include <boost/asio/strand.hpp>
 
 #include <sstream>
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/asio/deadline_timer.hpp>
 #include <boost/asio/io_service.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/deadline_timer.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+# include <boost/asio/steady_timer.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 using namespace boost::asio;
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif
+
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+typedef deadline_timer timer;
+namespace chronons = boost::posix_time;
+#elif defined(BOOST_ASIO_HAS_STD_CHRONO)
+typedef steady_timer timer;
+namespace chronons = std::chrono;
+#elif defined(BOOST_ASIO_HAS_BOOST_CHRONO)
+typedef steady_timer timer;
+namespace chronons = boost::chrono;
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+
 void increment(int* count)
 {
   ++(*count);
@@ -32,29 +59,33 @@
 
 void increment_without_lock(strand* s, int* count)
 {
+ BOOST_ASIO_CHECK(!s->running_in_this_thread());
+
   int original_count = *count;
 
- s->dispatch(boost::bind(increment, count));
+ s->dispatch(bindns::bind(increment, count));
 
   // No other functions are currently executing through the locking dispatcher,
   // so the previous call to dispatch should have successfully nested.
- BOOST_CHECK(*count == original_count + 1);
+ BOOST_ASIO_CHECK(*count == original_count + 1);
 }
 
 void increment_with_lock(strand* s, int* count)
 {
+ BOOST_ASIO_CHECK(s->running_in_this_thread());
+
   int original_count = *count;
 
- s->dispatch(boost::bind(increment, count));
+ s->dispatch(bindns::bind(increment, count));
 
   // The current function already holds the strand's lock, so the
   // previous call to dispatch should have successfully nested.
- BOOST_CHECK(*count == original_count + 1);
+ BOOST_ASIO_CHECK(*count == original_count + 1);
 }
 
 void sleep_increment(io_service* ios, int* count)
 {
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   ++(*count);
@@ -63,13 +94,13 @@
 void start_sleep_increments(io_service* ios, strand* s, int* count)
 {
   // Give all threads a chance to start.
- deadline_timer t(*ios, boost::posix_time::seconds(2));
+ timer t(*ios, chronons::seconds(2));
   t.wait();
 
   // Start three increments.
- s->post(boost::bind(sleep_increment, ios, count));
- s->post(boost::bind(sleep_increment, ios, count));
- s->post(boost::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
+ s->post(bindns::bind(sleep_increment, ios, count));
 }
 
 void throw_exception()
@@ -88,63 +119,63 @@
   strand s(ios);
   int count = 0;
 
- ios.post(boost::bind(increment_without_lock, &s, &count));
+ ios.post(bindns::bind(increment_without_lock, &s, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- s.post(boost::bind(increment_with_lock, &s, &count));
+ s.post(bindns::bind(increment_with_lock, &s, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
- BOOST_CHECK(count == 1);
+ BOOST_ASIO_CHECK(count == 1);
 
   count = 0;
   ios.reset();
- ios.post(boost::bind(start_sleep_increments, &ios, &s, &count));
- boost::thread thread1(boost::bind(io_service_run, &ios));
- boost::thread thread2(boost::bind(io_service_run, &ios));
+ ios.post(bindns::bind(start_sleep_increments, &ios, &s, &count));
+ boost::thread thread1(bindns::bind(io_service_run, &ios));
+ boost::thread thread2(bindns::bind(io_service_run, &ios));
 
   // Check all events run one after another even though there are two threads.
- deadline_timer timer1(ios, boost::posix_time::seconds(3));
+ timer timer1(ios, chronons::seconds(3));
   timer1.wait();
- BOOST_CHECK(count == 0);
- timer1.expires_at(timer1.expires_at() + boost::posix_time::seconds(2));
+ BOOST_ASIO_CHECK(count == 0);
+ timer1.expires_at(timer1.expires_at() + chronons::seconds(2));
   timer1.wait();
- BOOST_CHECK(count == 1);
- timer1.expires_at(timer1.expires_at() + boost::posix_time::seconds(2));
+ BOOST_ASIO_CHECK(count == 1);
+ timer1.expires_at(timer1.expires_at() + chronons::seconds(2));
   timer1.wait();
- BOOST_CHECK(count == 2);
+ BOOST_ASIO_CHECK(count == 2);
 
   thread1.join();
   thread2.join();
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(count == 3);
+ BOOST_ASIO_CHECK(count == 3);
 
   count = 0;
   int exception_count = 0;
   ios.reset();
   s.post(throw_exception);
- s.post(boost::bind(increment, &count));
- s.post(boost::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
   s.post(throw_exception);
- s.post(boost::bind(increment, &count));
+ s.post(bindns::bind(increment, &count));
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
- BOOST_CHECK(exception_count == 0);
+ BOOST_ASIO_CHECK(count == 0);
+ BOOST_ASIO_CHECK(exception_count == 0);
 
   for (;;)
   {
@@ -160,8 +191,8 @@
   }
 
   // The run() calls will not return until all work has finished.
- BOOST_CHECK(count == 3);
- BOOST_CHECK(exception_count == 2);
+ BOOST_ASIO_CHECK(count == 3);
+ BOOST_ASIO_CHECK(exception_count == 2);
 
   count = 0;
   ios.reset();
@@ -170,18 +201,17 @@
   // are abandoned.
   {
     strand s2(ios);
- s2.post(boost::bind(increment, &count));
- s2.post(boost::bind(increment, &count));
- s2.post(boost::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
+ s2.post(bindns::bind(increment, &count));
   }
 
   // No handlers can be called until run() is called.
- BOOST_CHECK(count == 0);
+ BOOST_ASIO_CHECK(count == 0);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("strand");
- test->add(BOOST_TEST_CASE(&strand_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "strand",
+ BOOST_ASIO_TEST_CASE(strand_test)
+)

Modified: branches/release/libs/asio/test/stream_socket_service.cpp
==============================================================================
--- branches/release/libs/asio/test/stream_socket_service.cpp (original)
+++ branches/release/libs/asio/test/stream_socket_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_socket_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("stream_socket_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "stream_socket_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/streambuf.cpp
==============================================================================
--- branches/release/libs/asio/test/streambuf.cpp (original)
+++ branches/release/libs/asio/test/streambuf.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // streambuf.cpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -25,39 +25,38 @@
 
   sb.sputn("abcd", 4);
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
 
   for (int i = 0; i < 100; ++i)
   {
     sb.consume(3);
 
- BOOST_CHECK(sb.size() == 1);
+ BOOST_ASIO_CHECK(sb.size() == 1);
 
     char buf[1];
     sb.sgetn(buf, 1);
 
- BOOST_CHECK(sb.size() == 0);
+ BOOST_ASIO_CHECK(sb.size() == 0);
 
     sb.sputn("ab", 2);
 
- BOOST_CHECK(sb.size() == 2);
+ BOOST_ASIO_CHECK(sb.size() == 2);
 
     boost::asio::buffer_copy(sb.prepare(10), boost::asio::buffer("cd", 2));
     sb.commit(2);
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
   }
 
- BOOST_CHECK(sb.size() == 4);
+ BOOST_ASIO_CHECK(sb.size() == 4);
 
   sb.consume(4);
 
- BOOST_CHECK(sb.size() == 0);
+ BOOST_ASIO_CHECK(sb.size() == 0);
 }
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("streambuf");
- test->add(BOOST_TEST_CASE(&streambuf_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "streambuf",
+ BOOST_ASIO_TEST_CASE(streambuf_test)
+)

Modified: branches/release/libs/asio/test/system_timer.cpp
==============================================================================
--- branches/release/libs/asio/test/system_timer.cpp (original)
+++ branches/release/libs/asio/test/system_timer.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // system_timer.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -23,9 +23,337 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
+#if defined(BOOST_ASIO_HAS_STD_CHRONO)
+
+#include <boost/asio/io_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/thread/thread.hpp>
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+namespace bindns = std;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+namespace chronons = std::chrono;
+
+void increment(int* count)
+{
+ ++(*count);
+}
+
+void decrement_to_zero(boost::asio::system_timer* t, int* count)
+{
+ if (*count > 0)
+ {
+ --(*count);
+
+ int before_value = *count;
+
+ t->expires_at(t->expires_at() + chronons::seconds(1));
+ t->async_wait(bindns::bind(decrement_to_zero, t, count));
+
+ // Completion cannot nest, so count value should remain unchanged.
+ BOOST_ASIO_CHECK(*count == before_value);
+ }
+}
+
+void increment_if_not_cancelled(int* count,
+ const boost::system::error_code& ec)
+{
+ if (!ec)
+ ++(*count);
+}
+
+void cancel_timer(boost::asio::system_timer* t)
+{
+ std::size_t num_cancelled = t->cancel();
+ BOOST_ASIO_CHECK(num_cancelled == 1);
+}
+
+void cancel_one_timer(boost::asio::system_timer* t)
+{
+ std::size_t num_cancelled = t->cancel_one();
+ BOOST_ASIO_CHECK(num_cancelled == 1);
+}
+
+boost::asio::system_timer::time_point now()
+{
+ return boost::asio::system_timer::clock_type::now();
+}
+
+void system_timer_test()
+{
+ using chronons::seconds;
+ using chronons::microseconds;
+#if !defined(BOOST_ASIO_HAS_BOOST_BIND)
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // !defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ int count = 0;
+
+ boost::asio::system_timer::time_point start = now();
+
+ boost::asio::system_timer t1(ios, seconds(1));
+ t1.wait();
+
+ // The timer must block until after its expiry time.
+ boost::asio::system_timer::time_point end = now();
+ boost::asio::system_timer::time_point expected_end = start + seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ boost::asio::system_timer t2(ios, seconds(1) + microseconds(500000));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end = start + seconds(1) + microseconds(500000);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ t2.expires_at(t2.expires_at() + seconds(1));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end += seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ t2.expires_from_now(seconds(1) + microseconds(200000));
+ t2.wait();
+
+ // The timer must block until after its expiry time.
+ end = now();
+ expected_end = start + seconds(1) + microseconds(200000);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ start = now();
+
+ boost::asio::system_timer t3(ios, seconds(5));
+ t3.async_wait(bindns::bind(increment, &count));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 0);
+
+ ios.run();
+
+ // The run() call will not return until all operations have finished, and
+ // this should not be until after the timer's expiry time.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(1);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 3;
+ start = now();
+
+ boost::asio::system_timer t4(ios, seconds(1));
+ t4.async_wait(bindns::bind(decrement_to_zero, &t4, &count));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 3);
+
+ ios.reset();
+ ios.run();
+
+ // The run() call will not return until all operations have finished, and
+ // this should not be until after the timer's final expiry time.
+ BOOST_ASIO_CHECK(count == 0);
+ end = now();
+ expected_end = start + seconds(3);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 0;
+ start = now();
+
+ boost::asio::system_timer t5(ios, seconds(10));
+ t5.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ boost::asio::system_timer t6(ios, seconds(1));
+ t6.async_wait(bindns::bind(cancel_timer, &t5));
+
+ // No completions can be delivered until run() is called.
+ BOOST_ASIO_CHECK(count == 0);
+
+ ios.reset();
+ ios.run();
+
+ // The timer should have been cancelled, so count should not have changed.
+ // The total run time should not have been much more than 1 second (and
+ // certainly far less than 10 seconds).
+ BOOST_ASIO_CHECK(count == 0);
+ end = now();
+ expected_end = start + seconds(2);
+ BOOST_ASIO_CHECK(end < expected_end);
+
+ // Wait on the timer again without cancelling it. This time the asynchronous
+ // wait should run to completion and increment the counter.
+ t5.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+
+ ios.reset();
+ ios.run();
+
+ // The timer should not have been cancelled, so count should have changed.
+ // The total time since the timer was created should be more than 10 seconds.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(10);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+
+ count = 0;
+ start = now();
+
+ // Start two waits on a timer, one of which will be cancelled. The one
+ // which is not cancelled should still run to completion and increment the
+ // counter.
+ boost::asio::system_timer t7(ios, seconds(3));
+ t7.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ t7.async_wait(bindns::bind(increment_if_not_cancelled, &count, _1));
+ boost::asio::system_timer t8(ios, seconds(1));
+ t8.async_wait(bindns::bind(cancel_one_timer, &t7));
+
+ ios.reset();
+ ios.run();
+
+ // One of the waits should not have been cancelled, so count should have
+ // changed. The total time since the timer was created should be more than 3
+ // seconds.
+ BOOST_ASIO_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(3);
+ BOOST_ASIO_CHECK(expected_end < end || expected_end == end);
+}
+
+void timer_handler(const boost::system::error_code&)
+{
+}
+
+void system_timer_cancel_test()
+{
+ static boost::asio::io_service io_service;
+ struct timer
+ {
+ boost::asio::system_timer t;
+ timer() : t(io_service)
+ {
+ t.expires_at(boost::asio::system_timer::time_point::max());
+ }
+ } timers[50];
+
+ timers[2].t.async_wait(&timer_handler);
+ timers[41].t.async_wait(&timer_handler);
+ for (int i = 10; i < 20; ++i)
+ timers[i].t.async_wait(&timer_handler);
+
+ BOOST_ASIO_CHECK(timers[2].t.cancel() == 1);
+ BOOST_ASIO_CHECK(timers[41].t.cancel() == 1);
+ for (int i = 10; i < 20; ++i)
+ BOOST_ASIO_CHECK(timers[i].t.cancel() == 1);
+}
+
+struct custom_allocation_timer_handler
 {
- test_suite* test = BOOST_TEST_SUITE("system_timer");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
+ custom_allocation_timer_handler(int* count) : count_(count) {}
+ void operator()(const boost::system::error_code&) {}
+ int* count_;
+};
+
+void* asio_handler_allocate(std::size_t size,
+ custom_allocation_timer_handler* handler)
+{
+ ++(*handler->count_);
+ return ::operator new(size);
 }
+
+void asio_handler_deallocate(void* pointer, std::size_t,
+ custom_allocation_timer_handler* handler)
+{
+ --(*handler->count_);
+ ::operator delete(pointer);
+}
+
+void system_timer_custom_allocation_test()
+{
+ static boost::asio::io_service io_service;
+ struct timer
+ {
+ boost::asio::system_timer t;
+ timer() : t(io_service) {}
+ } timers[100];
+
+ int allocation_count = 0;
+
+ for (int i = 0; i < 50; ++i)
+ {
+ timers[i].t.expires_at(boost::asio::system_timer::time_point::max());
+ timers[i].t.async_wait(custom_allocation_timer_handler(&allocation_count));
+ }
+
+ for (int i = 50; i < 100; ++i)
+ {
+ timers[i].t.expires_at(boost::asio::system_timer::time_point::min());
+ timers[i].t.async_wait(custom_allocation_timer_handler(&allocation_count));
+ }
+
+ for (int i = 0; i < 50; ++i)
+ timers[i].t.cancel();
+
+ io_service.run();
+
+ BOOST_ASIO_CHECK(allocation_count == 0);
+}
+
+void io_service_run(boost::asio::io_service* ios)
+{
+ ios->run();
+}
+
+void system_timer_thread_test()
+{
+ boost::asio::io_service ios;
+ boost::asio::io_service::work w(ios);
+ boost::asio::system_timer t1(ios);
+ boost::asio::system_timer t2(ios);
+ int count = 0;
+
+ boost::thread th(bindns::bind(io_service_run, &ios));
+
+ t2.expires_from_now(chronons::seconds(2));
+ t2.wait();
+
+ t1.expires_from_now(chronons::seconds(2));
+ t1.async_wait(bindns::bind(increment, &count));
+
+ t2.expires_from_now(chronons::seconds(4));
+ t2.wait();
+
+ ios.stop();
+ th.join();
+
+ BOOST_ASIO_CHECK(count == 1);
+}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "system_timer",
+ BOOST_ASIO_TEST_CASE(system_timer_test)
+ BOOST_ASIO_TEST_CASE(system_timer_cancel_test)
+ BOOST_ASIO_TEST_CASE(system_timer_custom_allocation_test)
+ BOOST_ASIO_TEST_CASE(system_timer_thread_test)
+)
+#else // defined(BOOST_ASIO_HAS_STD_CHRONO)
+BOOST_ASIO_TEST_SUITE
+(
+ "system_timer",
+ BOOST_ASIO_TEST_CASE(null_test)
+)
+#endif // defined(BOOST_ASIO_HAS_STD_CHRONO)

Modified: branches/release/libs/asio/test/time_traits.cpp
==============================================================================
--- branches/release/libs/asio/test/time_traits.cpp (original)
+++ branches/release/libs/asio/test/time_traits.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // time_traits.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("time_traits");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "time_traits",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/unit_test.hpp
==============================================================================
--- branches/release/libs/asio/test/unit_test.hpp (original)
+++ branches/release/libs/asio/test/unit_test.hpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // unit_test.hpp
 // ~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -11,7 +11,7 @@
 #ifndef UNIT_TEST_HPP
 #define UNIT_TEST_HPP
 
-#include <boost/config.hpp>
+#include <boost/asio/detail/config.hpp>
 
 #if defined(__sun)
 # include <stdlib.h> // Needed for lrand48.
@@ -28,18 +28,73 @@
 
 #endif // defined(__BORLANDC__)
 
-#if defined(BOOST_MSVC)
+#if defined(BOOST_ASIO_MSVC)
 # pragma warning (push)
 # pragma warning (disable:4244)
 # pragma warning (disable:4702)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
+
+#if defined(BOOST_ASIO_STANDALONE)
+
+#include <cassert>
+#include <iostream>
+
+#if defined(NDEBUG)
+# error NDEBUG must not be defined when building these unit tests
+#endif // defined(NDEBUG)
+
+#define BOOST_ASIO_CHECK(expr) assert(expr)
+
+#define BOOST_ASIO_CHECK_MESSAGE(expr, msg) \
+ do { if (!(expr)) { std::cout << msg << std::endl; assert(expr); } } while (0)
+
+#define BOOST_ASIO_WARN_MESSAGE(expr, msg) \
+ do { if (!(expr)) { std::cout << msg << std::endl; } } while (0)
+
+#define BOOST_ASIO_ERROR(msg) assert(0 && msg)
+
+#define BOOST_ASIO_TEST_SUITE(name, tests) \
+ int main() \
+ { \
+ std::cout << name << " test suite begins" << std::endl; \
+ tests \
+ std::cout << name << " test suite ends" << std::endl; \
+ return 0; \
+ }
+
+#define BOOST_ASIO_TEST_CASE(test) \
+ test(); \
+ std::cout << #test << " passed" << std::endl;
+
+#else // defined(BOOST_ASIO_STANDALONE)
 
 #include <boost/test/unit_test.hpp>
 using boost::unit_test::test_suite;
 
-#if defined(BOOST_MSVC)
+#define BOOST_ASIO_CHECK(expr) BOOST_CHECK(expr)
+
+#define BOOST_ASIO_CHECK_MESSAGE(expr, msg) BOOST_CHECK_MESSAGE(expr, msg)
+
+#define BOOST_ASIO_WARN_MESSAGE(expr, msg) BOOST_WARN_MESSAGE(expr, msg)
+
+#define BOOST_ASIO_ERROR(expr) BOOST_ERROR(expr)
+
+#define BOOST_ASIO_TEST_SUITE(name, tests) \
+ test_suite* init_unit_test_suite(int, char*[]) \
+ { \
+ test_suite* t = BOOST_TEST_SUITE(name); \
+ tests \
+ return t; \
+ }
+
+#define BOOST_ASIO_TEST_CASE(test) \
+ t->add(BOOST_TEST_CASE(&test));
+
+#endif // defined(BOOST_ASIO_STANDALONE)
+
+#if defined(BOOST_ASIO_MSVC)
 # pragma warning (pop)
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_ASIO_MSVC)
 
 inline void null_test()
 {

Modified: branches/release/libs/asio/test/wait_traits.cpp
==============================================================================
--- branches/release/libs/asio/test/wait_traits.cpp (original)
+++ branches/release/libs/asio/test/wait_traits.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // wait_traits.cpp
 // ~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("wait_traits");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "wait_traits",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/waitable_timer_service.cpp
==============================================================================
--- branches/release/libs/asio/test/waitable_timer_service.cpp (original)
+++ branches/release/libs/asio/test/waitable_timer_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // waitable_timer_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -18,9 +18,8 @@
 
 #include "unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("waitable_timer_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "waitable_timer_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/windows/basic_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/basic_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/basic_handle.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_handle.cpp
 // ~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/windows/basic_object_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/basic_object_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/basic_object_handle.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_object_handle.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_object_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_object_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/windows/basic_random_access_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/basic_random_access_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/basic_random_access_handle.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_random_access_handle.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_random_access_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_random_access_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/windows/basic_stream_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/basic_stream_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/basic_stream_handle.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // basic_stream_handle.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/basic_stream_handle");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/basic_stream_handle",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/windows/object_handle.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/object_handle.cpp (original)
+++ branches/release/libs/asio/test/windows/object_handle.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // object_handle.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/windows/object_handle.hpp>
 
 #include <boost/asio/io_service.hpp>
+#include "../archetypes/async_result.hpp"
 #include "../unit_test.hpp"
 
 //------------------------------------------------------------------------------
@@ -42,6 +43,7 @@
   try
   {
     io_service ios;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_object_handle constructors.
@@ -99,6 +101,8 @@
     handle1.wait(ec);
 
     handle1.async_wait(&wait_handler);
+ int i1 = handle1.async_wait(lazy);
+ (void)i1;
   }
   catch (std::exception&)
   {
@@ -109,9 +113,9 @@
 } // namespace windows_object_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/object_handle");
- test->add(BOOST_TEST_CASE(&windows_object_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/object_handle",
+ BOOST_ASIO_TEST_CASE(windows_object_handle_compile::test)
+)

Modified: branches/release/libs/asio/test/windows/object_handle_service.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/object_handle_service.cpp (original)
+++ branches/release/libs/asio/test/windows/object_handle_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // object_handle_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/object_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/object_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // overlapped_ptr.cpp
 // ~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -87,9 +87,9 @@
 } // namespace windows_overlapped_ptr_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/overlapped_ptr");
- test->add(BOOST_TEST_CASE(&windows_overlapped_ptr_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/overlapped_ptr",
+ BOOST_ASIO_TEST_CASE(windows_overlapped_ptr_compile::test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // random_access_handle.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/windows/random_access_handle.hpp>
 
 #include <boost/asio/io_service.hpp>
+#include "../archetypes/async_result.hpp"
 #include "../unit_test.hpp"
 
 //------------------------------------------------------------------------------
@@ -49,6 +50,7 @@
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
     boost::uint64_t offset = 0;
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_random_access_handle constructors.
@@ -114,12 +116,21 @@
         buffer(mutable_char_buffer), &write_some_handler);
     handle1.async_write_some_at(offset,
         buffer(const_char_buffer), &write_some_handler);
+ int i1 = handle1.async_write_some_at(offset,
+ buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = handle1.async_write_some_at(offset,
+ buffer(const_char_buffer), lazy);
+ (void)i2;
 
     handle1.read_some_at(offset, buffer(mutable_char_buffer));
     handle1.read_some_at(offset, buffer(mutable_char_buffer), ec);
 
     handle1.async_read_some_at(offset,
         buffer(mutable_char_buffer), &read_some_handler);
+ int i3 = handle1.async_read_some_at(offset,
+ buffer(mutable_char_buffer), lazy);
+ (void)i3;
   }
   catch (std::exception&)
   {
@@ -130,9 +141,9 @@
 } // namespace windows_random_access_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/random_access_handle");
- test->add(BOOST_TEST_CASE(&windows_random_access_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/random_access_handle",
+ BOOST_ASIO_TEST_CASE(windows_random_access_handle_compile::test)
+)

Modified: branches/release/libs/asio/test/windows/random_access_handle_service.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/random_access_handle_service.cpp (original)
+++ branches/release/libs/asio/test/windows/random_access_handle_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // random_access_handle_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/random_access_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/random_access_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_handle.cpp
 // ~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -17,6 +17,7 @@
 #include <boost/asio/windows/stream_handle.hpp>
 
 #include <boost/asio/io_service.hpp>
+#include "../archetypes/async_result.hpp"
 #include "../unit_test.hpp"
 
 //------------------------------------------------------------------------------
@@ -48,6 +49,7 @@
     io_service ios;
     char mutable_char_buffer[128] = "";
     const char const_char_buffer[128] = "";
+ archetypes::lazy_handler lazy;
     boost::system::error_code ec;
 
     // basic_stream_handle constructors.
@@ -111,11 +113,17 @@
 
     handle1.async_write_some(buffer(mutable_char_buffer), &write_some_handler);
     handle1.async_write_some(buffer(const_char_buffer), &write_some_handler);
+ int i1 = handle1.async_write_some(buffer(mutable_char_buffer), lazy);
+ (void)i1;
+ int i2 = handle1.async_write_some(buffer(const_char_buffer), lazy);
+ (void)i2;
 
     handle1.read_some(buffer(mutable_char_buffer));
     handle1.read_some(buffer(mutable_char_buffer), ec);
 
     handle1.async_read_some(buffer(mutable_char_buffer), &read_some_handler);
+ int i3 = handle1.async_read_some(buffer(mutable_char_buffer), lazy);
+ (void)i3;
   }
   catch (std::exception&)
   {
@@ -126,9 +134,9 @@
 } // namespace windows_stream_handle_compile
 
 //------------------------------------------------------------------------------
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/stream_handle");
- test->add(BOOST_TEST_CASE(&windows_stream_handle_compile::test));
- return test;
-}
+
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/stream_handle",
+ BOOST_ASIO_TEST_CASE(windows_stream_handle_compile::test)
+)

Modified: branches/release/libs/asio/test/windows/stream_handle_service.cpp
==============================================================================
--- branches/release/libs/asio/test/windows/stream_handle_service.cpp (original)
+++ branches/release/libs/asio/test/windows/stream_handle_service.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // stream_handle_service.cpp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -19,9 +19,8 @@
 #include <boost/asio.hpp>
 #include "../unit_test.hpp"
 
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("windows/stream_handle_service");
- test->add(BOOST_TEST_CASE(&null_test));
- return test;
-}
+BOOST_ASIO_TEST_SUITE
+(
+ "windows/stream_handle_service",
+ BOOST_ASIO_TEST_CASE(null_test)
+)

Modified: branches/release/libs/asio/test/write.cpp
==============================================================================
--- branches/release/libs/asio/test/write.cpp (original)
+++ branches/release/libs/asio/test/write.cpp 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // write.cpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,22 +16,30 @@
 // Test that header file is self-contained.
 #include <boost/asio/write.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
 #include <vector>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
+#include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_stream
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -52,7 +60,7 @@
 
   void reset(size_t length = max_length)
   {
- BOOST_CHECK(length <= max_length);
+ BOOST_ASIO_CHECK(length <= max_length);
 
     memset(data_, 0, max_length);
     length_ = length;
@@ -134,7 +142,7 @@
   std::vector<boost::asio::const_buffer> buffers;
 
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
 }
 
 void test_2_arg_const_buffers_1_write()
@@ -146,20 +154,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_2_arg_mutable_buffers_1_write()
@@ -171,20 +179,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_2_arg_vector_buffers_write()
@@ -197,20 +205,20 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_nothrow_zero_buffers_write()
@@ -221,8 +229,8 @@
 
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == 0);
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 0);
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_const_buffers_1_write()
@@ -235,23 +243,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_mutable_buffers_1_write()
@@ -264,23 +272,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_3_arg_nothrow_vector_buffers_write()
@@ -294,23 +302,23 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -335,176 +343,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_write()
@@ -517,176 +525,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_vector_buffers_write()
@@ -700,176 +708,176 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write(s, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_const_buffers_1_write()
@@ -883,230 +891,230 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_mutable_buffers_1_write()
@@ -1120,230 +1128,230 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_vector_buffers_write()
@@ -1358,242 +1366,250 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_write_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_3_arg_const_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::const_buffers_1 buffers
@@ -1602,44 +1618,53 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -1648,44 +1673,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_boost_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -1695,44 +1730,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_3_arg_std_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -1743,45 +1788,54 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_3_arg_vector_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -1791,44 +1845,117 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+}
+
+void test_3_arg_streambuf_async_write()
+{
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::streambuf sb;
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ bool called = false;
+ boost::asio::async_write(s, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ int i = boost::asio::async_write(s, sb, archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_const_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::const_buffers_1 buffers
@@ -1837,348 +1964,310 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -2187,348 +2276,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -2538,348 +2590,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_stream s(ios);
@@ -2890,349 +2905,311 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_write()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_stream s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -3242,372 +3219,696 @@
   s.reset();
   bool called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write(s, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
- ios.reset();
- ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
-}
-
-test_suite* init_unit_test_suite(int, char*[])
-{
- test_suite* test = BOOST_TEST_SUITE("write");
- test->add(BOOST_TEST_CASE(&test_2_arg_zero_buffers_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_2_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_zero_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_nothrow_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_boost_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_std_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_write));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_write));
- return test;
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write(s, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+}
+
+void test_4_arg_streambuf_async_write()
+{
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::streambuf sb;
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ bool called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 50));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write(s, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write(s, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write(s, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ int i = boost::asio::async_write(s, sb, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
+
+BOOST_ASIO_TEST_SUITE
+(
+ "write",
+ BOOST_ASIO_TEST_CASE(test_2_arg_zero_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_2_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_zero_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_nothrow_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_boost_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_std_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_3_arg_streambuf_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_write)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_write)
+)

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 2013-05-20 08:32:20 EDT (Mon, 20 May 2013)
@@ -2,7 +2,7 @@
 // write_at.cpp
 // ~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,21 +16,29 @@
 // Test that header file is self-contained.
 #include <boost/asio/write_at.hpp>
 
-#if defined(BOOST_ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
-#include <boost/array.hpp>
-#include <boost/bind.hpp>
-#include <boost/noncopyable.hpp>
 #include <cstring>
+#include "archetypes/async_result.hpp"
 #include <boost/asio/io_service.hpp>
-#include <boost/asio/placeholders.hpp>
+#include <boost/asio/streambuf.hpp>
 #include "unit_test.hpp"
 
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <boost/bind.hpp>
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+# include <functional>
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+#include <boost/array.hpp>
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
+
+#if defined(BOOST_ASIO_HAS_STD_ARRAY)
+# include <array>
+#endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
+
 using namespace std; // For memcmp, memcpy and memset.
 
 class test_random_access_device
- : private boost::noncopyable
 {
 public:
   typedef boost::asio::io_service io_service_type;
@@ -60,7 +68,7 @@
   }
 
   template <typename Const_Buffers>
- bool check_buffers(boost::uint64_t offset,
+ bool check_buffers(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, size_t length)
   {
     if (offset + length > max_length)
@@ -84,7 +92,8 @@
   }
 
   template <typename Const_Buffers>
- size_t write_some_at(boost::uint64_t offset, const Const_Buffers& buffers)
+ size_t write_some_at(boost::asio::uint64_t offset,
+ const Const_Buffers& buffers)
   {
     return boost::asio::buffer_copy(
         boost::asio::buffer(data_, length_) + offset,
@@ -92,7 +101,7 @@
   }
 
   template <typename Const_Buffers>
- size_t write_some_at(boost::uint64_t offset,
+ size_t write_some_at(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, boost::system::error_code& ec)
   {
     ec = boost::system::error_code();
@@ -100,7 +109,7 @@
   }
 
   template <typename Const_Buffers, typename Handler>
- void async_write_some_at(boost::uint64_t offset,
+ void async_write_some_at(boost::asio::uint64_t offset,
       const Const_Buffers& buffers, Handler handler)
   {
     size_t bytes_transferred = write_some_at(offset, buffers);
@@ -130,37 +139,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_3_arg_mutable_buffers_1_write_at()
@@ -172,37 +181,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 }
 
 void test_3_arg_vector_buffers_write_at()
@@ -215,37 +224,37 @@
 
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_nothrow_const_buffers_1_write_at()
@@ -258,43 +267,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_mutable_buffers_1_write_at()
@@ -307,43 +316,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_4_arg_nothrow_vector_buffers_write_at()
@@ -357,43 +366,43 @@
   s.reset();
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 bool old_style_transfer_all(const boost::system::error_code& ec,
@@ -418,356 +427,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_write_at()
@@ -780,356 +789,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 }
 
 void test_4_arg_vector_buffers_write_at()
@@ -1143,356 +1152,356 @@
   s.reset();
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42));
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1));
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10));
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42));
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 0, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   bytes_transferred = boost::asio::write_at(s, 1234, buffers, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_const_buffers_1_write_at()
@@ -1506,464 +1515,464 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_mutable_buffers_1_write_at()
@@ -1977,464 +1986,464 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(mutable_write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void test_5_arg_vector_buffers_write_at()
@@ -2449,476 +2458,484 @@
   boost::system::error_code error;
   size_t bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42), error);
- BOOST_CHECK(bytes_transferred == 50);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 50);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1), error);
- BOOST_CHECK(bytes_transferred == 1);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 1);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10), error);
- BOOST_CHECK(bytes_transferred == 10);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 10);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42), error);
- BOOST_CHECK(bytes_transferred == 42);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == 42);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(1);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 0, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 
   s.reset();
   s.next_write_length(10);
   error = boost::system::error_code();
   bytes_transferred = boost::asio::write_at(s, 1234, buffers,
       short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(write_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
- BOOST_CHECK(!error);
+ BOOST_ASIO_CHECK(bytes_transferred == sizeof(write_data));
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(!error);
 }
 
 void async_write_handler(const boost::system::error_code& e,
     size_t bytes_transferred, size_t expected_bytes_transferred, bool* called)
 {
   *called = true;
- BOOST_CHECK(!e);
- BOOST_CHECK(bytes_transferred == expected_bytes_transferred);
+ BOOST_ASIO_CHECK(!e);
+ BOOST_ASIO_CHECK(bytes_transferred == expected_bytes_transferred);
 }
 
 void test_4_arg_const_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::const_buffers_1 buffers
@@ -2927,94 +2944,97 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_mutable_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -3023,94 +3043,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_4_arg_boost_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -3120,94 +3144,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_4_arg_std_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -3218,95 +3246,98 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_4_arg_vector_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -3316,94 +3347,213 @@
   s.reset();
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+}
+
+void test_4_arg_streambuf_async_write_at()
+{
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb;
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ bool called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ int i = boost::asio::async_write_at(s, 0, sb,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_const_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::const_buffers_1 buffers
@@ -3413,731 +3563,639 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_mutable_buffers_1_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::asio::mutable_buffers_1 buffers
@@ -4147,731 +4205,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
 void test_5_arg_boost_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+#if defined(BOOST_ASIO_HAS_BOOST_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   boost::array<boost::asio::const_buffer, 2> buffers = { {
@@ -4882,731 +4849,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+#endif // defined(BOOST_ASIO_HAS_BOOST_ARRAY)
 }
 
 void test_5_arg_std_array_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
 #if defined(BOOST_ASIO_HAS_STD_ARRAY)
   boost::asio::io_service ios;
   test_random_access_device s(ios);
@@ -5618,732 +5494,640 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 #endif // defined(BOOST_ASIO_HAS_STD_ARRAY)
 }
 
 void test_5_arg_vector_buffers_async_write_at()
 {
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   std::vector<boost::asio::const_buffer> buffers;
@@ -6354,753 +6138,1407 @@
   bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_all(),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_at_least(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(1),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 1, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(10),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
       boost::asio::transfer_exactly(42),
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 
   s.reset();
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers, short_transfer,
- boost::bind(async_write_handler,
- boost::asio::placeholders::error,
- boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
   ios.reset();
   ios.run();
- BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ int i = boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
 
-test_suite* init_unit_test_suite(int, char*[])
+void test_5_arg_streambuf_async_write_at()
 {
- test_suite* test = BOOST_TEST_SUITE("write_at");
- test->add(BOOST_TEST_CASE(&test_3_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_3_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_nothrow_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_const_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_const_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_mutable_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_boost_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_std_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_4_arg_vector_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_const_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_mutable_buffers_1_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_boost_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_std_array_buffers_async_write_at));
- test->add(BOOST_TEST_CASE(&test_5_arg_vector_buffers_async_write_at));
- return test;
+#if defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = boost;
+#else // defined(BOOST_ASIO_HAS_BOOST_BIND)
+ namespace bindns = std;
+ using std::placeholders::_1;
+ using std::placeholders::_2;
+#endif // defined(BOOST_ASIO_HAS_BOOST_BIND)
+
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb;
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ bool called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_all(),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 50));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_at_least(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 50, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 50));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(1),
+ bindns::bind(async_write_handler,
+ _1, _2, 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 1));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(10),
+ bindns::bind(async_write_handler,
+ _1, _2, 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 10));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb,
+ boost::asio::transfer_exactly(42),
+ bindns::bind(async_write_handler,
+ _1, _2, 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, 42));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, old_style_transfer_all,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(1);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 0, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ s.next_write_length(10);
+ called = false;
+ boost::asio::async_write_at(s, 1234, sb, short_transfer,
+ bindns::bind(async_write_handler,
+ _1, _2, sizeof(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(called);
+ BOOST_ASIO_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+
+ s.reset();
+ sb.consume(sb.size());
+ sb.sputn(write_data, sizeof(write_data));
+ int i = boost::asio::async_write_at(s, 0, sb, short_transfer,
+ archetypes::lazy_handler());
+ BOOST_ASIO_CHECK(i == 42);
+ ios.reset();
+ ios.run();
+ BOOST_ASIO_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
 }
+
+BOOST_ASIO_TEST_SUITE
+(
+ "write_at",
+ BOOST_ASIO_TEST_CASE(test_3_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_3_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_nothrow_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_const_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_const_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_mutable_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_boost_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_std_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_vector_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_4_arg_streambuf_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_const_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_mutable_buffers_1_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_boost_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_std_array_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_vector_buffers_async_write_at)
+ BOOST_ASIO_TEST_CASE(test_5_arg_streambuf_async_write_at)
+)


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