Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69194 - in trunk: boost boost/asio boost/asio/detail boost/asio/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/impl boost/asio/windows libs/asio/doc libs/asio/doc/overview libs/asio/doc/requirements libs/asio/example/chat libs/asio/example/echo libs/asio/example/http/client libs/asio/example/http/server2 libs/asio/example/iostreams libs/asio/example/local 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/tutorial libs/asio/example/tutorial/daytime1 libs/asio/example/tutorial/daytime2 libs/asio/example/tutorial/daytime3 libs/asio/example/tutorial/daytime4 libs/asio/example/tutorial/daytime7 libs/asio/example/windows libs/asio/test libs/asio/test/ip libs/asio/test/local libs/asio/test/posix libs/asio/test/ssl libs/asio/test/windows
From: chris_at_[hidden]
Date: 2011-02-22 20:06:25


Author: chris_kohlhoff
Date: 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
New Revision: 69194
URL: http://svn.boost.org/trac/boost/changeset/69194

Log:
Changes for asio version 1.5.0:

* Added support for timeouts on socket iostreams, such as
  ip::tcp::iostream. A timeout is set by calling expires_at() or
  expires_from_now() to establish a deadline. Any socket operations
  which occur past the deadline will put the iostream into a bad state.

* Added a new error() member function to socket iostreams, for
  retrieving the error code from the most recent system call.

* Added a new basic_deadline_timer::cancel_one() function. This function
  lets you cancel a single waiting handler on a timer. Handlers are
  cancelled in FIFO order.

* Added a new transfer_exactly() completion condition. This can be used
  to send or receive a specified number of bytes even if the total size
  of the buffer (or buffer sequence) is larger.

* Added new free functions connect() and async_connect(). These
  operations try each endpoint in a list until the socket is
  successfully connected.

* Extended the buffer_size() function so that it works for buffer
  sequences in addition to individual buffers.

* Added a new buffer_copy() function that can be used to copy the raw
  bytes between individual buffers and buffer sequences.

* Added new non-throwing overloads of read(), read_at(), write() and
  write_at() that do not require a completion condition.

* Added friendlier compiler errors for when a completion handler does
  not meet the necessary type requirements. When C++0x is available
  (currently supported for g++ 4.5 or later, and MSVC 10), static_assert
  is also used to generate an informative error message. Checking may be
  disabled by defining BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS.

* Made the is_loopback(), is_unspecified() and is_multicast() functions
  consistently available across the ip::address, ip::address_v4 and
  ip::address_v6 classes. Refs #3939.

* Added new non_blocking() functions for managing the non-blocking
  behaviour of a socket or descriptor. The io_control() commands named
  non_blocking_io are now deprecated in favour of these new functions.

* Added new native_non_blocking() functions for managing the
  non-blocking mode of the underlying socket or descriptor. These
  functions are intended to allow the encapsulation of arbitrary
  non-blocking system calls as asynchronous operations, in a way that is
  transparent to the user of the socket object. The functions have no
  effect on the behaviour of the synchronous operations of the socket or
  descriptor. Refs #3307.

* Added the io_control() member function for socket acceptors.
  Refs #3297.

* For consistency with the C++0x standard library, deprecated the
  native_type typedefs in favour of native_handle_type, and the native()
  member functions in favour of native_handle().

* Added a release() member function to posix descriptors. This function
  releases ownership of the underlying native descriptor to the caller.
  Refs #3900.

* Added support for sequenced packet sockets (SOCK_SEQPACKET).

* Added a new io_service::stopped() function that can be used to
  determine whether the io_service has stopped (i.e. a reset() call is
  needed prior to any further calls to run(), run_one(), poll() or
  poll_one()).

* Reduced the copying of handler function objects.

* Added support for C++0x move construction to further reduce copying of
  handler objects. Move support is enabled when compiling in -std=c++0x
  mode on g++ 4.5 or higher, or when using MSVC10.

* Removed the dependency on OS-provided macros for the well-known IPv4
  and IPv6 addresses. This should eliminate the annoying "missing braces
  around initializer" warnings. Refs #3741.

* Reduced the size of ip::basic_endpoint<> objects (such as
  ip::tcp::endpoint and ip::udp::endpoint).

* Changed the reactor backends to assume that any descriptors or sockets
  added using assign() may have been dup()-ed, and so require explicit
  deregistration from the reactor. Refs #4971.

* Changed the SSL error category to return error strings from the
  OpenSSL library.

* Changed the separate compilation support such that, to use Asio's SSL
  capabilities, you should also include 'asio/ssl/impl/src.hpp in one
  source file in your program.

* Removed the deprecated member functions named io_service(). The
  get_io_service() member functions should be used instead.

* Removed the deprecated typedefs resolver_query and resolver_iterator
  from the ip::tcp, ip::udp and ip::icmp classes.

* Fixed a compile error on some versions of g++ due to anonymous enums.
  Refs #4883.

* Added an explicit cast to the FIONBIO constant to int to suppress a
  compiler warning on some platforms. Refs #5128.

* Fixed warnings reported by g++'s -Wshadow compiler option. Refs #3905.

Added:
   trunk/boost/asio/basic_seq_packet_socket.hpp (contents, props changed)
   trunk/boost/asio/connect.hpp (contents, props changed)
   trunk/boost/asio/detail/handler_type_requirements.hpp (contents, props changed)
   trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp (contents, props changed)
   trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp (contents, props changed)
   trunk/boost/asio/impl/connect.hpp (contents, props changed)
   trunk/boost/asio/seq_packet_socket_service.hpp (contents, props changed)
   trunk/boost/asio/ssl/error.hpp (contents, props changed)
   trunk/boost/asio/ssl/impl/
   trunk/boost/asio/ssl/impl/error.ipp (contents, props changed)
   trunk/boost/asio/ssl/impl/src.hpp (contents, props changed)
   trunk/libs/asio/doc/requirements/ComposedConnectHandler.qbk (contents, props changed)
   trunk/libs/asio/doc/requirements/SeqPacketSocketService.qbk (contents, props changed)
   trunk/libs/asio/example/iostreams/http_client.cpp (contents, props changed)
   trunk/libs/asio/test/basic_raw_socket.cpp (contents, props changed)
   trunk/libs/asio/test/basic_seq_packet_socket.cpp (contents, props changed)
   trunk/libs/asio/test/connect.cpp (contents, props changed)
   trunk/libs/asio/test/raw_socket_service.cpp (contents, props changed)
   trunk/libs/asio/test/seq_packet_socket_service.cpp (contents, props changed)
Text files modified:
   trunk/boost/asio.hpp | 3
   trunk/boost/asio/basic_datagram_socket.hpp | 61
   trunk/boost/asio/basic_deadline_timer.hpp | 69
   trunk/boost/asio/basic_io_object.hpp | 14
   trunk/boost/asio/basic_raw_socket.hpp | 61
   trunk/boost/asio/basic_serial_port.hpp | 43
   trunk/boost/asio/basic_socket.hpp | 363
   trunk/boost/asio/basic_socket_acceptor.hpp | 221
   trunk/boost/asio/basic_socket_iostream.hpp | 98
   trunk/boost/asio/basic_socket_streambuf.hpp | 328
   trunk/boost/asio/basic_stream_socket.hpp | 51
   trunk/boost/asio/basic_streambuf.hpp | 4
   trunk/boost/asio/buffer.hpp | 1218
   trunk/boost/asio/buffered_read_stream.hpp | 99
   trunk/boost/asio/buffered_stream.hpp | 7
   trunk/boost/asio/buffered_write_stream.hpp | 87
   trunk/boost/asio/completion_condition.hpp | 56
   trunk/boost/asio/datagram_socket_service.hpp | 49
   trunk/boost/asio/deadline_timer_service.hpp | 7
   trunk/boost/asio/detail/bind_handler.hpp | 43
   trunk/boost/asio/detail/buffer_sequence_adapter.hpp | 60
   trunk/boost/asio/detail/buffered_stream_storage.hpp | 19
   trunk/boost/asio/detail/completion_handler.hpp | 6
   trunk/boost/asio/detail/config.hpp | 35
   trunk/boost/asio/detail/deadline_timer_service.hpp | 26
   trunk/boost/asio/detail/descriptor_ops.hpp | 10
   trunk/boost/asio/detail/descriptor_read_op.hpp | 4
   trunk/boost/asio/detail/descriptor_write_op.hpp | 4
   trunk/boost/asio/detail/dev_poll_reactor.hpp | 10
   trunk/boost/asio/detail/epoll_reactor.hpp | 10
   trunk/boost/asio/detail/hash_map.hpp | 36
   trunk/boost/asio/detail/impl/descriptor_ops.ipp | 64
   trunk/boost/asio/detail/impl/dev_poll_reactor.hpp | 5
   trunk/boost/asio/detail/impl/dev_poll_reactor.ipp | 4
   trunk/boost/asio/detail/impl/epoll_reactor.hpp | 5
   trunk/boost/asio/detail/impl/epoll_reactor.ipp | 16
   trunk/boost/asio/detail/impl/kqueue_reactor.hpp | 5
   trunk/boost/asio/detail/impl/kqueue_reactor.ipp | 20
   trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp | 35
   trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp | 6
   trunk/boost/asio/detail/impl/reactive_socket_service_base.ipp | 19
   trunk/boost/asio/detail/impl/select_reactor.hpp | 5
   trunk/boost/asio/detail/impl/select_reactor.ipp | 4
   trunk/boost/asio/detail/impl/service_registry.ipp | 2
   trunk/boost/asio/detail/impl/socket_ops.ipp | 183
   trunk/boost/asio/detail/impl/strand_service.hpp | 4
   trunk/boost/asio/detail/impl/task_io_service.hpp | 4
   trunk/boost/asio/detail/impl/task_io_service.ipp | 6
   trunk/boost/asio/detail/impl/timer_queue.ipp | 4
   trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp | 6
   trunk/boost/asio/detail/impl/win_iocp_io_service.hpp | 9
   trunk/boost/asio/detail/impl/win_iocp_serial_port_service.ipp | 6
   trunk/boost/asio/detail/impl/win_iocp_socket_service_base.ipp | 6
   trunk/boost/asio/detail/impl/win_thread.ipp | 13
   trunk/boost/asio/detail/io_control.hpp | 4
   trunk/boost/asio/detail/kqueue_reactor.hpp | 8
   trunk/boost/asio/detail/old_win_sdk_compat.hpp | 124
   trunk/boost/asio/detail/posix_thread.hpp | 2
   trunk/boost/asio/detail/reactive_descriptor_service.hpp | 50
   trunk/boost/asio/detail/reactive_null_buffers_op.hpp | 4
   trunk/boost/asio/detail/reactive_serial_port_service.hpp | 15
   trunk/boost/asio/detail/reactive_socket_accept_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_connect_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_recv_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_send_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_sendto_op.hpp | 4
   trunk/boost/asio/detail/reactive_socket_service.hpp | 22
   trunk/boost/asio/detail/reactive_socket_service_base.hpp | 122
   trunk/boost/asio/detail/resolve_endpoint_op.hpp | 4
   trunk/boost/asio/detail/resolve_op.hpp | 4
   trunk/boost/asio/detail/resolver_service.hpp | 8
   trunk/boost/asio/detail/select_reactor.hpp | 12
   trunk/boost/asio/detail/socket_ops.hpp | 31
   trunk/boost/asio/detail/socket_types.hpp | 2
   trunk/boost/asio/detail/strand_service.hpp | 4
   trunk/boost/asio/detail/task_io_service.hpp | 9
   trunk/boost/asio/detail/timer_queue.hpp | 16
   trunk/boost/asio/detail/win_iocp_handle_read_op.hpp | 5
   trunk/boost/asio/detail/win_iocp_handle_service.hpp | 16
   trunk/boost/asio/detail/win_iocp_handle_write_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_io_service.hpp | 16
   trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_overlapped_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp | 4
   trunk/boost/asio/detail/win_iocp_serial_port_service.hpp | 14
   trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp | 6
   trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_socket_send_op.hpp | 4
   trunk/boost/asio/detail/win_iocp_socket_service.hpp | 26
   trunk/boost/asio/detail/win_iocp_socket_service_base.hpp | 110
   trunk/boost/asio/detail/wince_thread.hpp | 2
   trunk/boost/asio/detail/wrapped_handler.hpp | 2
   trunk/boost/asio/error.hpp | 24
   trunk/boost/asio/impl/error.ipp | 26
   trunk/boost/asio/impl/io_service.hpp | 27
   trunk/boost/asio/impl/io_service.ipp | 5
   trunk/boost/asio/impl/read.hpp | 54
   trunk/boost/asio/impl/read_at.hpp | 55
   trunk/boost/asio/impl/read_until.hpp | 65
   trunk/boost/asio/impl/write.hpp | 57
   trunk/boost/asio/impl/write_at.hpp | 58
   trunk/boost/asio/io_service.hpp | 48
   trunk/boost/asio/ip/address.hpp | 9
   trunk/boost/asio/ip/address_v4.hpp | 12
   trunk/boost/asio/ip/basic_endpoint.hpp | 9
   trunk/boost/asio/ip/basic_resolver.hpp | 17
   trunk/boost/asio/ip/basic_resolver_entry.hpp | 10
   trunk/boost/asio/ip/basic_resolver_query.hpp | 69
   trunk/boost/asio/ip/detail/endpoint.hpp | 5
   trunk/boost/asio/ip/detail/impl/endpoint.ipp | 14
   trunk/boost/asio/ip/detail/socket_option.hpp | 38
   trunk/boost/asio/ip/icmp.hpp | 12
   trunk/boost/asio/ip/impl/address.ipp | 21
   trunk/boost/asio/ip/impl/address_v4.ipp | 18
   trunk/boost/asio/ip/impl/address_v6.ipp | 66
   trunk/boost/asio/ip/tcp.hpp | 10
   trunk/boost/asio/ip/udp.hpp | 10
   trunk/boost/asio/local/basic_endpoint.hpp | 12
   trunk/boost/asio/local/detail/endpoint.hpp | 4
   trunk/boost/asio/local/detail/impl/endpoint.ipp | 20
   trunk/boost/asio/posix/basic_descriptor.hpp | 160
   trunk/boost/asio/posix/basic_stream_descriptor.hpp | 24
   trunk/boost/asio/posix/descriptor_base.hpp | 3
   trunk/boost/asio/posix/stream_descriptor_service.hpp | 67
   trunk/boost/asio/raw_socket_service.hpp | 49
   trunk/boost/asio/read.hpp | 68
   trunk/boost/asio/read_at.hpp | 79
   trunk/boost/asio/serial_port_service.hpp | 25
   trunk/boost/asio/socket_acceptor_service.hpp | 49
   trunk/boost/asio/socket_base.hpp | 8
   trunk/boost/asio/ssl.hpp | 1
   trunk/boost/asio/ssl/detail/openssl_operation.hpp | 1
   trunk/boost/asio/ssl/stream.hpp | 14
   trunk/boost/asio/strand.hpp | 31
   trunk/boost/asio/stream_socket_service.hpp | 49
   trunk/boost/asio/version.hpp | 2
   trunk/boost/asio/windows/basic_handle.hpp | 39
   trunk/boost/asio/windows/basic_random_access_handle.hpp | 30
   trunk/boost/asio/windows/basic_stream_handle.hpp | 29
   trunk/boost/asio/windows/random_access_handle_service.hpp | 25
   trunk/boost/asio/windows/stream_handle_service.hpp | 25
   trunk/boost/asio/write.hpp | 70
   trunk/boost/asio/write_at.hpp | 79
   trunk/libs/asio/doc/asio.qbk | 11
   trunk/libs/asio/doc/examples.qbk | 8
   trunk/libs/asio/doc/overview/basics.qbk | 12
   trunk/libs/asio/doc/overview/implementation.qbk | 4
   trunk/libs/asio/doc/overview/serial_ports.qbk | 11
   trunk/libs/asio/doc/overview/ssl.qbk | 5
   trunk/libs/asio/doc/quickref.xml | 12
   trunk/libs/asio/doc/reference.qbk | 60301 ++++++++++++++++++++++++---------------
   trunk/libs/asio/doc/reference.xsl | 8
   trunk/libs/asio/doc/requirements/AsyncReadStream.qbk | 4
   trunk/libs/asio/doc/requirements/AsyncWriteStream.qbk | 4
   trunk/libs/asio/doc/requirements/DatagramSocketService.qbk | 8
   trunk/libs/asio/doc/requirements/DescriptorService.qbk | 10
   trunk/libs/asio/doc/requirements/HandleService.qbk | 10
   trunk/libs/asio/doc/requirements/RawSocketService.qbk | 8
   trunk/libs/asio/doc/requirements/ResolverService.qbk | 4
   trunk/libs/asio/doc/requirements/SerialPortService.qbk | 10
   trunk/libs/asio/doc/requirements/SocketAcceptorService.qbk | 22
   trunk/libs/asio/doc/requirements/SocketService.qbk | 20
   trunk/libs/asio/doc/requirements/StreamDescriptorService.qbk | 4
   trunk/libs/asio/doc/requirements/StreamHandleService.qbk | 4
   trunk/libs/asio/doc/requirements/StreamSocketService.qbk | 4
   trunk/libs/asio/doc/requirements/TimerService.qbk | 2
   trunk/libs/asio/doc/requirements/asynchronous_operations.qbk | 10
   trunk/libs/asio/doc/tutorial.qbk | 42
   trunk/libs/asio/doc/using.qbk | 3
   trunk/libs/asio/example/chat/chat_client.cpp | 16
   trunk/libs/asio/example/chat/chat_message.hpp | 4
   trunk/libs/asio/example/chat/posix_chat_client.cpp | 18
   trunk/libs/asio/example/echo/blocking_tcp_echo_client.cpp | 2
   trunk/libs/asio/example/http/client/async_client.cpp | 21
   trunk/libs/asio/example/http/client/sync_client.cpp | 11
   trunk/libs/asio/example/http/server2/server.cpp | 2
   trunk/libs/asio/example/iostreams/Jamfile | 12
   trunk/libs/asio/example/iostreams/Jamfile.v2 | 1
   trunk/libs/asio/example/iostreams/daytime_client.cpp | 6
   trunk/libs/asio/example/local/iostream_client.cpp | 2
   trunk/libs/asio/example/nonblocking/third_party_lib.cpp | 5
   trunk/libs/asio/example/porthopper/protocol.hpp | 19
   trunk/libs/asio/example/serialization/client.cpp | 17
   trunk/libs/asio/example/serialization/connection.hpp | 2
   trunk/libs/asio/example/serialization/server.cpp | 4
   trunk/libs/asio/example/services/daytime_client.cpp | 16
   trunk/libs/asio/example/services/logger_service.hpp | 2
   trunk/libs/asio/example/services/stream_socket_service.hpp | 4
   trunk/libs/asio/example/socks4/sync_client.cpp | 11
   trunk/libs/asio/example/ssl/client.cpp | 16
   trunk/libs/asio/example/timeouts/blocking_tcp_client.cpp | 62
   trunk/libs/asio/example/tutorial/daytime1/client.cpp | 10
   trunk/libs/asio/example/tutorial/daytime2/server.cpp | 3
   trunk/libs/asio/example/tutorial/daytime3/server.cpp | 2
   trunk/libs/asio/example/tutorial/daytime4/client.cpp | 2
   trunk/libs/asio/example/tutorial/daytime7/server.cpp | 2
   trunk/libs/asio/example/tutorial/daytime_dox.txt | 10
   trunk/libs/asio/example/windows/transmit_file.cpp | 6
   trunk/libs/asio/test/Jamfile | 5
   trunk/libs/asio/test/Jamfile.v2 | 10
   trunk/libs/asio/test/buffer.cpp | 103
   trunk/libs/asio/test/deadline_timer.cpp | 31
   trunk/libs/asio/test/io_service.cpp | 20
   trunk/libs/asio/test/ip/address.cpp | 100
   trunk/libs/asio/test/ip/address_v4.cpp | 141
   trunk/libs/asio/test/ip/address_v6.cpp | 220
   trunk/libs/asio/test/ip/tcp.cpp | 21
   trunk/libs/asio/test/ip/udp.cpp | 18
   trunk/libs/asio/test/local/datagram_protocol.cpp | 2
   trunk/libs/asio/test/local/stream_protocol.cpp | 2
   trunk/libs/asio/test/posix/stream_descriptor.cpp | 20
   trunk/libs/asio/test/read.cpp | 1085
   trunk/libs/asio/test/read_at.cpp | 3215 +
   trunk/libs/asio/test/read_until.cpp | 26
   trunk/libs/asio/test/serial_port.cpp | 11
   trunk/libs/asio/test/ssl/stream.cpp | 2
   trunk/libs/asio/test/windows/random_access_handle.cpp | 6
   trunk/libs/asio/test/windows/stream_handle.cpp | 6
   trunk/libs/asio/test/write.cpp | 965
   trunk/libs/asio/test/write_at.cpp | 2560 +
   222 files changed, 49653 insertions(+), 25670 deletions(-)

Modified: trunk/boost/asio.hpp
==============================================================================
--- trunk/boost/asio.hpp (original)
+++ trunk/boost/asio.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -21,6 +21,7 @@
 #include <boost/asio/basic_deadline_timer.hpp>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/basic_raw_socket.hpp>
+#include <boost/asio/basic_seq_packet_socket.hpp>
 #include <boost/asio/basic_serial_port.hpp>
 #include <boost/asio/basic_socket_acceptor.hpp>
 #include <boost/asio/basic_socket_iostream.hpp>
@@ -36,6 +37,7 @@
 #include <boost/asio/buffered_write_stream.hpp>
 #include <boost/asio/buffers_iterator.hpp>
 #include <boost/asio/completion_condition.hpp>
+#include <boost/asio/connect.hpp>
 #include <boost/asio/datagram_socket_service.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
 #include <boost/asio/deadline_timer.hpp>
@@ -76,6 +78,7 @@
 #include <boost/asio/read.hpp>
 #include <boost/asio/read_at.hpp>
 #include <boost/asio/read_until.hpp>
+#include <boost/asio/seq_packet_socket_service.hpp>
 #include <boost/asio/serial_port.hpp>
 #include <boost/asio/serial_port_base.hpp>
 #include <boost/asio/serial_port_service.hpp>

Modified: trunk/boost/asio/basic_datagram_socket.hpp
==============================================================================
--- trunk/boost/asio/basic_datagram_socket.hpp (original)
+++ trunk/boost/asio/basic_datagram_socket.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 #include <cstddef>
 #include <boost/asio/basic_socket.hpp>
 #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/error.hpp>
 
@@ -42,8 +43,12 @@
   : public basic_socket<Protocol, DatagramSocketService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// socket.
+ typedef typename DatagramSocketService::native_handle_type native_type;
+
   /// The native representation of a socket.
- typedef typename DatagramSocketService::native_type native_type;
+ typedef typename DatagramSocketService::native_handle_type native_handle_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -121,7 +126,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_datagram_socket(boost::asio::io_service& io_service,
- const protocol_type& protocol, const native_type& native_socket)
+ const protocol_type& protocol, const native_handle_type& native_socket)
     : basic_socket<Protocol, DatagramSocketService>(
         io_service, protocol, native_socket)
   {
@@ -249,7 +254,12 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, 0, 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->service.async_send(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -285,7 +295,12 @@
   void async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, flags, 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->service.async_send(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Send a datagram to the specified endpoint.
@@ -417,8 +432,12 @@
   void async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, 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->service.async_send_to(this->implementation, buffers, destination, 0,
- handler);
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send.
@@ -453,8 +472,12 @@
       const endpoint_type& destination, socket_base::message_flags flags,
       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->service.async_send_to(this->implementation, buffers, destination,
- flags, handler);
+ flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Receive some data on a connected socket.
@@ -584,7 +607,12 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, 0, 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->service.async_receive(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -619,7 +647,12 @@
   void async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, flags, 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->service.async_receive(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Receive a datagram with the endpoint of the sender.
@@ -751,8 +784,12 @@
   void async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, 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->service.async_receive_from(this->implementation, buffers,
- sender_endpoint, 0, handler);
+ sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -789,8 +826,12 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       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->service.async_receive_from(this->implementation, buffers,
- sender_endpoint, flags, handler);
+ sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/basic_deadline_timer.hpp
==============================================================================
--- trunk/boost/asio/basic_deadline_timer.hpp (original)
+++ trunk/boost/asio/basic_deadline_timer.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 #include <cstddef>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/deadline_timer_service.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 
@@ -240,6 +241,67 @@
     return this->service.cancel(this->implementation, ec);
   }
 
+ /// Cancels one asynchronous operation that is waiting on the timer.
+ /**
+ * This function forces the completion of one pending asynchronous wait
+ * operation against the timer. Handlers are cancelled in FIFO order. The
+ * handler for the cancelled operation will be invoked with the
+ * boost::asio::error::operation_aborted error code.
+ *
+ * Cancelling the timer does not change the expiry time.
+ *
+ * @return The number of asynchronous operations that were cancelled. That is,
+ * either 0 or 1.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note If the timer has already expired when cancel_one() is called, then
+ * the handlers for asynchronous wait operations will:
+ *
+ * @li have already been invoked; or
+ *
+ * @li have been queued for invocation in the near future.
+ *
+ * These handlers can no longer be cancelled, and therefore are passed an
+ * error code that indicates the successful completion of the wait operation.
+ */
+ std::size_t cancel_one()
+ {
+ boost::system::error_code ec;
+ std::size_t s = this->service.cancel_one(this->implementation, ec);
+ boost::asio::detail::throw_error(ec);
+ return s;
+ }
+
+ /// Cancels one asynchronous operation that is waiting on the timer.
+ /**
+ * This function forces the completion of one pending asynchronous wait
+ * operation against the timer. Handlers are cancelled in FIFO order. The
+ * handler for the cancelled operation will be invoked with the
+ * boost::asio::error::operation_aborted error code.
+ *
+ * Cancelling the timer does not change the expiry time.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @return The number of asynchronous operations that were cancelled. That is,
+ * either 0 or 1.
+ *
+ * @note If the timer has already expired when cancel_one() is called, then
+ * the handlers for asynchronous wait operations will:
+ *
+ * @li have already been invoked; or
+ *
+ * @li have been queued for invocation in the near future.
+ *
+ * These handlers can no longer be cancelled, and therefore are passed an
+ * error code that indicates the successful completion of the wait operation.
+ */
+ std::size_t cancel_one(boost::system::error_code& ec)
+ {
+ return this->service.cancel_one(this->implementation, ec);
+ }
+
   /// Get the timer's expiry time as an absolute time.
   /**
    * This function may be used to obtain the timer's current expiry time.
@@ -432,7 +494,12 @@
   template <typename WaitHandler>
   void async_wait(WaitHandler handler)
   {
- this->service.async_wait(this->implementation, 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,
+ BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/basic_io_object.hpp
==============================================================================
--- trunk/boost/asio/basic_io_object.hpp (original)
+++ trunk/boost/asio/basic_io_object.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -36,20 +36,6 @@
   /// The underlying implementation type of I/O object.
   typedef typename service_type::implementation_type implementation_type;
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the object.
- /**
- * This function may be used to obtain the io_service object that the I/O
- * object uses to dispatch handlers for asynchronous operations.
- *
- * @return A reference to the io_service object that the I/O object will use
- * to dispatch handlers. Ownership is not transferred to the caller.
- */
- boost::asio::io_service& io_service()
- {
- return service.get_io_service();
- }
-
   /// Get the io_service associated with the object.
   /**
    * This function may be used to obtain the io_service object that the I/O

Modified: trunk/boost/asio/basic_raw_socket.hpp
==============================================================================
--- trunk/boost/asio/basic_raw_socket.hpp (original)
+++ trunk/boost/asio/basic_raw_socket.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <boost/asio/basic_socket.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/raw_socket_service.hpp>
@@ -42,8 +43,12 @@
   : public basic_socket<Protocol, RawSocketService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// socket.
+ typedef typename RawSocketService::native_handle_type native_type;
+
   /// The native representation of a socket.
- typedef typename RawSocketService::native_type native_type;
+ typedef typename RawSocketService::native_handle_type native_handle_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -121,7 +126,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_raw_socket(boost::asio::io_service& io_service,
- const protocol_type& protocol, const native_type& native_socket)
+ const protocol_type& protocol, const native_handle_type& native_socket)
     : basic_socket<Protocol, RawSocketService>(
         io_service, protocol, native_socket)
   {
@@ -245,7 +250,12 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, 0, 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->service.async_send(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send on a connected socket.
@@ -280,7 +290,12 @@
   void async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, flags, 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->service.async_send(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Send raw data to the specified endpoint.
@@ -412,8 +427,12 @@
   void async_send_to(const ConstBufferSequence& buffers,
       const endpoint_type& destination, 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->service.async_send_to(this->implementation, buffers, destination, 0,
- handler);
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send.
@@ -448,8 +467,12 @@
       const endpoint_type& destination, socket_base::message_flags flags,
       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->service.async_send_to(this->implementation, buffers, destination,
- flags, handler);
+ flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Receive some data on a connected socket.
@@ -579,7 +602,12 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, 0, 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->service.async_receive(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive on a connected socket.
@@ -614,7 +642,12 @@
   void async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, flags, 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->service.async_receive(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Receive raw data with the endpoint of the sender.
@@ -746,8 +779,12 @@
   void async_receive_from(const MutableBufferSequence& buffers,
       endpoint_type& sender_endpoint, 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->service.async_receive_from(this->implementation, buffers,
- sender_endpoint, 0, handler);
+ sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -784,8 +821,12 @@
       endpoint_type& sender_endpoint, socket_base::message_flags flags,
       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->service.async_receive_from(this->implementation, buffers,
- sender_endpoint, flags, handler);
+ sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Added: trunk/boost/asio/basic_seq_packet_socket.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/basic_seq_packet_socket.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,473 @@
+//
+// basic_seq_packet_socket.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_BASIC_SEQ_PACKET_SOCKET_HPP
+#define BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_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/basic_socket.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/seq_packet_socket_service.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// Provides sequenced packet socket functionality.
+/**
+ * The basic_seq_packet_socket class template provides asynchronous and blocking
+ * sequenced packet socket functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe._at_n
+ * @e Shared @e objects: Unsafe.
+ */
+template <typename Protocol,
+ typename SeqPacketSocketService = seq_packet_socket_service<Protocol> >
+class basic_seq_packet_socket
+ : public basic_socket<Protocol, SeqPacketSocketService>
+{
+public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// socket.
+ typedef typename SeqPacketSocketService::native_handle_type native_type;
+
+ /// The native representation of a socket.
+ typedef typename SeqPacketSocketService::native_handle_type
+ native_handle_type;
+
+ /// The protocol type.
+ typedef Protocol protocol_type;
+
+ /// The endpoint type.
+ typedef typename Protocol::endpoint endpoint_type;
+
+ /// Construct a basic_seq_packet_socket without opening it.
+ /**
+ * This constructor creates a sequenced packet socket without opening it. The
+ * socket needs to be opened and then connected or accepted before data can
+ * be sent or received on it.
+ *
+ * @param io_service The io_service object that the sequenced packet socket
+ * will use to dispatch handlers for any asynchronous operations performed on
+ * the socket.
+ */
+ explicit basic_seq_packet_socket(boost::asio::io_service& io_service)
+ : basic_socket<Protocol, SeqPacketSocketService>(io_service)
+ {
+ }
+
+ /// Construct and open a basic_seq_packet_socket.
+ /**
+ * This constructor creates and opens a sequenced_packet socket. The socket
+ * needs to be connected or accepted before data can be sent or received on
+ * it.
+ *
+ * @param io_service The io_service object that the sequenced packet socket
+ * will use to dispatch handlers for any asynchronous operations performed on
+ * the socket.
+ *
+ * @param protocol An object specifying protocol parameters to be used.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ */
+ basic_seq_packet_socket(boost::asio::io_service& io_service,
+ const protocol_type& protocol)
+ : basic_socket<Protocol, SeqPacketSocketService>(io_service, protocol)
+ {
+ }
+
+ /// Construct a basic_seq_packet_socket, opening it and binding it to the
+ /// given local endpoint.
+ /**
+ * This constructor creates a sequenced packet socket and automatically opens
+ * it bound to the specified endpoint on the local machine. The protocol used
+ * is the protocol associated with the given endpoint.
+ *
+ * @param io_service The io_service object that the sequenced packet socket
+ * will use to dispatch handlers for any asynchronous operations performed on
+ * the socket.
+ *
+ * @param endpoint An endpoint on the local machine to which the sequenced
+ * packet socket will be bound.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ */
+ basic_seq_packet_socket(boost::asio::io_service& io_service,
+ const endpoint_type& endpoint)
+ : basic_socket<Protocol, SeqPacketSocketService>(io_service, endpoint)
+ {
+ }
+
+ /// Construct a basic_seq_packet_socket on an existing native socket.
+ /**
+ * This constructor creates a sequenced packet socket object to hold an
+ * existing native socket.
+ *
+ * @param io_service The io_service object that the sequenced packet socket
+ * will use to dispatch handlers for any asynchronous operations performed on
+ * the socket.
+ *
+ * @param protocol An object specifying protocol parameters to be used.
+ *
+ * @param native_socket The new underlying socket implementation.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ */
+ basic_seq_packet_socket(boost::asio::io_service& io_service,
+ const protocol_type& protocol, const native_handle_type& native_socket)
+ : basic_socket<Protocol, SeqPacketSocketService>(
+ io_service, protocol, native_socket)
+ {
+ }
+
+ /// Send some data on the socket.
+ /**
+ * This function is used to send data on the sequenced packet socket. The
+ * function call will block until the data has been sent successfully, or an
+ * until error occurs.
+ *
+ * @param buffers One or more data buffers to be sent on the socket.
+ *
+ * @param flags Flags specifying how the send call is to be made.
+ *
+ * @returns The number of bytes sent.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @par Example
+ * To send a single data buffer use the @ref buffer function as follows:
+ * @code
+ * socket.send(boost::asio::buffer(data, size), 0);
+ * @endcode
+ * See the @ref buffer documentation for information on sending multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t send(const ConstBufferSequence& buffers,
+ socket_base::message_flags flags)
+ {
+ boost::system::error_code ec;
+ std::size_t s = this->service.send(
+ this->implementation, buffers, flags, ec);
+ boost::asio::detail::throw_error(ec);
+ return s;
+ }
+
+ /// Send some data on the socket.
+ /**
+ * This function is used to send data on the sequenced packet socket. The
+ * function call will block the data has been sent successfully, or an until
+ * error occurs.
+ *
+ * @param buffers One or more data buffers to be sent on the socket.
+ *
+ * @param flags Flags specifying how the send call is to be made.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes sent. Returns 0 if an error occurred.
+ *
+ * @note The send operation may not transmit all of the data to the peer.
+ * Consider using the @ref write function if you need to ensure that all data
+ * is written before the blocking operation completes.
+ */
+ template <typename ConstBufferSequence>
+ std::size_t send(const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, boost::system::error_code& ec)
+ {
+ return this->service.send(this->implementation, buffers, flags, ec);
+ }
+
+ /// Start an asynchronous send.
+ /**
+ * This function is used to asynchronously send data on the sequenced packet
+ * socket. The function call always returns immediately.
+ *
+ * @param buffers One or more data buffers to be sent on the socket. Although
+ * the buffers object may be copied as necessary, ownership of the underlying
+ * memory blocks is retained by the caller, which must guarantee that they
+ * remain valid until the handler is called.
+ *
+ * @param flags Flags specifying how the send call is to be made.
+ *
+ * @param handler The handler to be called when the send operation completes.
+ * Copies will be made of the handler as required. The function signature of
+ * the handler must be:
+ * @code void handler(
+ * const boost::system::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes sent.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @par Example
+ * To send a single data buffer use the @ref buffer function as follows:
+ * @code
+ * socket.async_send(boost::asio::buffer(data, size), 0, handler);
+ * @endcode
+ * See the @ref buffer documentation for information on sending multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename ConstBufferSequence, typename WriteHandler>
+ void async_send(const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, 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->service.async_send(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
+ }
+
+ /// Receive some data on the socket.
+ /**
+ * This function is used to receive data on the sequenced packet socket. The
+ * function call will block until data has been received successfully, or
+ * until an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be received.
+ *
+ * @param out_flags After the receive call completes, contains flags
+ * associated with the received data. For example, if the
+ * socket_base::message_end_of_record bit is set then the received data marks
+ * the end of a record.
+ *
+ * @returns The number of bytes received.
+ *
+ * @throws boost::system::system_error Thrown on failure. An error code of
+ * boost::asio::error::eof indicates that the connection was closed by the
+ * peer.
+ *
+ * @par Example
+ * To receive into a single data buffer use the @ref buffer function as
+ * follows:
+ * @code
+ * socket.receive(boost::asio::buffer(data, size), out_flags);
+ * @endcode
+ * See the @ref buffer documentation for information on receiving into
+ * multiple buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t receive(const MutableBufferSequence& buffers,
+ socket_base::message_flags& out_flags)
+ {
+ boost::system::error_code ec;
+ std::size_t s = this->service.receive(
+ this->implementation, buffers, 0, out_flags, ec);
+ boost::asio::detail::throw_error(ec);
+ return s;
+ }
+
+ /// Receive some data on the socket.
+ /**
+ * This function is used to receive data on the sequenced packet socket. The
+ * function call will block until data has been received successfully, or
+ * until an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be received.
+ *
+ * @param in_flags Flags specifying how the receive call is to be made.
+ *
+ * @param out_flags After the receive call completes, contains flags
+ * associated with the received data. For example, if the
+ * socket_base::message_end_of_record bit is set then the received data marks
+ * the end of a record.
+ *
+ * @returns The number of bytes received.
+ *
+ * @throws boost::system::system_error Thrown on failure. An error code of
+ * boost::asio::error::eof indicates that the connection was closed by the
+ * peer.
+ *
+ * @note The receive operation may not receive all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that the
+ * requested amount of data is read before the blocking operation completes.
+ *
+ * @par Example
+ * To receive into a single data buffer use the @ref buffer function as
+ * follows:
+ * @code
+ * socket.receive(boost::asio::buffer(data, size), 0, out_flags);
+ * @endcode
+ * See the @ref buffer documentation for information on receiving into
+ * multiple buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t receive(const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags)
+ {
+ boost::system::error_code ec;
+ std::size_t s = this->service.receive(
+ this->implementation, buffers, in_flags, out_flags, ec);
+ boost::asio::detail::throw_error(ec);
+ return s;
+ }
+
+ /// Receive some data on a connected socket.
+ /**
+ * This function is used to receive data on the sequenced packet socket. The
+ * function call will block until data has been received successfully, or
+ * until an error occurs.
+ *
+ * @param buffers One or more buffers into which the data will be received.
+ *
+ * @param in_flags Flags specifying how the receive call is to be made.
+ *
+ * @param out_flags After the receive call completes, contains flags
+ * associated with the received data. For example, if the
+ * socket_base::message_end_of_record bit is set then the received data marks
+ * the end of a record.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes received. Returns 0 if an error occurred.
+ *
+ * @note The receive operation may not receive all of the requested number of
+ * bytes. Consider using the @ref read function if you need to ensure that the
+ * requested amount of data is read before the blocking operation completes.
+ */
+ template <typename MutableBufferSequence>
+ std::size_t receive(const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ return this->service.receive(this->implementation,
+ buffers, in_flags, out_flags, ec);
+ }
+
+ /// Start an asynchronous receive.
+ /**
+ * This function is used to asynchronously receive data from the sequenced
+ * packet socket. The function call always returns immediately.
+ *
+ * @param buffers One or more buffers into which the data will be received.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the handler is called.
+ *
+ * @param out_flags Once the asynchronous operation completes, contains flags
+ * associated with the received data. For example, if the
+ * socket_base::message_end_of_record bit is set then the received data marks
+ * the end of a record. The caller must guarantee that the referenced
+ * variable remains valid until the handler is called.
+ *
+ * @param handler The handler to be called when the receive operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * const boost::system::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes received.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @par Example
+ * To receive into a single data buffer use the @ref buffer function as
+ * follows:
+ * @code
+ * socket.async_receive(boost::asio::buffer(data, size), out_flags, handler);
+ * @endcode
+ * See the @ref buffer documentation for information on receiving into
+ * multiple buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence, typename ReadHandler>
+ void async_receive(const MutableBufferSequence& buffers,
+ socket_base::message_flags& out_flags, 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->service.async_receive(this->implementation, buffers,
+ 0, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ }
+
+ /// Start an asynchronous receive.
+ /**
+ * This function is used to asynchronously receive data from the sequenced
+ * data socket. The function call always returns immediately.
+ *
+ * @param buffers One or more buffers into which the data will be received.
+ * Although the buffers object may be copied as necessary, ownership of the
+ * underlying memory blocks is retained by the caller, which must guarantee
+ * that they remain valid until the handler is called.
+ *
+ * @param in_flags Flags specifying how the receive call is to be made.
+ *
+ * @param out_flags Once the asynchronous operation completes, contains flags
+ * associated with the received data. For example, if the
+ * socket_base::message_end_of_record bit is set then the received data marks
+ * the end of a record. The caller must guarantee that the referenced
+ * variable remains valid until the handler is called.
+ *
+ * @param handler The handler to be called when the receive operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * const boost::system::error_code& error, // Result of operation.
+ * std::size_t bytes_transferred // Number of bytes received.
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @par Example
+ * To receive into a single data buffer use the @ref buffer function as
+ * follows:
+ * @code
+ * socket.async_receive(
+ * boost::asio::buffer(data, size),
+ * 0, out_flags, handler);
+ * @endcode
+ * See the @ref buffer documentation for information on receiving into
+ * multiple buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ */
+ template <typename MutableBufferSequence, typename ReadHandler>
+ void async_receive(const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, 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->service.async_receive(this->implementation, buffers,
+ in_flags, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
+ }
+};
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP

Modified: trunk/boost/asio/basic_serial_port.hpp
==============================================================================
--- trunk/boost/asio/basic_serial_port.hpp (original)
+++ trunk/boost/asio/basic_serial_port.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,6 +23,7 @@
 
 #include <string>
 #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/error.hpp>
 #include <boost/asio/serial_port_base.hpp>
@@ -48,8 +49,12 @@
     public serial_port_base
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// serial port.
+ typedef typename SerialPortService::native_handle_type native_type;
+
   /// The native representation of a serial port.
- typedef typename SerialPortService::native_type native_type;
+ typedef typename SerialPortService::native_handle_type native_handle_type;
 
   /// A basic_serial_port is always the lowest layer.
   typedef basic_serial_port<SerialPortService> lowest_layer_type;
@@ -119,7 +124,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_serial_port(boost::asio::io_service& io_service,
- const native_type& native_serial_port)
+ const native_handle_type& native_serial_port)
     : basic_io_object<SerialPortService>(io_service)
   {
     boost::system::error_code ec;
@@ -193,7 +198,7 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
- void assign(const native_type& native_serial_port)
+ void assign(const native_handle_type& native_serial_port)
   {
     boost::system::error_code ec;
     this->service.assign(this->implementation, native_serial_port, ec);
@@ -208,7 +213,7 @@
    *
    * @param ec Set to indicate what error occurred, if any.
    */
- boost::system::error_code assign(const native_type& native_serial_port,
+ boost::system::error_code assign(const native_handle_type& native_serial_port,
       boost::system::error_code& ec)
   {
     return this->service.assign(this->implementation, native_serial_port, ec);
@@ -248,7 +253,8 @@
     return this->service.close(this->implementation, ec);
   }
 
- /// Get the native serial port representation.
+ /// (Deprecated: Use native_handle().) Get the native serial port
+ /// representation.
   /**
    * This function may be used to obtain the underlying representation of the
    * serial port. This is intended to allow access to native serial port
@@ -256,7 +262,18 @@
    */
   native_type native()
   {
- return this->service.native(this->implementation);
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Get the native serial port representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * serial port. This is intended to allow access to native serial port
+ * functionality that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return this->service.native_handle(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the serial port.
@@ -503,7 +520,12 @@
   void async_write_some(const ConstBufferSequence& buffers,
       WriteHandler handler)
   {
- this->service.async_write_some(this->implementation, buffers, 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->service.async_write_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Read some data from the serial port.
@@ -607,7 +629,12 @@
   void async_read_some(const MutableBufferSequence& buffers,
       ReadHandler handler)
   {
- this->service.async_read_some(this->implementation, buffers, 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->service.async_read_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/basic_socket.hpp
==============================================================================
--- trunk/boost/asio/basic_socket.hpp (original)
+++ trunk/boost/asio/basic_socket.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.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/error.hpp>
 #include <boost/asio/socket_base.hpp>
@@ -41,8 +42,12 @@
     public socket_base
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// socket.
+ typedef typename SocketService::native_handle_type native_type;
+
   /// The native representation of a socket.
- typedef typename SocketService::native_type native_type;
+ typedef typename SocketService::native_handle_type native_handle_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -125,7 +130,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_socket(boost::asio::io_service& io_service,
- const protocol_type& protocol, const native_type& native_socket)
+ const protocol_type& protocol, const native_handle_type& native_socket)
     : basic_io_object<SocketService>(io_service)
   {
     boost::system::error_code ec;
@@ -217,7 +222,8 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
- void assign(const protocol_type& protocol, const native_type& native_socket)
+ void assign(const protocol_type& protocol,
+ const native_handle_type& native_socket)
   {
     boost::system::error_code ec;
     this->service.assign(this->implementation, protocol, native_socket, ec);
@@ -235,7 +241,7 @@
    * @param ec Set to indicate what error occurred, if any.
    */
   boost::system::error_code assign(const protocol_type& protocol,
- const native_type& native_socket, boost::system::error_code& ec)
+ const native_handle_type& native_socket, boost::system::error_code& ec)
   {
     return this->service.assign(this->implementation,
         protocol, native_socket, ec);
@@ -293,7 +299,7 @@
     return this->service.close(this->implementation, ec);
   }
 
- /// Get the native socket representation.
+ /// (Deprecated: Use native_handle().) Get the native socket representation.
   /**
    * This function may be used to obtain the underlying representation of the
    * socket. This is intended to allow access to native socket functionality
@@ -301,7 +307,18 @@
    */
   native_type native()
   {
- return this->service.native(this->implementation);
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Get the native socket representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * socket. This is intended to allow access to native socket functionality
+ * that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return this->service.native_handle(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -640,6 +657,10 @@
   template <typename ConnectHandler>
   void async_connect(const endpoint_type& peer_endpoint, ConnectHandler handler)
   {
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ConnectHandler.
+ BOOST_ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check;
+
     if (!is_open())
     {
       boost::system::error_code ec;
@@ -652,7 +673,8 @@
       }
     }
 
- this->service.async_connect(this->implementation, peer_endpoint, handler);
+ this->service.async_connect(this->implementation, peer_endpoint,
+ BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
   }
 
   /// Set an option on the socket.
@@ -897,6 +919,333 @@
     return this->service.io_control(this->implementation, command, ec);
   }
 
+ /// Gets the non-blocking mode of the socket.
+ /**
+ * @returns @c true if the socket's synchronous operations will fail with
+ * boost::asio::error::would_block if they are unable to perform the requested
+ * operation immediately. If @c false, synchronous operations will block
+ * until complete.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ bool non_blocking() const
+ {
+ return this->service.non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ /**
+ * @param mode If @c true, the socket's synchronous operations will fail with
+ * boost::asio::error::would_block if they are unable to perform the requested
+ * operation immediately. If @c false, synchronous operations will block
+ * until complete.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ void non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ /**
+ * @param mode If @c true, the socket's synchronous operations will fail with
+ * boost::asio::error::would_block if they are unable to perform the requested
+ * operation immediately. If @c false, synchronous operations will block
+ * until complete.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ boost::system::error_code non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.non_blocking(this->implementation, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native socket implementation.
+ /**
+ * This function is used to retrieve the non-blocking mode of the underlying
+ * native socket. This mode has no effect on the behaviour of the socket
+ * object's synchronous operations.
+ *
+ * @returns @c true if the underlying socket is in non-blocking mode and
+ * direct system calls may fail with boost::asio::error::would_block (or the
+ * equivalent system error).
+ *
+ * @note The current non-blocking mode is cached by the socket object.
+ * Consequently, the return value may be incorrect if the non-blocking mode
+ * was set directly on the native socket.
+ *
+ * @par Example
+ * This function is intended to allow the encapsulation of arbitrary
+ * non-blocking system calls as asynchronous operations, in a way that is
+ * transparent to the user of the socket object. The following example
+ * illustrates how Linux's @c sendfile system call might be encapsulated:
+ * @code template <typename Handler>
+ * struct sendfile_op
+ * {
+ * tcp::socket& sock_;
+ * int fd_;
+ * Handler handler_;
+ * off_t offset_;
+ * std::size_t total_bytes_transferred_;
+ *
+ * // Function call operator meeting WriteHandler requirements.
+ * // Used as the handler for the async_write_some operation.
+ * void operator()(boost::system::error_code ec, std::size_t)
+ * {
+ * // Put the underlying socket into non-blocking mode.
+ * if (!ec)
+ * if (!sock_.native_non_blocking())
+ * sock_.native_non_blocking(true, ec);
+ *
+ * if (!ec)
+ * {
+ * for (;;)
+ * {
+ * // Try the system call.
+ * errno = 0;
+ * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ * ec = boost::system::error_code(n < 0 ? errno : 0,
+ * boost::asio::error::get_system_category());
+ * total_bytes_transferred_ += ec ? 0 : n;
+ *
+ * // Retry operation immediately if interrupted by signal.
+ * if (ec == boost::asio::error::interrupted)
+ * continue;
+ *
+ * // Check if we need to run the operation again.
+ * if (ec == boost::asio::error::would_block
+ * || ec == boost::asio::error::try_again)
+ * {
+ * // We have to wait for the socket to become ready again.
+ * sock_.async_write_some(boost::asio::null_buffers(), *this);
+ * return;
+ * }
+ *
+ * if (ec || n == 0)
+ * {
+ * // An error occurred, or we have reached the end of the file.
+ * // Either way we must exit the loop so we can call the handler.
+ * break;
+ * }
+ *
+ * // Loop around to try calling sendfile again.
+ * }
+ * }
+ *
+ * // Pass result back to user's handler.
+ * handler_(ec, total_bytes_transferred_);
+ * }
+ * };
+ *
+ * template <typename Handler>
+ * void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ * {
+ * sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ * sock.async_write_some(boost::asio::null_buffers(), op);
+ * } @endcode
+ */
+ bool native_non_blocking() const
+ {
+ return this->service.native_non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native socket. It has no effect on the behaviour of the socket object's
+ * synchronous operations.
+ *
+ * @param mode If @c true, the underlying socket is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @throws boost::system::system_error Thrown on failure. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ *
+ * @par Example
+ * This function is intended to allow the encapsulation of arbitrary
+ * non-blocking system calls as asynchronous operations, in a way that is
+ * transparent to the user of the socket object. The following example
+ * illustrates how Linux's @c sendfile system call might be encapsulated:
+ * @code template <typename Handler>
+ * struct sendfile_op
+ * {
+ * tcp::socket& sock_;
+ * int fd_;
+ * Handler handler_;
+ * off_t offset_;
+ * std::size_t total_bytes_transferred_;
+ *
+ * // Function call operator meeting WriteHandler requirements.
+ * // Used as the handler for the async_write_some operation.
+ * void operator()(boost::system::error_code ec, std::size_t)
+ * {
+ * // Put the underlying socket into non-blocking mode.
+ * if (!ec)
+ * if (!sock_.native_non_blocking())
+ * sock_.native_non_blocking(true, ec);
+ *
+ * if (!ec)
+ * {
+ * for (;;)
+ * {
+ * // Try the system call.
+ * errno = 0;
+ * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ * ec = boost::system::error_code(n < 0 ? errno : 0,
+ * boost::asio::error::get_system_category());
+ * total_bytes_transferred_ += ec ? 0 : n;
+ *
+ * // Retry operation immediately if interrupted by signal.
+ * if (ec == boost::asio::error::interrupted)
+ * continue;
+ *
+ * // Check if we need to run the operation again.
+ * if (ec == boost::asio::error::would_block
+ * || ec == boost::asio::error::try_again)
+ * {
+ * // We have to wait for the socket to become ready again.
+ * sock_.async_write_some(boost::asio::null_buffers(), *this);
+ * return;
+ * }
+ *
+ * if (ec || n == 0)
+ * {
+ * // An error occurred, or we have reached the end of the file.
+ * // Either way we must exit the loop so we can call the handler.
+ * break;
+ * }
+ *
+ * // Loop around to try calling sendfile again.
+ * }
+ * }
+ *
+ * // Pass result back to user's handler.
+ * handler_(ec, total_bytes_transferred_);
+ * }
+ * };
+ *
+ * template <typename Handler>
+ * void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ * {
+ * sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ * sock.async_write_some(boost::asio::null_buffers(), op);
+ * } @endcode
+ */
+ void native_non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.native_non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native socket. It has no effect on the behaviour of the socket object's
+ * synchronous operations.
+ *
+ * @param mode If @c true, the underlying socket is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @param ec Set to indicate what error occurred, if any. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ *
+ * @par Example
+ * This function is intended to allow the encapsulation of arbitrary
+ * non-blocking system calls as asynchronous operations, in a way that is
+ * transparent to the user of the socket object. The following example
+ * illustrates how Linux's @c sendfile system call might be encapsulated:
+ * @code template <typename Handler>
+ * struct sendfile_op
+ * {
+ * tcp::socket& sock_;
+ * int fd_;
+ * Handler handler_;
+ * off_t offset_;
+ * std::size_t total_bytes_transferred_;
+ *
+ * // Function call operator meeting WriteHandler requirements.
+ * // Used as the handler for the async_write_some operation.
+ * void operator()(boost::system::error_code ec, std::size_t)
+ * {
+ * // Put the underlying socket into non-blocking mode.
+ * if (!ec)
+ * if (!sock_.native_non_blocking())
+ * sock_.native_non_blocking(true, ec);
+ *
+ * if (!ec)
+ * {
+ * for (;;)
+ * {
+ * // Try the system call.
+ * errno = 0;
+ * int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ * ec = boost::system::error_code(n < 0 ? errno : 0,
+ * boost::asio::error::get_system_category());
+ * total_bytes_transferred_ += ec ? 0 : n;
+ *
+ * // Retry operation immediately if interrupted by signal.
+ * if (ec == boost::asio::error::interrupted)
+ * continue;
+ *
+ * // Check if we need to run the operation again.
+ * if (ec == boost::asio::error::would_block
+ * || ec == boost::asio::error::try_again)
+ * {
+ * // We have to wait for the socket to become ready again.
+ * sock_.async_write_some(boost::asio::null_buffers(), *this);
+ * return;
+ * }
+ *
+ * if (ec || n == 0)
+ * {
+ * // An error occurred, or we have reached the end of the file.
+ * // Either way we must exit the loop so we can call the handler.
+ * break;
+ * }
+ *
+ * // Loop around to try calling sendfile again.
+ * }
+ * }
+ *
+ * // Pass result back to user's handler.
+ * handler_(ec, total_bytes_transferred_);
+ * }
+ * };
+ *
+ * template <typename Handler>
+ * void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ * {
+ * sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ * sock.async_write_some(boost::asio::null_buffers(), op);
+ * } @endcode
+ */
+ boost::system::error_code native_non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.native_non_blocking(this->implementation, mode, ec);
+ }
+
   /// Get the local endpoint of the socket.
   /**
    * This function is used to obtain the locally bound endpoint of the socket.

Modified: trunk/boost/asio/basic_socket_acceptor.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_acceptor.hpp (original)
+++ trunk/boost/asio/basic_socket_acceptor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/basic_io_object.hpp>
 #include <boost/asio/basic_socket.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/socket_acceptor_service.hpp>
@@ -55,8 +56,12 @@
     public socket_base
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of an
+ /// acceptor.
+ typedef typename SocketAcceptorService::native_handle_type native_type;
+
   /// The native representation of an acceptor.
- typedef typename SocketAcceptorService::native_type native_type;
+ typedef typename SocketAcceptorService::native_handle_type native_handle_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -163,7 +168,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_socket_acceptor(boost::asio::io_service& io_service,
- const protocol_type& protocol, const native_type& native_acceptor)
+ const protocol_type& protocol, const native_handle_type& native_acceptor)
     : basic_io_object<SocketAcceptorService>(io_service)
   {
     boost::system::error_code ec;
@@ -229,7 +234,8 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
- void assign(const protocol_type& protocol, const native_type& native_acceptor)
+ void assign(const protocol_type& protocol,
+ const native_handle_type& native_acceptor)
   {
     boost::system::error_code ec;
     this->service.assign(this->implementation, protocol, native_acceptor, ec);
@@ -247,7 +253,7 @@
    * @param ec Set to indicate what error occurred, if any.
    */
   boost::system::error_code assign(const protocol_type& protocol,
- const native_type& native_acceptor, boost::system::error_code& ec)
+ const native_handle_type& native_acceptor, boost::system::error_code& ec)
   {
     return this->service.assign(this->implementation,
         protocol, native_acceptor, ec);
@@ -399,7 +405,7 @@
     return this->service.close(this->implementation, ec);
   }
 
- /// Get the native acceptor representation.
+ /// (Deprecated: Use native_handle().) Get the native acceptor representation.
   /**
    * This function may be used to obtain the underlying representation of the
    * acceptor. This is intended to allow access to native acceptor functionality
@@ -407,7 +413,18 @@
    */
   native_type native()
   {
- return this->service.native(this->implementation);
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Get the native acceptor representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * acceptor. This is intended to allow access to native acceptor functionality
+ * that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return this->service.native_handle(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the acceptor.
@@ -564,6 +581,183 @@
     return this->service.get_option(this->implementation, option, ec);
   }
 
+ /// Perform an IO control command on the acceptor.
+ /**
+ * This function is used to execute an IO control command on the acceptor.
+ *
+ * @param command The IO control command to be performed on the acceptor.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @sa IoControlCommand @n
+ * boost::asio::socket_base::non_blocking_io
+ *
+ * @par Example
+ * Getting the number of bytes ready to read:
+ * @code
+ * boost::asio::ip::tcp::acceptor acceptor(io_service);
+ * ...
+ * boost::asio::ip::tcp::acceptor::non_blocking_io command(true);
+ * socket.io_control(command);
+ * @endcode
+ */
+ template <typename IoControlCommand>
+ void io_control(IoControlCommand& command)
+ {
+ boost::system::error_code ec;
+ this->service.io_control(this->implementation, command, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Perform an IO control command on the acceptor.
+ /**
+ * This function is used to execute an IO control command on the acceptor.
+ *
+ * @param command The IO control command to be performed on the acceptor.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @sa IoControlCommand @n
+ * boost::asio::socket_base::non_blocking_io
+ *
+ * @par Example
+ * Getting the number of bytes ready to read:
+ * @code
+ * boost::asio::ip::tcp::acceptor acceptor(io_service);
+ * ...
+ * boost::asio::ip::tcp::acceptor::non_blocking_io command(true);
+ * boost::system::error_code ec;
+ * socket.io_control(command, ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * @endcode
+ */
+ template <typename IoControlCommand>
+ boost::system::error_code io_control(IoControlCommand& command,
+ boost::system::error_code& ec)
+ {
+ return this->service.io_control(this->implementation, command, ec);
+ }
+
+ /// Gets the non-blocking mode of the acceptor.
+ /**
+ * @returns @c true if the acceptor's synchronous operations will fail with
+ * boost::asio::error::would_block if they are unable to perform the requested
+ * operation immediately. If @c false, synchronous operations will block
+ * until complete.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ bool non_blocking() const
+ {
+ return this->service.non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the acceptor.
+ /**
+ * @param mode If @c true, the acceptor's synchronous operations will fail
+ * with boost::asio::error::would_block if they are unable to perform the
+ * requested operation immediately. If @c false, synchronous operations will
+ * block until complete.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ void non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the acceptor.
+ /**
+ * @param mode If @c true, the acceptor's synchronous operations will fail
+ * with boost::asio::error::would_block if they are unable to perform the
+ * requested operation immediately. If @c false, synchronous operations will
+ * block until complete.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ boost::system::error_code non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.non_blocking(this->implementation, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native acceptor implementation.
+ /**
+ * This function is used to retrieve the non-blocking mode of the underlying
+ * native acceptor. This mode has no effect on the behaviour of the acceptor
+ * object's synchronous operations.
+ *
+ * @returns @c true if the underlying acceptor is in non-blocking mode and
+ * direct system calls may fail with boost::asio::error::would_block (or the
+ * equivalent system error).
+ *
+ * @note The current non-blocking mode is cached by the acceptor object.
+ * Consequently, the return value may be incorrect if the non-blocking mode
+ * was set directly on the native acceptor.
+ */
+ bool native_non_blocking() const
+ {
+ return this->service.native_non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the native acceptor implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native acceptor. It has no effect on the behaviour of the acceptor object's
+ * synchronous operations.
+ *
+ * @param mode If @c true, the underlying acceptor is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @throws boost::system::system_error Thrown on failure. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ */
+ void native_non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.native_non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the native acceptor implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native acceptor. It has no effect on the behaviour of the acceptor object's
+ * synchronous operations.
+ *
+ * @param mode If @c true, the underlying acceptor is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @param ec Set to indicate what error occurred, if any. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ */
+ boost::system::error_code native_non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.native_non_blocking(this->implementation, mode, ec);
+ }
+
   /// Get the local endpoint of the acceptor.
   /**
    * This function is used to obtain the locally bound endpoint of the acceptor.
@@ -713,7 +907,12 @@
   void async_accept(basic_socket<protocol_type, SocketService>& peer,
       AcceptHandler handler)
   {
- this->service.async_accept(this->implementation, peer, 0, 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->service.async_accept(this->implementation, peer, 0,
+ BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
   }
 
   /// Accept a new connection and obtain the endpoint of the peer
@@ -814,8 +1013,12 @@
   void async_accept(basic_socket<protocol_type, SocketService>& peer,
       endpoint_type& peer_endpoint, AcceptHandler handler)
   {
- this->service.async_accept(this->implementation,
- peer, &peer_endpoint, 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->service.async_accept(this->implementation, peer,
+ &peer_endpoint, BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/basic_socket_iostream.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_iostream.hpp (original)
+++ trunk/boost/asio/basic_socket_iostream.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -35,7 +35,8 @@
 // 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> >::member)
+// basic_socket_streambuf<Protocol, StreamSocketService,
+// Time, TimeTraits, TimerService> >::member)
 // {
 // if (rdbuf()->connect(x1, ..., xn) == 0)
 // this->setstate(std::ios_base::failbit);
@@ -46,7 +47,8 @@
   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> >::member) \
+ basic_socket_streambuf<Protocol, StreamSocketService, \
+ Time, TimeTraits, TimerService> >::member) \
   { \
     tie(this); \
     if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \
@@ -79,17 +81,31 @@
 
 /// Iostream interface for a socket.
 template <typename Protocol,
- typename StreamSocketService = stream_socket_service<Protocol> >
+ typename StreamSocketService = stream_socket_service<Protocol>,
+ typename Time = boost::posix_time::ptime,
+ typename TimeTraits = boost::asio::time_traits<Time>,
+ typename TimerService = deadline_timer_service<Time, TimeTraits> >
 class basic_socket_iostream
   : public boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService> >,
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService> >,
     public std::basic_iostream<char>
 {
 public:
+ /// The endpoint type.
+ typedef typename Protocol::endpoint endpoint_type;
+
+ /// The time type.
+ typedef typename TimeTraits::time_type time_type;
+
+ /// The duration type.
+ typedef typename TimeTraits::duration_type duration_type;
+
   /// 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> >::member)
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService> >::member)
   {
     tie(this);
   }
@@ -132,11 +148,77 @@
   }
 
   /// Return a pointer to the underlying streambuf.
- basic_socket_streambuf<Protocol, StreamSocketService>* rdbuf() const
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService>* rdbuf() const
   {
- return const_cast<basic_socket_streambuf<Protocol, StreamSocketService>*>(
+ return const_cast<basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService>*>(
         &this->boost::base_from_member<
- basic_socket_streambuf<Protocol, StreamSocketService> >::member);
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService> >::member);
+ }
+
+ /// Get the last error associated with the stream.
+ /**
+ * @return An \c error_code corresponding to the last error from the stream.
+ *
+ * @par Example
+ * To print the error associated with a failure to establish a connection:
+ * @code tcp::iostream s("www.boost.org", "http");
+ * if (!s)
+ * {
+ * std::cout << "Error: " << s.error().message() << std::endl;
+ * } @endcode
+ */
+ const boost::system::error_code& error() const
+ {
+ return rdbuf()->puberror();
+ }
+
+ /// Get the stream's expiry time as an absolute time.
+ /**
+ * @return An absolute time value representing the stream's expiry time.
+ */
+ time_type expires_at() const
+ {
+ return rdbuf()->expires_at();
+ }
+
+ /// Set the stream's expiry time as an absolute time.
+ /**
+ * This function sets the expiry time associated with the stream. Stream
+ * operations performed after this time (where the operations cannot be
+ * completed using the internal buffers) will fail with the error
+ * boost::asio::error::operation_aborted.
+ *
+ * @param expiry_time The expiry time to be used for the stream.
+ */
+ void expires_at(const time_type& expiry_time)
+ {
+ rdbuf()->expires_at(expiry_time);
+ }
+
+ /// Get the timer's expiry time relative to now.
+ /**
+ * @return A relative time value representing the stream's expiry time.
+ */
+ duration_type expires_from_now() const
+ {
+ return rdbuf()->expires_from_now();
+ }
+
+ /// Set the stream's expiry time relative to now.
+ /**
+ * This function sets the expiry time associated with the stream. Stream
+ * operations performed after this time (where the operations cannot be
+ * completed using the internal buffers) will fail with the error
+ * boost::asio::error::operation_aborted.
+ *
+ * @param expiry_time The expiry time to be used for the timer.
+ */
+ void expires_from_now(const duration_type& expiry_time)
+ {
+ rdbuf()->expires_from_now(expiry_time);
   }
 };
 

Modified: trunk/boost/asio/basic_socket_streambuf.hpp
==============================================================================
--- trunk/boost/asio/basic_socket_streambuf.hpp (original)
+++ trunk/boost/asio/basic_socket_streambuf.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -27,9 +27,15 @@
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
 #include <boost/utility/base_from_member.hpp>
 #include <boost/asio/basic_socket.hpp>
+#include <boost/asio/deadline_timer_service.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_SOCKET_STREAMBUF_MAX_ARITY)
 #define BOOST_ASIO_SOCKET_STREAMBUF_MAX_ARITY 5
@@ -37,33 +43,33 @@
 
 // A macro that should expand to:
 // template <typename T1, ..., typename Tn>
-// basic_socket_streambuf<Protocol, StreamSocketService>* connect(
+// basic_socket_streambuf<Protocol, StreamSocketService,
+// Time, TimeTraits, TimerService>* connect(
 // T1 x1, ..., Tn xn)
 // {
 // init_buffers();
-// boost::system::error_code ec;
-// this->basic_socket<Protocol, StreamSocketService>::close(ec);
+// this->basic_socket<Protocol, StreamSocketService>::close(ec_);
 // typedef typename Protocol::resolver resolver_type;
 // typedef typename resolver_type::query resolver_query;
 // resolver_query query(x1, ..., xn);
-// resolve_and_connect(query, ec);
-// return !ec ? this : 0;
+// resolve_and_connect(query);
+// return !ec_ ? this : 0;
 // }
 // This macro should only persist within this file.
 
 #define BOOST_ASIO_PRIVATE_CONNECT_DEF( z, n, data ) \
   template <BOOST_PP_ENUM_PARAMS(n, typename T)> \
- basic_socket_streambuf<Protocol, StreamSocketService>* connect( \
+ basic_socket_streambuf<Protocol, StreamSocketService, \
+ Time, TimeTraits, TimerService>* connect( \
       BOOST_PP_ENUM_BINARY_PARAMS(n, T, x)) \
   { \
     init_buffers(); \
- boost::system::error_code ec; \
- this->basic_socket<Protocol, StreamSocketService>::close(ec); \
+ this->basic_socket<Protocol, StreamSocketService>::close(ec_); \
     typedef typename Protocol::resolver resolver_type; \
     typedef typename resolver_type::query resolver_query; \
     resolver_query query(BOOST_PP_ENUM_PARAMS(n, x)); \
- resolve_and_connect(query, ec); \
- return !ec ? this : 0; \
+ resolve_and_connect(query); \
+ return !ec_ ? this : 0; \
   } \
   /**/
 
@@ -74,7 +80,10 @@
 
 /// Iostream streambuf for a socket.
 template <typename Protocol,
- typename StreamSocketService = stream_socket_service<Protocol> >
+ typename StreamSocketService = stream_socket_service<Protocol>,
+ typename Time = boost::posix_time::ptime,
+ typename TimeTraits = boost::asio::time_traits<Time>,
+ typename TimerService = deadline_timer_service<Time, TimeTraits> >
 class basic_socket_streambuf
   : public std::streambuf,
     private boost::base_from_member<io_service>,
@@ -84,11 +93,19 @@
   /// The endpoint type.
   typedef typename Protocol::endpoint endpoint_type;
 
+ /// The time type.
+ typedef typename TimeTraits::time_type time_type;
+
+ /// The duration type.
+ typedef typename TimeTraits::duration_type duration_type;
+
   /// 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),
- unbuffered_(false)
+ unbuffered_(false),
+ timer_service_(0),
+ timer_state_(no_timer)
   {
     init_buffers();
   }
@@ -98,6 +115,8 @@
   {
     if (pptr() != pbase())
       overflow(traits_type::eof());
+
+ destroy_timer();
   }
 
   /// Establish a connection.
@@ -107,14 +126,30 @@
    * @return \c this if a connection was successfully established, a null
    * pointer otherwise.
    */
- basic_socket_streambuf<Protocol, StreamSocketService>* connect(
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService>* connect(
       const endpoint_type& endpoint)
   {
     init_buffers();
- boost::system::error_code ec;
- this->basic_socket<Protocol, StreamSocketService>::close(ec);
- this->basic_socket<Protocol, StreamSocketService>::connect(endpoint, ec);
- return !ec ? this : 0;
+
+ this->basic_socket<Protocol, StreamSocketService>::close(ec_);
+
+ if (timer_state_ == timer_has_expired)
+ {
+ ec_ = boost::asio::error::operation_aborted;
+ return 0;
+ }
+
+ io_handler handler = { this };
+ this->basic_socket<Protocol, StreamSocketService>::async_connect(
+ endpoint, handler);
+
+ ec_ = boost::asio::error::would_block;
+ this->service.get_io_service().reset();
+ do this->service.get_io_service().run_one();
+ while (ec_ == boost::asio::error::would_block);
+
+ return !ec_ ? this : 0;
   }
 
 #if defined(GENERATING_DOCUMENTATION)
@@ -141,14 +176,85 @@
    * @return \c this if a connection was successfully established, a null
    * pointer otherwise.
    */
- basic_socket_streambuf<Protocol, StreamSocketService>* close()
+ basic_socket_streambuf<Protocol, StreamSocketService,
+ Time, TimeTraits, TimerService>* close()
   {
- boost::system::error_code ec;
     sync();
- this->basic_socket<Protocol, StreamSocketService>::close(ec);
- if (!ec)
+ this->basic_socket<Protocol, StreamSocketService>::close(ec_);
+ if (!ec_)
       init_buffers();
- return !ec ? this : 0;
+ return !ec_ ? this : 0;
+ }
+
+ /// Get the last error associated with the stream buffer.
+ /**
+ * @return An \c error_code corresponding to the last error from the stream
+ * buffer.
+ */
+ const boost::system::error_code& puberror() const
+ {
+ return error();
+ }
+
+ /// Get the stream buffer's expiry time as an absolute time.
+ /**
+ * @return An absolute time value representing the stream buffer's expiry
+ * time.
+ */
+ time_type expires_at() const
+ {
+ return timer_service_
+ ? timer_service_->expires_at(timer_implementation_)
+ : time_type();
+ }
+
+ /// Set the stream buffer's expiry time as an absolute time.
+ /**
+ * This function sets the expiry time associated with the stream. Stream
+ * operations performed after this time (where the operations cannot be
+ * completed using the internal buffers) will fail with the error
+ * boost::asio::error::operation_aborted.
+ *
+ * @param expiry_time The expiry time to be used for the stream.
+ */
+ void expires_at(const time_type& expiry_time)
+ {
+ construct_timer();
+
+ boost::system::error_code ec;
+ timer_service_->expires_at(timer_implementation_, expiry_time, ec);
+ boost::asio::detail::throw_error(ec);
+
+ start_timer();
+ }
+
+ /// Get the stream buffer's expiry time relative to now.
+ /**
+ * @return A relative time value representing the stream buffer's expiry time.
+ */
+ duration_type expires_from_now() const
+ {
+ return TimeTraits::subtract(expires_at(), TimeTraits::now());
+ }
+
+ /// Set the stream buffer's expiry time relative to now.
+ /**
+ * This function sets the expiry time associated with the stream. Stream
+ * operations performed after this time (where the operations cannot be
+ * completed using the internal buffers) will fail with the error
+ * boost::asio::error::operation_aborted.
+ *
+ * @param expiry_time The expiry time to be used for the timer.
+ */
+ void expires_from_now(const duration_type& expiry_time)
+ {
+ construct_timer();
+
+ boost::system::error_code ec;
+ timer_service_->expires_from_now(timer_implementation_, expiry_time, ec);
+ boost::asio::detail::throw_error(ec);
+
+ start_timer();
   }
 
 protected:
@@ -156,15 +262,26 @@
   {
     if (gptr() == egptr())
     {
- boost::system::error_code ec;
- std::size_t bytes_transferred = this->service.receive(
- this->implementation,
+ if (timer_state_ == timer_has_expired)
+ {
+ ec_ = boost::asio::error::operation_aborted;
+ return traits_type::eof();
+ }
+
+ io_handler handler = { this };
+ this->service.async_receive(this->implementation,
           boost::asio::buffer(boost::asio::buffer(get_buffer_) + putback_max),
- 0, ec);
- if (ec)
+ 0, handler);
+
+ ec_ = boost::asio::error::would_block;
+ this->service.get_io_service().reset();
+ do this->service.get_io_service().run_one();
+ while (ec_ == boost::asio::error::would_block);
+ if (ec_)
         return traits_type::eof();
+
       setg(get_buffer_.begin(), get_buffer_.begin() + putback_max,
- get_buffer_.begin() + putback_max + bytes_transferred);
+ get_buffer_.begin() + putback_max + bytes_transferred_);
       return traits_type::to_int_type(*gptr());
     }
     else
@@ -184,13 +301,25 @@
       }
       else
       {
+ if (timer_state_ == timer_has_expired)
+ {
+ ec_ = boost::asio::error::operation_aborted;
+ return traits_type::eof();
+ }
+
         // Send the single character immediately.
- boost::system::error_code ec;
         char_type ch = traits_type::to_char_type(c);
- this->service.send(this->implementation,
- boost::asio::buffer(&ch, sizeof(char_type)), 0, ec);
- if (ec)
+ io_handler handler = { this };
+ this->service.async_send(this->implementation,
+ boost::asio::buffer(&ch, sizeof(char_type)), 0, handler);
+
+ ec_ = boost::asio::error::would_block;
+ this->service.get_io_service().reset();
+ do this->service.get_io_service().run_one();
+ while (ec_ == boost::asio::error::would_block);
+ if (ec_)
           return traits_type::eof();
+
         return c;
       }
     }
@@ -201,13 +330,24 @@
         boost::asio::buffer(pbase(), pptr() - pbase());
       while (boost::asio::buffer_size(buffer) > 0)
       {
- boost::system::error_code ec;
- std::size_t bytes_transferred = this->service.send(
- this->implementation, boost::asio::buffer(buffer),
- 0, ec);
- if (ec)
+ if (timer_state_ == timer_has_expired)
+ {
+ ec_ = boost::asio::error::operation_aborted;
+ return traits_type::eof();
+ }
+
+ io_handler handler = { this };
+ this->service.async_send(this->implementation,
+ boost::asio::buffer(buffer), 0, handler);
+
+ ec_ = boost::asio::error::would_block;
+ this->service.get_io_service().reset();
+ do this->service.get_io_service().run_one();
+ while (ec_ == boost::asio::error::would_block);
+ if (ec_)
           return traits_type::eof();
- buffer = buffer + bytes_transferred;
+
+ buffer = buffer + bytes_transferred_;
       }
       setp(put_buffer_.begin(), put_buffer_.end());
 
@@ -239,6 +379,16 @@
     return 0;
   }
 
+ /// Get the last error associated with the stream buffer.
+ /**
+ * @return An \c error_code corresponding to the last error from the stream
+ * buffer.
+ */
+ virtual const boost::system::error_code& error() const
+ {
+ return ec_;
+ }
+
 private:
   void init_buffers()
   {
@@ -252,32 +402,118 @@
   }
 
   template <typename ResolverQuery>
- void resolve_and_connect(const ResolverQuery& query,
- boost::system::error_code& ec)
+ void resolve_and_connect(const ResolverQuery& query)
   {
     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);
- iterator_type i = resolver.resolve(query, ec);
- if (!ec)
+ iterator_type i = resolver.resolve(query, ec_);
+ if (!ec_)
     {
       iterator_type end;
- ec = boost::asio::error::host_not_found;
- while (ec && i != end)
+ ec_ = boost::asio::error::host_not_found;
+ while (ec_ && i != end)
       {
- this->basic_socket<Protocol, StreamSocketService>::close();
- this->basic_socket<Protocol, StreamSocketService>::connect(*i, ec);
+ this->basic_socket<Protocol, StreamSocketService>::close(ec_);
+
+ if (timer_state_ == timer_has_expired)
+ {
+ ec_ = boost::asio::error::operation_aborted;
+ return;
+ }
+
+ io_handler handler = { this };
+ this->basic_socket<Protocol, StreamSocketService>::async_connect(
+ *i, handler);
+
+ ec_ = boost::asio::error::would_block;
+ this->service.get_io_service().reset();
+ do this->service.get_io_service().run_one();
+ while (ec_ == boost::asio::error::would_block);
+
         ++i;
       }
     }
   }
 
+ struct io_handler;
+ friend struct io_handler;
+ struct io_handler
+ {
+ basic_socket_streambuf* this_;
+
+ void operator()(const boost::system::error_code& ec,
+ std::size_t bytes_transferred = 0)
+ {
+ this_->ec_ = ec;
+ this_->bytes_transferred_ = bytes_transferred;
+ }
+ };
+
+ struct timer_handler;
+ friend struct timer_handler;
+ struct timer_handler
+ {
+ basic_socket_streambuf* this_;
+
+ void operator()(const boost::system::error_code&)
+ {
+ time_type now = TimeTraits::now();
+
+ time_type expiry_time = this_->timer_service_->expires_at(
+ this_->timer_implementation_);
+
+ if (TimeTraits::less_than(now, expiry_time))
+ {
+ this_->timer_state_ = timer_is_pending;
+ this_->timer_service_->async_wait(this_->timer_implementation_, *this);
+ }
+ else
+ {
+ this_->timer_state_ = timer_has_expired;
+ boost::system::error_code ec;
+ this_->basic_socket<Protocol, StreamSocketService>::close(ec);
+ }
+ }
+ };
+
+ void construct_timer()
+ {
+ if (timer_service_ == 0)
+ {
+ TimerService& timer_service = use_service<TimerService>(
+ boost::base_from_member<boost::asio::io_service>::member);
+ timer_service.construct(timer_implementation_);
+ timer_service_ = &timer_service;
+ }
+ }
+
+ void destroy_timer()
+ {
+ if (timer_service_)
+ timer_service_->destroy(timer_implementation_);
+ }
+
+ void start_timer()
+ {
+ if (timer_state_ != timer_is_pending)
+ {
+ timer_handler handler = { this };
+ handler(boost::system::error_code());
+ }
+ }
+
   enum { putback_max = 8 };
   enum { buffer_size = 512 };
   boost::array<char, buffer_size> get_buffer_;
   boost::array<char, buffer_size> put_buffer_;
   bool unbuffered_;
+ boost::system::error_code ec_;
+ std::size_t bytes_transferred_;
+ TimerService* timer_service_;
+ typename TimerService::implementation_type timer_implementation_;
+ enum state { no_timer, timer_is_pending, timer_has_expired } timer_state_;
 };
 
 } // namespace asio

Modified: trunk/boost/asio/basic_stream_socket.hpp
==============================================================================
--- trunk/boost/asio/basic_stream_socket.hpp (original)
+++ trunk/boost/asio/basic_stream_socket.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -18,6 +18,7 @@
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
 #include <boost/asio/basic_socket.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/stream_socket_service.hpp>
@@ -45,8 +46,12 @@
   : public basic_socket<Protocol, StreamSocketService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// socket.
+ typedef typename StreamSocketService::native_handle_type native_type;
+
   /// The native representation of a socket.
- typedef typename StreamSocketService::native_type native_type;
+ typedef typename StreamSocketService::native_handle_type native_handle_type;
 
   /// The protocol type.
   typedef Protocol protocol_type;
@@ -122,7 +127,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_stream_socket(boost::asio::io_service& io_service,
- const protocol_type& protocol, const native_type& native_socket)
+ const protocol_type& protocol, const native_handle_type& native_socket)
     : basic_socket<Protocol, StreamSocketService>(
         io_service, protocol, native_socket)
   {
@@ -264,7 +269,12 @@
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_send(const ConstBufferSequence& buffers, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, 0, 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->service.async_send(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Start an asynchronous send.
@@ -308,7 +318,12 @@
   void async_send(const ConstBufferSequence& buffers,
       socket_base::message_flags flags, WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, flags, 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->service.async_send(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Receive some data on the socket.
@@ -454,7 +469,12 @@
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_receive(const MutableBufferSequence& buffers, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, 0, 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->service.async_receive(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Start an asynchronous receive.
@@ -500,7 +520,12 @@
   void async_receive(const MutableBufferSequence& buffers,
       socket_base::message_flags flags, ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, flags, 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->service.async_receive(this->implementation, buffers, flags,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 
   /// Write some data to the socket.
@@ -601,7 +626,12 @@
   void async_write_some(const ConstBufferSequence& buffers,
       WriteHandler handler)
   {
- this->service.async_send(this->implementation, buffers, 0, 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->service.async_send(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Read some data from the socket.
@@ -705,7 +735,12 @@
   void async_read_some(const MutableBufferSequence& buffers,
       ReadHandler handler)
   {
- this->service.async_receive(this->implementation, buffers, 0, 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->service.async_receive(this->implementation, buffers, 0,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/basic_streambuf.hpp
==============================================================================
--- trunk/boost/asio/basic_streambuf.hpp (original)
+++ trunk/boost/asio/basic_streambuf.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -130,9 +130,9 @@
    * of the streambuf's input sequence is 0.
    */
   explicit basic_streambuf(
- std::size_t max_size = (std::numeric_limits<std::size_t>::max)(),
+ std::size_t maximum_size = (std::numeric_limits<std::size_t>::max)(),
       const Allocator& allocator = Allocator())
- : max_size_(max_size),
+ : max_size_(maximum_size),
       buffer_(allocator)
   {
     std::size_t pend = (std::min<std::size_t>)(max_size_, buffer_delta);

Modified: trunk/boost/asio/buffer.hpp
==============================================================================
--- trunk/boost/asio/buffer.hpp (original)
+++ trunk/boost/asio/buffer.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
+#include <cstring>
 #include <string>
 #include <vector>
 #include <boost/detail/workaround.hpp>
@@ -68,6 +69,19 @@
  * The mutable_buffer class provides a safe representation of a buffer that can
  * be modified. It does not own the underlying data, and so is cheap to copy or
  * assign.
+ *
+ * @par Accessing Buffer Contents
+ *
+ * The contents of a buffer may be accessed using the @ref buffer_size
+ * and @ref buffer_cast functions:
+ *
+ * @code boost::asio::mutable_buffer b1 = ...;
+ * std::size_t s1 = boost::asio::buffer_size(b1);
+ * unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
+ * @endcode
+ *
+ * The boost::asio::buffer_cast function permits violations of type safety, so
+ * uses of it in application code should be carefully considered.
  */
 class mutable_buffer
 {
@@ -133,59 +147,6 @@
 
 } // namespace detail
 
-/// Cast a non-modifiable buffer to a specified pointer to POD type.
-/**
- * @relates mutable_buffer
- */
-template <typename PointerToPodType>
-inline PointerToPodType buffer_cast(const mutable_buffer& b)
-{
- return static_cast<PointerToPodType>(detail::buffer_cast_helper(b));
-}
-
-/// Get the number of bytes in a non-modifiable buffer.
-/**
- * @relates mutable_buffer
- */
-inline std::size_t buffer_size(const mutable_buffer& b)
-{
- return detail::buffer_size_helper(b);
-}
-
-/// Create a new modifiable buffer that is offset from the start of another.
-/**
- * @relates mutable_buffer
- */
-inline mutable_buffer operator+(const mutable_buffer& b, std::size_t start)
-{
- if (start > buffer_size(b))
- return mutable_buffer();
- char* new_data = buffer_cast<char*>(b) + start;
- std::size_t new_size = buffer_size(b) - start;
- return mutable_buffer(new_data, new_size
-#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , b.get_debug_check()
-#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
- );
-}
-
-/// Create a new modifiable buffer that is offset from the start of another.
-/**
- * @relates mutable_buffer
- */
-inline mutable_buffer operator+(std::size_t start, const mutable_buffer& b)
-{
- if (start > buffer_size(b))
- return mutable_buffer();
- char* new_data = buffer_cast<char*>(b) + start;
- std::size_t new_size = buffer_size(b) - start;
- return mutable_buffer(new_data, new_size
-#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , b.get_debug_check()
-#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
- );
-}
-
 /// Adapts a single modifiable buffer so that it meets the requirements of the
 /// MutableBufferSequence concept.
 class mutable_buffers_1
@@ -228,6 +189,19 @@
  * The const_buffer class provides a safe representation of a buffer that cannot
  * be modified. It does not own the underlying data, and so is cheap to copy or
  * assign.
+ *
+ * @par Accessing Buffer Contents
+ *
+ * The contents of a buffer may be accessed using the @ref buffer_size
+ * and @ref buffer_cast functions:
+ *
+ * @code boost::asio::const_buffer b1 = ...;
+ * std::size_t s1 = boost::asio::buffer_size(b1);
+ * const unsigned char* p1 = boost::asio::buffer_cast<const unsigned char*>(b1);
+ * @endcode
+ *
+ * The boost::asio::buffer_cast function permits violations of type safety, so
+ * uses of it in application code should be carefully considered.
  */
 class const_buffer
 {
@@ -303,59 +277,6 @@
 
 } // namespace detail
 
-/// Cast a non-modifiable buffer to a specified pointer to POD type.
-/**
- * @relates const_buffer
- */
-template <typename PointerToPodType>
-inline PointerToPodType buffer_cast(const const_buffer& b)
-{
- return static_cast<PointerToPodType>(detail::buffer_cast_helper(b));
-}
-
-/// Get the number of bytes in a non-modifiable buffer.
-/**
- * @relates const_buffer
- */
-inline std::size_t buffer_size(const const_buffer& b)
-{
- return detail::buffer_size_helper(b);
-}
-
-/// Create a new non-modifiable buffer that is offset from the start of another.
-/**
- * @relates const_buffer
- */
-inline const_buffer operator+(const const_buffer& b, std::size_t start)
-{
- if (start > buffer_size(b))
- return const_buffer();
- const char* new_data = buffer_cast<const char*>(b) + start;
- std::size_t new_size = buffer_size(b) - start;
- return const_buffer(new_data, new_size
-#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , b.get_debug_check()
-#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
- );
-}
-
-/// Create a new non-modifiable buffer that is offset from the start of another.
-/**
- * @relates const_buffer
- */
-inline const_buffer operator+(std::size_t start, const const_buffer& b)
-{
- if (start > buffer_size(b))
- return const_buffer();
- const char* new_data = buffer_cast<const char*>(b) + start;
- std::size_t new_size = buffer_size(b) - start;
- return const_buffer(new_data, new_size
-#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , b.get_debug_check()
-#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
- );
-}
-
 /// Adapts a single non-modifiable buffer so that it meets the requirements of
 /// the ConstBufferSequence concept.
 class const_buffers_1
@@ -420,6 +341,163 @@
   mutable_buffer buf_;
 };
 
+/** @defgroup buffer_size boost::asio::buffer_size
+ *
+ * @brief The boost::asio::buffer_size function determines the total number of
+ * bytes in a buffer or buffer sequence.
+ */
+/*@{*/
+
+/// Get the number of bytes in a modifiable buffer.
+inline std::size_t buffer_size(const mutable_buffer& b)
+{
+ return detail::buffer_size_helper(b);
+}
+
+/// Get the number of bytes in a modifiable buffer.
+inline std::size_t buffer_size(const mutable_buffers_1& b)
+{
+ return detail::buffer_size_helper(b);
+}
+
+/// Get the number of bytes in a non-modifiable buffer.
+inline std::size_t buffer_size(const const_buffer& b)
+{
+ return detail::buffer_size_helper(b);
+}
+
+/// Get the number of bytes in a non-modifiable buffer.
+inline std::size_t buffer_size(const const_buffers_1& b)
+{
+ return detail::buffer_size_helper(b);
+}
+
+/// Get the total number of bytes in a buffer sequence.
+/**
+ * The @c BufferSequence template parameter may meet either of the @c
+ * ConstBufferSequence or @c MutableBufferSequence type requirements.
+ */
+template <typename BufferSequence>
+inline std::size_t buffer_size(const BufferSequence& b)
+{
+ std::size_t total_buffer_size = 0;
+
+ typename BufferSequence::const_iterator iter = b.begin();
+ typename BufferSequence::const_iterator end = b.end();
+ for (; iter != end; ++iter)
+ total_buffer_size += detail::buffer_size_helper(*iter);
+
+ return total_buffer_size;
+}
+
+/*@}*/
+
+/** @defgroup buffer_cast boost::asio::buffer_cast
+ *
+ * @brief The boost::asio::buffer_cast function is used to obtain a pointer to
+ * the underlying memory region associated with a buffer.
+ *
+ * @par Examples:
+ *
+ * To access the memory of a non-modifiable buffer, use:
+ * @code boost::asio::const_buffer b1 = ...;
+ * const unsigned char* p1 = boost::asio::buffer_cast<const unsigned char*>(b1);
+ * @endcode
+ *
+ * To access the memory of a modifiable buffer, use:
+ * @code boost::asio::mutable_buffer b2 = ...;
+ * unsigned char* p2 = boost::asio::buffer_cast<unsigned char*>(b2);
+ * @endcode
+ *
+ * The boost::asio::buffer_cast function permits violations of type safety, so
+ * uses of it in application code should be carefully considered.
+ */
+/*@{*/
+
+/// Cast a non-modifiable buffer to a specified pointer to POD type.
+template <typename PointerToPodType>
+inline PointerToPodType buffer_cast(const mutable_buffer& b)
+{
+ return static_cast<PointerToPodType>(detail::buffer_cast_helper(b));
+}
+
+/// Cast a non-modifiable buffer to a specified pointer to POD type.
+template <typename PointerToPodType>
+inline PointerToPodType buffer_cast(const const_buffer& b)
+{
+ return static_cast<PointerToPodType>(detail::buffer_cast_helper(b));
+}
+
+/*@}*/
+
+/// Create a new modifiable buffer that is offset from the start of another.
+/**
+ * @relates mutable_buffer
+ */
+inline mutable_buffer operator+(const mutable_buffer& b, std::size_t start)
+{
+ if (start > buffer_size(b))
+ return mutable_buffer();
+ char* new_data = buffer_cast<char*>(b) + start;
+ std::size_t new_size = buffer_size(b) - start;
+ return mutable_buffer(new_data, new_size
+#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+ , b.get_debug_check()
+#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
+ );
+}
+
+/// Create a new modifiable buffer that is offset from the start of another.
+/**
+ * @relates mutable_buffer
+ */
+inline mutable_buffer operator+(std::size_t start, const mutable_buffer& b)
+{
+ if (start > buffer_size(b))
+ return mutable_buffer();
+ char* new_data = buffer_cast<char*>(b) + start;
+ std::size_t new_size = buffer_size(b) - start;
+ return mutable_buffer(new_data, new_size
+#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+ , b.get_debug_check()
+#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
+ );
+}
+
+/// Create a new non-modifiable buffer that is offset from the start of another.
+/**
+ * @relates const_buffer
+ */
+inline const_buffer operator+(const const_buffer& b, std::size_t start)
+{
+ if (start > buffer_size(b))
+ return const_buffer();
+ const char* new_data = buffer_cast<const char*>(b) + start;
+ std::size_t new_size = buffer_size(b) - start;
+ return const_buffer(new_data, new_size
+#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+ , b.get_debug_check()
+#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
+ );
+}
+
+/// Create a new non-modifiable buffer that is offset from the start of another.
+/**
+ * @relates const_buffer
+ */
+inline const_buffer operator+(std::size_t start, const const_buffer& b)
+{
+ if (start > buffer_size(b))
+ return const_buffer();
+ const char* new_data = buffer_cast<const char*>(b) + start;
+ std::size_t new_size = buffer_size(b) - start;
+ return const_buffer(new_data, new_size
+#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+ , b.get_debug_check()
+#endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
+ );
+}
+
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
 namespace detail {
 
@@ -499,8 +577,8 @@
  *
  * @par Accessing Buffer Contents
  *
- * The contents of a buffer may be accessed using the boost::asio::buffer_size
- * and boost::asio::buffer_cast functions:
+ * The contents of a buffer may be accessed using the @ref buffer_size and
+ * @ref buffer_cast functions:
  *
  * @code boost::asio::mutable_buffer b1 = ...;
  * std::size_t s1 = boost::asio::buffer_size(b1);
@@ -526,8 +604,8 @@
  * referring to the elements in the sequence (C++ Std, 23.2.4)
  *
  * For the boost::asio::buffer overloads that accept an argument of type
- * std::string, the buffer objects returned are invalidated according to the
- * rules defined for invalidation of references, pointers and iterators
+ * std::basic_string, the buffer objects returned are invalidated according to
+ * the rules defined for invalidation of references, pointers and iterators
  * referring to elements of the sequence (C++ Std, 21.3).
  *
  * @par Buffer Arithmetic
@@ -997,16 +1075,20 @@
 
 /// Create a new non-modifiable buffer that represents the given string.
 /**
- * @returns <tt>const_buffers_1(data.data(), data.size())</tt>.
+ * @returns <tt>const_buffers_1(data.data(), data.size() * sizeof(Elem))</tt>.
  *
  * @note The buffer is invalidated by any non-const operation called on the
  * given string object.
  */
-inline const_buffers_1 buffer(const std::string& data)
+template <typename Elem, typename Traits, typename Allocator>
+inline const_buffers_1 buffer(
+ const std::basic_string<Elem, Traits, Allocator>& data)
 {
- return const_buffers_1(const_buffer(data.data(), data.size()
+ return const_buffers_1(const_buffer(data.data(), data.size() * sizeof(Elem)
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , detail::buffer_debug_check<std::string::const_iterator>(data.begin())
+ , detail::buffer_debug_check<
+ typename std::basic_string<Elem, Traits, Allocator>::const_iterator
+ >(data.begin())
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
         ));
 }
@@ -1016,26 +1098,924 @@
  * @returns A const_buffers_1 value equivalent to:
  * @code const_buffers_1(
  * data.data(),
- * min(data.size(), max_size_in_bytes)); @endcode
+ * min(data.size() * sizeof(Elem), max_size_in_bytes)); @endcode
  *
  * @note The buffer is invalidated by any non-const operation called on the
  * given string object.
  */
-inline const_buffers_1 buffer(const std::string& data,
+template <typename Elem, typename Traits, typename Allocator>
+inline const_buffers_1 buffer(
+ const std::basic_string<Elem, Traits, Allocator>& data,
     std::size_t max_size_in_bytes)
 {
   return const_buffers_1(
       const_buffer(data.data(),
- data.size() < max_size_in_bytes
- ? data.size() : max_size_in_bytes
+ data.size() * sizeof(Elem) < max_size_in_bytes
+ ? data.size() * sizeof(Elem) : max_size_in_bytes
 #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
- , detail::buffer_debug_check<std::string::const_iterator>(data.begin())
+ , detail::buffer_debug_check<
+ typename std::basic_string<Elem, Traits, Allocator>::const_iterator
+ >(data.begin())
 #endif // BOOST_ASIO_ENABLE_BUFFER_DEBUGGING
         ));
 }
 
 /*@}*/
 
+/** @defgroup buffer_copy boost::asio::buffer_copy
+ *
+ * @brief The boost::asio::buffer_copy function is used to copy bytes from a
+ * source buffer (or buffer sequence) to a target buffer (or buffer sequence).
+ *
+ * The @c buffer_copy function is available in two forms:
+ *
+ * @li A 2-argument form: @c buffer_copy(target, source)
+ *
+ * @li A 3-argument form: @c buffer_copy(target, source, max_bytes_to_copy)
+
+ * Both forms return the number of bytes actually copied. The number of bytes
+ * copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c If specified, @c max_bytes_to_copy.
+ *
+ * This prevents buffer overflow, regardless of the buffer sizes used in the
+ * copy operation.
+ */
+/*@{*/
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const const_buffer& source)
+{
+ using namespace std; // For memcpy.
+ std::size_t target_size = buffer_size(target);
+ std::size_t source_size = buffer_size(source);
+ std::size_t n = target_size < source_size ? target_size : source_size;
+ memcpy(buffer_cast<void*>(target), buffer_cast<const void*>(source), n);
+ return n;
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const const_buffers_1& source)
+{
+ return buffer_copy(target, static_cast<const const_buffer&>(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const mutable_buffer& source)
+{
+ return buffer_copy(target, const_buffer(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const mutable_buffers_1& source)
+{
+ return buffer_copy(target, const_buffer(source));
+}
+
+/// Copies bytes from a source buffer sequence to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename ConstBufferSequence>
+std::size_t buffer_copy(const mutable_buffer& target,
+ const ConstBufferSequence& source)
+{
+ std::size_t total_bytes_copied = 0;
+
+ typename ConstBufferSequence::const_iterator source_iter = source.begin();
+ typename ConstBufferSequence::const_iterator source_end = source.end();
+
+ for (mutable_buffer target_buffer(target);
+ buffer_size(target_buffer) && source_iter != source_end; ++source_iter)
+ {
+ const_buffer source_buffer(*source_iter);
+ std::size_t bytes_copied = buffer_copy(target_buffer, source_buffer);
+ total_bytes_copied += bytes_copied;
+ target_buffer = target_buffer + bytes_copied;
+ }
+
+ return total_bytes_copied;
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const const_buffer& source)
+{
+ return buffer_copy(static_cast<const mutable_buffer&>(target), source);
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const const_buffers_1& source)
+{
+ return buffer_copy(static_cast<const mutable_buffer&>(target),
+ static_cast<const const_buffer&>(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const mutable_buffer& source)
+{
+ return buffer_copy(static_cast<const mutable_buffer&>(target),
+ const_buffer(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const mutable_buffers_1& source)
+{
+ return buffer_copy(static_cast<const mutable_buffer&>(target),
+ const_buffer(source));
+}
+
+/// Copies bytes from a source buffer sequence to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename ConstBufferSequence>
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const ConstBufferSequence& source)
+{
+ return buffer_copy(static_cast<const mutable_buffer&>(target), source);
+}
+
+/// Copies bytes from a source buffer to a target buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename MutableBufferSequence>
+std::size_t buffer_copy(const MutableBufferSequence& target,
+ const const_buffer& source)
+{
+ std::size_t total_bytes_copied = 0;
+
+ typename MutableBufferSequence::const_iterator target_iter = target.begin();
+ typename MutableBufferSequence::const_iterator target_end = target.end();
+
+ for (const_buffer source_buffer(source);
+ buffer_size(source_buffer) && target_iter != target_end; ++target_iter)
+ {
+ mutable_buffer target_buffer(*target_iter);
+ std::size_t bytes_copied = buffer_copy(target_buffer, source_buffer);
+ total_bytes_copied += bytes_copied;
+ source_buffer = source_buffer + bytes_copied;
+ }
+
+ return total_bytes_copied;
+}
+
+/// Copies bytes from a source buffer to a target buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const const_buffers_1& source)
+{
+ return buffer_copy(target, static_cast<const const_buffer&>(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const mutable_buffer& source)
+{
+ return buffer_copy(target, const_buffer(source));
+}
+
+/// Copies bytes from a source buffer to a target buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const mutable_buffers_1& source)
+{
+ return buffer_copy(target, const_buffer(source));
+}
+
+/// Copies bytes from a source buffer sequence to a target buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ */
+template <typename MutableBufferSequence, typename ConstBufferSequence>
+std::size_t buffer_copy(const MutableBufferSequence& target,
+ const ConstBufferSequence& source)
+{
+ std::size_t total_bytes_copied = 0;
+
+ typename MutableBufferSequence::const_iterator target_iter = target.begin();
+ typename MutableBufferSequence::const_iterator target_end = target.end();
+ std::size_t target_buffer_offset = 0;
+
+ typename ConstBufferSequence::const_iterator source_iter = source.begin();
+ typename ConstBufferSequence::const_iterator source_end = source.end();
+ std::size_t source_buffer_offset = 0;
+
+ while (target_iter != target_end && source_iter != source_end)
+ {
+ mutable_buffer target_buffer =
+ mutable_buffer(*target_iter) + target_buffer_offset;
+
+ const_buffer source_buffer =
+ const_buffer(*source_iter) + source_buffer_offset;
+
+ std::size_t bytes_copied = buffer_copy(target_buffer, source_buffer);
+ total_bytes_copied += bytes_copied;
+
+ if (bytes_copied == buffer_size(target_buffer))
+ {
+ ++target_iter;
+ target_buffer_offset = 0;
+ }
+ else
+ target_buffer_offset += bytes_copied;
+
+ if (bytes_copied == buffer_size(source_buffer))
+ {
+ ++source_iter;
+ source_buffer_offset = 0;
+ }
+ else
+ source_buffer_offset += bytes_copied;
+ }
+
+ return total_bytes_copied;
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const const_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const const_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const mutable_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const mutable_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer sequence to a target
+/// buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename ConstBufferSequence>
+inline std::size_t buffer_copy(const mutable_buffer& target,
+ const ConstBufferSequence& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const const_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const const_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const mutable_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const mutable_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer sequence to a target
+/// buffer.
+/**
+ * @param target A modifiable buffer representing the memory region to which
+ * the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename ConstBufferSequence>
+inline std::size_t buffer_copy(const mutable_buffers_1& target,
+ const ConstBufferSequence& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(buffer(target, max_bytes_to_copy), source);
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer
+/// sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const const_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(target, buffer(source, max_bytes_to_copy));
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer
+/// sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer representing the memory region from
+ * which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const const_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(target, buffer(source, max_bytes_to_copy));
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer
+/// sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const mutable_buffer& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(target, buffer(source, max_bytes_to_copy));
+}
+
+/// Copies a limited number of bytes from a source buffer to a target buffer
+/// sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A modifiable buffer representing the memory region from which
+ * the bytes will be copied. The contents of the source buffer will not be
+ * modified.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename MutableBufferSequence>
+inline std::size_t buffer_copy(const MutableBufferSequence& target,
+ const mutable_buffers_1& source, std::size_t max_bytes_to_copy)
+{
+ return buffer_copy(target, buffer(source, max_bytes_to_copy));
+}
+
+/// Copies a limited number of bytes from a source buffer sequence to a target
+/// buffer sequence.
+/**
+ * @param target A modifiable buffer sequence representing the memory regions to
+ * which the bytes will be copied.
+ *
+ * @param source A non-modifiable buffer sequence representing the memory
+ * regions from which the bytes will be copied.
+ *
+ * @param max_bytes_to_copy The maximum number of bytes to be copied.
+ *
+ * @returns The number of bytes copied.
+ *
+ * @note The number of bytes copied is the lesser of:
+ *
+ * @li @c buffer_size(target)
+ *
+ * @li @c buffer_size(source)
+ *
+ * @li @c max_bytes_to_copy
+ */
+template <typename MutableBufferSequence, typename ConstBufferSequence>
+std::size_t buffer_copy(const MutableBufferSequence& target,
+ const ConstBufferSequence& source, std::size_t max_bytes_to_copy)
+{
+ std::size_t total_bytes_copied = 0;
+
+ typename MutableBufferSequence::const_iterator target_iter = target.begin();
+ typename MutableBufferSequence::const_iterator target_end = target.end();
+ std::size_t target_buffer_offset = 0;
+
+ typename ConstBufferSequence::const_iterator source_iter = source.begin();
+ typename ConstBufferSequence::const_iterator source_end = source.end();
+ std::size_t source_buffer_offset = 0;
+
+ while (total_bytes_copied != max_bytes_to_copy
+ && target_iter != target_end && source_iter != source_end)
+ {
+ mutable_buffer target_buffer =
+ mutable_buffer(*target_iter) + target_buffer_offset;
+
+ const_buffer source_buffer =
+ const_buffer(*source_iter) + source_buffer_offset;
+
+ std::size_t bytes_copied = buffer_copy(target_buffer,
+ source_buffer, max_bytes_to_copy - total_bytes_copied);
+ total_bytes_copied += bytes_copied;
+
+ if (bytes_copied == buffer_size(target_buffer))
+ {
+ ++target_iter;
+ target_buffer_offset = 0;
+ }
+ else
+ target_buffer_offset += bytes_copied;
+
+ if (bytes_copied == buffer_size(source_buffer))
+ {
+ ++source_iter;
+ source_buffer_offset = 0;
+ }
+ else
+ source_buffer_offset += bytes_copied;
+ }
+
+ return total_bytes_copied;
+}
+
+/*@}*/
+
 } // namespace asio
 } // namespace boost
 

Modified: trunk/boost/asio/buffered_read_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_read_stream.hpp (original)
+++ trunk/boost/asio/buffered_read_stream.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -17,7 +17,6 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <cstring>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_read_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
@@ -97,13 +96,6 @@
     return next_layer_.lowest_layer();
   }
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the object.
- boost::asio::io_service& io_service()
- {
- return next_layer_.get_io_service();
- }
-
   /// Get the io_service associated with the object.
   boost::asio::io_service& get_io_service()
   {
@@ -227,16 +219,7 @@
   template <typename MutableBufferSequence>
   std::size_t read_some(const MutableBufferSequence& buffers)
   {
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::mutable_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
       return 0;
 
     if (storage_.empty())
@@ -253,16 +236,7 @@
   {
     ec = boost::system::error_code();
 
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::mutable_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
       return 0;
 
     if (storage_.empty() && !fill(ec))
@@ -294,24 +268,8 @@
       }
       else
       {
- using namespace std; // For memcpy.
-
- std::size_t bytes_avail = storage_.size();
- std::size_t bytes_copied = 0;
-
- typename MutableBufferSequence::const_iterator iter = buffers_.begin();
- typename MutableBufferSequence::const_iterator end = buffers_.end();
- for (; iter != end && bytes_avail > 0; ++iter)
- {
- std::size_t max_length = buffer_size(*iter);
- std::size_t length = (max_length < bytes_avail)
- ? max_length : bytes_avail;
- memcpy(buffer_cast<void*>(*iter),
- storage_.data() + bytes_copied, length);
- bytes_copied += length;
- bytes_avail -= length;
- }
-
+ std::size_t bytes_copied = boost::asio::buffer_copy(
+ buffers_, storage_.data(), storage_.size());
         storage_.consume(bytes_copied);
         io_service_.dispatch(detail::bind_handler(handler_, ec, bytes_copied));
       }
@@ -330,16 +288,7 @@
   void async_read_some(const MutableBufferSequence& buffers,
       ReadHandler handler)
   {
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::mutable_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
     {
       get_io_service().post(detail::bind_handler(
             handler, boost::system::error_code(), 0));
@@ -398,23 +347,8 @@
   template <typename MutableBufferSequence>
   std::size_t copy(const MutableBufferSequence& buffers)
   {
- using namespace std; // For memcpy.
-
- std::size_t bytes_avail = storage_.size();
- std::size_t bytes_copied = 0;
-
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- for (; iter != end && bytes_avail > 0; ++iter)
- {
- std::size_t max_length = buffer_size(*iter);
- std::size_t length = (max_length < bytes_avail)
- ? max_length : bytes_avail;
- memcpy(buffer_cast<void*>(*iter), storage_.data() + bytes_copied, length);
- bytes_copied += length;
- bytes_avail -= length;
- }
-
+ std::size_t bytes_copied = boost::asio::buffer_copy(
+ buffers, storage_.data(), storage_.size());
     storage_.consume(bytes_copied);
     return bytes_copied;
   }
@@ -425,24 +359,7 @@
   template <typename MutableBufferSequence>
   std::size_t peek_copy(const MutableBufferSequence& buffers)
   {
- using namespace std; // For memcpy.
-
- std::size_t bytes_avail = storage_.size();
- std::size_t bytes_copied = 0;
-
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- for (; iter != end && bytes_avail > 0; ++iter)
- {
- std::size_t max_length = buffer_size(*iter);
- std::size_t length = (max_length < bytes_avail)
- ? max_length : bytes_avail;
- memcpy(buffer_cast<void*>(*iter), storage_.data() + bytes_copied, length);
- bytes_copied += length;
- bytes_avail -= length;
- }
-
- return bytes_copied;
+ return boost::asio::buffer_copy(buffers, storage_.data(), storage_.size());
   }
 
   /// The next layer.

Modified: trunk/boost/asio/buffered_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_stream.hpp (original)
+++ trunk/boost/asio/buffered_stream.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -87,13 +87,6 @@
     return stream_impl_.lowest_layer();
   }
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the object.
- boost::asio::io_service& io_service()
- {
- return stream_impl_.get_io_service();
- }
-
   /// Get the io_service associated with the object.
   boost::asio::io_service& get_io_service()
   {

Modified: trunk/boost/asio/buffered_write_stream.hpp
==============================================================================
--- trunk/boost/asio/buffered_write_stream.hpp (original)
+++ trunk/boost/asio/buffered_write_stream.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -17,7 +17,6 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <cstddef>
-#include <cstring>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/asio/buffered_write_stream_fwd.hpp>
 #include <boost/asio/buffer.hpp>
@@ -98,13 +97,6 @@
     return next_layer_.lowest_layer();
   }
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the object.
- boost::asio::io_service& io_service()
- {
- return next_layer_.get_io_service();
- }
-
   /// Get the io_service associated with the object.
   boost::asio::io_service& get_io_service()
   {
@@ -184,16 +176,7 @@
   template <typename ConstBufferSequence>
   std::size_t write_some(const ConstBufferSequence& buffers)
   {
- typename ConstBufferSequence::const_iterator iter = buffers.begin();
- typename ConstBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::const_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
       return 0;
 
     if (storage_.size() == storage_.capacity())
@@ -210,16 +193,7 @@
   {
     ec = boost::system::error_code();
 
- typename ConstBufferSequence::const_iterator iter = buffers.begin();
- typename ConstBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::const_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
       return 0;
 
     if (storage_.size() == storage_.capacity() && !flush(ec))
@@ -251,25 +225,14 @@
       }
       else
       {
- using namespace std; // For memcpy.
-
         std::size_t orig_size = storage_.size();
         std::size_t space_avail = storage_.capacity() - orig_size;
- std::size_t bytes_copied = 0;
-
- typename ConstBufferSequence::const_iterator iter = buffers_.begin();
- typename ConstBufferSequence::const_iterator end = buffers_.end();
- for (; iter != end && space_avail > 0; ++iter)
- {
- std::size_t bytes_avail = buffer_size(*iter);
- std::size_t length = (bytes_avail < space_avail)
- ? bytes_avail : space_avail;
- storage_.resize(orig_size + bytes_copied + length);
- memcpy(storage_.data() + orig_size + bytes_copied,
- buffer_cast<const void*>(*iter), length);
- bytes_copied += length;
- space_avail -= length;
- }
+ std::size_t bytes_avail = boost::asio::buffer_size(buffers_);
+ std::size_t length = bytes_avail < space_avail
+ ? bytes_avail : space_avail;
+ storage_.resize(orig_size + length);
+ std::size_t bytes_copied = boost::asio::buffer_copy(
+ storage_.data(), buffers_, length);
 
         io_service_.dispatch(detail::bind_handler(handler_, ec, bytes_copied));
       }
@@ -288,16 +251,7 @@
   void async_write_some(const ConstBufferSequence& buffers,
       WriteHandler handler)
   {
- typename ConstBufferSequence::const_iterator iter = buffers.begin();
- typename ConstBufferSequence::const_iterator end = buffers.end();
- size_t total_buffer_size = 0;
- for (; iter != end; ++iter)
- {
- boost::asio::const_buffer buffer(*iter);
- total_buffer_size += boost::asio::buffer_size(buffer);
- }
-
- if (total_buffer_size == 0)
+ if (boost::asio::buffer_size(buffers) == 0)
     {
       get_io_service().post(detail::bind_handler(
             handler, boost::system::error_code(), 0));
@@ -376,27 +330,12 @@
   template <typename ConstBufferSequence>
   std::size_t copy(const ConstBufferSequence& buffers)
   {
- using namespace std; // For memcpy.
-
     std::size_t orig_size = storage_.size();
     std::size_t space_avail = storage_.capacity() - orig_size;
- std::size_t bytes_copied = 0;
-
- typename ConstBufferSequence::const_iterator iter = buffers.begin();
- typename ConstBufferSequence::const_iterator end = buffers.end();
- for (; iter != end && space_avail > 0; ++iter)
- {
- std::size_t bytes_avail = buffer_size(*iter);
- std::size_t length = (bytes_avail < space_avail)
- ? bytes_avail : space_avail;
- storage_.resize(orig_size + bytes_copied + length);
- memcpy(storage_.data() + orig_size + bytes_copied,
- buffer_cast<const void*>(*iter), length);
- bytes_copied += length;
- space_avail -= length;
- }
-
- return bytes_copied;
+ std::size_t bytes_avail = boost::asio::buffer_size(buffers);
+ std::size_t length = bytes_avail < space_avail ? bytes_avail : space_avail;
+ storage_.resize(orig_size + length);
+ return boost::asio::buffer_copy(storage_.data(), buffers, length);
   }
 
   /// The next layer.

Modified: trunk/boost/asio/completion_condition.hpp
==============================================================================
--- trunk/boost/asio/completion_condition.hpp (original)
+++ trunk/boost/asio/completion_condition.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -76,6 +76,28 @@
   std::size_t minimum_;
 };
 
+class transfer_exactly_t
+{
+public:
+ typedef std::size_t result_type;
+
+ explicit transfer_exactly_t(std::size_t size)
+ : size_(size)
+ {
+ }
+
+ template <typename Error>
+ std::size_t operator()(const Error& err, std::size_t bytes_transferred)
+ {
+ return (!!err || bytes_transferred >= size_) ? 0 :
+ (size_ - bytes_transferred < default_max_transfer_size
+ ? size_ - bytes_transferred : std::size_t(default_max_transfer_size));
+ }
+
+private:
+ std::size_t size_;
+};
+
 } // namespace detail
 
 /**
@@ -154,6 +176,40 @@
 }
 #endif
 
+/// Return a completion condition function object that indicates that a read or
+/// write operation should continue until an exact number of bytes has been
+/// transferred, or until an error occurs.
+/**
+ * This function is used to create an object, of unspecified type, that meets
+ * CompletionCondition requirements.
+ *
+ * @par Example
+ * Reading until a buffer is full or contains exactly 64 bytes:
+ * @code
+ * boost::array<char, 128> buf;
+ * boost::system::error_code ec;
+ * std::size_t n = boost::asio::read(
+ * sock, boost::asio::buffer(buf),
+ * boost::asio::transfer_exactly(64), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * // n == 64
+ * }
+ * @endcode
+ */
+#if defined(GENERATING_DOCUMENTATION)
+unspecified transfer_exactly(std::size_t minimum);
+#else
+inline detail::transfer_exactly_t transfer_exactly(std::size_t size)
+{
+ return detail::transfer_exactly_t(size);
+}
+#endif
+
 /*@}*/
 
 } // namespace asio

Added: trunk/boost/asio/connect.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/connect.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,814 @@
+//
+// connect.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_CONNECT_HPP
+#define BOOST_ASIO_CONNECT_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/basic_socket.hpp>
+#include <boost/asio/error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/**
+ * @defgroup connect boost::asio::connect
+ *
+ * @brief Establishes a socket connection by trying each endpoint in a sequence.
+ */
+/*@{*/
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @throws boost::system::system_error Thrown on failure. If the sequence is
+ * empty, the associated @c error_code is boost::asio::error::not_found.
+ * Otherwise, contains the error from the last connection attempt.
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ * boost::asio::connect(s, r.resolve(q)); @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s, Iterator begin);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param ec Set to indicate what error occurred, if any. If the sequence is
+ * empty, set to boost::asio::error::not_found. Otherwise, contains the error
+ * from the last connection attempt.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ * boost::system::error_code ec;
+ * boost::asio::connect(s, r.resolve(q), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, boost::system::error_code& ec);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @throws boost::system::system_error Thrown on failure. If the sequence is
+ * empty, the associated @c error_code is boost::asio::error::not_found.
+ * Otherwise, contains the error from the last connection attempt.
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::resolver::iterator i = r.resolve(q), end;
+ * tcp::socket s(io_service);
+ * boost::asio::connect(s, i, end); @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @param ec Set to indicate what error occurred, if any. If the sequence is
+ * empty, set to boost::asio::error::not_found. Otherwise, contains the error
+ * from the last connection attempt.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::resolver::iterator i = r.resolve(q), end;
+ * tcp::socket s(io_service);
+ * boost::system::error_code ec;
+ * boost::asio::connect(s, i, end, ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, boost::system::error_code& ec);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @throws boost::system::system_error Thrown on failure. If the sequence is
+ * empty, the associated @c error_code is boost::asio::error::not_found.
+ * Otherwise, contains the error from the last connection attempt.
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ * tcp::resolver::iterator i = boost::asio::connect(
+ * s, r.resolve(q), my_connect_condition());
+ * std::cout << "Connected to: " << i->endpoint() << std::endl; @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ConnectCondition connect_condition);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @param ec Set to indicate what error occurred, if any. If the sequence is
+ * empty, set to boost::asio::error::not_found. Otherwise, contains the error
+ * from the last connection attempt.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ * boost::system::error_code ec;
+ * tcp::resolver::iterator i = boost::asio::connect(
+ * s, r.resolve(q), my_connect_condition(), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * std::cout << "Connected to: " << i->endpoint() << std::endl;
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s, Iterator begin,
+ ConnectCondition connect_condition, boost::system::error_code& ec);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @throws boost::system::system_error Thrown on failure. If the sequence is
+ * empty, the associated @c error_code is boost::asio::error::not_found.
+ * Otherwise, contains the error from the last connection attempt.
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::resolver::iterator i = r.resolve(q), end;
+ * tcp::socket s(io_service);
+ * i = boost::asio::connect(s, i, end, my_connect_condition());
+ * std::cout << "Connected to: " << i->endpoint() << std::endl; @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s, Iterator begin,
+ Iterator end, ConnectCondition connect_condition);
+
+/// Establishes a socket connection by trying each endpoint in a sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c connect member
+ * function, once for each endpoint in the sequence, until a connection is
+ * successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @param ec Set to indicate what error occurred, if any. If the sequence is
+ * empty, set to boost::asio::error::not_found. Otherwise, contains the error
+ * from the last connection attempt.
+ *
+ * @returns On success, an iterator denoting the successfully connected
+ * endpoint. Otherwise, the end iterator.
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::resolver::iterator i = r.resolve(q), end;
+ * tcp::socket s(io_service);
+ * boost::system::error_code ec;
+ * i = boost::asio::connect(s, i, end, my_connect_condition(), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * std::cout << "Connected to: " << i->endpoint() << std::endl;
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ boost::system::error_code& ec);
+
+/*@}*/
+
+/**
+ * @defgroup async_connect boost::asio::async_connect
+ *
+ * @brief Asynchronously establishes a socket connection by trying each
+ * endpoint in a sequence.
+ */
+/*@{*/
+
+/// Asynchronously establishes a socket connection by trying each endpoint in a
+/// sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c async_connect
+ * member function, once for each endpoint in the sequence, until a connection
+ * is successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param handler The handler to be called when the connect operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * // Result of operation. if the sequence is empty, set to
+ * // boost::asio::error::not_found. Otherwise, contains the
+ * // error from the last connection attempt.
+ * const boost::system::error_code& error,
+ *
+ * // On success, an iterator denoting the successfully
+ * // connected endpoint. Otherwise, the end iterator.
+ * Iterator iterator
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ *
+ * // ...
+ *
+ * r.async_resolve(q, resolve_handler);
+ *
+ * // ...
+ *
+ * void resolve_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (!ec)
+ * {
+ * boost::asio::async_connect(s, i, connect_handler);
+ * }
+ * }
+ *
+ * // ...
+ *
+ * void connect_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * // ...
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ComposedConnectHandler>
+void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ComposedConnectHandler handler);
+
+/// Asynchronously establishes a socket connection by trying each endpoint in a
+/// sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c async_connect
+ * member function, once for each endpoint in the sequence, until a connection
+ * is successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @param handler The handler to be called when the connect operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * // Result of operation. if the sequence is empty, set to
+ * // boost::asio::error::not_found. Otherwise, contains the
+ * // error from the last connection attempt.
+ * const boost::system::error_code& error,
+ *
+ * // On success, an iterator denoting the successfully
+ * // connected endpoint. Otherwise, the end iterator.
+ * Iterator iterator
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @par Example
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ *
+ * // ...
+ *
+ * r.async_resolve(q, resolve_handler);
+ *
+ * // ...
+ *
+ * void resolve_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (!ec)
+ * {
+ * tcp::resolver::iterator end;
+ * boost::asio::async_connect(s, i, end, connect_handler);
+ * }
+ * }
+ *
+ * // ...
+ *
+ * void connect_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * // ...
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ComposedConnectHandler>
+void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ComposedConnectHandler handler);
+
+/// Asynchronously establishes a socket connection by trying each endpoint in a
+/// sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c async_connect
+ * member function, once for each endpoint in the sequence, until a connection
+ * is successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @param handler The handler to be called when the connect operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * // Result of operation. if the sequence is empty, set to
+ * // boost::asio::error::not_found. Otherwise, contains the
+ * // error from the last connection attempt.
+ * const boost::system::error_code& error,
+ *
+ * // On success, an iterator denoting the successfully
+ * // connected endpoint. Otherwise, the end iterator.
+ * Iterator iterator
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @note This overload assumes that a default constructed object of type @c
+ * Iterator represents the end of the sequence. This is a valid assumption for
+ * iterator types such as @c boost::asio::ip::tcp::resolver::iterator.
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ *
+ * // ...
+ *
+ * r.async_resolve(q, resolve_handler);
+ *
+ * // ...
+ *
+ * void resolve_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (!ec)
+ * {
+ * boost::asio::async_connect(s, i,
+ * my_connect_condition(),
+ * connect_handler);
+ * }
+ * }
+ *
+ * // ...
+ *
+ * void connect_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * std::cout << "Connected to: " << i->endpoint() << std::endl;
+ * }
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+void async_connect(basic_socket<Protocol, SocketService>& s, Iterator begin,
+ ConnectCondition connect_condition, ComposedConnectHandler handler);
+
+/// Asynchronously establishes a socket connection by trying each endpoint in a
+/// sequence.
+/**
+ * This function attempts to connect a socket to one of a sequence of
+ * endpoints. It does this by repeated calls to the socket's @c async_connect
+ * member function, once for each endpoint in the sequence, until a connection
+ * is successfully established.
+ *
+ * @param s The socket to be connected. If the socket is already open, it will
+ * be closed.
+ *
+ * @param begin An iterator pointing to the start of a sequence of endpoints.
+ *
+ * @param end An iterator pointing to the end of a sequence of endpoints.
+ *
+ * @param connect_condition A function object that is called prior to each
+ * connection attempt. The signature of the function object must be:
+ * @code Iterator connect_condition(
+ * const boost::system::error_code& ec,
+ * Iterator next); @endcode
+ * The @c ec parameter contains the result from the most recent connect
+ * operation. Before the first connection attempt, @c ec is always set to
+ * indicate success. The @c next parameter is an iterator pointing to the next
+ * endpoint to be tried. The function object should return the next iterator,
+ * but is permitted to return a different iterator so that endpoints may be
+ * skipped. The implementation guarantees that the function object will never
+ * be called with the end iterator.
+ *
+ * @param handler The handler to be called when the connect operation
+ * completes. Copies will be made of the handler as required. The function
+ * signature of the handler must be:
+ * @code void handler(
+ * // Result of operation. if the sequence is empty, set to
+ * // boost::asio::error::not_found. Otherwise, contains the
+ * // error from the last connection attempt.
+ * const boost::system::error_code& error,
+ *
+ * // On success, an iterator denoting the successfully
+ * // connected endpoint. Otherwise, the end iterator.
+ * Iterator iterator
+ * ); @endcode
+ * Regardless of whether the asynchronous operation completes immediately or
+ * not, the handler will not be invoked from within this function. Invocation
+ * of the handler will be performed in a manner equivalent to using
+ * boost::asio::io_service::post().
+ *
+ * @par Example
+ * The following connect condition function object can be used to output
+ * information about the individual connection attempts:
+ * @code struct my_connect_condition
+ * {
+ * template <typename Iterator>
+ * Iterator operator()(
+ * const boost::system::error_code& ec,
+ * Iterator next)
+ * {
+ * if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ * std::cout << "Trying: " << next->endpoint() << std::endl;
+ * return next;
+ * }
+ * }; @endcode
+ * It would be used with the boost::asio::connect function as follows:
+ * @code tcp::resolver r(io_service);
+ * tcp::resolver::query q("host", "service");
+ * tcp::socket s(io_service);
+ *
+ * // ...
+ *
+ * r.async_resolve(q, resolve_handler);
+ *
+ * // ...
+ *
+ * void resolve_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (!ec)
+ * {
+ * tcp::resolver::iterator end;
+ * boost::asio::async_connect(s, i, end,
+ * my_connect_condition(),
+ * connect_handler);
+ * }
+ * }
+ *
+ * // ...
+ *
+ * void connect_handler(
+ * const boost::system::error_code& ec,
+ * tcp::resolver::iterator i)
+ * {
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * std::cout << "Connected to: " << i->endpoint() << std::endl;
+ * }
+ * } @endcode
+ */
+template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ ComposedConnectHandler handler);
+
+/*@}*/
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#include <boost/asio/impl/connect.hpp>
+
+#endif

Modified: trunk/boost/asio/datagram_socket_service.hpp
==============================================================================
--- trunk/boost/asio/datagram_socket_service.hpp (original)
+++ trunk/boost/asio/datagram_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,11 +68,18 @@
   typedef typename service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native socket type.
+ /// (Deprecated: Use native_handle_type.) The native socket type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef typename service_impl_type::native_type native_type;
+ typedef typename service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native socket type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new datagram socket service for the specified io_service.
@@ -114,7 +121,7 @@
 
   /// Assign an existing native socket to a datagram socket.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     return service_impl_.assign(impl, protocol, native_socket, ec);
@@ -133,10 +140,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native socket implementation.
+ /// (Deprecated: Use native_handle().) Get the native socket implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native socket implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -206,6 +219,32 @@
     return service_impl_.io_control(impl, command, ec);
   }
 
+ /// Gets the non-blocking mode of the socket.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
   /// Get the local endpoint.
   endpoint_type local_endpoint(const implementation_type& impl,
       boost::system::error_code& ec) const

Modified: trunk/boost/asio/deadline_timer_service.hpp
==============================================================================
--- trunk/boost/asio/deadline_timer_service.hpp (original)
+++ trunk/boost/asio/deadline_timer_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -96,6 +96,13 @@
     return service_impl_.cancel(impl, ec);
   }
 
+ /// Cancels one asynchronous wait operation associated with the timer.
+ std::size_t cancel_one(implementation_type& impl,
+ boost::system::error_code& ec)
+ {
+ return service_impl_.cancel_one(impl, ec);
+ }
+
   /// Get the expiry time for the timer as an absolute time.
   time_type expires_at(const implementation_type& impl) const
   {

Modified: trunk/boost/asio/detail/bind_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/bind_handler.hpp (original)
+++ trunk/boost/asio/detail/bind_handler.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -35,6 +35,12 @@
   {
   }
 
+ binder1(Handler& handler, const Arg1& arg1)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ arg1_(arg1)
+ {
+ }
+
   void operator()()
   {
     handler_(static_cast<const Arg1&>(arg1_));
@@ -92,6 +98,13 @@
   {
   }
 
+ binder2(Handler& handler, const Arg1& arg1, const Arg2& arg2)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ arg1_(arg1),
+ arg2_(arg2)
+ {
+ }
+
   void operator()()
   {
     handler_(static_cast<const Arg1&>(arg1_),
@@ -153,6 +166,15 @@
   {
   }
 
+ binder3(Handler& handler, const Arg1& arg1, const Arg2& arg2,
+ const Arg3& arg3)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ arg1_(arg1),
+ arg2_(arg2),
+ arg3_(arg3)
+ {
+ }
+
   void operator()()
   {
     handler_(static_cast<const Arg1&>(arg1_),
@@ -219,6 +241,16 @@
   {
   }
 
+ binder4(Handler& handler, const Arg1& arg1, const Arg2& arg2,
+ const Arg3& arg3, const Arg4& arg4)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ arg1_(arg1),
+ arg2_(arg2),
+ arg3_(arg3),
+ arg4_(arg4)
+ {
+ }
+
   void operator()()
   {
     handler_(static_cast<const Arg1&>(arg1_),
@@ -293,6 +325,17 @@
   {
   }
 
+ binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2,
+ const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
+ : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
+ arg1_(arg1),
+ arg2_(arg2),
+ arg3_(arg3),
+ arg4_(arg4),
+ arg5_(arg5)
+ {
+ }
+
   void operator()()
   {
     handler_(static_cast<const Arg1&>(arg1_),

Modified: trunk/boost/asio/detail/buffer_sequence_adapter.hpp
==============================================================================
--- trunk/boost/asio/detail/buffer_sequence_adapter.hpp (original)
+++ trunk/boost/asio/detail/buffer_sequence_adapter.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -81,11 +81,11 @@
   : buffer_sequence_adapter_base
 {
 public:
- explicit buffer_sequence_adapter(const Buffers& buffers)
+ explicit buffer_sequence_adapter(const Buffers& buffer_sequence)
     : count_(0), total_buffer_size_(0)
   {
- typename Buffers::const_iterator iter = buffers.begin();
- typename Buffers::const_iterator end = buffers.end();
+ typename Buffers::const_iterator iter = buffer_sequence.begin();
+ typename Buffers::const_iterator end = buffer_sequence.end();
     for (; iter != end && count_ < max_buffers; ++iter, ++count_)
     {
       Buffer buffer(*iter);
@@ -109,10 +109,10 @@
     return total_buffer_size_ == 0;
   }
 
- static bool all_empty(const Buffers& buffers)
+ static bool all_empty(const Buffers& buffer_sequence)
   {
- typename Buffers::const_iterator iter = buffers.begin();
- typename Buffers::const_iterator end = buffers.end();
+ typename Buffers::const_iterator iter = buffer_sequence.begin();
+ typename Buffers::const_iterator end = buffer_sequence.end();
     std::size_t i = 0;
     for (; iter != end && i < max_buffers; ++iter, ++i)
       if (boost::asio::buffer_size(Buffer(*iter)) > 0)
@@ -120,10 +120,10 @@
     return true;
   }
 
- static void validate(const Buffers& buffers)
+ static void validate(const Buffers& buffer_sequence)
   {
- typename Buffers::const_iterator iter = buffers.begin();
- typename Buffers::const_iterator end = buffers.end();
+ typename Buffers::const_iterator iter = buffer_sequence.begin();
+ typename Buffers::const_iterator end = buffer_sequence.end();
     for (; iter != end; ++iter)
     {
       Buffer buffer(*iter);
@@ -131,10 +131,10 @@
     }
   }
 
- static Buffer first(const Buffers& buffers)
+ static Buffer first(const Buffers& buffer_sequence)
   {
- typename Buffers::const_iterator iter = buffers.begin();
- typename Buffers::const_iterator end = buffers.end();
+ typename Buffers::const_iterator iter = buffer_sequence.begin();
+ typename Buffers::const_iterator end = buffer_sequence.end();
     for (; iter != end; ++iter)
     {
       Buffer buffer(*iter);
@@ -159,10 +159,10 @@
 {
 public:
   explicit buffer_sequence_adapter(
- const boost::asio::mutable_buffers_1& buffers)
+ const boost::asio::mutable_buffers_1& buffer_sequence)
   {
- init_native_buffer(buffer_, Buffer(buffers));
- total_buffer_size_ = boost::asio::buffer_size(buffers);
+ init_native_buffer(buffer_, Buffer(buffer_sequence));
+ total_buffer_size_ = boost::asio::buffer_size(buffer_sequence);
   }
 
   native_buffer_type* buffers()
@@ -180,19 +180,19 @@
     return total_buffer_size_ == 0;
   }
 
- static bool all_empty(const boost::asio::mutable_buffers_1& buffers)
+ static bool all_empty(const boost::asio::mutable_buffers_1& buffer_sequence)
   {
- return boost::asio::buffer_size(buffers) == 0;
+ return boost::asio::buffer_size(buffer_sequence) == 0;
   }
 
- static void validate(const boost::asio::mutable_buffers_1& buffers)
+ static void validate(const boost::asio::mutable_buffers_1& buffer_sequence)
   {
- boost::asio::buffer_cast<const void*>(buffers);
+ boost::asio::buffer_cast<const void*>(buffer_sequence);
   }
 
- static Buffer first(const boost::asio::mutable_buffers_1& buffers)
+ static Buffer first(const boost::asio::mutable_buffers_1& buffer_sequence)
   {
- return Buffer(buffers);
+ return Buffer(buffer_sequence);
   }
 
 private:
@@ -206,10 +206,10 @@
 {
 public:
   explicit buffer_sequence_adapter(
- const boost::asio::const_buffers_1& buffers)
+ const boost::asio::const_buffers_1& buffer_sequence)
   {
- init_native_buffer(buffer_, Buffer(buffers));
- total_buffer_size_ = boost::asio::buffer_size(buffers);
+ init_native_buffer(buffer_, Buffer(buffer_sequence));
+ total_buffer_size_ = boost::asio::buffer_size(buffer_sequence);
   }
 
   native_buffer_type* buffers()
@@ -227,19 +227,19 @@
     return total_buffer_size_ == 0;
   }
 
- static bool all_empty(const boost::asio::const_buffers_1& buffers)
+ static bool all_empty(const boost::asio::const_buffers_1& buffer_sequence)
   {
- return boost::asio::buffer_size(buffers) == 0;
+ return boost::asio::buffer_size(buffer_sequence) == 0;
   }
 
- static void validate(const boost::asio::const_buffers_1& buffers)
+ static void validate(const boost::asio::const_buffers_1& buffer_sequence)
   {
- boost::asio::buffer_cast<const void*>(buffers);
+ boost::asio::buffer_cast<const void*>(buffer_sequence);
   }
 
- static Buffer first(const boost::asio::const_buffers_1& buffers)
+ static Buffer first(const boost::asio::const_buffers_1& buffer_sequence)
   {
- return Buffer(buffers);
+ return Buffer(buffer_sequence);
   }
 
 private:

Modified: trunk/boost/asio/detail/buffered_stream_storage.hpp
==============================================================================
--- trunk/boost/asio/detail/buffered_stream_storage.hpp (original)
+++ trunk/boost/asio/detail/buffered_stream_storage.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,7 +16,8 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <cassert>
+#include <boost/asio/buffer.hpp>
+#include <boost/assert.hpp>
 #include <cstddef>
 #include <cstring>
 #include <vector>
@@ -37,10 +38,10 @@
   typedef std::size_t size_type;
 
   // Constructor.
- explicit buffered_stream_storage(std::size_t capacity)
+ explicit buffered_stream_storage(std::size_t buffer_capacity)
     : begin_offset_(0),
       end_offset_(0),
- buffer_(capacity)
+ buffer_(buffer_capacity)
   {
   }
 
@@ -52,15 +53,15 @@
   }
 
   // Return a pointer to the beginning of the unread data.
- byte_type* data()
+ mutable_buffer data()
   {
- return &buffer_[0] + begin_offset_;
+ return boost::asio::buffer(buffer_) + begin_offset_;
   }
 
   // Return a pointer to the beginning of the unread data.
- const byte_type* data() const
+ const_buffer data() const
   {
- return &buffer_[0] + begin_offset_;
+ return boost::asio::buffer(buffer_) + begin_offset_;
   }
 
   // Is there no unread data in the buffer.
@@ -78,7 +79,7 @@
   // Resize the buffer to the specified length.
   void resize(size_type length)
   {
- assert(length <= capacity());
+ BOOST_ASSERT(length <= capacity());
     if (begin_offset_ + length <= capacity())
     {
       end_offset_ = begin_offset_ + length;
@@ -101,7 +102,7 @@
   // Consume multiple bytes from the beginning of the buffer.
   void consume(size_type count)
   {
- assert(begin_offset_ + count <= end_offset_);
+ BOOST_ASSERT(begin_offset_ + count <= end_offset_);
     begin_offset_ += count;
     if (empty())
       clear();

Modified: trunk/boost/asio/detail/completion_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/completion_handler.hpp (original)
+++ trunk/boost/asio/detail/completion_handler.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -33,9 +33,9 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(completion_handler);
 
- completion_handler(Handler h)
+ completion_handler(Handler& h)
     : operation(&completion_handler::do_complete),
- handler_(h)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(h))
   {
   }
 
@@ -52,7 +52,7 @@
     // with the handler. Consequently, a local copy of the handler is required
     // to ensure that any owning sub-object remains valid until after we have
     // deallocated the memory here.
- Handler handler(h->handler_);
+ Handler handler(BOOST_ASIO_MOVE_CAST(Handler)(h->handler_));
     p.h = boost::addressof(handler);
     p.reset();
 

Modified: trunk/boost/asio/detail/config.hpp
==============================================================================
--- trunk/boost/asio/detail/config.hpp (original)
+++ trunk/boost/asio/detail/config.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -46,6 +46,41 @@
 # define BOOST_ASIO_DECL
 #endif // !defined(BOOST_ASIO_DECL)
 
+// Support move construction on compilers known to allow it.
+#if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+#endif // defined(__GNUC__)
+#if defined(BOOST_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_MOVE_CAST(type) static_cast<type&&>
+# endif // (_MSC_VER >= 1600)
+#endif // defined(BOOST_MSVC)
+
+// If BOOST_ASIO_MOVE_CAST isn't defined yet use a C++03 compatible version.
+#if !defined(BOOST_ASIO_MOVE_CAST)
+# define BOOST_ASIO_MOVE_CAST(type) static_cast<const type&>
+#endif // !defined_BOOST_ASIO_MOVE_CAST
+
+// Standard library support for system errors.
+#if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_MSVC)
+# if (_MSC_VER >= 1600)
+# define BOOST_ASIO_HAS_STD_SYSTEM_ERROR
+# endif // (_MSC_VER >= 1600)
+# endif // defined(BOOST_MSVC)
+#endif // !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
+
 // Windows: target OS version.
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 # if !defined(_WIN32_WINNT) && !defined(_WIN32_WINDOWS)

Modified: trunk/boost/asio/detail/deadline_timer_service.hpp
==============================================================================
--- trunk/boost/asio/detail/deadline_timer_service.hpp (original)
+++ trunk/boost/asio/detail/deadline_timer_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -100,12 +100,31 @@
       ec = boost::system::error_code();
       return 0;
     }
+
     std::size_t count = scheduler_.cancel_timer(timer_queue_, impl.timer_data);
     impl.might_have_pending_waits = false;
     ec = boost::system::error_code();
     return count;
   }
 
+ // Cancels one asynchronous wait operation associated with the timer.
+ std::size_t cancel_one(implementation_type& impl,
+ boost::system::error_code& ec)
+ {
+ if (!impl.might_have_pending_waits)
+ {
+ ec = boost::system::error_code();
+ return 0;
+ }
+
+ std::size_t count = scheduler_.cancel_timer(
+ timer_queue_, impl.timer_data, 1);
+ if (count == 0)
+ impl.might_have_pending_waits = false;
+ ec = boost::system::error_code();
+ return count;
+ }
+
   // Get the expiry time for the timer as an absolute time.
   time_type expires_at(const implementation_type& impl) const
   {
@@ -140,23 +159,22 @@
   void wait(implementation_type& impl, boost::system::error_code& ec)
   {
     time_type now = Time_Traits::now();
- while (Time_Traits::less_than(now, impl.expiry))
+ ec = boost::system::error_code();
+ while (Time_Traits::less_than(now, impl.expiry) && !ec)
     {
       boost::posix_time::time_duration timeout =
         Time_Traits::to_posix_duration(Time_Traits::subtract(impl.expiry, now));
       ::timeval tv;
       tv.tv_sec = timeout.total_seconds();
       tv.tv_usec = timeout.total_microseconds() % 1000000;
- boost::system::error_code ec;
       socket_ops::select(0, 0, 0, 0, &tv, ec);
       now = Time_Traits::now();
     }
- ec = boost::system::error_code();
   }
 
   // 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;

Modified: trunk/boost/asio/detail/descriptor_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_ops.hpp (original)
+++ trunk/boost/asio/detail/descriptor_ops.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -40,7 +40,10 @@
   internal_non_blocking = 2,
 
   // Helper "state" used to determine whether the descriptor is non-blocking.
- non_blocking = user_set_non_blocking | internal_non_blocking
+ non_blocking = user_set_non_blocking | internal_non_blocking,
+
+ // The descriptor may have been dup()-ed.
+ possible_dup = 4
 };
 
 typedef unsigned char state_type;
@@ -60,8 +63,11 @@
 BOOST_ASIO_DECL int close(int d, state_type& state,
     boost::system::error_code& ec);
 
+BOOST_ASIO_DECL bool set_user_non_blocking(int d,
+ state_type& state, bool value, boost::system::error_code& ec);
+
 BOOST_ASIO_DECL bool set_internal_non_blocking(int d,
- state_type& state, boost::system::error_code& ec);
+ state_type& state, bool value, boost::system::error_code& ec);
 
 typedef iovec buf;
 

Modified: trunk/boost/asio/detail/descriptor_read_op.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_read_op.hpp (original)
+++ trunk/boost/asio/detail/descriptor_read_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,10 +68,10 @@
   BOOST_ASIO_DEFINE_HANDLER_PTR(descriptor_read_op);
 
   descriptor_read_op(int descriptor,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
     : descriptor_read_op_base<MutableBufferSequence>(
         descriptor, buffers, &descriptor_read_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/descriptor_write_op.hpp
==============================================================================
--- trunk/boost/asio/detail/descriptor_write_op.hpp (original)
+++ trunk/boost/asio/detail/descriptor_write_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,10 +68,10 @@
   BOOST_ASIO_DEFINE_HANDLER_PTR(descriptor_write_op);
 
   descriptor_write_op(int descriptor,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
     : descriptor_write_op_base<ConstBufferSequence>(
         descriptor, buffers, &descriptor_write_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ trunk/boost/asio/detail/dev_poll_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_DEV_POLL)
 
+#include <boost/limits.hpp>
 #include <cstddef>
 #include <vector>
 #include <sys/devpoll.h>
@@ -46,7 +47,7 @@
   : public boost::asio::detail::service_base<dev_poll_reactor>
 {
 public:
- enum { read_op = 0, write_op = 1,
+ enum op_types { read_op = 0, write_op = 1,
     connect_op = 1, except_op = 2, max_ops = 3 };
 
   // Per-descriptor data.
@@ -88,8 +89,8 @@
 
   // Cancel any operations that are running against the descriptor and remove
   // its registration from the reactor.
- BOOST_ASIO_DECL void close_descriptor(
- socket_type descriptor, per_descriptor_data&);
+ BOOST_ASIO_DECL void deregister_descriptor(socket_type descriptor,
+ per_descriptor_data&, bool closing);
 
   // Add a new timer queue to the reactor.
   template <typename Time_Traits>
@@ -110,7 +111,8 @@
   // number of operations that have been posted or dispatched.
   template <typename Time_Traits>
   std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer);
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
   // Run /dev/poll once until interrupted or events are ready to be dispatched.
   BOOST_ASIO_DECL void run(bool block, op_queue<operation>& ops);

Modified: trunk/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/epoll_reactor.hpp (original)
+++ trunk/boost/asio/detail/epoll_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_EPOLL)
 
+#include <boost/limits.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/epoll_reactor_fwd.hpp>
 #include <boost/asio/detail/mutex.hpp>
@@ -42,7 +43,7 @@
   : public boost::asio::detail::service_base<epoll_reactor>
 {
 public:
- enum { read_op = 0, write_op = 1,
+ enum op_types { read_op = 0, write_op = 1,
     connect_op = 1, except_op = 2, max_ops = 3 };
 
   // Per-descriptor queues.
@@ -97,8 +98,8 @@
 
   // Cancel any operations that are running against the descriptor and remove
   // its registration from the reactor.
- BOOST_ASIO_DECL void close_descriptor(socket_type descriptor,
- per_descriptor_data& descriptor_data);
+ BOOST_ASIO_DECL void deregister_descriptor(socket_type descriptor,
+ per_descriptor_data& descriptor_data, bool closing);
 
   // Add a new timer queue to the reactor.
   template <typename Time_Traits>
@@ -119,7 +120,8 @@
   // number of operations that have been posted or dispatched.
   template <typename Time_Traits>
   std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer);
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
   // Run epoll once until interrupted or events are ready to be dispatched.
   BOOST_ASIO_DECL void run(bool block, op_queue<operation>& ops);

Added: trunk/boost/asio/detail/handler_type_requirements.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/handler_type_requirements.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,288 @@
+//
+// detail/handler_type_requirements.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_HANDLER_TYPE_REQUIREMENTS_HPP
+#define BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include <boost/asio/detail/config.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+// Older versions of gcc have difficulty compiling the sizeof expressions where
+// we test the handler type requirements. We'll disable checking of handler type
+// requirements for those compilers, but otherwise enable it by default.
+#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
+# if !defined(__GNUC__) || (__GNUC__ >= 4)
+# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1
+# endif // !defined(__GNUC__) || (__GNUC__ >= 4)
+#endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
+
+// With C++0x we can use a combination of enhanced SFINAE and static_assert to
+// generate better template error messages. As this technique is not yet widely
+// portable, we'll only enable it for tested compilers.
+#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# if defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
+# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
+# endif // defined(__GNUC__)
+# if defined(BOOST_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_DISABLE_HANDLER_TYPE_REQUIREMENTS)
+
+#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
+
+# if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
+
+template <typename Handler>
+auto zero_arg_handler_test(Handler* h)
+ -> decltype(
+ sizeof(Handler(*static_cast<const Handler*>(h))),
+ ((*h)()),
+ char(0));
+
+char (&zero_arg_handler_test(...))[2];
+
+template <typename Handler, typename Arg1>
+auto one_arg_handler_test(Handler* h, Arg1* a1)
+ -> decltype(
+ sizeof(Handler(*static_cast<const Handler*>(h))),
+ ((*h)(*a1)),
+ char(0));
+
+char (&one_arg_handler_test(...))[2];
+
+template <typename Handler, typename Arg1, typename Arg2>
+auto two_arg_handler_test(Handler* h, Arg1* a1, Arg2* a2)
+ -> decltype(
+ sizeof(Handler(*static_cast<const Handler*>(h))),
+ ((*h)(*a1, *a2)),
+ char(0));
+
+char (&two_arg_handler_test(...))[2];
+
+# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \
+ static_assert(expr, msg);
+
+# else // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
+
+# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg)
+
+# endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
+
+template <typename T> T& lvref();
+
+template <int>
+struct handler_type_requirements
+{
+};
+
+#define BOOST_ASIO_COMPLETION_HANDLER_CHECK( \
+ handler_type, handler) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::zero_arg_handler_test( \
+ static_cast<handler_type*>(0))) == 1, \
+ "CompletionHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler(), \
+ char(0))>
+
+#define BOOST_ASIO_READ_HANDLER_CHECK( \
+ handler_type, handler) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::two_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0), \
+ static_cast<const std::size_t*>(0))) == 1, \
+ "ReadHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ 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) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::two_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0), \
+ static_cast<const std::size_t*>(0))) == 1, \
+ "WriteHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ 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) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::one_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0))) == 1, \
+ "AcceptHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
+ char(0))>
+
+#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
+ handler_type, handler) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::one_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0))) == 1, \
+ "ConnectHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
+ char(0))>
+
+#define BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK( \
+ handler_type, handler, iter_type) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::two_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0), \
+ static_cast<const iter_type*>(0))) == 1, \
+ "ComposedConnectHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ 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) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::two_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0), \
+ static_cast<const iter_type*>(0))) == 1, \
+ "ResolveHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ 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) \
+ \
+ BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
+ sizeof(boost::asio::detail::one_arg_handler_test( \
+ static_cast<handler_type*>(0), \
+ static_cast<const boost::system::error_code*>(0))) == 1, \
+ "WaitHandler type requirements not met") \
+ \
+ typedef boost::asio::detail::handler_type_requirements< \
+ sizeof( \
+ handler_type( \
+ static_cast<const handler_type&>(handler))) + \
+ sizeof( \
+ handler( \
+ boost::asio::detail::lvref<const boost::system::error_code>()), \
+ char(0))>
+
+#else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
+
+#define BOOST_ASIO_COMPLETION_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#define BOOST_ASIO_READ_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#define BOOST_ASIO_WRITE_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#define BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK( \
+ handler_type, handler, iter_type) \
+ typedef int
+
+#define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
+ handler_type, handler, iter_type) \
+ typedef int
+
+#define BOOST_ASIO_WAIT_HANDLER_CHECK( \
+ handler_type, handler) \
+ typedef int
+
+#endif // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#endif // BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP

Modified: trunk/boost/asio/detail/hash_map.hpp
==============================================================================
--- trunk/boost/asio/detail/hash_map.hpp (original)
+++ trunk/boost/asio/detail/hash_map.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,7 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <cassert>
+#include <boost/assert.hpp>
 #include <list>
 #include <utility>
 #include <boost/asio/detail/noncopyable.hpp>
@@ -117,9 +117,9 @@
       iterator it = buckets_[bucket].first;
       if (it == values_.end())
         return values_.end();
- iterator end = buckets_[bucket].last;
- ++end;
- while (it != end)
+ iterator end_it = buckets_[bucket].last;
+ ++end_it;
+ while (it != end_it)
       {
         if (it->first == k)
           return it;
@@ -138,9 +138,9 @@
       const_iterator it = buckets_[bucket].first;
       if (it == values_.end())
         return it;
- const_iterator end = buckets_[bucket].last;
- ++end;
- while (it != end)
+ const_iterator end_it = buckets_[bucket].last;
+ ++end_it;
+ while (it != end_it)
       {
         if (it->first == k)
           return it;
@@ -164,15 +164,15 @@
       ++size_;
       return std::pair<iterator, bool>(buckets_[bucket].last, true);
     }
- iterator end = buckets_[bucket].last;
- ++end;
- while (it != end)
+ iterator end_it = buckets_[bucket].last;
+ ++end_it;
+ while (it != end_it)
     {
       if (it->first == v.first)
         return std::pair<iterator, bool>(it, false);
       ++it;
     }
- buckets_[bucket].last = values_insert(end, v);
+ buckets_[bucket].last = values_insert(end_it, v);
     ++size_;
     return std::pair<iterator, bool>(buckets_[bucket].last, true);
   }
@@ -180,7 +180,7 @@
   // Erase an entry from the map.
   void erase(iterator it)
   {
- assert(it != values_.end());
+ BOOST_ASSERT(it != values_.end());
 
     size_t bucket = calculate_hash_value(it->first) % num_buckets_;
     bool is_first = (it == buckets_[bucket].first);
@@ -212,9 +212,9 @@
     size_ = 0;
 
     // Initialise all buckets to empty.
- iterator end = values_.end();
+ iterator end_it = values_.end();
     for (size_t i = 0; i < num_buckets_; ++i)
- buckets_[i].first = buckets_[i].last = end;
+ buckets_[i].first = buckets_[i].last = end_it;
   }
 
 private:
@@ -245,21 +245,21 @@
       return;
     num_buckets_ = num_buckets;
 
- iterator end = values_.end();
+ iterator end_iter = values_.end();
 
     // Update number of buckets and initialise all buckets to empty.
     bucket_type* tmp = new bucket_type[num_buckets_];
     delete[] buckets_;
     buckets_ = tmp;
     for (std::size_t i = 0; i < num_buckets_; ++i)
- buckets_[i].first = buckets_[i].last = end;
+ buckets_[i].first = buckets_[i].last = end_iter;
 
     // Put all values back into the hash.
     iterator iter = values_.begin();
- while (iter != end)
+ while (iter != end_iter)
     {
       std::size_t bucket = calculate_hash_value(iter->first) % num_buckets_;
- if (buckets_[bucket].last == end)
+ if (buckets_[bucket].last == end_iter)
       {
         buckets_[bucket].first = buckets_[bucket].last = iter++;
       }

Modified: trunk/boost/asio/detail/impl/descriptor_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/descriptor_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/descriptor_ops.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -65,8 +65,8 @@
   return result;
 }
 
-bool set_internal_non_blocking(int d,
- state_type& state, boost::system::error_code& ec)
+bool set_user_non_blocking(int d, state_type& state,
+ bool value, boost::system::error_code& ec)
 {
   if (d == -1)
   {
@@ -80,17 +80,71 @@
   if (result >= 0)
   {
     errno = 0;
- result = error_wrapper(::fcntl(d, F_SETFL, result | O_NONBLOCK), ec);
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = error_wrapper(::fcntl(d, F_SETFL, flag), ec);
   }
 #else // defined(__SYMBIAN32__)
- ioctl_arg_type arg = 1;
+ ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctl(d, FIONBIO, &arg), ec);
 #endif // defined(__SYMBIAN32__)
 
   if (result >= 0)
   {
     ec = boost::system::error_code();
- state |= internal_non_blocking;
+ if (value)
+ state |= user_set_non_blocking;
+ else
+ {
+ // Clearing the user-set non-blocking mode always overrides any
+ // internally-set non-blocking flag. Any subsequent asynchronous
+ // operations will need to re-enable non-blocking I/O.
+ state &= ~(user_set_non_blocking | internal_non_blocking);
+ }
+ return true;
+ }
+
+ return false;
+}
+
+bool set_internal_non_blocking(int d, state_type& state,
+ bool value, boost::system::error_code& ec)
+{
+ if (d == -1)
+ {
+ ec = boost::asio::error::bad_descriptor;
+ return false;
+ }
+
+ if (!value && (state & user_set_non_blocking))
+ {
+ // It does not make sense to clear the internal non-blocking flag if the
+ // user still wants non-blocking behaviour. Return an error and let the
+ // caller figure out whether to update the user-set non-blocking flag.
+ ec = boost::asio::error::invalid_argument;
+ return false;
+ }
+
+ errno = 0;
+#if defined(__SYMBIAN32__)
+ int result = error_wrapper(::fcntl(d, F_GETFL, 0), ec);
+ if (result >= 0)
+ {
+ errno = 0;
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = error_wrapper(::fcntl(d, F_SETFL, flag), ec);
+ }
+#else // defined(__SYMBIAN32__)
+ ioctl_arg_type arg = (value ? 1 : 0);
+ int result = error_wrapper(::ioctl(d, FIONBIO, &arg), ec);
+#endif // defined(__SYMBIAN32__)
+
+ if (result >= 0)
+ {
+ ec = boost::system::error_code();
+ if (value)
+ state |= internal_non_blocking;
+ else
+ state &= ~internal_non_blocking;
     return true;
   }
 

Modified: trunk/boost/asio/detail/impl/dev_poll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/dev_poll_reactor.hpp (original)
+++ trunk/boost/asio/detail/impl/dev_poll_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -58,11 +58,12 @@
 
 template <typename Time_Traits>
 std::size_t dev_poll_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer)
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
   op_queue<operation> ops;
- std::size_t n = queue.cancel_timer(timer, ops);
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
   lock.unlock();
   io_service_.post_deferred_completions(ops);
   return n;

Modified: trunk/boost/asio/detail/impl/dev_poll_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/dev_poll_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/dev_poll_reactor.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -129,8 +129,8 @@
   cancel_ops_unlocked(descriptor, boost::asio::error::operation_aborted);
 }
 
-void dev_poll_reactor::close_descriptor(socket_type descriptor,
- dev_poll_reactor::per_descriptor_data&)
+void dev_poll_reactor::deregister_descriptor(socket_type descriptor,
+ dev_poll_reactor::per_descriptor_data&, bool)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
 

Modified: trunk/boost/asio/detail/impl/epoll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/epoll_reactor.hpp (original)
+++ trunk/boost/asio/detail/impl/epoll_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -56,11 +56,12 @@
 
 template <typename Time_Traits>
 std::size_t epoll_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer)
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
 {
   mutex::scoped_lock lock(mutex_);
   op_queue<operation> ops;
- std::size_t n = queue.cancel_timer(timer, ops);
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
   lock.unlock();
   io_service_.post_deferred_completions(ops);
   return n;

Modified: trunk/boost/asio/detail/impl/epoll_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/epoll_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/epoll_reactor.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -185,8 +185,8 @@
   io_service_.post_deferred_completions(ops);
 }
 
-void epoll_reactor::close_descriptor(socket_type,
- epoll_reactor::per_descriptor_data& descriptor_data)
+void epoll_reactor::deregister_descriptor(socket_type descriptor,
+ epoll_reactor::per_descriptor_data& descriptor_data, bool closing)
 {
   if (!descriptor_data)
     return;
@@ -196,8 +196,16 @@
 
   if (!descriptor_data->shutdown_)
   {
- // Remove the descriptor from the set of known descriptors. The descriptor
- // will be automatically removed from the epoll set when it is closed.
+ if (closing)
+ {
+ // The descriptor will be automatically removed from the epoll set when
+ // it is closed.
+ }
+ else
+ {
+ epoll_event ev = { 0, { 0 } };
+ epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, descriptor, &ev);
+ }
 
     op_queue<operation> ops;
     for (int i = 0; i < max_ops; ++i)

Modified: trunk/boost/asio/detail/impl/kqueue_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/kqueue_reactor.hpp (original)
+++ trunk/boost/asio/detail/impl/kqueue_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -60,11 +60,12 @@
 
 template <typename Time_Traits>
 std::size_t kqueue_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer)
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
   op_queue<operation> ops;
- std::size_t n = queue.cancel_timer(timer, ops);
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
   lock.unlock();
   io_service_.post_deferred_completions(ops);
   return n;

Modified: trunk/boost/asio/detail/impl/kqueue_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/kqueue_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/kqueue_reactor.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -187,8 +187,8 @@
   io_service_.post_deferred_completions(ops);
 }
 
-void kqueue_reactor::close_descriptor(socket_type,
- kqueue_reactor::per_descriptor_data& descriptor_data)
+void kqueue_reactor::deregister_descriptor(socket_type descriptor,
+ kqueue_reactor::per_descriptor_data& descriptor_data, bool closing)
 {
   if (!descriptor_data)
     return;
@@ -198,8 +198,20 @@
 
   if (!descriptor_data->shutdown_)
   {
- // Remove the descriptor from the set of known descriptors. The descriptor
- // will be automatically removed from the kqueue set when it is closed.
+ if (closing)
+ {
+ // The descriptor will be automatically removed from the kqueue when it
+ // is closed.
+ }
+ else
+ {
+ struct kevent events[2];
+ BOOST_ASIO_KQUEUE_EV_SET(&events[0], descriptor,
+ EVFILT_READ, EV_DELETE, 0, 0, 0);
+ BOOST_ASIO_KQUEUE_EV_SET(&events[1], descriptor,
+ EVFILT_WRITE, EV_DELETE, 0, 0, 0);
+ ::kevent(kqueue_fd_, events, 2, 0, 0, 0);
+ }
 
     op_queue<operation> ops;
     for (int i = 0; i < max_ops; ++i)

Modified: trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp (original)
+++ trunk/boost/asio/detail/impl/reactive_descriptor_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -50,7 +50,10 @@
     reactive_descriptor_service::implementation_type& impl)
 {
   if (is_open(impl))
- reactor_.close_descriptor(impl.descriptor_, impl.reactor_data_);
+ {
+ reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_,
+ (impl.state_ & descriptor_ops::possible_dup) == 0);
+ }
 
   boost::system::error_code ignored_ec;
   descriptor_ops::close(impl.descriptor_, impl.state_, ignored_ec);
@@ -58,7 +61,7 @@
 
 boost::system::error_code reactive_descriptor_service::assign(
     reactive_descriptor_service::implementation_type& impl,
- const native_type& native_descriptor, boost::system::error_code& ec)
+ const native_handle_type& native_descriptor, boost::system::error_code& ec)
 {
   if (is_open(impl))
   {
@@ -75,7 +78,7 @@
   }
 
   impl.descriptor_ = native_descriptor;
- impl.state_ = 0;
+ impl.state_ = descriptor_ops::possible_dup;
   ec = boost::system::error_code();
   return ec;
 }
@@ -85,7 +88,10 @@
     boost::system::error_code& ec)
 {
   if (is_open(impl))
- reactor_.close_descriptor(impl.descriptor_, impl.reactor_data_);
+ {
+ reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_,
+ (impl.state_ & descriptor_ops::possible_dup) == 0);
+ }
 
   if (descriptor_ops::close(impl.descriptor_, impl.state_, ec) == 0)
     construct(impl);
@@ -93,6 +99,21 @@
   return ec;
 }
 
+reactive_descriptor_service::native_handle_type
+reactive_descriptor_service::release(
+ reactive_descriptor_service::implementation_type& impl)
+{
+ native_handle_type descriptor = impl.descriptor_;
+
+ if (is_open(impl))
+ {
+ reactor_.deregister_descriptor(impl.descriptor_, impl.reactor_data_, false);
+ construct(impl);
+ }
+
+ return descriptor;
+}
+
 boost::system::error_code reactive_descriptor_service::cancel(
     reactive_descriptor_service::implementation_type& impl,
     boost::system::error_code& ec)
@@ -110,16 +131,16 @@
 
 void reactive_descriptor_service::start_op(
     reactive_descriptor_service::implementation_type& impl,
- int op_type, reactor_op* op, bool non_blocking, bool noop)
+ int op_type, reactor_op* op, bool is_non_blocking, bool noop)
 {
   if (!noop)
   {
     if ((impl.state_ & descriptor_ops::non_blocking) ||
         descriptor_ops::set_internal_non_blocking(
- impl.descriptor_, impl.state_, op->ec_))
+ impl.descriptor_, impl.state_, true, op->ec_))
     {
       reactor_.start_op(op_type, impl.descriptor_,
- impl.reactor_data_, op, non_blocking);
+ impl.reactor_data_, op, is_non_blocking);
       return;
     }
   }

Modified: trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp (original)
+++ trunk/boost/asio/detail/impl/reactive_serial_port_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -113,7 +113,7 @@
   termios ios;
   errno = 0;
   descriptor_ops::error_wrapper(::tcgetattr(
- descriptor_service_.native(impl), &ios), ec);
+ descriptor_service_.native_handle(impl), &ios), ec);
   if (ec)
     return ec;
 
@@ -122,7 +122,7 @@
 
   errno = 0;
   descriptor_ops::error_wrapper(::tcsetattr(
- descriptor_service_.native(impl), TCSANOW, &ios), ec);
+ descriptor_service_.native_handle(impl), TCSANOW, &ios), ec);
   return ec;
 }
 
@@ -134,7 +134,7 @@
   termios ios;
   errno = 0;
   descriptor_ops::error_wrapper(::tcgetattr(
- descriptor_service_.native(impl), &ios), ec);
+ descriptor_service_.native_handle(impl), &ios), ec);
   if (ec)
     return ec;
 

Modified: trunk/boost/asio/detail/impl/reactive_socket_service_base.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/reactive_socket_service_base.ipp (original)
+++ trunk/boost/asio/detail/impl/reactive_socket_service_base.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -50,7 +50,8 @@
 {
   if (impl.socket_ != invalid_socket)
   {
- reactor_.close_descriptor(impl.socket_, impl.reactor_data_);
+ reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_,
+ (impl.state_ & socket_ops::possible_dup) == 0);
 
     boost::system::error_code ignored_ec;
     socket_ops::close(impl.socket_, impl.state_, true, ignored_ec);
@@ -62,7 +63,10 @@
     boost::system::error_code& ec)
 {
   if (is_open(impl))
- reactor_.close_descriptor(impl.socket_, impl.reactor_data_);
+ {
+ reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_,
+ (impl.state_ & socket_ops::possible_dup) == 0);
+ }
 
   if (socket_ops::close(impl.socket_, impl.state_, true, ec) == 0)
     construct(impl);
@@ -119,7 +123,7 @@
 
 boost::system::error_code reactive_socket_service_base::do_assign(
     reactive_socket_service_base::base_implementation_type& impl, int type,
- const reactive_socket_service_base::native_type& native_socket,
+ const reactive_socket_service_base::native_handle_type& native_socket,
     boost::system::error_code& ec)
 {
   if (is_open(impl))
@@ -143,22 +147,23 @@
   case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break;
   default: impl.state_ = 0; break;
   }
+ impl.state_ |= socket_ops::possible_dup;
   ec = boost::system::error_code();
   return ec;
 }
 
 void reactive_socket_service_base::start_op(
     reactive_socket_service_base::base_implementation_type& impl,
- int op_type, reactor_op* op, bool non_blocking, bool noop)
+ int op_type, reactor_op* op, bool is_non_blocking, bool noop)
 {
   if (!noop)
   {
     if ((impl.state_ & socket_ops::non_blocking)
         || socket_ops::set_internal_non_blocking(
- impl.socket_, impl.state_, op->ec_))
+ impl.socket_, impl.state_, true, op->ec_))
     {
       reactor_.start_op(op_type, impl.socket_,
- impl.reactor_data_, op, non_blocking);
+ impl.reactor_data_, op, is_non_blocking);
       return;
     }
   }
@@ -185,7 +190,7 @@
 {
   if ((impl.state_ & socket_ops::non_blocking)
       || socket_ops::set_internal_non_blocking(
- impl.socket_, impl.state_, op->ec_))
+ impl.socket_, impl.state_, true, op->ec_))
   {
     if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0)
     {

Modified: trunk/boost/asio/detail/impl/select_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/select_reactor.hpp (original)
+++ trunk/boost/asio/detail/impl/select_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -62,11 +62,12 @@
 
 template <typename Time_Traits>
 std::size_t select_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer)
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
   op_queue<operation> ops;
- std::size_t n = queue.cancel_timer(timer, ops);
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
   lock.unlock();
   io_service_.post_deferred_completions(ops);
   return n;

Modified: trunk/boost/asio/detail/impl/select_reactor.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/select_reactor.ipp (original)
+++ trunk/boost/asio/detail/impl/select_reactor.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -119,8 +119,8 @@
   cancel_ops_unlocked(descriptor, boost::asio::error::operation_aborted);
 }
 
-void select_reactor::close_descriptor(socket_type descriptor,
- select_reactor::per_descriptor_data&)
+void select_reactor::deregister_descriptor(socket_type descriptor,
+ select_reactor::per_descriptor_data&, bool)
 {
   boost::asio::detail::mutex::scoped_lock lock(mutex_);
   cancel_ops_unlocked(descriptor, boost::asio::error::operation_aborted);

Modified: trunk/boost/asio/detail/impl/service_registry.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/service_registry.ipp (original)
+++ trunk/boost/asio/detail/impl/service_registry.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -121,7 +121,7 @@
     const boost::asio::io_service::service::key& key,
     boost::asio::io_service::service* new_service)
 {
- if (&owner_ != &new_service->io_service())
+ if (&owner_ != &new_service->get_io_service())
     boost::throw_exception(invalid_service_owner());
 
   boost::asio::detail::mutex::scoped_lock lock(mutex_);

Modified: trunk/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_ops.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -323,8 +323,52 @@
   return result;
 }
 
+bool set_user_non_blocking(socket_type s,
+ state_type& state, bool value, boost::system::error_code& ec)
+{
+ if (s == invalid_socket)
+ {
+ ec = boost::asio::error::bad_descriptor;
+ return false;
+ }
+
+ clear_last_error();
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+ ioctl_arg_type arg = (value ? 1 : 0);
+ int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
+#elif defined(__SYMBIAN32__)
+ int result = error_wrapper(::fcntl(s, F_GETFL, 0), ec);
+ if (result >= 0)
+ {
+ clear_last_error();
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = error_wrapper(::fcntl(s, F_SETFL, flag), ec);
+ }
+#else
+ ioctl_arg_type arg = (value ? 1 : 0);
+ int result = error_wrapper(::ioctl(s, FIONBIO, &arg), ec);
+#endif
+
+ if (result >= 0)
+ {
+ ec = boost::system::error_code();
+ if (value)
+ state |= user_set_non_blocking;
+ else
+ {
+ // Clearing the user-set non-blocking mode always overrides any
+ // internally-set non-blocking flag. Any subsequent asynchronous
+ // operations will need to re-enable non-blocking I/O.
+ state &= ~(user_set_non_blocking | internal_non_blocking);
+ }
+ return true;
+ }
+
+ return false;
+}
+
 bool set_internal_non_blocking(socket_type s,
- state_type& state, boost::system::error_code& ec)
+ state_type& state, bool value, boost::system::error_code& ec)
 {
   if (s == invalid_socket)
   {
@@ -332,26 +376,39 @@
     return false;
   }
 
+ if (!value && (state & user_set_non_blocking))
+ {
+ // It does not make sense to clear the internal non-blocking flag if the
+ // user still wants non-blocking behaviour. Return an error and let the
+ // caller figure out whether to update the user-set non-blocking flag.
+ ec = boost::asio::error::invalid_argument;
+ return false;
+ }
+
   clear_last_error();
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- ioctl_arg_type arg = 1;
+ ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
 #elif defined(__SYMBIAN32__)
   int result = error_wrapper(::fcntl(s, F_GETFL, 0), ec);
   if (result >= 0)
   {
     clear_last_error();
- result = error_wrapper(::fcntl(s, F_SETFL, result | O_NONBLOCK), ec);
+ int flag = (value ? (result | O_NONBLOCK) : (result & ~O_NONBLOCK));
+ result = error_wrapper(::fcntl(s, F_SETFL, flag), ec);
   }
 #else
- ioctl_arg_type arg = 1;
+ ioctl_arg_type arg = (value ? 1 : 0);
   int result = error_wrapper(::ioctl(s, FIONBIO, &arg), ec);
 #endif
 
   if (result >= 0)
   {
     ec = boost::system::error_code();
- state |= internal_non_blocking;
+ if (value)
+ state |= internal_non_blocking;
+ else
+ state &= ~internal_non_blocking;
     return true;
   }
 
@@ -863,6 +920,116 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
+int recvmsg(socket_type s, buf* bufs, size_t count,
+ int in_flags, int& out_flags, boost::system::error_code& ec)
+{
+ clear_last_error();
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+ out_flags = 0;
+ return socket_ops::recv(s, bufs, count, in_flags, ec);
+#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+ msghdr msg = msghdr();
+ msg.msg_iov = bufs;
+ msg.msg_iovlen = count;
+ int result = error_wrapper(::recvmsg(s, &msg, in_flags), ec);
+ if (result >= 0)
+ {
+ ec = boost::system::error_code();
+ out_flags = msg.msg_flags;
+ }
+ else
+ out_flags = 0;
+ return result;
+#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+}
+
+size_t sync_recvmsg(socket_type s, state_type state,
+ buf* bufs, size_t count, int in_flags, int& out_flags,
+ boost::system::error_code& ec)
+{
+ if (s == invalid_socket)
+ {
+ ec = boost::asio::error::bad_descriptor;
+ return 0;
+ }
+
+ // Read some data.
+ for (;;)
+ {
+ // Try to complete the operation without blocking.
+ int bytes = socket_ops::recvmsg(s, bufs, count, in_flags, out_flags, ec);
+
+ // Check if operation succeeded.
+ if (bytes >= 0)
+ return bytes;
+
+ // Operation failed.
+ if ((state & user_set_non_blocking)
+ || (ec != boost::asio::error::would_block
+ && ec != boost::asio::error::try_again))
+ return 0;
+
+ // Wait for socket to become ready.
+ if (socket_ops::poll_read(s, ec) < 0)
+ return 0;
+ }
+}
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+
+void complete_iocp_recvmsg(
+ const weak_cancel_token_type& cancel_token,
+ boost::system::error_code& ec)
+{
+ // Map non-portable errors to their portable counterparts.
+ if (ec.value() == ERROR_NETNAME_DELETED)
+ {
+ if (cancel_token.expired())
+ ec = boost::asio::error::operation_aborted;
+ else
+ ec = boost::asio::error::connection_reset;
+ }
+ else if (ec.value() == ERROR_PORT_UNREACHABLE)
+ {
+ ec = boost::asio::error::connection_refused;
+ }
+}
+
+#else // defined(BOOST_ASIO_HAS_IOCP)
+
+bool non_blocking_recvmsg(socket_type s,
+ buf* bufs, size_t count, int in_flags, int& out_flags,
+ boost::system::error_code& ec, size_t& bytes_transferred)
+{
+ for (;;)
+ {
+ // Read some data.
+ int bytes = socket_ops::recvmsg(s, bufs, count, in_flags, out_flags, ec);
+
+ // Retry operation if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ return false;
+
+ // Operation is complete.
+ if (bytes >= 0)
+ {
+ ec = boost::system::error_code();
+ bytes_transferred = bytes;
+ }
+ else
+ bytes_transferred = 0;
+
+ return true;
+ }
+}
+
+#endif // defined(BOOST_ASIO_HAS_IOCP)
+
 int send(socket_type s, const buf* bufs, size_t count, int flags,
     boost::system::error_code& ec)
 {
@@ -1680,7 +1847,8 @@
     using namespace std; // For strcat and sprintf.
     char if_name[IF_NAMESIZE + 1] = "%";
     const in6_addr_type* ipv6_address = static_cast<const in6_addr_type*>(src);
- bool is_link_local = IN6_IS_ADDR_LINKLOCAL(ipv6_address);
+ bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe)
+ && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80));
     if (!is_link_local || if_indextoname(scope_id, if_name + 1) == 0)
       sprintf(if_name + 1, "%lu", scope_id);
     strcat(dest, if_name);
@@ -1764,7 +1932,8 @@
     if (const char* if_name = strchr(src, '%'))
     {
       in6_addr_type* ipv6_address = static_cast<in6_addr_type*>(dest);
- bool is_link_local = IN6_IS_ADDR_LINKLOCAL(ipv6_address);
+ bool is_link_local = ((ipv6_address->s6_addr[0] == 0xfe)
+ && ((ipv6_address->s6_addr[1] & 0xc0) == 0x80));
       if (is_link_local)
         *scope_id = if_nametoindex(if_name + 1);
       if (*scope_id == 0)

Modified: trunk/boost/asio/detail/impl/strand_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/strand_service.hpp (original)
+++ trunk/boost/asio/detail/impl/strand_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -56,7 +56,7 @@
 
 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))
@@ -112,7 +112,7 @@
 // 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)
 {
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;

Modified: trunk/boost/asio/detail/impl/task_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/task_io_service.hpp (original)
+++ trunk/boost/asio/detail/impl/task_io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -28,7 +28,7 @@
 namespace detail {
 
 template <typename Handler>
-void task_io_service::dispatch(Handler handler)
+void task_io_service::dispatch(Handler& handler)
 {
   if (call_stack<task_io_service>::contains(this))
   {
@@ -40,7 +40,7 @@
 }
 
 template <typename Handler>
-void task_io_service::post(Handler handler)
+void task_io_service::post(Handler& handler)
 {
   // Allocate and construct an operation to wrap the handler.
   typedef completion_handler<Handler> op;

Modified: trunk/boost/asio/detail/impl/task_io_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/task_io_service.ipp (original)
+++ trunk/boost/asio/detail/impl/task_io_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -194,6 +194,12 @@
   stop_all_threads(lock);
 }
 
+bool task_io_service::stopped() const
+{
+ mutex::scoped_lock lock(mutex_);
+ return stopped_;
+}
+
 void task_io_service::reset()
 {
   mutex::scoped_lock lock(mutex_);

Modified: trunk/boost/asio/detail/impl/timer_queue.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/timer_queue.ipp (original)
+++ trunk/boost/asio/detail/impl/timer_queue.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -71,9 +71,9 @@
 }
 
 std::size_t timer_queue<time_traits<boost::posix_time::ptime> >::cancel_timer(
- per_timer_data& timer, op_queue<operation>& ops)
+ per_timer_data& timer, op_queue<operation>& ops, std::size_t max_cancelled)
 {
- return impl_.cancel_timer(timer, ops);
+ return impl_.cancel_timer(timer, ops, max_cancelled);
 }
 
 } // namespace detail

Modified: trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_handle_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -119,7 +119,7 @@
 
 boost::system::error_code win_iocp_handle_service::assign(
     win_iocp_handle_service::implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec)
+ const native_handle_type& handle, boost::system::error_code& ec)
 {
   if (is_open(impl))
   {
@@ -127,10 +127,10 @@
     return ec;
   }
 
- if (iocp_service_.register_handle(native_handle, ec))
+ if (iocp_service_.register_handle(handle, ec))
     return ec;
 
- impl.handle_ = native_handle;
+ impl.handle_ = handle;
   ec = boost::system::error_code();
   return ec;
 }

Modified: trunk/boost/asio/detail/impl/win_iocp_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_io_service.hpp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -32,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 (call_stack<win_iocp_io_service>::contains(this))
   {
@@ -44,7 +44,7 @@
 }
 
 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;
@@ -93,7 +93,8 @@
 
 template <typename Time_Traits>
 std::size_t win_iocp_io_service::cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer)
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled)
 {
   // If the service has been shut down we silently ignore the cancellation.
   if (::InterlockedExchangeAdd(&shutdown_, 0) != 0)
@@ -101,7 +102,7 @@
 
   mutex::scoped_lock lock(dispatch_mutex_);
   op_queue<win_iocp_operation> ops;
- std::size_t n = queue.cancel_timer(timer, ops);
+ std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
   post_deferred_completions(ops);
   return n;
 }

Modified: trunk/boost/asio/detail/impl/win_iocp_serial_port_service.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_serial_port_service.ipp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_serial_port_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -127,7 +127,7 @@
   ::DCB dcb;
   memset(&dcb, 0, sizeof(DCB));
   dcb.DCBlength = sizeof(DCB);
- if (!::GetCommState(handle_service_.native(impl), &dcb))
+ if (!::GetCommState(handle_service_.native_handle(impl), &dcb))
   {
     DWORD last_error = ::GetLastError();
     ec = boost::system::error_code(last_error,
@@ -138,7 +138,7 @@
   if (store(option, dcb, ec))
     return ec;
 
- if (!::SetCommState(handle_service_.native(impl), &dcb))
+ if (!::SetCommState(handle_service_.native_handle(impl), &dcb))
   {
     DWORD last_error = ::GetLastError();
     ec = boost::system::error_code(last_error,
@@ -160,7 +160,7 @@
   ::DCB dcb;
   memset(&dcb, 0, sizeof(DCB));
   dcb.DCBlength = sizeof(DCB);
- if (!::GetCommState(handle_service_.native(impl), &dcb))
+ if (!::GetCommState(handle_service_.native_handle(impl), &dcb))
   {
     DWORD last_error = ::GetLastError();
     ec = boost::system::error_code(last_error,

Modified: trunk/boost/asio/detail/impl/win_iocp_socket_service_base.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_iocp_socket_service_base.ipp (original)
+++ trunk/boost/asio/detail/impl/win_iocp_socket_service_base.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -99,7 +99,7 @@
           interlocked_compare_exchange_pointer(
             reinterpret_cast<void**>(&reactor_), 0, 0));
     if (r)
- r->close_descriptor(impl.socket_, impl.reactor_data_);
+ r->deregister_descriptor(impl.socket_, impl.reactor_data_, true);
   }
 
   if (socket_ops::close(impl.socket_, impl.state_, false, ec) == 0)
@@ -474,7 +474,7 @@
 
   if ((impl.state_ & socket_ops::non_blocking) != 0
       || socket_ops::set_internal_non_blocking(
- impl.socket_, impl.state_, op->ec_))
+ impl.socket_, impl.state_, true, op->ec_))
   {
     if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0)
     {
@@ -504,7 +504,7 @@
           interlocked_compare_exchange_pointer(
             reinterpret_cast<void**>(&reactor_), 0, 0));
     if (r)
- r->close_descriptor(impl.socket_, impl.reactor_data_);
+ r->deregister_descriptor(impl.socket_, impl.reactor_data_, true);
   }
 
   boost::system::error_code ignored_ec;

Modified: trunk/boost/asio/detail/impl/win_thread.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/win_thread.ipp (original)
+++ trunk/boost/asio/detail/impl/win_thread.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -102,12 +102,12 @@
 
 unsigned int __stdcall win_thread_function(void* arg)
 {
- std::auto_ptr<win_thread::func_base> func(
- static_cast<win_thread::func_base*>(arg));
+ win_thread::auto_func_base_ptr func = {
+ static_cast<win_thread::func_base*>(arg) };
 
- ::SetEvent(func->entry_event_);
+ ::SetEvent(func.ptr->entry_event_);
 
- func->run();
+ func.ptr->run();
 
   // Signal that the thread has finished its work, but rather than returning go
   // to sleep to put the thread into a well known state. If the thread is being
@@ -115,8 +115,9 @@
   // TerminateThread (to avoid a deadlock in DllMain). Otherwise, the SleepEx
   // call will be interrupted using QueueUserAPC and the thread will shut down
   // cleanly.
- HANDLE exit_event = func->exit_event_;
- func.reset();
+ HANDLE exit_event = func.ptr->exit_event_;
+ delete func.ptr;
+ func.ptr = 0;
   ::SetEvent(exit_event);
   ::SleepEx(INFINITE, TRUE);
 

Modified: trunk/boost/asio/detail/io_control.hpp
==============================================================================
--- trunk/boost/asio/detail/io_control.hpp (original)
+++ trunk/boost/asio/detail/io_control.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -46,7 +46,7 @@
   // Get the name of the IO control command.
   int name() const
   {
- return FIONBIO;
+ return static_cast<int>(FIONBIO);
   }
 
   // Set the value of the I/O control command.
@@ -96,7 +96,7 @@
   // Get the name of the IO control command.
   int name() const
   {
- return FIONREAD;
+ return static_cast<int>(FIONREAD);
   }
 
   // Set the value of the I/O control command.

Modified: trunk/boost/asio/detail/kqueue_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/kqueue_reactor.hpp (original)
+++ trunk/boost/asio/detail/kqueue_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -20,6 +20,7 @@
 
 #if defined(BOOST_ASIO_HAS_KQUEUE)
 
+#include <boost/limits.hpp>
 #include <cstddef>
 #include <sys/types.h>
 #include <sys/event.h>
@@ -108,8 +109,8 @@
 
   // Cancel any operations that are running against the descriptor and remove
   // its registration from the reactor.
- BOOST_ASIO_DECL void close_descriptor(socket_type descriptor,
- per_descriptor_data& descriptor_data);
+ BOOST_ASIO_DECL void deregister_descriptor(socket_type descriptor,
+ per_descriptor_data& descriptor_data, bool closing);
 
   // Add a new timer queue to the reactor.
   template <typename Time_Traits>
@@ -130,7 +131,8 @@
   // number of operations that have been posted or dispatched.
   template <typename Time_Traits>
   std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer);
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
   // Run the kqueue loop.
   BOOST_ASIO_DECL void run(bool block, op_queue<operation>& ops);

Modified: trunk/boost/asio/detail/old_win_sdk_compat.hpp
==============================================================================
--- trunk/boost/asio/detail/old_win_sdk_compat.hpp (original)
+++ trunk/boost/asio/detail/old_win_sdk_compat.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -85,14 +85,6 @@
   unsigned int ipv6mr_interface;
 };
 
-#if !defined(IN6ADDR_ANY_INIT)
-# define IN6ADDR_ANY_INIT { 0 }
-#endif
-
-#if !defined(IN6ADDR_LOOPBACK_INIT)
-# define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
-#endif
-
 struct addrinfo_emulation
 {
   int ai_flags;
@@ -201,122 +193,6 @@
 # define IPV6_LEAVE_GROUP 13
 #endif
 
-inline int IN6_IS_ADDR_UNSPECIFIED(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0)
- && (a->s6_addr[1] == 0)
- && (a->s6_addr[2] == 0)
- && (a->s6_addr[3] == 0)
- && (a->s6_addr[4] == 0)
- && (a->s6_addr[5] == 0)
- && (a->s6_addr[6] == 0)
- && (a->s6_addr[7] == 0)
- && (a->s6_addr[8] == 0)
- && (a->s6_addr[9] == 0)
- && (a->s6_addr[10] == 0)
- && (a->s6_addr[11] == 0)
- && (a->s6_addr[12] == 0)
- && (a->s6_addr[13] == 0)
- && (a->s6_addr[14] == 0)
- && (a->s6_addr[15] == 0));
-}
-
-inline int IN6_IS_ADDR_LOOPBACK(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0)
- && (a->s6_addr[1] == 0)
- && (a->s6_addr[2] == 0)
- && (a->s6_addr[3] == 0)
- && (a->s6_addr[4] == 0)
- && (a->s6_addr[5] == 0)
- && (a->s6_addr[6] == 0)
- && (a->s6_addr[7] == 0)
- && (a->s6_addr[8] == 0)
- && (a->s6_addr[9] == 0)
- && (a->s6_addr[10] == 0)
- && (a->s6_addr[11] == 0)
- && (a->s6_addr[12] == 0)
- && (a->s6_addr[13] == 0)
- && (a->s6_addr[14] == 0)
- && (a->s6_addr[15] == 1));
-}
-
-inline int IN6_IS_ADDR_MULTICAST(const in6_addr_emulation* a)
-{
- return (a->s6_addr[0] == 0xff);
-}
-
-inline int IN6_IS_ADDR_LINKLOCAL(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0xfe) && ((a->s6_addr[1] & 0xc0) == 0x80));
-}
-
-inline int IN6_IS_ADDR_SITELOCAL(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0xfe) && ((a->s6_addr[1] & 0xc0) == 0xc0));
-}
-
-inline int IN6_IS_ADDR_V4MAPPED(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0)
- && (a->s6_addr[1] == 0)
- && (a->s6_addr[2] == 0)
- && (a->s6_addr[3] == 0)
- && (a->s6_addr[4] == 0)
- && (a->s6_addr[5] == 0)
- && (a->s6_addr[6] == 0)
- && (a->s6_addr[7] == 0)
- && (a->s6_addr[8] == 0)
- && (a->s6_addr[9] == 0)
- && (a->s6_addr[10] == 0xff)
- && (a->s6_addr[11] == 0xff));
-}
-
-inline int IN6_IS_ADDR_V4COMPAT(const in6_addr_emulation* a)
-{
- return ((a->s6_addr[0] == 0)
- && (a->s6_addr[1] == 0)
- && (a->s6_addr[2] == 0)
- && (a->s6_addr[3] == 0)
- && (a->s6_addr[4] == 0)
- && (a->s6_addr[5] == 0)
- && (a->s6_addr[6] == 0)
- && (a->s6_addr[7] == 0)
- && (a->s6_addr[8] == 0)
- && (a->s6_addr[9] == 0)
- && (a->s6_addr[10] == 0xff)
- && (a->s6_addr[11] == 0xff)
- && !((a->s6_addr[12] == 0)
- && (a->s6_addr[13] == 0)
- && (a->s6_addr[14] == 0)
- && ((a->s6_addr[15] == 0) || (a->s6_addr[15] == 1))));
-}
-
-inline int IN6_IS_ADDR_MC_NODELOCAL(const in6_addr_emulation* a)
-{
- return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_addr[1] & 0xf) == 1);
-}
-
-inline int IN6_IS_ADDR_MC_LINKLOCAL(const in6_addr_emulation* a)
-{
- return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_addr[1] & 0xf) == 2);
-}
-
-inline int IN6_IS_ADDR_MC_SITELOCAL(const in6_addr_emulation* a)
-{
- return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_addr[1] & 0xf) == 5);
-}
-
-inline int IN6_IS_ADDR_MC_ORGLOCAL(const in6_addr_emulation* a)
-{
- return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_addr[1] & 0xf) == 8);
-}
-
-inline int IN6_IS_ADDR_MC_GLOBAL(const in6_addr_emulation* a)
-{
- return IN6_IS_ADDR_MULTICAST(a) && ((a->s6_addr[1] & 0xf) == 0xe);
-}
-
 } // namespace detail
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/detail/posix_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/posix_thread.hpp (original)
+++ trunk/boost/asio/detail/posix_thread.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,7 +39,7 @@
 public:
   // Constructor.
   template <typename Function>
- posix_thread(Function f)
+ posix_thread(Function f, unsigned int = 0)
     : joined_(false)
   {
     start_thread(new func<Function>(f));

Modified: trunk/boost/asio/detail/reactive_descriptor_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_descriptor_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_descriptor_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -42,7 +42,7 @@
 {
 public:
   // The native type of a descriptor.
- typedef int native_type;
+ typedef int native_handle_type;
 
   // The implementation type of the descriptor.
   class implementation_type
@@ -85,7 +85,8 @@
 
   // Assign a native descriptor to a descriptor implementation.
   BOOST_ASIO_DECL boost::system::error_code assign(implementation_type& impl,
- const native_type& native_descriptor, boost::system::error_code& ec);
+ const native_handle_type& native_descriptor,
+ boost::system::error_code& ec);
 
   // Determine whether the descriptor is open.
   bool is_open(const implementation_type& impl) const
@@ -98,11 +99,14 @@
       boost::system::error_code& ec);
 
   // Get the native descriptor representation.
- native_type native(const implementation_type& impl) const
+ native_handle_type native_handle(const implementation_type& impl) const
   {
     return impl.descriptor_;
   }
 
+ // Release ownership of the native descriptor representation.
+ BOOST_ASIO_DECL native_handle_type release(implementation_type& impl);
+
   // Cancel all operations associated with the descriptor.
   BOOST_ASIO_DECL boost::system::error_code cancel(implementation_type& impl,
       boost::system::error_code& ec);
@@ -117,6 +121,36 @@
     return ec;
   }
 
+ // Gets the non-blocking mode of the descriptor.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return (impl.state_ & descriptor_ops::user_set_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the descriptor.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ descriptor_ops::set_user_non_blocking(
+ impl.descriptor_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the native descriptor implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return (impl.state_ & descriptor_ops::internal_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the native descriptor implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ descriptor_ops::set_internal_non_blocking(
+ impl.descriptor_, impl.state_, mode, ec);
+ return ec;
+ }
+
   // Write some data to the descriptor.
   template <typename ConstBufferSequence>
   size_t write_some(implementation_type& impl,
@@ -143,7 +177,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)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_write_op<ConstBufferSequence, Handler> op;
@@ -161,7 +195,7 @@
   // 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)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
@@ -200,7 +234,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)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef descriptor_read_op<MutableBufferSequence, Handler> op;
@@ -218,7 +252,7 @@
   // 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)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
@@ -234,7 +268,7 @@
 private:
   // Start the asynchronous operation.
   BOOST_ASIO_DECL void start_op(implementation_type& impl, int op_type,
- reactor_op* op, bool non_blocking, bool noop);
+ reactor_op* op, bool is_non_blocking, bool noop);
 
   // The selector that performs event demultiplexing for the service.
   reactor& reactor_;

Modified: trunk/boost/asio/detail/reactive_null_buffers_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_null_buffers_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_null_buffers_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -34,10 +34,10 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_null_buffers_op);
 
- reactive_null_buffers_op(Handler handler)
+ reactive_null_buffers_op(Handler& handler)
     : reactor_op(&reactive_null_buffers_op::do_perform,
         &reactive_null_buffers_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_serial_port_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_serial_port_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,7 +39,7 @@
 {
 public:
   // The native type of a serial port.
- typedef reactive_descriptor_service::native_type native_type;
+ typedef reactive_descriptor_service::native_handle_type native_handle_type;
 
   // The implementation type of the serial port.
   typedef reactive_descriptor_service::implementation_type implementation_type;
@@ -68,7 +68,8 @@
 
   // Assign a native descriptor to a serial port implementation.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_descriptor, boost::system::error_code& ec)
+ const native_handle_type& native_descriptor,
+ boost::system::error_code& ec)
   {
     return descriptor_service_.assign(impl, native_descriptor, ec);
   }
@@ -87,9 +88,9 @@
   }
 
   // Get the native serial port representation.
- native_type native(implementation_type& impl)
+ native_handle_type native_handle(implementation_type& impl)
   {
- return descriptor_service_.native(impl);
+ return descriptor_service_.native_handle(impl);
   }
 
   // Cancel all operations associated with the serial port.
@@ -125,7 +126,7 @@
   {
     errno = 0;
     descriptor_ops::error_wrapper(::tcsendbreak(
- descriptor_service_.native(impl), 0), ec);
+ descriptor_service_.native_handle(impl), 0), ec);
     return ec;
   }
 
@@ -141,7 +142,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);
   }
@@ -158,7 +159,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);
   }

Modified: trunk/boost/asio/detail/reactive_socket_accept_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_accept_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_accept_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -87,10 +87,10 @@
 
   reactive_socket_accept_op(socket_type socket,
       socket_ops::state_type state, Socket& peer, const Protocol& protocol,
- typename Protocol::endpoint* peer_endpoint, Handler handler)
+ typename Protocol::endpoint* peer_endpoint, Handler& handler)
     : reactive_socket_accept_op_base<Socket, Protocol>(socket, state, peer,
         protocol, peer_endpoint, &reactive_socket_accept_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_socket_connect_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_connect_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_connect_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -56,10 +56,10 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_connect_op);
 
- reactive_socket_connect_op(socket_type socket, Handler handler)
+ reactive_socket_connect_op(socket_type socket, Handler& handler)
     : reactive_socket_connect_op_base(socket,
         &reactive_socket_connect_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_socket_recv_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_recv_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_recv_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -74,10 +74,10 @@
 
   reactive_socket_recv_op(socket_type socket,
       socket_ops::state_type state, const MutableBufferSequence& buffers,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
     : reactive_socket_recv_op_base<MutableBufferSequence>(socket, state,
         buffers, flags, &reactive_socket_recv_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_recvfrom_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -82,11 +82,11 @@
 
   reactive_socket_recvfrom_op(socket_type socket, int protocol_type,
       const MutableBufferSequence& buffers, Endpoint& endpoint,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
     : reactive_socket_recvfrom_op_base<MutableBufferSequence, Endpoint>(
         socket, protocol_type, buffers, endpoint, flags,
         &reactive_socket_recvfrom_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Added: trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/reactive_socket_recvmsg_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,122 @@
+//
+// detail/reactive_socket_recvmsg_op.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_REACTIVE_SOCKET_RECVMSG_OP_HPP
+#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_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/utility/addressof.hpp>
+#include <boost/asio/detail/bind_handler.hpp>
+#include <boost/asio/detail/buffer_sequence_adapter.hpp>
+#include <boost/asio/detail/fenced_block.hpp>
+#include <boost/asio/detail/reactor_op.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/socket_base.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence>
+class reactive_socket_recvmsg_op_base : public reactor_op
+{
+public:
+ reactive_socket_recvmsg_op_base(socket_type socket,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, func_type complete_func)
+ : reactor_op(&reactive_socket_recvmsg_op_base::do_perform, complete_func),
+ socket_(socket),
+ buffers_(buffers),
+ in_flags_(in_flags),
+ out_flags_(out_flags)
+ {
+ }
+
+ static bool do_perform(reactor_op* base)
+ {
+ reactive_socket_recvmsg_op_base* o(
+ static_cast<reactive_socket_recvmsg_op_base*>(base));
+
+ buffer_sequence_adapter<boost::asio::mutable_buffer,
+ MutableBufferSequence> bufs(o->buffers_);
+
+ return socket_ops::non_blocking_recvmsg(o->socket_,
+ bufs.buffers(), bufs.count(),
+ o->in_flags_, o->out_flags_,
+ o->ec_, o->bytes_transferred_);
+ }
+
+private:
+ socket_type socket_;
+ MutableBufferSequence buffers_;
+ socket_base::message_flags in_flags_;
+ socket_base::message_flags& out_flags_;
+};
+
+template <typename MutableBufferSequence, typename Handler>
+class reactive_socket_recvmsg_op :
+ public reactive_socket_recvmsg_op_base<MutableBufferSequence>
+{
+public:
+ BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op);
+
+ reactive_socket_recvmsg_op(socket_type socket,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& handler)
+ : reactive_socket_recvmsg_op_base<MutableBufferSequence>(socket, buffers,
+ in_flags, out_flags, &reactive_socket_recvmsg_op::do_complete),
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
+ {
+ }
+
+ static void do_complete(io_service_impl* owner, operation* base,
+ boost::system::error_code /*ec*/, std::size_t /*bytes_transferred*/)
+ {
+ // 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 };
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // 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.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ boost::asio::detail::fenced_block b;
+ boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_);
+ }
+ }
+
+private:
+ Handler handler_;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP

Modified: trunk/boost/asio/detail/reactive_socket_send_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_send_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_send_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -71,10 +71,10 @@
 
   reactive_socket_send_op(socket_type socket,
       const ConstBufferSequence& buffers,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
     : reactive_socket_send_op_base<ConstBufferSequence>(socket,
         buffers, flags, &reactive_socket_send_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_socket_sendto_op.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_sendto_op.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_sendto_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -74,10 +74,10 @@
 
   reactive_socket_sendto_op(socket_type socket,
       const ConstBufferSequence& buffers, const Endpoint& endpoint,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
     : reactive_socket_sendto_op_base<ConstBufferSequence, Endpoint>(socket,
         buffers, endpoint, flags, &reactive_socket_sendto_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/reactive_socket_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -56,7 +56,7 @@
   typedef typename Protocol::endpoint endpoint_type;
 
   // The native type of a socket.
- typedef socket_type native_type;
+ typedef socket_type native_handle_type;
 
   // The implementation type of the socket.
   struct implementation_type :
@@ -90,7 +90,7 @@
 
   // Assign a native socket to a socket implementation.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     if (!do_assign(impl, protocol.type(), native_socket, ec))
@@ -99,7 +99,7 @@
   }
 
   // Get the native socket representation.
- native_type native(implementation_type& impl)
+ native_handle_type native_handle(implementation_type& impl)
   {
     return impl.socket_;
   }
@@ -194,7 +194,7 @@
   void async_send_to(implementation_type& impl,
       const ConstBufferSequence& buffers,
       const endpoint_type& destination, socket_base::message_flags flags,
- Handler handler)
+ Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_sendto_op<ConstBufferSequence,
@@ -211,7 +211,7 @@
   // 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 reactive_null_buffers_op<Handler> op;
@@ -266,7 +266,7 @@
   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)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recvfrom_op<MutableBufferSequence,
@@ -274,8 +274,8 @@
     typename op::ptr p = { boost::addressof(handler),
       boost_asio_handler_alloc_helpers::allocate(
         sizeof(op), handler), 0 };
- int protocol_type = impl.protocol_.type();
- p.p = new (p.v) op(impl.socket_, protocol_type,
+ int protocol = impl.protocol_.type();
+ p.p = new (p.v) op(impl.socket_, protocol,
         buffers, sender_endpoint, flags, handler);
 
     start_op(impl,
@@ -289,7 +289,7 @@
   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 reactive_null_buffers_op<Handler> op;
@@ -341,7 +341,7 @@
   // 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 reactive_socket_accept_op<Socket, Protocol, Handler> op;
@@ -367,7 +367,7 @@
   // 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;

Modified: trunk/boost/asio/detail/reactive_socket_service_base.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_socket_service_base.hpp (original)
+++ trunk/boost/asio/detail/reactive_socket_service_base.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -27,6 +27,7 @@
 #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>
+#include <boost/asio/detail/reactive_socket_recvmsg_op.hpp>
 #include <boost/asio/detail/reactive_socket_send_op.hpp>
 #include <boost/asio/detail/reactor.hpp>
 #include <boost/asio/detail/reactor_op.hpp>
@@ -44,7 +45,7 @@
 {
 public:
   // The native type of a socket.
- typedef socket_type native_type;
+ typedef socket_type native_handle_type;
 
   // The implementation type of the socket.
   struct base_implementation_type
@@ -83,7 +84,7 @@
       base_implementation_type& impl, boost::system::error_code& ec);
 
   // Get the native socket representation.
- native_type native(base_implementation_type& impl)
+ native_handle_type native_handle(base_implementation_type& impl)
   {
     return impl.socket_;
   }
@@ -124,7 +125,35 @@
     return ec;
   }
 
- /// Disable sends or receives on the socket.
+ // Gets the non-blocking mode of the socket.
+ bool non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::user_set_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(base_implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::internal_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(base_implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Disable sends or receives on the socket.
   boost::system::error_code shutdown(base_implementation_type& impl,
       socket_base::shutdown_type what, boost::system::error_code& ec)
   {
@@ -160,7 +189,7 @@
   template <typename ConstBufferSequence, typename Handler>
   void async_send(base_implementation_type& impl,
       const ConstBufferSequence& buffers,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_send_op<ConstBufferSequence, Handler> op;
@@ -179,7 +208,7 @@
   // Start an asynchronous wait until data can be sent without blocking.
   template <typename Handler>
   void async_send(base_implementation_type& impl, const null_buffers&,
- socket_base::message_flags, Handler handler)
+ socket_base::message_flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
@@ -220,7 +249,7 @@
   template <typename MutableBufferSequence, typename Handler>
   void async_receive(base_implementation_type& impl,
       const MutableBufferSequence& buffers,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_socket_recv_op<MutableBufferSequence, Handler> op;
@@ -242,7 +271,7 @@
   // Wait until data can be received without blocking.
   template <typename Handler>
   void async_receive(base_implementation_type& impl, const null_buffers&,
- socket_base::message_flags flags, Handler handler)
+ socket_base::message_flags flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef reactive_null_buffers_op<Handler> op;
@@ -258,6 +287,81 @@
     p.v = p.p = 0;
   }
 
+ // Receive some data with associated flags. Returns the number of bytes
+ // received.
+ template <typename MutableBufferSequence>
+ size_t receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ buffer_sequence_adapter<boost::asio::mutable_buffer,
+ MutableBufferSequence> bufs(buffers);
+
+ return socket_ops::sync_recvmsg(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), in_flags, out_flags, ec);
+ }
+
+ // Wait until data can be received without blocking.
+ size_t receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_read(impl.socket_, ec);
+
+ // Clear out_flags, since we cannot give it any other sensible value when
+ // performing a null_buffers operation.
+ out_flags = 0;
+
+ return 0;
+ }
+
+ // Start an asynchronous receive. The buffer for the data being received
+ // must be valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence, typename Handler>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& 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),
+ boost_asio_handler_alloc_helpers::allocate(
+ sizeof(op), handler), 0 };
+ p.p = new (p.v) op(impl.socket_, buffers, in_flags, out_flags, handler);
+
+ 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.v = p.p = 0;
+ }
+
+ // Wait until data can be received without blocking.
+ template <typename Handler>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& handler)
+ {
+ // Allocate and construct an operation to wrap the handler.
+ typedef reactive_null_buffers_op<Handler> op;
+ typename op::ptr p = { boost::addressof(handler),
+ boost_asio_handler_alloc_helpers::allocate(
+ sizeof(op), handler), 0 };
+ p.p = new (p.v) op(handler);
+
+ // Clear out_flags, since we cannot give it any other sensible value when
+ // performing a null_buffers operation.
+ out_flags = 0;
+
+ start_op(impl,
+ (in_flags & socket_base::message_out_of_band)
+ ? reactor::except_op : reactor::read_op,
+ p.p, false, false);
+ p.v = p.p = 0;
+ }
+
 protected:
   // Open a new socket implementation.
   BOOST_ASIO_DECL boost::system::error_code do_open(
@@ -267,11 +371,11 @@
   // Assign a native socket to a socket implementation.
   BOOST_ASIO_DECL boost::system::error_code do_assign(
       base_implementation_type& impl, int type,
- const native_type& native_socket, boost::system::error_code& ec);
+ const native_handle_type& native_socket, boost::system::error_code& ec);
 
   // Start the asynchronous read or write operation.
   BOOST_ASIO_DECL void start_op(base_implementation_type& impl, int op_type,
- reactor_op* op, bool non_blocking, bool noop);
+ reactor_op* op, bool is_non_blocking, bool noop);
 
   // Start the asynchronous accept operation.
   BOOST_ASIO_DECL void start_accept_op(base_implementation_type& impl,

Modified: trunk/boost/asio/detail/resolve_endpoint_op.hpp
==============================================================================
--- trunk/boost/asio/detail/resolve_endpoint_op.hpp (original)
+++ trunk/boost/asio/detail/resolve_endpoint_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,12 +43,12 @@
   typedef boost::asio::ip::basic_resolver_iterator<Protocol> iterator_type;
 
   resolve_endpoint_op(socket_ops::weak_cancel_token_type cancel_token,
- const endpoint_type& endpoint, io_service_impl& ios, Handler handler)
+ const endpoint_type& endpoint, io_service_impl& ios, Handler& handler)
     : operation(&resolve_endpoint_op::do_complete),
       cancel_token_(cancel_token),
       endpoint_(endpoint),
       io_service_impl_(ios),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/resolve_op.hpp
==============================================================================
--- trunk/boost/asio/detail/resolve_op.hpp (original)
+++ trunk/boost/asio/detail/resolve_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -44,12 +44,12 @@
   typedef boost::asio::ip::basic_resolver_iterator<Protocol> iterator_type;
 
   resolve_op(socket_ops::weak_cancel_token_type cancel_token,
- const query_type& query, io_service_impl& ios, Handler handler)
+ const query_type& query, io_service_impl& ios, Handler& handler)
     : operation(&resolve_op::do_complete),
       cancel_token_(cancel_token),
       query_(query),
       io_service_impl_(ios),
- handler_(handler),
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
       addrinfo_(0)
   {
   }

Modified: trunk/boost/asio/detail/resolver_service.hpp
==============================================================================
--- trunk/boost/asio/detail/resolver_service.hpp (original)
+++ trunk/boost/asio/detail/resolver_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -67,8 +67,8 @@
 
   // Asynchronously resolve a query to a list of entries.
   template <typename Handler>
- void async_resolve(implementation_type& impl, const query_type& query,
- Handler handler)
+ void async_resolve(implementation_type& impl,
+ const query_type& query, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_op<Protocol, Handler> op;
@@ -97,8 +97,8 @@
 
   // Asynchronously resolve an endpoint to a list of entries.
   template <typename Handler>
- void async_resolve(implementation_type& impl, const endpoint_type& endpoint,
- Handler handler)
+ void async_resolve(implementation_type& impl,
+ const endpoint_type& endpoint, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef resolve_endpoint_op<Protocol, Handler> op;

Modified: trunk/boost/asio/detail/select_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/select_reactor.hpp (original)
+++ trunk/boost/asio/detail/select_reactor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -22,6 +22,7 @@
       && !defined(BOOST_ASIO_HAS_EPOLL) \
       && !defined(BOOST_ASIO_HAS_KQUEUE))
 
+#include <boost/limits.hpp>
 #include <cstddef>
 #include <boost/asio/detail/mutex.hpp>
 #include <boost/asio/detail/op_queue.hpp>
@@ -51,10 +52,10 @@
 {
 public:
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- enum { read_op = 0, write_op = 1, except_op = 2,
+ 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__)
- enum { read_op = 0, write_op = 1, except_op = 2,
+ 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__)
 
@@ -97,8 +98,8 @@
 
   // Cancel any operations that are running against the descriptor and remove
   // its registration from the reactor.
- BOOST_ASIO_DECL void close_descriptor(socket_type descriptor,
- per_descriptor_data&);
+ BOOST_ASIO_DECL void deregister_descriptor(socket_type descriptor,
+ per_descriptor_data&, bool closing);
 
   // Add a new timer queue to the reactor.
   template <typename Time_Traits>
@@ -119,7 +120,8 @@
   // number of operations that have been posted or dispatched.
   template <typename Time_Traits>
   std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer);
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
   // Run select once until interrupted or events are ready to be dispatched.
   BOOST_ASIO_DECL void run(bool block, op_queue<operation>& ops);

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -51,7 +51,10 @@
   stream_oriented = 16,
 
   // The socket is datagram-oriented.
- datagram_oriented = 32
+ datagram_oriented = 32,
+
+ // The socket may have been dup()-ed.
+ possible_dup = 64
 };
 
 typedef unsigned char state_type;
@@ -88,8 +91,11 @@
 BOOST_ASIO_DECL int close(socket_type s, state_type& state,
     bool destruction, boost::system::error_code& ec);
 
+BOOST_ASIO_DECL bool set_user_non_blocking(socket_type s,
+ state_type& state, bool value, boost::system::error_code& ec);
+
 BOOST_ASIO_DECL bool set_internal_non_blocking(socket_type s,
- state_type& state, boost::system::error_code& ec);
+ state_type& state, bool value, boost::system::error_code& ec);
 
 BOOST_ASIO_DECL int shutdown(socket_type s,
     int what, boost::system::error_code& ec);
@@ -166,6 +172,27 @@
 
 #endif // defined(BOOST_ASIO_HAS_IOCP)
 
+BOOST_ASIO_DECL int recvmsg(socket_type s, buf* bufs, size_t count,
+ int in_flags, int& out_flags, boost::system::error_code& ec);
+
+BOOST_ASIO_DECL size_t sync_recvmsg(socket_type s, state_type state,
+ buf* bufs, size_t count, int in_flags, int& out_flags,
+ boost::system::error_code& ec);
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+
+BOOST_ASIO_DECL void complete_iocp_recvmsg(
+ const weak_cancel_token_type& cancel_token,
+ boost::system::error_code& ec);
+
+#else // defined(BOOST_ASIO_HAS_IOCP)
+
+BOOST_ASIO_DECL bool non_blocking_recvmsg(socket_type s,
+ buf* bufs, size_t count, int in_flags, int& out_flags,
+ boost::system::error_code& ec, size_t& bytes_transferred);
+
+#endif // defined(BOOST_ASIO_HAS_IOCP)
+
 BOOST_ASIO_DECL int send(socket_type s, const buf* bufs,
     size_t count, int flags, boost::system::error_code& ec);
 

Modified: trunk/boost/asio/detail/socket_types.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_types.hpp (original)
+++ trunk/boost/asio/detail/socket_types.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -113,6 +113,7 @@
 const int message_peek = MSG_PEEK;
 const int message_out_of_band = MSG_OOB;
 const int message_do_not_route = MSG_DONTROUTE;
+const int message_end_of_record = 0; // Not supported on Windows.
 # if defined (_WIN32_WINNT)
 const int max_iov_len = 64;
 # else
@@ -156,6 +157,7 @@
 const int message_peek = MSG_PEEK;
 const int message_out_of_band = MSG_OOB;
 const int message_do_not_route = MSG_DONTROUTE;
+const int message_end_of_record = MSG_EOR;
 # if defined(IOV_MAX)
 const int max_iov_len = IOV_MAX;
 # else

Modified: trunk/boost/asio/detail/strand_service.hpp
==============================================================================
--- trunk/boost/asio/detail/strand_service.hpp (original)
+++ trunk/boost/asio/detail/strand_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -80,11 +80,11 @@
 
   // 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);
 
 private:
   BOOST_ASIO_DECL static void do_complete(io_service_impl* owner,

Modified: trunk/boost/asio/detail/task_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/task_io_service.hpp (original)
+++ trunk/boost/asio/detail/task_io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -67,6 +67,9 @@
   // Interrupt the event processing loop.
   BOOST_ASIO_DECL void stop();
 
+ // Determine whether the io_service is stopped.
+ BOOST_ASIO_DECL bool stopped() const;
+
   // Reset in preparation for a subsequent run invocation.
   BOOST_ASIO_DECL void reset();
 
@@ -85,11 +88,11 @@
 
   // 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.
@@ -132,7 +135,7 @@
   struct work_finished_on_block_exit;
 
   // Mutex to protect access to internal data.
- mutex mutex_;
+ mutable mutex mutex_;
 
   // The task to be run by this service.
   reactor* task_;

Modified: trunk/boost/asio/detail/timer_queue.hpp
==============================================================================
--- trunk/boost/asio/detail/timer_queue.hpp (original)
+++ trunk/boost/asio/detail/timer_queue.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -183,20 +183,23 @@
     heap_.clear();
   }
 
- // Cancel and dequeue the timers with the given token.
- std::size_t cancel_timer(per_timer_data& timer, op_queue<operation>& ops)
+ // Cancel and dequeue operations for the given timer.
+ std::size_t cancel_timer(per_timer_data& timer, op_queue<operation>& ops,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)())
   {
     std::size_t num_cancelled = 0;
     if (timer.prev_ != 0 || &timer == timers_)
     {
- while (timer_op* op = timer.op_queue_.front())
+ while (timer_op* op = (num_cancelled != max_cancelled)
+ ? timer.op_queue_.front() : 0)
       {
         op->ec_ = boost::asio::error::operation_aborted;
         timer.op_queue_.pop();
         ops.push(op);
         ++num_cancelled;
       }
- remove_timer(timer);
+ if (timer.op_queue_.empty())
+ remove_timer(timer);
     }
     return num_cancelled;
   }
@@ -354,9 +357,10 @@
   // Dequeue all timers.
   BOOST_ASIO_DECL virtual void get_all_timers(op_queue<operation>& ops);
 
- // Cancel and dequeue the timers with the given token.
+ // Cancel and dequeue operations for the given timer.
   BOOST_ASIO_DECL std::size_t cancel_timer(
- per_timer_data& timer, op_queue<operation>& ops);
+ per_timer_data& timer, op_queue<operation>& ops,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
 private:
   timer_queue<forwarding_posix_time_traits> impl_;

Modified: trunk/boost/asio/detail/win_iocp_handle_read_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_read_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_read_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,10 +41,11 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_read_op);
 
- win_iocp_handle_read_op(const MutableBufferSequence& buffers, Handler handler)
+ win_iocp_handle_read_op(
+ const MutableBufferSequence& buffers, Handler& handler)
     : operation(&win_iocp_handle_read_op::do_complete),
       buffers_(buffers),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_handle_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,7 +41,7 @@
 {
 public:
   // The native type of a stream handle.
- typedef HANDLE native_type;
+ typedef HANDLE native_handle_type;
 
   // The implementation type of the stream handle.
   class implementation_type
@@ -61,7 +61,7 @@
     friend class win_iocp_handle_service;
 
     // The native stream handle representation.
- native_type handle_;
+ native_handle_type handle_;
 
     // The ID of the thread from which it is safe to cancel asynchronous
     // operations. 0 means no asynchronous operations have been started yet.
@@ -87,7 +87,7 @@
 
   // Assign a native handle to a handle implementation.
   BOOST_ASIO_DECL boost::system::error_code assign(implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec);
+ const native_handle_type& handle, boost::system::error_code& ec);
 
   // Determine whether the handle is open.
   bool is_open(const implementation_type& impl) const
@@ -100,7 +100,7 @@
       boost::system::error_code& ec);
 
   // Get the native handle representation.
- native_type native(const implementation_type& impl) const
+ native_handle_type native_handle(const implementation_type& impl) const
   {
     return impl.handle_;
   }
@@ -134,7 +134,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)
   {
     async_write_some_at(impl, 0, buffers, handler);
   }
@@ -143,7 +143,7 @@
   // 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)
+ const ConstBufferSequence& buffers, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_handle_write_op<ConstBufferSequence, Handler> op;
@@ -182,7 +182,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)
   {
     async_read_some_at(impl, 0, buffers, handler);
   }
@@ -192,7 +192,7 @@
   // operation.
   template <typename MutableBufferSequence, typename Handler>
   void async_read_some_at(implementation_type& impl, boost::uint64_t offset,
- 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;

Modified: trunk/boost/asio/detail/win_iocp_handle_write_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_handle_write_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_handle_write_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,10 +41,10 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_handle_write_op);
 
- win_iocp_handle_write_op(const ConstBufferSequence& buffers, Handler handler)
+ win_iocp_handle_write_op(const ConstBufferSequence& buffers, Handler& handler)
     : operation(&win_iocp_handle_write_op::do_complete),
       buffers_(buffers),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 
 #if defined(BOOST_ASIO_HAS_IOCP)
 
+#include <boost/limits.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/detail/mutex.hpp>
@@ -76,6 +77,12 @@
   // Stop the event processing loop.
   BOOST_ASIO_DECL void stop();
 
+ // Determine whether the io_service is stopped.
+ bool stopped() const
+ {
+ return ::InterlockedExchangeAdd(&stopped_, 0) != 0;
+ }
+
   // Reset in preparation for a subsequent run invocation.
   void reset()
   {
@@ -97,11 +104,11 @@
 
   // 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.
@@ -156,7 +163,8 @@
   // handlers that have been posted or dispatched.
   template <typename Time_Traits>
   std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
- typename timer_queue<Time_Traits>::per_timer_data& timer);
+ typename timer_queue<Time_Traits>::per_timer_data& timer,
+ std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
 
 private:
 #if defined(WINVER) && (WINVER < 0x0500)
@@ -199,7 +207,7 @@
   long outstanding_work_;
 
   // Flag to indicate whether the event loop has been stopped.
- long stopped_;
+ mutable long stopped_;
 
   // Flag to indicate whether the service has been shut down.
   long shutdown_;

Modified: trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_null_buffers_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -42,11 +42,11 @@
   BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_null_buffers_op);
 
   win_iocp_null_buffers_op(socket_ops::weak_cancel_token_type cancel_token,
- Handler handler)
+ Handler& handler)
     : reactor_op(&win_iocp_null_buffers_op::do_perform,
         &win_iocp_null_buffers_op::do_complete),
       cancel_token_(cancel_token),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_overlapped_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_overlapped_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_overlapped_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,9 +39,9 @@
 public:
   BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_overlapped_op);
 
- win_iocp_overlapped_op(Handler handler)
+ win_iocp_overlapped_op(Handler& handler)
     : operation(&win_iocp_overlapped_op::do_complete),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_overlapped_ptr.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -47,7 +47,7 @@
   // Construct an win_iocp_overlapped_ptr to contain the specified handler.
   template <typename Handler>
   explicit win_iocp_overlapped_ptr(
- boost::asio::io_service& io_service, Handler handler)
+ boost::asio::io_service& io_service, Handler& handler)
     : ptr_(0),
       iocp_service_(0)
   {
@@ -75,7 +75,7 @@
   // Reset to contain the specified handler, freeing any current OVERLAPPED
   // object.
   template <typename Handler>
- void reset(boost::asio::io_service& io_service, Handler handler)
+ void reset(boost::asio::io_service& io_service, Handler& handler)
   {
     typedef win_iocp_overlapped_op<Handler> op;
     typename op::ptr p = { boost::addressof(handler),

Modified: trunk/boost/asio/detail/win_iocp_serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_serial_port_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_serial_port_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -36,7 +36,7 @@
 {
 public:
   // The native type of a serial port.
- typedef win_iocp_handle_service::native_type native_type;
+ typedef win_iocp_handle_service::native_handle_type native_handle_type;
 
   // The implementation type of the serial port.
   typedef win_iocp_handle_service::implementation_type implementation_type;
@@ -66,9 +66,9 @@
 
   // Assign a native handle to a serial port implementation.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec)
+ const native_handle_type& handle, boost::system::error_code& ec)
   {
- return handle_service_.assign(impl, native_handle, ec);
+ return handle_service_.assign(impl, handle, ec);
   }
 
   // Determine whether the serial port is open.
@@ -85,9 +85,9 @@
   }
 
   // Get the native serial port representation.
- native_type native(implementation_type& impl)
+ native_handle_type native_handle(implementation_type& impl)
   {
- return handle_service_.native(impl);
+ return handle_service_.native_handle(impl);
   }
 
   // Cancel all operations associated with the handle.
@@ -137,7 +137,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);
   }
@@ -154,7 +154,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: trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_accept_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -45,7 +45,7 @@
   win_iocp_socket_accept_op(win_iocp_socket_service_base& socket_service,
       socket_type socket, Socket& peer, const Protocol& protocol,
       typename Protocol::endpoint* peer_endpoint,
- bool enable_connection_aborted, Handler handler)
+ bool enable_connection_aborted, Handler& handler)
     : operation(&win_iocp_socket_accept_op::do_complete),
       socket_service_(socket_service),
       socket_(socket),
@@ -53,7 +53,7 @@
       protocol_(protocol),
       peer_endpoint_(peer_endpoint),
       enable_connection_aborted_(enable_connection_aborted),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 
@@ -107,7 +107,7 @@
       if (!ec)
       {
         o->peer_.assign(o->protocol_,
- typename Socket::native_type(
+ typename Socket::native_handle_type(
               o->new_socket_.get(), peer_endpoint), ec);
         if (!ec)
           o->new_socket_.release();

Modified: trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_recv_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,12 +43,12 @@
 
   win_iocp_socket_recv_op(socket_ops::state_type state,
       socket_ops::weak_cancel_token_type cancel_token,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
     : operation(&win_iocp_socket_recv_op::do_complete),
       state_(state),
       cancel_token_(cancel_token),
       buffers_(buffers),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_recvfrom_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,13 +43,13 @@
 
   win_iocp_socket_recvfrom_op(Endpoint& endpoint,
       socket_ops::weak_cancel_token_type cancel_token,
- const MutableBufferSequence& buffers, Handler handler)
+ const MutableBufferSequence& buffers, Handler& handler)
     : operation(&win_iocp_socket_recvfrom_op::do_complete),
       endpoint_(endpoint),
       endpoint_size_(static_cast<int>(endpoint.capacity())),
       cancel_token_(cancel_token),
       buffers_(buffers),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Added: trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/detail/win_iocp_socket_recvmsg_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,111 @@
+//
+// detail/win_iocp_socket_recvmsg_op.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_WIN_IOCP_SOCKET_RECVMSG_OP_HPP
+#define BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_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_HAS_IOCP)
+
+#include <boost/utility/addressof.hpp>
+#include <boost/asio/detail/bind_handler.hpp>
+#include <boost/asio/detail/buffer_sequence_adapter.hpp>
+#include <boost/asio/detail/fenced_block.hpp>
+#include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/operation.hpp>
+#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/asio/error.hpp>
+#include <boost/asio/socket_base.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace detail {
+
+template <typename MutableBufferSequence, typename Handler>
+class win_iocp_socket_recvmsg_op : public operation
+{
+public:
+ BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvmsg_op);
+
+ win_iocp_socket_recvmsg_op(
+ socket_ops::weak_cancel_token_type cancel_token,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags& out_flags, Handler& handler)
+ : operation(&win_iocp_socket_recvmsg_op::do_complete),
+ cancel_token_(cancel_token),
+ buffers_(buffers),
+ out_flags_(out_flags),
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
+ {
+ }
+
+ static void do_complete(io_service_impl* owner, operation* base,
+ boost::system::error_code ec, std::size_t bytes_transferred)
+ {
+ // 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 };
+
+#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+ // Check whether buffers are still valid.
+ if (owner)
+ {
+ buffer_sequence_adapter<boost::asio::mutable_buffer,
+ MutableBufferSequence>::validate(o->buffers_);
+ }
+#endif // defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
+
+ socket_ops::complete_iocp_recvmsg(o->cancel_token_, ec);
+ o->out_flags_ = 0;
+
+ // Make a copy of the handler so that the memory can be deallocated before
+ // the upcall is made. Even if we're not about to make an upcall, a
+ // sub-object of the handler may be the true owner of the memory associated
+ // with the handler. Consequently, a local copy of the handler is required
+ // to ensure that any owning sub-object remains valid until after we have
+ // 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.reset();
+
+ // Make the upcall if required.
+ if (owner)
+ {
+ boost::asio::detail::fenced_block b;
+ boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_);
+ }
+ }
+
+private:
+ socket_ops::weak_cancel_token_type cancel_token_;
+ MutableBufferSequence buffers_;
+ socket_base::message_flags& out_flags_;
+ Handler handler_;
+};
+
+} // namespace detail
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // defined(BOOST_ASIO_HAS_IOCP)
+
+#endif // BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVMSG_OP_HPP

Modified: trunk/boost/asio/detail/win_iocp_socket_send_op.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_send_op.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_send_op.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -42,11 +42,11 @@
   BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_send_op);
 
   win_iocp_socket_send_op(socket_ops::weak_cancel_token_type cancel_token,
- const ConstBufferSequence& buffers, Handler handler)
+ const ConstBufferSequence& buffers, Handler& handler)
     : operation(&win_iocp_socket_send_op::do_complete),
       cancel_token_(cancel_token),
       buffers_(buffers),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler))
   {
   }
 

Modified: trunk/boost/asio/detail/win_iocp_socket_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -61,16 +61,16 @@
   typedef typename Protocol::endpoint endpoint_type;
 
   // The native type of a socket.
- class native_type
+ class native_handle_type
   {
   public:
- native_type(socket_type s)
+ native_handle_type(socket_type s)
       : socket_(s),
         have_remote_endpoint_(false)
     {
     }
 
- native_type(socket_type s, const endpoint_type& ep)
+ native_handle_type(socket_type s, const endpoint_type& ep)
       : socket_(s),
         have_remote_endpoint_(true),
         remote_endpoint_(ep)
@@ -149,7 +149,7 @@
 
   // Assign a native socket to a socket implementation.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     if (!do_assign(impl, protocol.type(), native_socket, ec))
@@ -162,11 +162,11 @@
   }
 
   // Get the native socket representation.
- native_type native(implementation_type& impl)
+ native_handle_type native_handle(implementation_type& impl)
   {
     if (impl.have_remote_endpoint_)
- return native_type(impl.socket_, impl.remote_endpoint_);
- return native_type(impl.socket_);
+ return native_handle_type(impl.socket_, impl.remote_endpoint_);
+ return native_handle_type(impl.socket_);
   }
 
   // Bind the socket to the specified local endpoint.
@@ -258,7 +258,7 @@
   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;
@@ -279,7 +279,7 @@
   // 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;
@@ -334,7 +334,7 @@
   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<
@@ -356,7 +356,7 @@
   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;
@@ -405,7 +405,7 @@
   // 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;
@@ -436,7 +436,7 @@
   // 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;

Modified: trunk/boost/asio/detail/win_iocp_socket_service_base.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_socket_service_base.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_socket_service_base.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -40,6 +40,7 @@
 #include <boost/asio/detail/win_iocp_null_buffers_op.hpp>
 #include <boost/asio/detail/win_iocp_socket_send_op.hpp>
 #include <boost/asio/detail/win_iocp_socket_recv_op.hpp>
+#include <boost/asio/detail/win_iocp_socket_recvmsg_op.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -142,7 +143,35 @@
     return ec;
   }
 
- /// Disable sends or receives on the socket.
+ // Gets the non-blocking mode of the socket.
+ bool non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::user_set_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(base_implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const base_implementation_type& impl) const
+ {
+ return (impl.state_ & socket_ops::internal_non_blocking) != 0;
+ }
+
+ // Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(base_implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec);
+ return ec;
+ }
+
+ // Disable sends or receives on the socket.
   boost::system::error_code shutdown(base_implementation_type& impl,
       socket_base::shutdown_type what, boost::system::error_code& ec)
   {
@@ -178,7 +207,7 @@
   template <typename ConstBufferSequence, typename Handler>
   void async_send(base_implementation_type& impl,
       const ConstBufferSequence& buffers,
- 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;
@@ -199,7 +228,7 @@
   // Start an asynchronous wait until data can be sent without blocking.
   template <typename Handler>
   void async_send(base_implementation_type& impl, const null_buffers&,
- socket_base::message_flags, Handler handler)
+ socket_base::message_flags, Handler& handler)
   {
     // Allocate and construct an operation to wrap the handler.
     typedef win_iocp_null_buffers_op<Handler> op;
@@ -240,7 +269,7 @@
   template <typename MutableBufferSequence, typename Handler>
   void async_receive(base_implementation_type& impl,
       const MutableBufferSequence& buffers,
- 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_recv_op<MutableBufferSequence, Handler> op;
@@ -261,7 +290,7 @@
   // Wait until data can be received without blocking.
   template <typename Handler>
   void async_receive(base_implementation_type& impl, const null_buffers&,
- 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;
@@ -274,6 +303,77 @@
     p.v = p.p = 0;
   }
 
+ // Receive some data with associated flags. Returns the number of bytes
+ // received.
+ template <typename MutableBufferSequence>
+ size_t receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ buffer_sequence_adapter<boost::asio::mutable_buffer,
+ MutableBufferSequence> bufs(buffers);
+
+ return socket_ops::sync_recvmsg(impl.socket_, impl.state_,
+ bufs.buffers(), bufs.count(), in_flags, out_flags, ec);
+ }
+
+ // Wait until data can be received without blocking.
+ size_t receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ // Wait for socket to become ready.
+ socket_ops::poll_read(impl.socket_, ec);
+
+ // Clear out_flags, since we cannot give it any other sensible value when
+ // performing a null_buffers operation.
+ out_flags = 0;
+
+ return 0;
+ }
+
+ // Start an asynchronous receive. The buffer for the data being received
+ // must be valid for the lifetime of the asynchronous operation.
+ template <typename MutableBufferSequence, typename Handler>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, Handler& handler)
+ {
+ // 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),
+ boost_asio_handler_alloc_helpers::allocate(
+ sizeof(op), handler), 0 };
+ p.p = new (p.v) op(impl.cancel_token_, buffers, out_flags, handler);
+
+ buffer_sequence_adapter<boost::asio::mutable_buffer,
+ MutableBufferSequence> bufs(buffers);
+
+ start_receive_op(impl, bufs.buffers(), bufs.count(), in_flags, false, p.p);
+ p.v = p.p = 0;
+ }
+
+ // Wait until data can be received without blocking.
+ template <typename Handler>
+ void async_receive_with_flags(base_implementation_type& impl,
+ const null_buffers&, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_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),
+ boost_asio_handler_alloc_helpers::allocate(
+ sizeof(op), handler), 0 };
+ p.p = new (p.v) op(impl.cancel_token_, handler);
+
+ // Reset out_flags since it can be given no sensible value at this time.
+ out_flags = 0;
+
+ start_null_buffers_receive_op(impl, in_flags, p.p);
+ p.v = p.p = 0;
+ }
+
   // Helper function to restart an asynchronous accept operation.
   BOOST_ASIO_DECL void restart_accept_op(socket_type s,
       socket_holder& new_socket, int family, int type, int protocol,

Modified: trunk/boost/asio/detail/wince_thread.hpp
==============================================================================
--- trunk/boost/asio/detail/wince_thread.hpp (original)
+++ trunk/boost/asio/detail/wince_thread.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,7 +39,7 @@
 public:
   // Constructor.
   template <typename Function>
- wince_thread(Function f)
+ wince_thread(Function f, unsigned int = 0)
   {
     std::auto_ptr<func_base> arg(new func<Function>(f));
     DWORD thread_id = 0;

Modified: trunk/boost/asio/detail/wrapped_handler.hpp
==============================================================================
--- trunk/boost/asio/detail/wrapped_handler.hpp (original)
+++ trunk/boost/asio/detail/wrapped_handler.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -31,7 +31,7 @@
 public:
   typedef void result_type;
 
- wrapped_handler(Dispatcher dispatcher, Handler handler)
+ wrapped_handler(Dispatcher dispatcher, const Handler& handler)
     : dispatcher_(dispatcher),
       handler_(handler)
   {

Modified: trunk/boost/asio/error.hpp
==============================================================================
--- trunk/boost/asio/error.hpp (original)
+++ trunk/boost/asio/error.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -211,10 +211,6 @@
   fd_set_failure
 };
 
-enum ssl_errors
-{
-};
-
 inline const boost::system::error_category& get_system_category()
 {
   return boost::system::system_category();
@@ -245,9 +241,6 @@
 extern BOOST_ASIO_DECL
 const boost::system::error_category& get_misc_category();
 
-extern BOOST_ASIO_DECL
-const boost::system::error_category& get_ssl_category();
-
 static const boost::system::error_category& system_category
   = boost::asio::error::get_system_category();
 static const boost::system::error_category& netdb_category
@@ -256,12 +249,12 @@
   = boost::asio::error::get_addrinfo_category();
 static const boost::system::error_category& misc_category
   = boost::asio::error::get_misc_category();
-static const boost::system::error_category& ssl_category
- = boost::asio::error::get_ssl_category();
 
 } // namespace error
 } // namespace asio
+} // namespace boost
 
+namespace boost {
 namespace system {
 
 template<> struct is_error_code_enum<boost::asio::error::basic_errors>
@@ -284,13 +277,10 @@
   static const bool value = true;
 };
 
-template<> struct is_error_code_enum<boost::asio::error::ssl_errors>
-{
- static const bool value = true;
-};
-
 } // namespace system
+} // namespace boost
 
+namespace boost {
 namespace asio {
 namespace error {
 
@@ -318,12 +308,6 @@
       static_cast<int>(e), get_misc_category());
 }
 
-inline boost::system::error_code make_error_code(ssl_errors e)
-{
- return boost::system::error_code(
- static_cast<int>(e), get_ssl_category());
-}
-
 } // namespace error
 } // namespace asio
 } // namespace boost

Added: trunk/boost/asio/impl/connect.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/impl/connect.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,346 @@
+//
+// impl/connect.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_IMPL_CONNECT_HPP
+#define BOOST_ASIO_IMPL_CONNECT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#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_invoke_helpers.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
+#include <boost/asio/detail/throw_error.hpp>
+#include <boost/asio/error.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+namespace detail
+{
+ struct default_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(const boost::system::error_code&, Iterator next)
+ {
+ return next;
+ }
+ };
+}
+
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s, Iterator begin)
+{
+ boost::system::error_code ec;
+ Iterator result = connect(s, begin, ec);
+ boost::asio::detail::throw_error(ec);
+ return result;
+}
+
+template <typename Protocol, typename SocketService, typename Iterator>
+inline Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, boost::system::error_code& ec)
+{
+ return connect(s, begin, Iterator(), detail::default_connect_condition(), ec);
+}
+
+template <typename Protocol, typename SocketService, typename Iterator>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end)
+{
+ boost::system::error_code ec;
+ Iterator result = connect(s, begin, end, ec);
+ boost::asio::detail::throw_error(ec);
+ return result;
+}
+
+template <typename Protocol, typename SocketService, typename Iterator>
+inline Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, boost::system::error_code& ec)
+{
+ return connect(s, begin, end, detail::default_connect_condition(), ec);
+}
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ConnectCondition connect_condition)
+{
+ boost::system::error_code ec;
+ Iterator result = connect(s, begin, connect_condition, ec);
+ boost::asio::detail::throw_error(ec);
+ return result;
+}
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+inline Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ConnectCondition connect_condition,
+ boost::system::error_code& ec)
+{
+ return connect(s, begin, Iterator(), connect_condition, ec);
+}
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition)
+{
+ boost::system::error_code ec;
+ Iterator result = connect(s, begin, end, connect_condition, ec);
+ boost::asio::detail::throw_error(ec);
+ return result;
+}
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ConnectCondition>
+Iterator connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ boost::system::error_code& ec)
+{
+ ec = boost::system::error_code();
+
+ for (Iterator iter = begin; iter != end; ++iter)
+ {
+ iter = connect_condition(ec, iter);
+ if (iter != end)
+ {
+ s.close(ec);
+ s.connect(*iter, ec);
+ if (!ec)
+ return iter;
+ }
+ }
+
+ if (!ec)
+ ec = boost::asio::error::not_found;
+
+ return end;
+}
+
+namespace detail
+{
+ // Enable the empty base class optimisation for the connect condition.
+ template <typename ConnectCondition>
+ class base_from_connect_condition
+ {
+ protected:
+ explicit base_from_connect_condition(
+ const ConnectCondition& connect_condition)
+ : connect_condition_(connect_condition)
+ {
+ }
+
+ template <typename Iterator>
+ void check_condition(const boost::system::error_code& ec,
+ Iterator& iter, Iterator& end)
+ {
+ if (iter != end)
+ iter = connect_condition_(ec, static_cast<const Iterator&>(iter));
+ }
+
+ private:
+ ConnectCondition connect_condition_;
+ };
+
+ // The default_connect_condition implementation is essentially a no-op. This
+ // template specialisation lets us eliminate all costs associated with it.
+ template <>
+ class base_from_connect_condition<default_connect_condition>
+ {
+ protected:
+ explicit base_from_connect_condition(const default_connect_condition&)
+ {
+ }
+
+ template <typename Iterator>
+ void check_condition(const boost::system::error_code&, Iterator&, Iterator&)
+ {
+ }
+ };
+
+ template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+ class connect_op : base_from_connect_condition<ConnectCondition>
+ {
+ public:
+ connect_op(basic_socket<Protocol, SocketService>& sock,
+ const Iterator& begin, const Iterator& end,
+ const ConnectCondition& connect_condition,
+ ComposedConnectHandler& handler)
+ : base_from_connect_condition<ConnectCondition>(connect_condition),
+ socket_(sock),
+ iter_(begin),
+ end_(end),
+ handler_(BOOST_ASIO_MOVE_CAST(ComposedConnectHandler)(handler))
+ {
+ }
+
+ void operator()(boost::system::error_code ec, int start = 0)
+ {
+ switch (start)
+ {
+ case 1:
+ for (;;)
+ {
+ this->check_condition(ec, iter_, end_);
+
+ if (iter_ != end_)
+ {
+ socket_.close(ec);
+ socket_.async_connect(*iter_, *this);
+ return;
+ }
+
+ if (start)
+ {
+ ec = boost::asio::error::not_found;
+ socket_.get_io_service().post(detail::bind_handler(*this, ec));
+ return;
+ }
+
+ default:
+
+ if (iter_ == end_)
+ break;
+
+ if (!socket_.is_open())
+ {
+ ec = boost::asio::error::operation_aborted;
+ break;
+ }
+
+ if (!ec)
+ break;
+
+ ++iter_;
+ }
+
+ handler_(static_cast<const boost::system::error_code&>(ec),
+ static_cast<const Iterator&>(iter_));
+ }
+ }
+
+ //private:
+ basic_socket<Protocol, SocketService>& socket_;
+ Iterator iter_;
+ Iterator end_;
+ ComposedConnectHandler handler_;
+ };
+
+ template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+ inline void* asio_handler_allocate(std::size_t size,
+ connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>* this_handler)
+ {
+ return boost_asio_handler_alloc_helpers::allocate(
+ size, this_handler->handler_);
+ }
+
+ template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+ inline void asio_handler_deallocate(void* pointer, std::size_t size,
+ connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>* this_handler)
+ {
+ boost_asio_handler_alloc_helpers::deallocate(
+ pointer, size, this_handler->handler_);
+ }
+
+ template <typename Function, typename Protocol,
+ typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+ inline void asio_handler_invoke(const Function& function,
+ connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>* this_handler)
+ {
+ boost_asio_handler_invoke_helpers::invoke(
+ function, this_handler->handler_);
+ }
+} // namespace detail
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ComposedConnectHandler>
+inline void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ComposedConnectHandler handler)
+{
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ComposedConnectHandler.
+ BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
+ ComposedConnectHandler, handler, Iterator) type_check;
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ detail::default_connect_condition, ComposedConnectHandler>(
+ s, begin, Iterator(), detail::default_connect_condition(), handler)(
+ boost::system::error_code(), 1);
+}
+
+template <typename Protocol, typename SocketService,
+ typename Iterator, typename ComposedConnectHandler>
+inline void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ComposedConnectHandler handler)
+{
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ComposedConnectHandler.
+ BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
+ ComposedConnectHandler, handler, Iterator) type_check;
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ detail::default_connect_condition, ComposedConnectHandler>(
+ s, begin, end, detail::default_connect_condition(), handler)(
+ boost::system::error_code(), 1);
+}
+
+template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+inline void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, ConnectCondition connect_condition,
+ ComposedConnectHandler handler)
+{
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ComposedConnectHandler.
+ BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
+ ComposedConnectHandler, handler, Iterator) type_check;
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>(
+ s, begin, Iterator(), connect_condition, handler)(
+ boost::system::error_code(), 1);
+}
+
+template <typename Protocol, typename SocketService, typename Iterator,
+ typename ConnectCondition, typename ComposedConnectHandler>
+void async_connect(basic_socket<Protocol, SocketService>& s,
+ Iterator begin, Iterator end, ConnectCondition connect_condition,
+ ComposedConnectHandler handler)
+{
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ComposedConnectHandler.
+ BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK(
+ ComposedConnectHandler, handler, Iterator) type_check;
+
+ detail::connect_op<Protocol, SocketService, Iterator,
+ ConnectCondition, ComposedConnectHandler>(
+ s, begin, end, connect_condition, handler)(
+ boost::system::error_code(), 1);
+}
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_IMPL_CONNECT_HPP

Modified: trunk/boost/asio/impl/error.ipp
==============================================================================
--- trunk/boost/asio/impl/error.ipp (original)
+++ trunk/boost/asio/impl/error.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,8 +16,6 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
-#include <boost/cerrno.hpp>
-#include <boost/system/error_code.hpp>
 #include <boost/asio/error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -122,30 +120,6 @@
   return instance;
 }
 
-namespace detail {
-
-class ssl_category : public boost::system::error_category
-{
-public:
- const char* name() const
- {
- return "asio.ssl";
- }
-
- std::string message(int) const
- {
- return "asio.ssl error";
- }
-};
-
-} // namespace detail
-
-const boost::system::error_category& get_ssl_category()
-{
- static detail::ssl_category instance;
- return instance;
-}
-
 } // namespace error
 } // namespace asio
 } // namespace boost

Modified: trunk/boost/asio/impl/io_service.hpp
==============================================================================
--- trunk/boost/asio/impl/io_service.hpp (original)
+++ trunk/boost/asio/impl/io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -15,6 +15,7 @@
 # pragma once
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/service_registry.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -68,15 +69,23 @@
 namespace boost {
 namespace asio {
 
-template <typename Handler>
-inline void io_service::dispatch(Handler handler)
+template <typename CompletionHandler>
+inline void io_service::dispatch(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(handler);
 }
 
-template <typename Handler>
-inline void io_service::post(Handler handler)
+template <typename CompletionHandler>
+inline void io_service::post(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(handler);
 }
 
@@ -108,21 +117,11 @@
   io_service_.impl_.work_finished();
 }
 
-inline boost::asio::io_service& io_service::work::io_service()
-{
- return io_service_;
-}
-
 inline boost::asio::io_service& io_service::work::get_io_service()
 {
   return io_service_;
 }
 
-inline boost::asio::io_service& io_service::service::io_service()
-{
- return owner_;
-}
-
 inline boost::asio::io_service& io_service::service::get_io_service()
 {
   return owner_;

Modified: trunk/boost/asio/impl/io_service.ipp
==============================================================================
--- trunk/boost/asio/impl/io_service.ipp (original)
+++ trunk/boost/asio/impl/io_service.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -108,6 +108,11 @@
   impl_.stop();
 }
 
+bool io_service::stopped() const
+{
+ return impl_.stopped();
+}
+
 void io_service::reset()
 {
   impl_.reset();

Modified: trunk/boost/asio/impl/read.hpp
==============================================================================
--- trunk/boost/asio/impl/read.hpp (original)
+++ trunk/boost/asio/impl/read.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/handler_alloc_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>
 #include <boost/asio/error.hpp>
 
@@ -62,6 +63,13 @@
   return bytes_transferred;
 }
 
+template <typename SyncReadStream, typename MutableBufferSequence>
+inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
+ boost::system::error_code& ec)
+{
+ return read(s, buffers, transfer_all(), ec);
+}
+
 template <typename SyncReadStream, typename MutableBufferSequence,
     typename CompletionCondition>
 inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
@@ -108,6 +116,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncReadStream, typename Allocator>
+inline std::size_t read(SyncReadStream& s,
+ boost::asio::basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec)
+{
+ return read(s, b, transfer_all(), ec);
+}
+
 template <typename SyncReadStream, typename Allocator,
     typename CompletionCondition>
 inline std::size_t read(SyncReadStream& s,
@@ -131,13 +147,13 @@
   {
   public:
     read_op(AsyncReadStream& stream, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, ReadHandler handler)
+ CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -182,13 +198,13 @@
     read_op(AsyncReadStream& stream,
         const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition,
- ReadHandler handler)
+ ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -260,6 +276,10 @@
 inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, 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::read_op<AsyncReadStream, MutableBufferSequence,
     CompletionCondition, ReadHandler>(
       s, buffers, completion_condition, handler)(
@@ -271,7 +291,14 @@
 inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
     ReadHandler handler)
 {
- async_read(s, buffers, transfer_all(), 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::read_op<AsyncReadStream, MutableBufferSequence,
+ detail::transfer_all_t, ReadHandler>(
+ s, buffers, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #if !defined(BOOST_NO_IOSTREAM)
@@ -286,13 +313,13 @@
   public:
     read_streambuf_op(AsyncReadStream& stream,
         basic_streambuf<Allocator>& streambuf,
- CompletionCondition completion_condition, ReadHandler handler)
+ CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         streambuf_(streambuf),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -365,6 +392,10 @@
     boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, 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::read_streambuf_op<AsyncReadStream,
     Allocator, CompletionCondition, ReadHandler>(
       s, b, completion_condition, handler)(
@@ -375,7 +406,14 @@
 inline void async_read(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, ReadHandler handler)
 {
- async_read(s, b, transfer_all(), 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::read_streambuf_op<AsyncReadStream,
+ Allocator, detail::transfer_all_t, ReadHandler>(
+ s, b, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #endif // !defined(BOOST_NO_IOSTREAM)

Modified: trunk/boost/asio/impl/read_at.hpp
==============================================================================
--- trunk/boost/asio/impl/read_at.hpp (original)
+++ trunk/boost/asio/impl/read_at.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/handler_alloc_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>
 #include <boost/asio/error.hpp>
 
@@ -66,6 +67,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
+inline std::size_t read_at(SyncRandomAccessReadDevice& d,
+ boost::uint64_t offset, const MutableBufferSequence& buffers,
+ boost::system::error_code& ec)
+{
+ return read_at(d, offset, buffers, transfer_all(), ec);
+}
+
 template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
@@ -116,6 +125,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncRandomAccessReadDevice, typename Allocator>
+inline std::size_t read_at(SyncRandomAccessReadDevice& d,
+ boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec)
+{
+ return read_at(d, offset, b, transfer_all(), ec);
+}
+
 template <typename SyncRandomAccessReadDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t read_at(SyncRandomAccessReadDevice& d,
@@ -142,14 +159,14 @@
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
         boost::uint64_t offset, const MutableBufferSequence& buffers,
- CompletionCondition completion_condition, ReadHandler handler)
+ CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -195,14 +212,14 @@
   public:
     read_at_op(AsyncRandomAccessReadDevice& device,
         boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
- CompletionCondition completion_condition, ReadHandler handler)
+ CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -278,6 +295,10 @@
     boost::uint64_t offset, const MutableBufferSequence& buffers,
     CompletionCondition completion_condition, 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::read_at_op<AsyncRandomAccessReadDevice,
     MutableBufferSequence, CompletionCondition, ReadHandler>(
       d, offset, buffers, completion_condition, handler)(
@@ -290,7 +311,14 @@
     boost::uint64_t offset, const MutableBufferSequence& buffers,
     ReadHandler handler)
 {
- async_read_at(d, offset, buffers, transfer_all(), 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::read_at_op<AsyncRandomAccessReadDevice,
+ MutableBufferSequence, detail::transfer_all_t, ReadHandler>(
+ d, offset, buffers, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #if !defined(BOOST_NO_IOSTREAM)
@@ -305,14 +333,14 @@
   public:
     read_at_streambuf_op(AsyncRandomAccessReadDevice& device,
         boost::uint64_t offset, basic_streambuf<Allocator>& streambuf,
- CompletionCondition completion_condition, ReadHandler handler)
+ CompletionCondition completion_condition, ReadHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         streambuf_(streambuf),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -387,6 +415,10 @@
     boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, 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::read_at_streambuf_op<AsyncRandomAccessReadDevice,
     Allocator, CompletionCondition, ReadHandler>(
       d, offset, b, completion_condition, handler)(
@@ -399,7 +431,14 @@
     boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     ReadHandler handler)
 {
- async_read_at(d, offset, b, transfer_all(), 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::read_at_streambuf_op<AsyncRandomAccessReadDevice,
+ Allocator, detail::transfer_all_t, ReadHandler>(
+ d, offset, b, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #endif // !defined(BOOST_NO_IOSTREAM)

Modified: trunk/boost/asio/impl/read_until.hpp
==============================================================================
--- trunk/boost/asio/impl/read_until.hpp (original)
+++ trunk/boost/asio/impl/read_until.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -25,6 +25,7 @@
 #include <boost/asio/detail/bind_handler.hpp>
 #include <boost/asio/detail/handler_alloc_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>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -56,11 +57,11 @@
     typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
     const_buffers_type buffers = b.data();
     iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position;
+ iterator start_pos = begin + search_position;
     iterator end = iterator::end(buffers);
 
     // Look for a match.
- iterator iter = std::find(start, end, delim);
+ iterator iter = std::find(start_pos, end, delim);
     if (iter != end)
     {
       // Found a match. We're done.
@@ -147,12 +148,12 @@
     typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
     const_buffers_type buffers = b.data();
     iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position;
+ iterator start_pos = begin + search_position;
     iterator end = iterator::end(buffers);
 
     // Look for a match.
     std::pair<iterator, bool> result = detail::partial_search(
- start, end, delim.begin(), delim.end());
+ start_pos, end, delim.begin(), delim.end());
     if (result.first != end)
     {
       if (result.second)
@@ -212,14 +213,14 @@
     typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
     const_buffers_type buffers = b.data();
     iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position;
+ iterator start_pos = begin + search_position;
     iterator end = iterator::end(buffers);
 
     // Look for a match.
     boost::match_results<iterator,
       typename std::vector<boost::sub_match<iterator> >::allocator_type>
         match_results;
- if (regex_search(start, end, match_results, expr,
+ if (regex_search(start_pos, end, match_results, expr,
           boost::match_default | boost::match_partial))
     {
       if (match_results[0].matched)
@@ -270,11 +271,11 @@
     typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
     const_buffers_type buffers = b.data();
     iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position;
+ iterator start_pos = begin + search_position;
     iterator end = iterator::end(buffers);
 
     // Look for a match.
- std::pair<iterator, bool> result = match_condition(start, end);
+ std::pair<iterator, bool> result = match_condition(start_pos, end);
     if (result.second)
     {
       // Full match. We're done.
@@ -326,12 +327,12 @@
   public:
     read_until_delim_op(AsyncReadStream& stream,
         boost::asio::basic_streambuf<Allocator>& streambuf,
- char delim, ReadHandler handler)
+ char delim, ReadHandler& handler)
       : stream_(stream),
         streambuf_(streambuf),
         delim_(delim),
         search_position_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -352,11 +353,11 @@
             typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
             const_buffers_type buffers = streambuf_.data();
             iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position_;
+ iterator start_pos = begin + search_position_;
             iterator end = iterator::end(buffers);
 
             // Look for a match.
- iterator iter = std::find(start, end, delim_);
+ iterator iter = std::find(start_pos, end, delim_);
             if (iter != end)
             {
               // Found a match. We're done.
@@ -445,6 +446,10 @@
 void async_read_until(AsyncReadStream& s,
     boost::asio::basic_streambuf<Allocator>& b, char delim, 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::read_until_delim_op<
     AsyncReadStream, Allocator, ReadHandler>(
       s, b, delim, handler)(
@@ -459,12 +464,12 @@
   public:
     read_until_delim_string_op(AsyncReadStream& stream,
         boost::asio::basic_streambuf<Allocator>& streambuf,
- const std::string& delim, ReadHandler handler)
+ const std::string& delim, ReadHandler& handler)
       : stream_(stream),
         streambuf_(streambuf),
         delim_(delim),
         search_position_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -485,12 +490,12 @@
             typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
             const_buffers_type buffers = streambuf_.data();
             iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position_;
+ iterator start_pos = begin + search_position_;
             iterator end = iterator::end(buffers);
 
             // Look for a match.
             std::pair<iterator, bool> result = detail::partial_search(
- start, end, delim_.begin(), delim_.end());
+ start_pos, end, delim_.begin(), delim_.end());
             if (result.first != end && result.second)
             {
               // Full match. We're done.
@@ -590,6 +595,10 @@
     boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
     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::read_until_delim_string_op<
     AsyncReadStream, Allocator, ReadHandler>(
       s, b, delim, handler)(
@@ -605,12 +614,12 @@
   public:
     read_until_expr_op(AsyncReadStream& stream,
         boost::asio::basic_streambuf<Allocator>& streambuf,
- const boost::regex& expr, ReadHandler handler)
+ const boost::regex& expr, ReadHandler& handler)
       : stream_(stream),
         streambuf_(streambuf),
         expr_(expr),
         search_position_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -631,14 +640,14 @@
             typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
             const_buffers_type buffers = streambuf_.data();
             iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position_;
+ iterator start_pos = begin + search_position_;
             iterator end = iterator::end(buffers);
 
             // Look for a match.
             boost::match_results<iterator,
               typename std::vector<boost::sub_match<iterator> >::allocator_type>
                 match_results;
- bool match = regex_search(start, end, match_results, expr_,
+ bool match = regex_search(start_pos, end, match_results, expr_,
                 boost::match_default | boost::match_partial);
             if (match && match_results[0].matched)
             {
@@ -741,6 +750,10 @@
     boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
     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::read_until_expr_op<AsyncReadStream,
     Allocator, boost::regex, ReadHandler>(
       s, b, expr, handler)(
@@ -756,12 +769,12 @@
   public:
     read_until_match_op(AsyncReadStream& stream,
         boost::asio::basic_streambuf<Allocator>& streambuf,
- MatchCondition match_condition, ReadHandler handler)
+ MatchCondition match_condition, ReadHandler& handler)
       : stream_(stream),
         streambuf_(streambuf),
         match_condition_(match_condition),
         search_position_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(ReadHandler)(handler))
     {
     }
 
@@ -782,11 +795,11 @@
             typedef boost::asio::buffers_iterator<const_buffers_type> iterator;
             const_buffers_type buffers = streambuf_.data();
             iterator begin = iterator::begin(buffers);
- iterator start = begin + search_position_;
+ iterator start_pos = begin + search_position_;
             iterator end = iterator::end(buffers);
 
             // Look for a match.
- std::pair<iterator, bool> result = match_condition_(start, end);
+ std::pair<iterator, bool> result = match_condition_(start_pos, end);
             if (result.second)
             {
               // Full match. We're done.
@@ -890,6 +903,10 @@
     MatchCondition match_condition, ReadHandler handler,
     typename boost::enable_if<is_match_condition<MatchCondition> >::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::read_until_match_op<
     AsyncReadStream, Allocator, MatchCondition, ReadHandler>(
       s, b, match_condition, handler)(

Modified: trunk/boost/asio/impl/write.hpp
==============================================================================
--- trunk/boost/asio/impl/write.hpp (original)
+++ trunk/boost/asio/impl/write.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -22,6 +22,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/handler_alloc_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>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -60,6 +61,13 @@
   return bytes_transferred;
 }
 
+template <typename SyncWriteStream, typename ConstBufferSequence>
+inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
+ boost::system::error_code& ec)
+{
+ return write(s, buffers, transfer_all(), ec);
+}
+
 template <typename SyncWriteStream, typename ConstBufferSequence,
     typename CompletionCondition>
 inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
@@ -94,6 +102,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncWriteStream, typename Allocator>
+inline std::size_t write(SyncWriteStream& s,
+ boost::asio::basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec)
+{
+ return write(s, b, transfer_all(), ec);
+}
+
 template <typename SyncWriteStream, typename Allocator,
     typename CompletionCondition>
 inline std::size_t write(SyncWriteStream& s,
@@ -117,13 +133,13 @@
   {
   public:
     write_op(AsyncWriteStream& stream, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, WriteHandler handler)
+ CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffers_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -168,13 +184,13 @@
     write_op(AsyncWriteStream& stream,
         const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition,
- WriteHandler handler)
+ WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -219,13 +235,13 @@
     write_op(AsyncWriteStream& stream,
         const boost::asio::const_buffers_1& buffers,
         CompletionCondition completion_condition,
- WriteHandler handler)
+ WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         stream_(stream),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -297,6 +313,10 @@
 inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, 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::write_op<AsyncWriteStream, ConstBufferSequence,
     CompletionCondition, WriteHandler>(
       s, buffers, completion_condition, handler)(
@@ -308,7 +328,14 @@
 inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
     WriteHandler handler)
 {
- async_write(s, buffers, transfer_all(), 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::write_op<AsyncWriteStream, ConstBufferSequence,
+ detail::transfer_all_t, WriteHandler>(
+ s, buffers, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #if !defined(BOOST_NO_IOSTREAM)
@@ -321,9 +348,9 @@
   {
   public:
     write_streambuf_handler(boost::asio::basic_streambuf<Allocator>& streambuf,
- WriteHandler handler)
+ WriteHandler& handler)
       : streambuf_(streambuf),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -376,6 +403,10 @@
     boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, 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;
+
   async_write(s, b.data(), completion_condition,
       detail::write_streambuf_handler<
         AsyncWriteStream, Allocator, WriteHandler>(b, handler));
@@ -385,7 +416,13 @@
 inline void async_write(AsyncWriteStream& s,
     boost::asio::basic_streambuf<Allocator>& b, WriteHandler handler)
 {
- async_write(s, b, transfer_all(), 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;
+
+ async_write(s, b.data(), transfer_all(),
+ detail::write_streambuf_handler<
+ AsyncWriteStream, Allocator, WriteHandler>(b, handler));
 }
 
 #endif // !defined(BOOST_NO_IOSTREAM)

Modified: trunk/boost/asio/impl/write_at.hpp
==============================================================================
--- trunk/boost/asio/impl/write_at.hpp (original)
+++ trunk/boost/asio/impl/write_at.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -22,6 +22,7 @@
 #include <boost/asio/detail/consuming_buffers.hpp>
 #include <boost/asio/detail/handler_alloc_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>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -64,6 +65,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
+inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
+ boost::uint64_t offset, const ConstBufferSequence& buffers,
+ boost::system::error_code& ec)
+{
+ return write_at(d, offset, buffers, transfer_all(), ec);
+}
+
 template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
@@ -101,6 +110,14 @@
   return bytes_transferred;
 }
 
+template <typename SyncRandomAccessWriteDevice, typename Allocator>
+inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
+ boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec)
+{
+ return write_at(d, offset, b, transfer_all(), ec);
+}
+
 template <typename SyncRandomAccessWriteDevice, typename Allocator,
     typename CompletionCondition>
 inline std::size_t write_at(SyncRandomAccessWriteDevice& d,
@@ -126,14 +143,14 @@
   public:
     write_at_op(AsyncRandomAccessWriteDevice& device,
         boost::uint64_t offset, const ConstBufferSequence& buffers,
- CompletionCondition completion_condition, WriteHandler handler)
+ CompletionCondition completion_condition, WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffers_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -180,14 +197,14 @@
     write_at_op(AsyncRandomAccessWriteDevice& device,
         boost::uint64_t offset, const boost::asio::mutable_buffers_1& buffers,
         CompletionCondition completion_condition,
- WriteHandler handler)
+ WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -233,14 +250,14 @@
     write_at_op(AsyncRandomAccessWriteDevice& device,
         boost::uint64_t offset, const boost::asio::const_buffers_1& buffers,
         CompletionCondition completion_condition,
- WriteHandler handler)
+ WriteHandler& handler)
       : detail::base_from_completion_cond<
           CompletionCondition>(completion_condition),
         device_(device),
         offset_(offset),
         buffer_(buffers),
         total_transferred_(0),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -314,6 +331,10 @@
     boost::uint64_t offset, const ConstBufferSequence& buffers,
     CompletionCondition completion_condition, 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::write_at_op<AsyncRandomAccessWriteDevice,
     ConstBufferSequence, CompletionCondition, WriteHandler>(
       d, offset, buffers, completion_condition, handler)(
@@ -326,7 +347,14 @@
     boost::uint64_t offset, const ConstBufferSequence& buffers,
     WriteHandler handler)
 {
- async_write_at(d, offset, buffers, transfer_all(), 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::write_at_op<AsyncRandomAccessWriteDevice,
+ ConstBufferSequence, detail::transfer_all_t, WriteHandler>(
+ d, offset, buffers, transfer_all(), handler)(
+ boost::system::error_code(), 0, 1);
 }
 
 #if !defined(BOOST_NO_IOSTREAM)
@@ -340,9 +368,9 @@
   public:
     write_at_streambuf_op(
         boost::asio::basic_streambuf<Allocator>& streambuf,
- WriteHandler handler)
+ WriteHandler& handler)
       : streambuf_(streambuf),
- handler_(handler)
+ handler_(BOOST_ASIO_MOVE_CAST(WriteHandler)(handler))
     {
     }
 
@@ -395,6 +423,10 @@
     boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     CompletionCondition completion_condition, 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;
+
   async_write_at(d, offset, b.data(), completion_condition,
       detail::write_at_streambuf_op<
         AsyncRandomAccessWriteDevice, Allocator, WriteHandler>(b, handler));
@@ -406,7 +438,13 @@
     boost::uint64_t offset, boost::asio::basic_streambuf<Allocator>& b,
     WriteHandler handler)
 {
- async_write_at(d, offset, b, transfer_all(), 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;
+
+ async_write_at(d, offset, b.data(), transfer_all(),
+ detail::write_at_streambuf_op<
+ AsyncRandomAccessWriteDevice, Allocator, WriteHandler>(b, handler));
 }
 
 #endif // !defined(BOOST_NO_IOSTREAM)

Modified: trunk/boost/asio/io_service.hpp
==============================================================================
--- trunk/boost/asio/io_service.hpp (original)
+++ trunk/boost/asio/io_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -256,8 +256,10 @@
    * waiting in the pool are equivalent and the io_service may choose any one
    * of them to invoke a handler.
    *
- * The run() function may be safely called again once it has completed only
- * after a call to reset().
+ * A normal exit from the run() function implies that the io_service object
+ * is stopped (the stopped() function returns @c true). Subsequent calls to
+ * run(), run_one(), poll() or poll_one() will return immediately unless there
+ * is a prior call to reset().
    *
    * @return The number of handlers that were executed.
    *
@@ -282,8 +284,10 @@
    * waiting in the pool are equivalent and the io_service may choose any one
    * of them to invoke a handler.
    *
- * The run() function may be safely called again once it has completed only
- * after a call to reset().
+ * A normal exit from the run() function implies that the io_service object
+ * is stopped (the stopped() function returns @c true). Subsequent calls to
+ * run(), run_one(), poll() or poll_one() will return immediately unless there
+ * is a prior call to reset().
    *
    * @param ec Set to indicate what error occurred, if any.
    *
@@ -304,7 +308,11 @@
    * The run_one() function blocks until one handler has been dispatched, or
    * until the io_service has been stopped.
    *
- * @return The number of handlers that were executed.
+ * @return The number of handlers that were executed. A zero return value
+ * implies that the io_service object is stopped (the stopped() function
+ * returns @c true). Subsequent calls to run(), run_one(), poll() or
+ * poll_one() will return immediately unless there is a prior call to
+ * reset().
    *
    * @throws boost::system::system_error Thrown on failure.
    */
@@ -316,7 +324,11 @@
    * The run_one() function blocks until one handler has been dispatched, or
    * until the io_service has been stopped.
    *
- * @param ec Set to indicate what error occurred, if any.
+ * @return The number of handlers that were executed. A zero return value
+ * implies that the io_service object is stopped (the stopped() function
+ * returns @c true). Subsequent calls to run(), run_one(), poll() or
+ * poll_one() will return immediately unless there is a prior call to
+ * reset().
    *
    * @return The number of handlers that were executed.
    */
@@ -379,13 +391,25 @@
    */
   BOOST_ASIO_DECL void stop();
 
+ /// Determine whether the io_service object has been stopped.
+ /**
+ * This function is used to determine whether an io_service object has been
+ * stopped, either through an explicit call to stop(), or due to running out
+ * of work. When an io_service object is stopped, calls to run(), run_one(),
+ * poll() or poll_one() will return immediately without invoking any
+ * handlers.
+ *
+ * @return @c true if the io_service object is stopped, otherwise @c false.
+ */
+ BOOST_ASIO_DECL bool stopped() const;
+
   /// Reset the io_service in preparation for a subsequent run() invocation.
   /**
    * This function must be called prior to any second or later set of
    * invocations of the run(), run_one(), poll() or poll_one() functions when a
    * previous invocation of these functions returned due to the io_service
- * being stopped or running out of work. This function allows the io_service
- * to reset any internal state, such as a "stopped" flag.
+ * being stopped or running out of work. After a call to reset(), the
+ * io_service object's stopped() function will return @c false.
    *
    * This function must not be called while there are any unfinished calls to
    * the run(), run_one(), poll() or poll_one() functions.
@@ -569,10 +593,6 @@
    */
   ~work();
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with the
- /// work.
- boost::asio::io_service& io_service();
-
   /// Get the io_service associated with the work.
   boost::asio::io_service& get_io_service();
 
@@ -598,10 +618,6 @@
   : private noncopyable
 {
 public:
- /// (Deprecated: use get_io_service().) Get the io_service object that owns
- /// the service.
- boost::asio::io_service& io_service();
-
   /// Get the io_service object that owns the service.
   boost::asio::io_service& get_io_service();
 

Modified: trunk/boost/asio/ip/address.hpp
==============================================================================
--- trunk/boost/asio/ip/address.hpp (original)
+++ trunk/boost/asio/ip/address.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -108,6 +108,15 @@
   BOOST_ASIO_DECL static address from_string(
       const std::string& str, boost::system::error_code& ec);
 
+ /// Determine whether the address is a loopback address.
+ BOOST_ASIO_DECL bool is_loopback() const;
+
+ /// Determine whether the address is unspecified.
+ BOOST_ASIO_DECL bool is_unspecified() const;
+
+ /// Determine whether the address is a multicast address.
+ BOOST_ASIO_DECL bool is_multicast() const;
+
   /// Compare two addresses for equality.
   BOOST_ASIO_DECL friend bool operator==(const address& a1, const address& a2);
 

Modified: trunk/boost/asio/ip/address_v4.hpp
==============================================================================
--- trunk/boost/asio/ip/address_v4.hpp (original)
+++ trunk/boost/asio/ip/address_v4.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -98,6 +98,12 @@
   BOOST_ASIO_DECL static address_v4 from_string(
       const std::string& str, boost::system::error_code& ec);
 
+ /// Determine whether the address is a loopback address.
+ BOOST_ASIO_DECL bool is_loopback() const;
+
+ /// Determine whether the address is unspecified.
+ BOOST_ASIO_DECL bool is_unspecified() const;
+
   /// Determine whether the address is a class A address.
   BOOST_ASIO_DECL bool is_class_a() const;
 
@@ -149,19 +155,19 @@
   /// Obtain an address object that represents any address.
   static address_v4 any()
   {
- return address_v4(static_cast<unsigned long>(INADDR_ANY));
+ return address_v4();
   }
 
   /// Obtain an address object that represents the loopback address.
   static address_v4 loopback()
   {
- return address_v4(static_cast<unsigned long>(INADDR_LOOPBACK));
+ return address_v4(0x7F000001);
   }
 
   /// Obtain an address object that represents the broadcast address.
   static address_v4 broadcast()
   {
- return address_v4(static_cast<unsigned long>(INADDR_BROADCAST));
+ return address_v4(0xFFFFFFFF);
   }
 
   /// Obtain an address object that represents the broadcast address that

Modified: trunk/boost/asio/ip/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_endpoint.hpp (original)
+++ trunk/boost/asio/ip/basic_endpoint.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -78,8 +78,9 @@
    * boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
    * @endcode
    */
- basic_endpoint(const InternetProtocol& protocol, unsigned short port_num)
- : impl_(protocol.family(), port_num)
+ basic_endpoint(const InternetProtocol& internet_protocol,
+ unsigned short port_num)
+ : impl_(internet_protocol.family(), port_num)
   {
   }
 
@@ -131,9 +132,9 @@
   }
 
   /// Set the underlying size of the endpoint in the native type.
- void resize(std::size_t size)
+ void resize(std::size_t new_size)
   {
- impl_.resize(size);
+ impl_.resize(new_size);
   }
 
   /// Get the capacity of the endpoint in the native type.

Modified: trunk/boost/asio/ip/basic_resolver.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_resolver.hpp (original)
+++ trunk/boost/asio/ip/basic_resolver.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -17,6 +17,7 @@
 
 #include <boost/asio/detail/config.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/error.hpp>
 #include <boost/asio/ip/basic_resolver_iterator.hpp>
@@ -154,7 +155,13 @@
   template <typename ResolveHandler>
   void async_resolve(const query& q, ResolveHandler handler)
   {
- return this->service.async_resolve(this->implementation, q, handler);
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ResolveHandler.
+ BOOST_ASIO_RESOLVE_HANDLER_CHECK(
+ ResolveHandler, handler, iterator) type_check;
+
+ return this->service.async_resolve(this->implementation, q,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
   }
 
   /// Perform reverse resolution of an endpoint to a list of entries.
@@ -238,7 +245,13 @@
   template <typename ResolveHandler>
   void async_resolve(const endpoint_type& e, ResolveHandler handler)
   {
- return this->service.async_resolve(this->implementation, e, handler);
+ // If you get an error on the following line it means that your handler does
+ // not meet the documented type requirements for a ResolveHandler.
+ BOOST_ASIO_RESOLVE_HANDLER_CHECK(
+ ResolveHandler, handler, iterator) type_check;
+
+ return this->service.async_resolve(this->implementation, e,
+ BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/ip/basic_resolver_entry.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_resolver_entry.hpp (original)
+++ trunk/boost/asio/ip/basic_resolver_entry.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -49,11 +49,11 @@
   }
 
   /// Construct with specified endpoint, host name and service name.
- basic_resolver_entry(const endpoint_type& endpoint,
- const std::string& host_name, const std::string& service_name)
- : endpoint_(endpoint),
- host_name_(host_name),
- service_name_(service_name)
+ basic_resolver_entry(const endpoint_type& ep,
+ const std::string& host, const std::string& service)
+ : endpoint_(ep),
+ host_name_(host),
+ service_name_(service)
   {
   }
 

Modified: trunk/boost/asio/ip/basic_resolver_query.hpp
==============================================================================
--- trunk/boost/asio/ip/basic_resolver_query.hpp (original)
+++ trunk/boost/asio/ip/basic_resolver_query.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -48,8 +48,8 @@
    * This constructor is typically used to perform name resolution for local
    * service binding.
    *
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number.
    *
    * @param resolve_flags A set of flags that determine how name resolution
    * should be performed. The default flags are suitable for local service
@@ -60,11 +60,11 @@
    * <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
    * may use additional locations when resolving service names.
    */
- basic_resolver_query(const std::string& service_name,
+ basic_resolver_query(const std::string& service,
       resolver_query_base::flags resolve_flags = passive | address_configured)
     : hints_(),
       host_name_(),
- service_name_(service_name)
+ service_name_(service)
   {
     typename InternetProtocol::endpoint endpoint;
     hints_.ai_flags = static_cast<int>(resolve_flags);
@@ -85,8 +85,8 @@
    * @param protocol A protocol object, normally representing either the IPv4 or
    * IPv6 version of an internet protocol.
    *
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number.
    *
    * @param resolve_flags A set of flags that determine how name resolution
    * should be performed. The default flags are suitable for local service
@@ -98,11 +98,11 @@
    * may use additional locations when resolving service names.
    */
   basic_resolver_query(const protocol_type& protocol,
- const std::string& service_name,
+ const std::string& service,
       resolver_query_base::flags resolve_flags = passive | address_configured)
     : hints_(),
       host_name_(),
- service_name_(service_name)
+ service_name_(service)
   {
     hints_.ai_flags = static_cast<int>(resolve_flags);
     hints_.ai_family = protocol.family();
@@ -119,16 +119,16 @@
    * This constructor is typically used to perform name resolution for
    * communication with remote hosts.
    *
- * @param host_name A string identifying a location. May be a descriptive name
- * or a numeric address string. If an empty string and the passive flag has
- * been specified, the resolved endpoints are suitable for local service
- * binding. If an empty string and passive is not specified, the resolved
- * endpoints will use the loopback address.
- *
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
- * May be an empty string, in which case all resolved endpoints will have a
- * port number of 0.
+ * @param host A string identifying a location. May be a descriptive name or
+ * a numeric address string. If an empty string and the passive flag has been
+ * specified, the resolved endpoints are suitable for local service binding.
+ * If an empty string and passive is not specified, the resolved endpoints
+ * will use the loopback address.
+ *
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number. May
+ * be an empty string, in which case all resolved endpoints will have a port
+ * number of 0.
    *
    * @param resolve_flags A set of flags that determine how name resolution
    * should be performed. The default flags are suitable for communication with
@@ -145,12 +145,11 @@
    * <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
    * may use additional locations when resolving service names.
    */
- basic_resolver_query(const std::string& host_name,
- const std::string& service_name,
+ basic_resolver_query(const std::string& host, const std::string& service,
       resolver_query_base::flags resolve_flags = address_configured)
     : hints_(),
- host_name_(host_name),
- service_name_(service_name)
+ host_name_(host),
+ service_name_(service)
   {
     typename InternetProtocol::endpoint endpoint;
     hints_.ai_flags = static_cast<int>(resolve_flags);
@@ -171,16 +170,16 @@
    * @param protocol A protocol object, normally representing either the IPv4 or
    * IPv6 version of an internet protocol.
    *
- * @param host_name A string identifying a location. May be a descriptive name
- * or a numeric address string. If an empty string and the passive flag has
- * been specified, the resolved endpoints are suitable for local service
- * binding. If an empty string and passive is not specified, the resolved
- * endpoints will use the loopback address.
- *
- * @param service_name A string identifying the requested service. This may
- * be a descriptive name or a numeric string corresponding to a port number.
- * May be an empty string, in which case all resolved endpoints will have a
- * port number of 0.
+ * @param host A string identifying a location. May be a descriptive name or
+ * a numeric address string. If an empty string and the passive flag has been
+ * specified, the resolved endpoints are suitable for local service binding.
+ * If an empty string and passive is not specified, the resolved endpoints
+ * will use the loopback address.
+ *
+ * @param service A string identifying the requested service. This may be a
+ * descriptive name or a numeric string corresponding to a port number. May
+ * be an empty string, in which case all resolved endpoints will have a port
+ * number of 0.
    *
    * @param resolve_flags A set of flags that determine how name resolution
    * should be performed. The default flags are suitable for communication with
@@ -198,11 +197,11 @@
    * may use additional locations when resolving service names.
    */
   basic_resolver_query(const protocol_type& protocol,
- const std::string& host_name, const std::string& service_name,
+ const std::string& host, const std::string& service,
       resolver_query_base::flags resolve_flags = address_configured)
     : hints_(),
- host_name_(host_name),
- service_name_(service_name)
+ host_name_(host),
+ service_name_(service)
   {
     hints_.ai_flags = static_cast<int>(resolve_flags);
     hints_.ai_family = protocol.family();

Modified: trunk/boost/asio/ip/detail/endpoint.hpp
==============================================================================
--- trunk/boost/asio/ip/detail/endpoint.hpp (original)
+++ trunk/boost/asio/ip/detail/endpoint.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -78,12 +78,12 @@
   }
 
   // Set the underlying size of the endpoint in the native type.
- BOOST_ASIO_DECL void resize(std::size_t size);
+ BOOST_ASIO_DECL void resize(std::size_t new_size);
 
   // Get the capacity of the endpoint in the native type.
   std::size_t capacity() const
   {
- return sizeof(boost::asio::detail::sockaddr_storage_type);
+ return sizeof(data_);
   }
 
   // Get the port associated with the endpoint.
@@ -122,7 +122,6 @@
   union data_union
   {
     boost::asio::detail::socket_addr_type base;
- boost::asio::detail::sockaddr_storage_type storage;
     boost::asio::detail::sockaddr_in4_type v4;
     boost::asio::detail::sockaddr_in6_type v6;
   } data_;

Modified: trunk/boost/asio/ip/detail/impl/endpoint.ipp
==============================================================================
--- trunk/boost/asio/ip/detail/impl/endpoint.ipp (original)
+++ trunk/boost/asio/ip/detail/impl/endpoint.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -57,8 +57,14 @@
     data_.v6.sin6_port =
       boost::asio::detail::socket_ops::host_to_network_short(port_num);
     data_.v6.sin6_flowinfo = 0;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- data_.v6.sin6_addr = tmp_addr;
+ data_.v6.sin6_addr.s6_addr[0] = 0; data_.v6.sin6_addr.s6_addr[1] = 0;
+ data_.v6.sin6_addr.s6_addr[2] = 0, data_.v6.sin6_addr.s6_addr[3] = 0;
+ data_.v6.sin6_addr.s6_addr[4] = 0, data_.v6.sin6_addr.s6_addr[5] = 0;
+ data_.v6.sin6_addr.s6_addr[6] = 0, data_.v6.sin6_addr.s6_addr[7] = 0;
+ data_.v6.sin6_addr.s6_addr[8] = 0, data_.v6.sin6_addr.s6_addr[9] = 0;
+ data_.v6.sin6_addr.s6_addr[10] = 0, data_.v6.sin6_addr.s6_addr[11] = 0;
+ data_.v6.sin6_addr.s6_addr[12] = 0, data_.v6.sin6_addr.s6_addr[13] = 0;
+ data_.v6.sin6_addr.s6_addr[14] = 0, data_.v6.sin6_addr.s6_addr[15] = 0;
     data_.v6.sin6_scope_id = 0;
   }
 }
@@ -90,9 +96,9 @@
   }
 }
 
-void endpoint::resize(std::size_t size)
+void endpoint::resize(std::size_t new_size)
 {
- if (size > sizeof(boost::asio::detail::sockaddr_storage_type))
+ 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);

Modified: trunk/boost/asio/ip/detail/socket_option.hpp
==============================================================================
--- trunk/boost/asio/ip/detail/socket_option.hpp (original)
+++ trunk/boost/asio/ip/detail/socket_option.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -385,31 +385,18 @@
 public:
   // Default constructor.
   multicast_request()
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
   {
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
   }
 
   // Construct with multicast address only.
   explicit multicast_request(const boost::asio::ip::address& multicast_address)
+ : ipv4_value_(), // Zero-initialisation gives the "any" address.
+ ipv6_value_() // Zero-initialisation gives the "any" address.
   {
     if (multicast_address.is_v6())
     {
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
       using namespace std; // For memcpy.
       boost::asio::ip::address_v6 ipv6_address = multicast_address.to_v6();
       boost::asio::ip::address_v6::bytes_type bytes = ipv6_address.to_bytes();
@@ -424,10 +411,6 @@
       ipv4_value_.imr_interface.s_addr =
         boost::asio::detail::socket_ops::host_to_network_long(
             boost::asio::ip::address_v4::any().to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
     }
   }
 
@@ -436,6 +419,7 @@
       const boost::asio::ip::address_v4& multicast_address,
       const boost::asio::ip::address_v4& network_interface
         = boost::asio::ip::address_v4::any())
+ : ipv6_value_() // Zero-initialisation gives the "any" address.
   {
     ipv4_value_.imr_multiaddr.s_addr =
       boost::asio::detail::socket_ops::host_to_network_long(
@@ -443,24 +427,14 @@
     ipv4_value_.imr_interface.s_addr =
       boost::asio::detail::socket_ops::host_to_network_long(
           network_interface.to_ulong());
-
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- ipv6_value_.ipv6mr_multiaddr = tmp_addr;
- ipv6_value_.ipv6mr_interface = 0;
   }
 
   // Construct with multicast address and IPv6 network interface index.
   explicit multicast_request(
       const boost::asio::ip::address_v6& multicast_address,
       unsigned long network_interface = 0)
+ : ipv4_value_() // Zero-initialisation gives the "any" address.
   {
- ipv4_value_.imr_multiaddr.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
- ipv4_value_.imr_interface.s_addr =
- boost::asio::detail::socket_ops::host_to_network_long(
- boost::asio::ip::address_v4::any().to_ulong());
-
     using namespace std; // For memcpy.
     boost::asio::ip::address_v6::bytes_type bytes =
       multicast_address.to_bytes();

Modified: trunk/boost/asio/ip/icmp.hpp
==============================================================================
--- trunk/boost/asio/ip/icmp.hpp (original)
+++ trunk/boost/asio/ip/icmp.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -46,12 +46,6 @@
   /// The type of a ICMP endpoint.
   typedef basic_endpoint<icmp> endpoint;
 
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<icmp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<icmp> resolver_iterator;
-
   /// Construct to represent the IPv4 ICMP protocol.
   static icmp v4()
   {
@@ -102,9 +96,9 @@
 
 private:
   // Construct with a specific family.
- explicit icmp(int protocol, int family)
- : protocol_(protocol),
- family_(family)
+ explicit icmp(int protocol_id, int protocol_family)
+ : protocol_(protocol_id),
+ family_(protocol_family)
   {
   }
 

Modified: trunk/boost/asio/ip/impl/address.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address.ipp (original)
+++ trunk/boost/asio/ip/impl/address.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -159,6 +159,27 @@
   return from_string(str.c_str(), ec);
 }
 
+bool address::is_loopback() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_loopback()
+ : ipv6_address_.is_loopback();
+}
+
+bool address::is_unspecified() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_unspecified()
+ : ipv6_address_.is_unspecified();
+}
+
+bool address::is_multicast() const
+{
+ return (type_ == ipv4)
+ ? ipv4_address_.is_multicast()
+ : ipv6_address_.is_multicast();
+}
+
 bool operator==(const address& a1, const address& a2)
 {
   if (a1.type_ != a2.type_)

Modified: trunk/boost/asio/ip/impl/address_v4.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v4.ipp (original)
+++ trunk/boost/asio/ip/impl/address_v4.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -119,24 +119,34 @@
   return from_string(str.c_str(), ec);
 }
 
+bool address_v4::is_loopback() const
+{
+ return (to_ulong() & 0xFF000000) == 0x7F000000;
+}
+
+bool address_v4::is_unspecified() const
+{
+ return to_ulong() == 0;
+}
+
 bool address_v4::is_class_a() const
 {
- return IN_CLASSA(to_ulong());
+ return (to_ulong() & 0x80000000) == 0;
 }
 
 bool address_v4::is_class_b() const
 {
- return IN_CLASSB(to_ulong());
+ return (to_ulong() & 0xC0000000) == 0x80000000;
 }
 
 bool address_v4::is_class_c() const
 {
- return IN_CLASSC(to_ulong());
+ return (to_ulong() & 0xE0000000) == 0xC0000000;
 }
 
 bool address_v4::is_multicast() const
 {
- return IN_MULTICAST(to_ulong());
+ return (to_ulong() & 0xF0000000) == 0xE0000000;
 }
 
 address_v4 address_v4::broadcast(const address_v4& addr, const address_v4& mask)

Modified: trunk/boost/asio/ip/impl/address_v6.ipp
==============================================================================
--- trunk/boost/asio/ip/impl/address_v6.ipp (original)
+++ trunk/boost/asio/ip/impl/address_v6.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -32,15 +32,14 @@
 namespace ip {
 
 address_v6::address_v6()
- : scope_id_(0)
+ : addr_(),
+ scope_id_(0)
 {
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_ANY_INIT;
- addr_ = tmp_addr;
 }
 
 address_v6::address_v6(const address_v6::bytes_type& bytes,
- unsigned long scope_id)
- : scope_id_(scope_id)
+ unsigned long scope)
+ : scope_id_(scope)
 {
 #if UCHAR_MAX > 0xFF
   for (std::size_t i = 0; i < bytes.size(); ++i)
@@ -141,7 +140,6 @@
 
 bool address_v6::is_loopback() const
 {
-#if defined(__BORLANDC__)
   return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
       && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
       && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
@@ -150,15 +148,10 @@
       && (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
       && (addr_.s6_addr[12] == 0) && (addr_.s6_addr[13] == 0)
       && (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 1));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LOOPBACK(&addr_) != 0;
-#endif
 }
 
 bool address_v6::is_unspecified() const
 {
-#if defined(__BORLANDC__)
   return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
       && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
       && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
@@ -167,70 +160,70 @@
       && (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
       && (addr_.s6_addr[12] == 0) && (addr_.s6_addr[13] == 0)
       && (addr_.s6_addr[14] == 0) && (addr_.s6_addr[15] == 0));
-#else
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_UNSPECIFIED(&addr_) != 0;
-#endif
 }
 
 bool address_v6::is_link_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_LINKLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0x80));
 }
 
 bool address_v6::is_site_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_SITELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xfe) && ((addr_.s6_addr[1] & 0xc0) == 0xc0));
 }
 
 bool address_v6::is_v4_mapped() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4MAPPED(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
+ && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
+ && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
+ && (addr_.s6_addr[6] == 0) && (addr_.s6_addr[7] == 0)
+ && (addr_.s6_addr[8] == 0) && (addr_.s6_addr[9] == 0)
+ && (addr_.s6_addr[10] == 0xff) && (addr_.s6_addr[11] == 0xff));
 }
 
 bool address_v6::is_v4_compatible() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_V4COMPAT(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0) && (addr_.s6_addr[1] == 0)
+ && (addr_.s6_addr[2] == 0) && (addr_.s6_addr[3] == 0)
+ && (addr_.s6_addr[4] == 0) && (addr_.s6_addr[5] == 0)
+ && (addr_.s6_addr[6] == 0) && (addr_.s6_addr[7] == 0)
+ && (addr_.s6_addr[8] == 0) && (addr_.s6_addr[9] == 0)
+ && (addr_.s6_addr[10] == 0) && (addr_.s6_addr[11] == 0)
+ && !((addr_.s6_addr[12] == 0)
+ && (addr_.s6_addr[13] == 0)
+ && (addr_.s6_addr[14] == 0)
+ && ((addr_.s6_addr[15] == 0) || (addr_.s6_addr[15] == 1))));
 }
 
 bool address_v6::is_multicast() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MULTICAST(&addr_) != 0;
+ return (addr_.s6_addr[0] == 0xff);
 }
 
 bool address_v6::is_multicast_global() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_GLOBAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x0e));
 }
 
 bool address_v6::is_multicast_link_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_LINKLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x02));
 }
 
 bool address_v6::is_multicast_node_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_NODELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x01));
 }
 
 bool address_v6::is_multicast_org_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_ORGLOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x08));
 }
 
 bool address_v6::is_multicast_site_local() const
 {
- using namespace boost::asio::detail;
- return IN6_IS_ADDR_MC_SITELOCAL(&addr_) != 0;
+ return ((addr_.s6_addr[0] == 0xff) && ((addr_.s6_addr[1] & 0x0f) == 0x05));
 }
 
 bool operator==(const address_v6& a1, const address_v6& a2)
@@ -256,8 +249,7 @@
 address_v6 address_v6::loopback()
 {
   address_v6 tmp;
- boost::asio::detail::in6_addr_type tmp_addr = IN6ADDR_LOOPBACK_INIT;
- tmp.addr_ = tmp_addr;
+ tmp.addr_.s6_addr[15] = 1;
   return tmp;
 }
 

Modified: trunk/boost/asio/ip/tcp.hpp
==============================================================================
--- trunk/boost/asio/ip/tcp.hpp (original)
+++ trunk/boost/asio/ip/tcp.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -49,12 +49,6 @@
   /// The type of a TCP endpoint.
   typedef basic_endpoint<tcp> endpoint;
 
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<tcp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<tcp> resolver_iterator;
-
   /// Construct to represent the IPv4 TCP protocol.
   static tcp v4()
   {
@@ -146,8 +140,8 @@
 
 private:
   // Construct with a specific family.
- explicit tcp(int family)
- : family_(family)
+ explicit tcp(int protocol_family)
+ : family_(protocol_family)
   {
   }
 

Modified: trunk/boost/asio/ip/udp.hpp
==============================================================================
--- trunk/boost/asio/ip/udp.hpp (original)
+++ trunk/boost/asio/ip/udp.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -46,12 +46,6 @@
   /// The type of a UDP endpoint.
   typedef basic_endpoint<udp> endpoint;
 
- /// (Deprecated: use resolver::query.) The type of a resolver query.
- typedef basic_resolver_query<udp> resolver_query;
-
- /// (Deprecated: use resolver::iterator.) The type of a resolver iterator.
- typedef basic_resolver_iterator<udp> resolver_iterator;
-
   /// Construct to represent the IPv4 UDP protocol.
   static udp v4()
   {
@@ -102,8 +96,8 @@
 
 private:
   // Construct with a specific family.
- explicit udp(int family)
- : family_(family)
+ explicit udp(int protocol_family)
+ : family_(protocol_family)
   {
   }
 

Modified: trunk/boost/asio/local/basic_endpoint.hpp
==============================================================================
--- trunk/boost/asio/local/basic_endpoint.hpp (original)
+++ trunk/boost/asio/local/basic_endpoint.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -66,14 +66,14 @@
   }
 
   /// Construct an endpoint using the specified path name.
- basic_endpoint(const char* path)
- : impl_(path)
+ basic_endpoint(const char* path_name)
+ : impl_(path_name)
   {
   }
 
   /// Construct an endpoint using the specified path name.
- basic_endpoint(const std::string& path)
- : impl_(path)
+ basic_endpoint(const std::string& path_name)
+ : impl_(path_name)
   {
   }
 
@@ -115,9 +115,9 @@
   }
 
   /// Set the underlying size of the endpoint in the native type.
- void resize(std::size_t size)
+ void resize(std::size_t new_size)
   {
- impl_.resize(size);
+ impl_.resize(new_size);
   }
 
   /// Get the capacity of the endpoint in the native type.

Modified: trunk/boost/asio/local/detail/endpoint.hpp
==============================================================================
--- trunk/boost/asio/local/detail/endpoint.hpp (original)
+++ trunk/boost/asio/local/detail/endpoint.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,10 +39,10 @@
   BOOST_ASIO_DECL endpoint();
 
   // Construct an endpoint using the specified path name.
- BOOST_ASIO_DECL endpoint(const char* path);
+ BOOST_ASIO_DECL endpoint(const char* path_name);
 
   // Construct an endpoint using the specified path name.
- BOOST_ASIO_DECL endpoint(const std::string& path);
+ BOOST_ASIO_DECL endpoint(const std::string& path_name);
 
   // Copy constructor.
   endpoint(const endpoint& other)

Modified: trunk/boost/asio/local/detail/impl/endpoint.ipp
==============================================================================
--- trunk/boost/asio/local/detail/impl/endpoint.ipp (original)
+++ trunk/boost/asio/local/detail/impl/endpoint.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -38,31 +38,31 @@
   init("", 0);
 }
 
-endpoint::endpoint(const char* path)
+endpoint::endpoint(const char* path_name)
 {
   using namespace std; // For strlen.
- init(path, strlen(path));
+ init(path_name, strlen(path_name));
 }
 
-endpoint::endpoint(const std::string& path)
+endpoint::endpoint(const std::string& path_name)
 {
- init(path.data(), path.length());
+ init(path_name.data(), path_name.length());
 }
 
-void endpoint::resize(std::size_t size)
+void endpoint::resize(std::size_t new_size)
 {
- if (size > sizeof(boost::asio::detail::sockaddr_un_type))
+ if (new_size > sizeof(boost::asio::detail::sockaddr_un_type))
   {
     boost::system::error_code ec(boost::asio::error::invalid_argument);
     boost::asio::detail::throw_error(ec);
   }
- else if (size == 0)
+ else if (new_size == 0)
   {
     path_length_ = 0;
   }
   else
   {
- path_length_ = size
+ path_length_ = new_size
       - offsetof(boost::asio::detail::sockaddr_un_type, sun_path);
 
     // The path returned by the operating system may be NUL-terminated.
@@ -97,7 +97,7 @@
   return e1.path() < e2.path();
 }
 
-void endpoint::init(const char* path, std::size_t path_length)
+void endpoint::init(const char* path_name, std::size_t path_length)
 {
   if (path_length > sizeof(data_.local.sun_path) - 1)
   {
@@ -109,7 +109,7 @@
   using namespace std; // For memcpy.
   data_.local = boost::asio::detail::sockaddr_un_type();
   data_.local.sun_family = AF_UNIX;
- memcpy(data_.local.sun_path, path, path_length);
+ memcpy(data_.local.sun_path, path_name, path_length);
   path_length_ = path_length;
 
   // NUL-terminate normal path names. Names that start with a NUL are in the

Modified: trunk/boost/asio/posix/basic_descriptor.hpp
==============================================================================
--- trunk/boost/asio/posix/basic_descriptor.hpp (original)
+++ trunk/boost/asio/posix/basic_descriptor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -46,8 +46,12 @@
     public descriptor_base
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// descriptor.
+ typedef typename DescriptorService::native_handle_type native_type;
+
   /// The native representation of a descriptor.
- typedef typename DescriptorService::native_type native_type;
+ typedef typename DescriptorService::native_handle_type native_handle_type;
 
   /// A basic_descriptor is always the lowest layer.
   typedef basic_descriptor<DescriptorService> lowest_layer_type;
@@ -79,7 +83,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_descriptor(boost::asio::io_service& io_service,
- const native_type& native_descriptor)
+ const native_handle_type& native_descriptor)
     : basic_io_object<DescriptorService>(io_service)
   {
     boost::system::error_code ec;
@@ -123,7 +127,7 @@
    *
    * @throws boost::system::system_error Thrown on failure.
    */
- void assign(const native_type& native_descriptor)
+ void assign(const native_handle_type& native_descriptor)
   {
     boost::system::error_code ec;
     this->service.assign(this->implementation, native_descriptor, ec);
@@ -138,7 +142,7 @@
    *
    * @param ec Set to indicate what error occurred, if any.
    */
- boost::system::error_code assign(const native_type& native_descriptor,
+ boost::system::error_code assign(const native_handle_type& native_descriptor,
       boost::system::error_code& ec)
   {
     return this->service.assign(this->implementation, native_descriptor, ec);
@@ -178,7 +182,8 @@
     return this->service.close(this->implementation, ec);
   }
 
- /// Get the native descriptor representation.
+ /// (Deprecated: Use native_handle().) Get the native descriptor
+ /// representation.
   /**
    * This function may be used to obtain the underlying representation of the
    * descriptor. This is intended to allow access to native descriptor
@@ -186,7 +191,33 @@
    */
   native_type native()
   {
- return this->service.native(this->implementation);
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Get the native descriptor representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * descriptor. This is intended to allow access to native descriptor
+ * functionality that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Release ownership of the native descriptor implementation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * descriptor. After calling this function, @c is_open() returns false. The
+ * caller is responsible for closing the descriptor.
+ *
+ * All outstanding asynchronous read or write operations will finish
+ * immediately, and the handlers for cancelled operations will be passed the
+ * boost::asio::error::operation_aborted error.
+ */
+ native_handle_type release()
+ {
+ return this->service.release(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the descriptor.
@@ -281,6 +312,123 @@
     return this->service.io_control(this->implementation, command, ec);
   }
 
+ /// Gets the non-blocking mode of the descriptor.
+ /**
+ * @returns @c true if the descriptor's synchronous operations will fail with
+ * boost::asio::error::would_block if they are unable to perform the requested
+ * operation immediately. If @c false, synchronous operations will block
+ * until complete.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ bool non_blocking() const
+ {
+ return this->service.non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the descriptor.
+ /**
+ * @param mode If @c true, the descriptor's synchronous operations will fail
+ * with boost::asio::error::would_block if they are unable to perform the
+ * requested operation immediately. If @c false, synchronous operations will
+ * block until complete.
+ *
+ * @throws boost::system::system_error Thrown on failure.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ void non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the descriptor.
+ /**
+ * @param mode If @c true, the descriptor's synchronous operations will fail
+ * with boost::asio::error::would_block if they are unable to perform the
+ * requested operation immediately. If @c false, synchronous operations will
+ * block until complete.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @note The non-blocking mode has no effect on the behaviour of asynchronous
+ * operations. Asynchronous operations will never fail with the error
+ * boost::asio::error::would_block.
+ */
+ boost::system::error_code non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.non_blocking(this->implementation, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native descriptor implementation.
+ /**
+ * This function is used to retrieve the non-blocking mode of the underlying
+ * native descriptor. This mode has no effect on the behaviour of the
+ * descriptor object's synchronous operations.
+ *
+ * @returns @c true if the underlying descriptor is in non-blocking mode and
+ * direct system calls may fail with boost::asio::error::would_block (or the
+ * equivalent system error).
+ *
+ * @note The current non-blocking mode is cached by the descriptor object.
+ * Consequently, the return value may be incorrect if the non-blocking mode
+ * was set directly on the native descriptor.
+ */
+ bool native_non_blocking() const
+ {
+ return this->service.native_non_blocking(this->implementation);
+ }
+
+ /// Sets the non-blocking mode of the native descriptor implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native descriptor. It has no effect on the behaviour of the descriptor
+ * object's synchronous operations.
+ *
+ * @param mode If @c true, the underlying descriptor is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @throws boost::system::system_error Thrown on failure. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ */
+ void native_non_blocking(bool mode)
+ {
+ boost::system::error_code ec;
+ this->service.native_non_blocking(this->implementation, mode, ec);
+ boost::asio::detail::throw_error(ec);
+ }
+
+ /// Sets the non-blocking mode of the native descriptor implementation.
+ /**
+ * This function is used to modify the non-blocking mode of the underlying
+ * native descriptor. It has no effect on the behaviour of the descriptor
+ * object's synchronous operations.
+ *
+ * @param mode If @c true, the underlying descriptor is put into non-blocking
+ * mode and direct system calls may fail with boost::asio::error::would_block
+ * (or the equivalent system error).
+ *
+ * @param ec Set to indicate what error occurred, if any. If the @c mode is
+ * @c false, but the current value of @c non_blocking() is @c true, this
+ * function fails with boost::asio::error::invalid_argument, as the
+ * combination does not make sense.
+ */
+ boost::system::error_code native_non_blocking(
+ bool mode, boost::system::error_code& ec)
+ {
+ return this->service.native_non_blocking(this->implementation, mode, ec);
+ }
+
 protected:
   /// Protected destructor to prevent deletion through this type.
   ~basic_descriptor()

Modified: trunk/boost/asio/posix/basic_stream_descriptor.hpp
==============================================================================
--- trunk/boost/asio/posix/basic_stream_descriptor.hpp (original)
+++ trunk/boost/asio/posix/basic_stream_descriptor.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -21,6 +21,7 @@
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/posix/basic_descriptor.hpp>
@@ -49,8 +50,13 @@
   : public basic_descriptor<StreamDescriptorService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// descriptor.
+ typedef typename StreamDescriptorService::native_handle_type native_type;
+
   /// The native representation of a descriptor.
- typedef typename StreamDescriptorService::native_type native_type;
+ typedef typename StreamDescriptorService::native_handle_type
+ native_handle_type;
 
   /// Construct a basic_stream_descriptor without opening it.
   /**
@@ -81,7 +87,7 @@
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_stream_descriptor(boost::asio::io_service& io_service,
- const native_type& native_descriptor)
+ const native_handle_type& native_descriptor)
     : basic_descriptor<StreamDescriptorService>(io_service, native_descriptor)
   {
   }
@@ -184,7 +190,12 @@
   void async_write_some(const ConstBufferSequence& buffers,
       WriteHandler handler)
   {
- this->service.async_write_some(this->implementation, buffers, 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->service.async_write_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Read some data from the descriptor.
@@ -288,7 +299,12 @@
   void async_read_some(const MutableBufferSequence& buffers,
       ReadHandler handler)
   {
- this->service.async_read_some(this->implementation, buffers, 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->service.async_read_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/posix/descriptor_base.hpp
==============================================================================
--- trunk/boost/asio/posix/descriptor_base.hpp (original)
+++ trunk/boost/asio/posix/descriptor_base.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -35,7 +35,8 @@
 class descriptor_base
 {
 public:
- /// IO control command to set the blocking mode of the descriptor.
+ /// (Deprecated: Use non_blocking().) IO control command to set the blocking
+ /// mode of the descriptor.
   /**
    * Implements the FIONBIO IO control command.
    *

Modified: trunk/boost/asio/posix/stream_descriptor_service.hpp
==============================================================================
--- trunk/boost/asio/posix/stream_descriptor_service.hpp (original)
+++ trunk/boost/asio/posix/stream_descriptor_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -57,11 +57,18 @@
   typedef service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native descriptor type.
+ /// (Deprecated: Use native_handle_type.) The native descriptor type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef service_impl_type::native_type native_type;
+ typedef service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native descriptor type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new stream descriptor service for the specified io_service.
@@ -71,7 +78,7 @@
   {
   }
 
- /// Destroy all user-defined descriptorr objects owned by the service.
+ /// Destroy all user-defined handler objects owned by the service.
   void shutdown_service()
   {
     service_impl_.shutdown_service();
@@ -91,7 +98,8 @@
 
   /// Assign an existing native descriptor to a stream descriptor.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_descriptor, boost::system::error_code& ec)
+ const native_handle_type& native_descriptor,
+ boost::system::error_code& ec)
   {
     return service_impl_.assign(impl, native_descriptor, ec);
   }
@@ -109,10 +117,23 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native descriptor implementation.
+ /// (Deprecated: Use native_handle().) Get the native descriptor
+ /// implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native descriptor implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Release ownership of the native descriptor implementation.
+ native_handle_type release(implementation_type& impl)
+ {
+ return service_impl_.release(impl);
   }
 
   /// Cancel all asynchronous operations associated with the descriptor.
@@ -130,6 +151,32 @@
     return service_impl_.io_control(impl, command, ec);
   }
 
+ /// Gets the non-blocking mode of the descriptor.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the descriptor.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native descriptor implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native descriptor implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
   /// Write the given data to the stream.
   template <typename ConstBufferSequence>
   std::size_t write_some(implementation_type& impl,
@@ -141,9 +188,9 @@
   /// Start an asynchronous write.
   template <typename ConstBufferSequence, typename WriteHandler>
   void async_write_some(implementation_type& impl,
- const ConstBufferSequence& buffers, WriteHandler descriptorr)
+ const ConstBufferSequence& buffers, WriteHandler handler)
   {
- service_impl_.async_write_some(impl, buffers, descriptorr);
+ service_impl_.async_write_some(impl, buffers, handler);
   }
 
   /// Read some data from the stream.
@@ -157,9 +204,9 @@
   /// Start an asynchronous read.
   template <typename MutableBufferSequence, typename ReadHandler>
   void async_read_some(implementation_type& impl,
- const MutableBufferSequence& buffers, ReadHandler descriptorr)
+ const MutableBufferSequence& buffers, ReadHandler handler)
   {
- service_impl_.async_read_some(impl, buffers, descriptorr);
+ service_impl_.async_read_some(impl, buffers, handler);
   }
 
 private:

Modified: trunk/boost/asio/raw_socket_service.hpp
==============================================================================
--- trunk/boost/asio/raw_socket_service.hpp (original)
+++ trunk/boost/asio/raw_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,11 +68,18 @@
   typedef typename service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native socket type.
+ /// (Deprecated: Use native_handle_type.) The native socket type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef typename service_impl_type::native_type native_type;
+ typedef typename service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native socket type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new raw socket service for the specified io_service.
@@ -114,7 +121,7 @@
 
   /// Assign an existing native socket to a raw socket.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     return service_impl_.assign(impl, protocol, native_socket, ec);
@@ -133,10 +140,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native socket implementation.
+ /// (Deprecated: Use native_handle().) Get the native socket implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native socket implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -206,6 +219,32 @@
     return service_impl_.io_control(impl, command, ec);
   }
 
+ /// Gets the non-blocking mode of the socket.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
   /// Get the local endpoint.
   endpoint_type local_endpoint(const implementation_type& impl,
       boost::system::error_code& ec) const

Modified: trunk/boost/asio/read.hpp
==============================================================================
--- trunk/boost/asio/read.hpp (original)
+++ trunk/boost/asio/read.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -80,6 +80,46 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the stream's
+ * read_some function.
+ *
+ * @param s The stream from which the data is to be read. The type must support
+ * the SyncReadStream concept.
+ *
+ * @param buffers One or more buffers into which the data will be read. The sum
+ * of the buffer sizes indicates the maximum number of bytes to read from the
+ * stream.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code boost::asio::read(s, boost::asio::buffer(data, size), ec); @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::read(
+ * s, buffers,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncReadStream, typename MutableBufferSequence>
+std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
+ boost::system::error_code& ec);
+
+/// Attempt to read a certain amount of data from a stream before returning.
+/**
+ * This function is used to read a certain number of bytes of data from a
+ * stream. The call will block until one of the following conditions is true:
+ *
+ * @li The supplied buffers are full. That is, the bytes transferred is equal to
+ * the sum of the buffer sizes.
+ *
  * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's
@@ -201,6 +241,34 @@
  * This function is used to read a certain number of bytes of data from a
  * stream. The call will block until one of the following conditions is true:
  *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the stream's
+ * read_some function.
+ *
+ * @param s The stream from which the data is to be read. The type must support
+ * the SyncReadStream concept.
+ *
+ * @param b The basic_streambuf object into which the data will be read.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::read(
+ * s, b,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncReadStream, typename Allocator>
+std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec);
+
+/// Attempt to read a certain amount of data from a stream before returning.
+/**
+ * This function is used to read a certain number of bytes of data from a
+ * stream. The call will block until one of the following conditions is true:
+ *
  * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the stream's

Modified: trunk/boost/asio/read_at.hpp
==============================================================================
--- trunk/boost/asio/read_at.hpp (original)
+++ trunk/boost/asio/read_at.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -88,6 +88,52 @@
  * @li The supplied buffers are full. That is, the bytes transferred is equal to
  * the sum of the buffer sizes.
  *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the device's
+ * read_some_at function.
+ *
+ * @param d The device from which the data is to be read. The type must support
+ * the SyncRandomAccessReadDevice concept.
+ *
+ * @param offset The offset at which the data will be read.
+ *
+ * @param buffers One or more buffers into which the data will be read. The sum
+ * of the buffer sizes indicates the maximum number of bytes to read from the
+ * device.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @par Example
+ * To read into a single data buffer use the @ref buffer function as follows:
+ * @code boost::asio::read_at(d, 42,
+ * boost::asio::buffer(data, size), ec); @endcode
+ * See the @ref buffer documentation for information on reading into multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::read_at(
+ * d, 42, buffers,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncRandomAccessReadDevice, typename MutableBufferSequence>
+std::size_t read_at(SyncRandomAccessReadDevice& d,
+ boost::uint64_t offset, const MutableBufferSequence& buffers,
+ boost::system::error_code& ec);
+
+/// Attempt to read a certain amount of data at the specified offset before
+/// returning.
+/**
+ * This function is used to read a certain number of bytes of data from a
+ * random access device at the specified offset. The call will block until one
+ * of the following conditions is true:
+ *
+ * @li The supplied buffers are full. That is, the bytes transferred is equal to
+ * the sum of the buffer sizes.
+ *
  * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's
@@ -224,6 +270,39 @@
  * random access device at the specified offset. The call will block until one
  * of the following conditions is true:
  *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the device's
+ * read_some_at function.
+ *
+ * @param d The device from which the data is to be read. The type must support
+ * the SyncRandomAccessReadDevice concept.
+ *
+ * @param offset The offset at which the data will be read.
+ *
+ * @param b The basic_streambuf object into which the data will be read.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::read_at(
+ * d, 42, b,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncRandomAccessReadDevice, typename Allocator>
+std::size_t read_at(SyncRandomAccessReadDevice& d,
+ boost::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
+/// returning.
+/**
+ * This function is used to read a certain number of bytes of data from a
+ * random access device at the specified offset. The call will block until one
+ * of the following conditions is true:
+ *
  * @li The completion_condition function object returns 0.
  *
  * This operation is implemented in terms of zero or more calls to the device's

Added: trunk/boost/asio/seq_packet_socket_service.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/seq_packet_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,319 @@
+//
+// seq_packet_socket_service.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_SEQ_PACKET_SOCKET_SERVICE_HPP
+#define BOOST_ASIO_SEQ_PACKET_SOCKET_SERVICE_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/error.hpp>
+#include <boost/asio/io_service.hpp>
+
+#if defined(BOOST_ASIO_HAS_IOCP)
+# include <boost/asio/detail/win_iocp_socket_service.hpp>
+#else
+# include <boost/asio/detail/reactive_socket_service.hpp>
+#endif
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+
+/// Default service implementation for a sequenced packet socket.
+template <typename Protocol>
+class seq_packet_socket_service
+#if defined(GENERATING_DOCUMENTATION)
+ : public boost::asio::io_service::service
+#else
+ : public boost::asio::detail::service_base<
+ seq_packet_socket_service<Protocol> >
+#endif
+{
+public:
+#if defined(GENERATING_DOCUMENTATION)
+ /// The unique service identifier.
+ static boost::asio::io_service::id id;
+#endif
+
+ /// The protocol type.
+ typedef Protocol protocol_type;
+
+ /// The endpoint type.
+ typedef typename Protocol::endpoint endpoint_type;
+
+private:
+ // The type of the platform-specific implementation.
+#if defined(BOOST_ASIO_HAS_IOCP)
+ typedef detail::win_iocp_socket_service<Protocol> service_impl_type;
+#else
+ typedef detail::reactive_socket_service<Protocol> service_impl_type;
+#endif
+
+public:
+ /// The type of a sequenced packet socket implementation.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined implementation_type;
+#else
+ typedef typename service_impl_type::implementation_type implementation_type;
+#endif
+
+ /// (Deprecated: Use native_handle_type.) The native socket type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native socket type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_handle_type;
+#endif
+
+ /// Construct a new sequenced packet socket service for the specified
+ /// io_service.
+ explicit seq_packet_socket_service(boost::asio::io_service& io_service)
+ : boost::asio::detail::service_base<
+ seq_packet_socket_service<Protocol> >(io_service),
+ service_impl_(io_service)
+ {
+ }
+
+ /// Destroy all user-defined handler objects owned by the service.
+ void shutdown_service()
+ {
+ service_impl_.shutdown_service();
+ }
+
+ /// Construct a new sequenced packet socket implementation.
+ void construct(implementation_type& impl)
+ {
+ service_impl_.construct(impl);
+ }
+
+ /// Destroy a sequenced packet socket implementation.
+ void destroy(implementation_type& impl)
+ {
+ service_impl_.destroy(impl);
+ }
+
+ /// Open a sequenced packet socket.
+ boost::system::error_code open(implementation_type& impl,
+ const protocol_type& protocol, boost::system::error_code& ec)
+ {
+ if (protocol.type() == SOCK_SEQPACKET)
+ service_impl_.open(impl, protocol, ec);
+ else
+ ec = boost::asio::error::invalid_argument;
+ return ec;
+ }
+
+ /// Assign an existing native socket to a sequenced packet socket.
+ boost::system::error_code assign(implementation_type& impl,
+ const protocol_type& protocol, const native_handle_type& native_socket,
+ boost::system::error_code& ec)
+ {
+ return service_impl_.assign(impl, protocol, native_socket, ec);
+ }
+
+ /// Determine whether the socket is open.
+ bool is_open(const implementation_type& impl) const
+ {
+ return service_impl_.is_open(impl);
+ }
+
+ /// Close a sequenced packet socket implementation.
+ boost::system::error_code close(implementation_type& impl,
+ boost::system::error_code& ec)
+ {
+ return service_impl_.close(impl, ec);
+ }
+
+ /// (Deprecated: Use native_handle().) Get the native socket implementation.
+ native_type native(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native socket implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Cancel all asynchronous operations associated with the socket.
+ boost::system::error_code cancel(implementation_type& impl,
+ boost::system::error_code& ec)
+ {
+ return service_impl_.cancel(impl, ec);
+ }
+
+ /// Determine whether the socket is at the out-of-band data mark.
+ bool at_mark(const implementation_type& impl,
+ boost::system::error_code& ec) const
+ {
+ return service_impl_.at_mark(impl, ec);
+ }
+
+ /// Determine the number of bytes available for reading.
+ std::size_t available(const implementation_type& impl,
+ boost::system::error_code& ec) const
+ {
+ return service_impl_.available(impl, ec);
+ }
+
+ /// Bind the sequenced packet socket to the specified local endpoint.
+ boost::system::error_code bind(implementation_type& impl,
+ const endpoint_type& endpoint, boost::system::error_code& ec)
+ {
+ return service_impl_.bind(impl, endpoint, ec);
+ }
+
+ /// Connect the sequenced packet socket to the specified endpoint.
+ boost::system::error_code connect(implementation_type& impl,
+ const endpoint_type& peer_endpoint, boost::system::error_code& ec)
+ {
+ return service_impl_.connect(impl, peer_endpoint, ec);
+ }
+
+ /// Start an asynchronous connect.
+ template <typename ConnectHandler>
+ void async_connect(implementation_type& impl,
+ const endpoint_type& peer_endpoint, ConnectHandler handler)
+ {
+ service_impl_.async_connect(impl, peer_endpoint, handler);
+ }
+
+ /// Set a socket option.
+ template <typename SettableSocketOption>
+ boost::system::error_code set_option(implementation_type& impl,
+ const SettableSocketOption& option, boost::system::error_code& ec)
+ {
+ return service_impl_.set_option(impl, option, ec);
+ }
+
+ /// Get a socket option.
+ template <typename GettableSocketOption>
+ boost::system::error_code get_option(const implementation_type& impl,
+ GettableSocketOption& option, boost::system::error_code& ec) const
+ {
+ return service_impl_.get_option(impl, option, ec);
+ }
+
+ /// Perform an IO control command on the socket.
+ template <typename IoControlCommand>
+ boost::system::error_code io_control(implementation_type& impl,
+ IoControlCommand& command, boost::system::error_code& ec)
+ {
+ return service_impl_.io_control(impl, command, ec);
+ }
+
+ /// Gets the non-blocking mode of the socket.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
+ /// Get the local endpoint.
+ endpoint_type local_endpoint(const implementation_type& impl,
+ boost::system::error_code& ec) const
+ {
+ return service_impl_.local_endpoint(impl, ec);
+ }
+
+ /// Get the remote endpoint.
+ endpoint_type remote_endpoint(const implementation_type& impl,
+ boost::system::error_code& ec) const
+ {
+ return service_impl_.remote_endpoint(impl, ec);
+ }
+
+ /// Disable sends or receives on the socket.
+ boost::system::error_code shutdown(implementation_type& impl,
+ socket_base::shutdown_type what, boost::system::error_code& ec)
+ {
+ return service_impl_.shutdown(impl, what, ec);
+ }
+
+ /// Send the given data to the peer.
+ template <typename ConstBufferSequence>
+ std::size_t send(implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, boost::system::error_code& ec)
+ {
+ return service_impl_.send(impl, buffers, flags, ec);
+ }
+
+ /// Start an asynchronous send.
+ template <typename ConstBufferSequence, typename WriteHandler>
+ void async_send(implementation_type& impl,
+ const ConstBufferSequence& buffers,
+ socket_base::message_flags flags, WriteHandler handler)
+ {
+ service_impl_.async_send(impl, buffers, flags, handler);
+ }
+
+ /// Receive some data from the peer.
+ template <typename MutableBufferSequence>
+ std::size_t receive(implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, boost::system::error_code& ec)
+ {
+ return service_impl_.receive_with_flags(impl,
+ buffers, in_flags, out_flags, ec);
+ }
+
+ /// Start an asynchronous receive.
+ template <typename MutableBufferSequence, typename ReadHandler>
+ void async_receive(implementation_type& impl,
+ const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
+ socket_base::message_flags& out_flags, ReadHandler handler)
+ {
+ service_impl_.async_receive_with_flags(impl,
+ buffers, in_flags, out_flags, handler);
+ }
+
+private:
+ // The platform-specific implementation.
+ service_impl_type service_impl_;
+};
+
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_SEQ_PACKET_SOCKET_SERVICE_HPP

Modified: trunk/boost/asio/serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/serial_port_service.hpp (original)
+++ trunk/boost/asio/serial_port_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -63,11 +63,18 @@
   typedef service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native handle type.
+ /// (Deprecated: Use native_handle_type.) The native handle type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef service_impl_type::native_type native_type;
+ typedef service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native handle type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new serial port service for the specified io_service.
@@ -104,9 +111,9 @@
 
   /// Assign an existing native handle to a serial port.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec)
+ const native_handle_type& handle, boost::system::error_code& ec)
   {
- return service_impl_.assign(impl, native_handle, ec);
+ return service_impl_.assign(impl, handle, ec);
   }
 
   /// Determine whether the handle is open.
@@ -122,10 +129,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native handle implementation.
+ /// (Deprecated: Use native_handle().) Get the native handle implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native handle implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the handle.

Modified: trunk/boost/asio/socket_acceptor_service.hpp
==============================================================================
--- trunk/boost/asio/socket_acceptor_service.hpp (original)
+++ trunk/boost/asio/socket_acceptor_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,11 +68,18 @@
   typedef typename service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native acceptor type.
+ /// (Deprecated: Use native_handle_type.) The native acceptor type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef typename service_impl_type::native_type native_type;
+ typedef typename service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native acceptor type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new socket acceptor service for the specified io_service.
@@ -110,7 +117,7 @@
 
   /// Assign an existing native acceptor to a socket acceptor.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_acceptor,
+ const protocol_type& protocol, const native_handle_type& native_acceptor,
       boost::system::error_code& ec)
   {
     return service_impl_.assign(impl, protocol, native_acceptor, ec);
@@ -151,10 +158,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native acceptor implementation.
+ /// (Deprecated: Use native_handle().) Get the native acceptor implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native acceptor implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Set a socket option.
@@ -181,6 +194,32 @@
     return service_impl_.io_control(impl, command, ec);
   }
 
+ /// Gets the non-blocking mode of the acceptor.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the acceptor.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native acceptor implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native acceptor implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
   /// Get the local endpoint.
   endpoint_type local_endpoint(const implementation_type& impl,
       boost::system::error_code& ec) const

Modified: trunk/boost/asio/socket_base.hpp
==============================================================================
--- trunk/boost/asio/socket_base.hpp (original)
+++ trunk/boost/asio/socket_base.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -63,6 +63,9 @@
 
   /// Specify that the data should not be subject to routing.
   static const int message_do_not_route = implementation_defined;
+
+ /// Specifies that the data marks the end of a record.
+ static const int message_end_of_record = implementation_defined;
 #else
   BOOST_STATIC_CONSTANT(int,
       message_peek = boost::asio::detail::message_peek);
@@ -70,6 +73,8 @@
       message_out_of_band = boost::asio::detail::message_out_of_band);
   BOOST_STATIC_CONSTANT(int,
       message_do_not_route = boost::asio::detail::message_do_not_route);
+ BOOST_STATIC_CONSTANT(int,
+ message_end_of_record = boost::asio::detail::message_end_of_record);
 #endif
 
   /// Socket option to permit sending of broadcast messages.
@@ -442,7 +447,8 @@
     enable_connection_aborted;
 #endif
 
- /// IO control command to set the blocking mode of the socket.
+ /// (Deprecated: Use non_blocking().) IO control command to
+ /// set the blocking mode of the socket.
   /**
    * Implements the FIONBIO IO control command.
    *

Modified: trunk/boost/asio/ssl.hpp
==============================================================================
--- trunk/boost/asio/ssl.hpp (original)
+++ trunk/boost/asio/ssl.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -19,6 +19,7 @@
 #include <boost/asio/ssl/context.hpp>
 #include <boost/asio/ssl/context_base.hpp>
 #include <boost/asio/ssl/context_service.hpp>
+#include <boost/asio/ssl/error.hpp>
 #include <boost/asio/ssl/stream.hpp>
 #include <boost/asio/ssl/stream_base.hpp>
 #include <boost/asio/ssl/stream_service.hpp>

Modified: trunk/boost/asio/ssl/detail/openssl_operation.hpp
==============================================================================
--- trunk/boost/asio/ssl/detail/openssl_operation.hpp (original)
+++ trunk/boost/asio/ssl/detail/openssl_operation.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,6 +23,7 @@
 #include <boost/asio/detail/socket_ops.hpp>
 #include <boost/asio/placeholders.hpp>
 #include <boost/asio/ssl/detail/openssl_types.hpp>
+#include <boost/asio/ssl/error.hpp>
 #include <boost/asio/strand.hpp>
 #include <boost/system/system_error.hpp>
 #include <boost/asio/write.hpp>

Added: trunk/boost/asio/ssl/error.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/ssl/error.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,72 @@
+//
+// ssl/error.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_SSL_ERROR_HPP
+#define BOOST_ASIO_SSL_ERROR_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/system/error_code.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace error {
+
+enum ssl_errors
+{
+};
+
+extern BOOST_ASIO_DECL
+const boost::system::error_category& get_ssl_category();
+
+static const boost::system::error_category& ssl_category
+ = boost::asio::error::get_ssl_category();
+
+} // namespace error
+} // namespace asio
+} // namespace boost
+
+namespace boost {
+namespace system {
+
+template<> struct is_error_code_enum<boost::asio::error::ssl_errors>
+{
+ static const bool value = true;
+};
+
+} // namespace system
+} // namespace boost
+
+namespace boost {
+namespace asio {
+namespace error {
+
+inline boost::system::error_code make_error_code(ssl_errors e)
+{
+ return boost::system::error_code(
+ static_cast<int>(e), get_ssl_category());
+}
+
+} // namespace error
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# include <boost/asio/ssl/impl/error.ipp>
+#endif // defined(BOOST_ASIO_HEADER_ONLY)
+
+#endif // BOOST_ASIO_SSL_ERROR_HPP

Added: trunk/boost/asio/ssl/impl/error.ipp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/ssl/impl/error.ipp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,59 @@
+//
+// ssl/impl/error.ipp
+// ~~~~~~~~~~~~~~~~~~
+//
+// 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_SSL_IMPL_ERROR_IPP
+#define BOOST_ASIO_SSL_IMPL_ERROR_IPP
+
+#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/ssl/error.hpp>
+#include <boost/asio/ssl/detail/openssl_init.hpp>
+
+#include <boost/asio/detail/push_options.hpp>
+
+namespace boost {
+namespace asio {
+namespace error {
+
+namespace detail {
+
+class ssl_category : public boost::system::error_category
+{
+public:
+ const char* name() const
+ {
+ return "asio.ssl";
+ }
+
+ std::string message(int value) const
+ {
+ const char* s = ::ERR_reason_error_string(value);
+ return s ? s : "asio.ssl error";
+ }
+};
+
+} // namespace detail
+
+const boost::system::error_category& get_ssl_category()
+{
+ static detail::ssl_category instance;
+ return instance;
+}
+
+} // namespace error
+} // namespace asio
+} // namespace boost
+
+#include <boost/asio/detail/pop_options.hpp>
+
+#endif // BOOST_ASIO_SSL_IMPL_ERROR_IPP

Added: trunk/boost/asio/ssl/impl/src.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/asio/ssl/impl/src.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,24 @@
+//
+// impl/ssl/src.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_IMPL_SRC_HPP
+#define BOOST_ASIO_IMPL_SRC_HPP
+
+#define BOOST_ASIO_SOURCE
+
+#include <boost/asio/detail/config.hpp>
+
+#if defined(BOOST_ASIO_HEADER_ONLY)
+# error Do not compile Asio library source with BOOST_ASIO_HEADER_ONLY defined
+#endif
+
+#include <boost/asio/ssl/impl/error.ipp>
+
+#endif // BOOST_ASIO_IMPL_SRC_HPP

Modified: trunk/boost/asio/ssl/stream.hpp
==============================================================================
--- trunk/boost/asio/ssl/stream.hpp (original)
+++ trunk/boost/asio/ssl/stream.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -94,20 +94,6 @@
     service_.destroy(impl_, next_layer_);
   }
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the object.
- /**
- * This function may be used to obtain the io_service object that the stream
- * uses to dispatch handlers for asynchronous operations.
- *
- * @return A reference to the io_service object that stream will use to
- * dispatch handlers. Ownership is not transferred to the caller.
- */
- boost::asio::io_service& io_service()
- {
- return next_layer_.get_io_service();
- }
-
   /// Get the io_service associated with the object.
   /**
    * This function may be used to obtain the io_service object that the stream

Modified: trunk/boost/asio/strand.hpp
==============================================================================
--- trunk/boost/asio/strand.hpp (original)
+++ trunk/boost/asio/strand.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,6 +16,7 @@
 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
 
 #include <boost/asio/detail/config.hpp>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/strand_service.hpp>
 #include <boost/asio/detail/wrapped_handler.hpp>
 #include <boost/asio/io_service.hpp>
@@ -107,20 +108,6 @@
     service_.destroy(impl_);
   }
 
- /// (Deprecated: use get_io_service().) Get the io_service associated with
- /// the strand.
- /**
- * This function may be used to obtain the io_service object that the strand
- * uses to dispatch handlers for asynchronous operations.
- *
- * @return A reference to the io_service object that the strand will use to
- * dispatch handlers. Ownership is not transferred to the caller.
- */
- boost::asio::io_service& io_service()
- {
- return service_.get_io_service();
- }
-
   /// Get the io_service associated with the strand.
   /**
    * This function may be used to obtain the io_service object that the strand
@@ -153,9 +140,13 @@
    * handler object as required. The function signature of the handler must be:
    * @code void handler(); @endcode
    */
- template <typename Handler>
- void dispatch(Handler handler)
+ template <typename CompletionHandler>
+ void dispatch(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_, handler);
   }
 
@@ -175,9 +166,13 @@
    * handler object as required. The function signature of the handler must be:
    * @code void handler(); @endcode
    */
- template <typename Handler>
- void post(Handler handler)
+ template <typename CompletionHandler>
+ void post(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_, handler);
   }
 

Modified: trunk/boost/asio/stream_socket_service.hpp
==============================================================================
--- trunk/boost/asio/stream_socket_service.hpp (original)
+++ trunk/boost/asio/stream_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -68,11 +68,18 @@
   typedef typename service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native socket type.
+ /// (Deprecated: Use native_handle_type.) The native socket type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef typename service_impl_type::native_type native_type;
+ typedef typename service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native socket type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef typename service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new stream socket service for the specified io_service.
@@ -114,7 +121,7 @@
 
   /// Assign an existing native socket to a stream socket.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     return service_impl_.assign(impl, protocol, native_socket, ec);
@@ -133,10 +140,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native socket implementation.
+ /// (Deprecated: Use native_handle().) Get the native socket implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native socket implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the socket.
@@ -206,6 +219,32 @@
     return service_impl_.io_control(impl, command, ec);
   }
 
+ /// Gets the non-blocking mode of the socket.
+ bool non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the socket.
+ boost::system::error_code non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.non_blocking(impl, mode, ec);
+ }
+
+ /// Gets the non-blocking mode of the native socket implementation.
+ bool native_non_blocking(const implementation_type& impl) const
+ {
+ return service_impl_.native_non_blocking(impl);
+ }
+
+ /// Sets the non-blocking mode of the native socket implementation.
+ boost::system::error_code native_non_blocking(implementation_type& impl,
+ bool mode, boost::system::error_code& ec)
+ {
+ return service_impl_.native_non_blocking(impl, mode, ec);
+ }
+
   /// Get the local endpoint.
   endpoint_type local_endpoint(const implementation_type& impl,
       boost::system::error_code& ec) const

Modified: trunk/boost/asio/version.hpp
==============================================================================
--- trunk/boost/asio/version.hpp (original)
+++ trunk/boost/asio/version.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -18,6 +18,6 @@
 // BOOST_ASIO_VERSION % 100 is the sub-minor version
 // BOOST_ASIO_VERSION / 100 % 1000 is the minor version
 // BOOST_ASIO_VERSION / 100000 is the major version
-#define BOOST_ASIO_VERSION 100408 // 1.4.8
+#define BOOST_ASIO_VERSION 100500 // 1.5.0
 
 #endif // BOOST_ASIO_VERSION_HPP

Modified: trunk/boost/asio/windows/basic_handle.hpp
==============================================================================
--- trunk/boost/asio/windows/basic_handle.hpp (original)
+++ trunk/boost/asio/windows/basic_handle.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -45,8 +45,12 @@
   : public basic_io_object<HandleService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// handle.
+ typedef typename HandleService::native_handle_type native_type;
+
   /// The native representation of a handle.
- typedef typename HandleService::native_type native_type;
+ typedef typename HandleService::native_handle_type native_handle_type;
 
   /// A basic_handle is always the lowest layer.
   typedef basic_handle<HandleService> lowest_layer_type;
@@ -70,16 +74,16 @@
    * @param io_service The io_service object that the handle will use to
    * dispatch handlers for any asynchronous operations performed on the handle.
    *
- * @param native_handle A native handle.
+ * @param handle A native handle.
    *
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_handle(boost::asio::io_service& io_service,
- const native_type& native_handle)
+ const native_handle_type& handle)
     : basic_io_object<HandleService>(io_service)
   {
     boost::system::error_code ec;
- this->service.assign(this->implementation, native_handle, ec);
+ this->service.assign(this->implementation, handle, ec);
     boost::asio::detail::throw_error(ec);
   }
 
@@ -115,14 +119,14 @@
   /*
    * This function opens the handle to hold an existing native handle.
    *
- * @param native_handle A native handle.
+ * @param handle A native handle.
    *
    * @throws boost::system::system_error Thrown on failure.
    */
- void assign(const native_type& native_handle)
+ void assign(const native_handle_type& handle)
   {
     boost::system::error_code ec;
- this->service.assign(this->implementation, native_handle, ec);
+ this->service.assign(this->implementation, handle, ec);
     boost::asio::detail::throw_error(ec);
   }
 
@@ -130,14 +134,14 @@
   /*
    * This function opens the handle to hold an existing native handle.
    *
- * @param native_handle A native handle.
+ * @param handle A native handle.
    *
    * @param ec Set to indicate what error occurred, if any.
    */
- boost::system::error_code assign(const native_type& native_handle,
+ boost::system::error_code assign(const native_handle_type& handle,
       boost::system::error_code& ec)
   {
- return this->service.assign(this->implementation, native_handle, ec);
+ return this->service.assign(this->implementation, handle, ec);
   }
 
   /// Determine whether the handle is open.
@@ -174,7 +178,7 @@
     return this->service.close(this->implementation, ec);
   }
 
- /// Get the native handle representation.
+ /// (Deprecated: Use native_handle().) Get the native handle representation.
   /**
    * This function may be used to obtain the underlying representation of the
    * handle. This is intended to allow access to native handle functionality
@@ -182,7 +186,18 @@
    */
   native_type native()
   {
- return this->service.native(this->implementation);
+ return this->service.native_handle(this->implementation);
+ }
+
+ /// Get the native handle representation.
+ /**
+ * This function may be used to obtain the underlying representation of the
+ * handle. This is intended to allow access to native handle functionality
+ * that is not otherwise provided.
+ */
+ native_handle_type native_handle()
+ {
+ return this->service.native_handle(this->implementation);
   }
 
   /// Cancel all asynchronous operations associated with the handle.

Modified: trunk/boost/asio/windows/basic_random_access_handle.hpp
==============================================================================
--- trunk/boost/asio/windows/basic_random_access_handle.hpp (original)
+++ trunk/boost/asio/windows/basic_random_access_handle.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -21,6 +21,7 @@
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
+#include <boost/asio/detail/handler_type_requirements.hpp>
 #include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/windows/basic_handle.hpp>
@@ -46,8 +47,13 @@
   : public basic_handle<RandomAccessHandleService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// handle.
+ typedef typename RandomAccessHandleService::native_handle_type native_type;
+
   /// The native representation of a handle.
- typedef typename RandomAccessHandleService::native_type native_type;
+ typedef typename RandomAccessHandleService::native_handle_type
+ native_handle_type;
 
   /// Construct a basic_random_access_handle without opening it.
   /**
@@ -72,13 +78,13 @@
    * use to dispatch handlers for any asynchronous operations performed on the
    * handle.
    *
- * @param native_handle The new underlying handle implementation.
+ * @param handle The new underlying handle implementation.
    *
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_random_access_handle(boost::asio::io_service& io_service,
- const native_type& native_handle)
- : basic_handle<RandomAccessHandleService>(io_service, native_handle)
+ const native_handle_type& handle)
+ : basic_handle<RandomAccessHandleService>(io_service, handle)
   {
   }
 
@@ -189,8 +195,12 @@
   void async_write_some_at(boost::uint64_t offset,
       const ConstBufferSequence& buffers, WriteHandler handler)
   {
- this->service.async_write_some_at(
- this->implementation, offset, buffers, 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->service.async_write_some_at(this->implementation,
+ offset, buffers, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Read some data from the handle at the specified offset.
@@ -303,8 +313,12 @@
   void async_read_some_at(boost::uint64_t offset,
       const MutableBufferSequence& buffers, ReadHandler handler)
   {
- this->service.async_read_some_at(
- this->implementation, offset, buffers, 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->service.async_read_some_at(this->implementation,
+ offset, buffers, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/windows/basic_stream_handle.hpp
==============================================================================
--- trunk/boost/asio/windows/basic_stream_handle.hpp (original)
+++ trunk/boost/asio/windows/basic_stream_handle.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -21,10 +21,11 @@
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
+#include <boost/asio/detail/handler_type_requirements.hpp>
+#include <boost/asio/detail/throw_error.hpp>
 #include <boost/asio/error.hpp>
 #include <boost/asio/windows/basic_handle.hpp>
 #include <boost/asio/windows/stream_handle_service.hpp>
-#include <boost/asio/detail/throw_error.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
 
@@ -49,8 +50,12 @@
   : public basic_handle<StreamHandleService>
 {
 public:
+ /// (Deprecated: Use native_handle_type.) The native representation of a
+ /// handle.
+ typedef typename StreamHandleService::native_handle_type native_type;
+
   /// The native representation of a handle.
- typedef typename StreamHandleService::native_type native_type;
+ typedef typename StreamHandleService::native_handle_type native_handle_type;
 
   /// Construct a basic_stream_handle without opening it.
   /**
@@ -74,13 +79,13 @@
    * @param io_service The io_service object that the stream handle will use to
    * dispatch handlers for any asynchronous operations performed on the handle.
    *
- * @param native_handle The new underlying handle implementation.
+ * @param handle The new underlying handle implementation.
    *
    * @throws boost::system::system_error Thrown on failure.
    */
   basic_stream_handle(boost::asio::io_service& io_service,
- const native_type& native_handle)
- : basic_handle<StreamHandleService>(io_service, native_handle)
+ const native_handle_type& handle)
+ : basic_handle<StreamHandleService>(io_service, handle)
   {
   }
 
@@ -182,7 +187,12 @@
   void async_write_some(const ConstBufferSequence& buffers,
       WriteHandler handler)
   {
- this->service.async_write_some(this->implementation, buffers, 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->service.async_write_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
   }
 
   /// Read some data from the handle.
@@ -286,7 +296,12 @@
   void async_read_some(const MutableBufferSequence& buffers,
       ReadHandler handler)
   {
- this->service.async_read_some(this->implementation, buffers, 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->service.async_read_some(this->implementation, buffers,
+ BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
   }
 };
 

Modified: trunk/boost/asio/windows/random_access_handle_service.hpp
==============================================================================
--- trunk/boost/asio/windows/random_access_handle_service.hpp (original)
+++ trunk/boost/asio/windows/random_access_handle_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -59,11 +59,18 @@
   typedef service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native handle type.
+ /// (Deprecated: Use native_handle_type.) The native handle type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef service_impl_type::native_type native_type;
+ typedef service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native handle type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new random-access handle service for the specified io_service.
@@ -94,9 +101,9 @@
 
   /// Assign an existing native handle to a random-access handle.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec)
+ const native_handle_type& handle, boost::system::error_code& ec)
   {
- return service_impl_.assign(impl, native_handle, ec);
+ return service_impl_.assign(impl, handle, ec);
   }
 
   /// Determine whether the handle is open.
@@ -112,10 +119,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native handle implementation.
+ /// (Deprecated: Use native_handle().) Get the native handle implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native handle implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the handle.

Modified: trunk/boost/asio/windows/stream_handle_service.hpp
==============================================================================
--- trunk/boost/asio/windows/stream_handle_service.hpp (original)
+++ trunk/boost/asio/windows/stream_handle_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -57,11 +57,18 @@
   typedef service_impl_type::implementation_type implementation_type;
 #endif
 
- /// The native handle type.
+ /// (Deprecated: Use native_handle_type.) The native handle type.
 #if defined(GENERATING_DOCUMENTATION)
   typedef implementation_defined native_type;
 #else
- typedef service_impl_type::native_type native_type;
+ typedef service_impl_type::native_handle_type native_type;
+#endif
+
+ /// The native handle type.
+#if defined(GENERATING_DOCUMENTATION)
+ typedef implementation_defined native_handle_type;
+#else
+ typedef service_impl_type::native_handle_type native_handle_type;
 #endif
 
   /// Construct a new stream handle service for the specified io_service.
@@ -91,9 +98,9 @@
 
   /// Assign an existing native handle to a stream handle.
   boost::system::error_code assign(implementation_type& impl,
- const native_type& native_handle, boost::system::error_code& ec)
+ const native_handle_type& handle, boost::system::error_code& ec)
   {
- return service_impl_.assign(impl, native_handle, ec);
+ return service_impl_.assign(impl, handle, ec);
   }
 
   /// Determine whether the handle is open.
@@ -109,10 +116,16 @@
     return service_impl_.close(impl, ec);
   }
 
- /// Get the native handle implementation.
+ /// (Deprecated: Use native_handle().) Get the native handle implementation.
   native_type native(implementation_type& impl)
   {
- return service_impl_.native(impl);
+ return service_impl_.native_handle(impl);
+ }
+
+ /// Get the native handle implementation.
+ native_handle_type native_handle(implementation_type& impl)
+ {
+ return service_impl_.native_handle(impl);
   }
 
   /// Cancel all asynchronous operations associated with the handle.

Modified: trunk/boost/asio/write.hpp
==============================================================================
--- trunk/boost/asio/write.hpp (original)
+++ trunk/boost/asio/write.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -71,6 +71,46 @@
 template <typename SyncWriteStream, typename ConstBufferSequence>
 std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers);
 
+/// Write all of the supplied data to a stream before returning.
+/**
+ * This function is used to write a certain number of bytes of data to a stream.
+ * The call will block until one of the following conditions is true:
+ *
+ * @li All of the data in the supplied buffers has been written. That is, the
+ * bytes transferred is equal to the sum of the buffer sizes.
+ *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the stream's
+ * write_some function.
+ *
+ * @param s The stream to which the data is to be written. The type must support
+ * the SyncWriteStream concept.
+ *
+ * @param buffers One or more buffers containing the data to be written. The sum
+ * of the buffer sizes indicates the maximum number of bytes to write to the
+ * stream.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code boost::asio::write(s, boost::asio::buffer(data, size), ec); @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::write(
+ * s, buffers,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncWriteStream, typename ConstBufferSequence>
+std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
+ boost::system::error_code& ec);
+
 /// Write a certain amount of data to a stream before returning.
 /**
  * This function is used to write a certain number of bytes of data to a stream.
@@ -197,6 +237,36 @@
 template <typename SyncWriteStream, typename Allocator>
 std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b);
 
+/// Write all of the supplied data to a stream before returning.
+/**
+ * This function is used to write a certain number of bytes of data to a stream.
+ * The call will block until one of the following conditions is true:
+ *
+ * @li All of the data in the supplied basic_streambuf has been written.
+ *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the stream's
+ * write_some function.
+ *
+ * @param s The stream to which the data is to be written. The type must support
+ * the SyncWriteStream concept.
+ *
+ * @param b The basic_streambuf object from which data will be written.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::write(
+ * s, b,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncWriteStream, typename Allocator>
+std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec);
+
 /// Write a certain amount of data to a stream before returning.
 /**
  * This function is used to write a certain number of bytes of data to a stream.

Modified: trunk/boost/asio/write_at.hpp
==============================================================================
--- trunk/boost/asio/write_at.hpp (original)
+++ trunk/boost/asio/write_at.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -76,6 +76,51 @@
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
     boost::uint64_t offset, const ConstBufferSequence& buffers);
 
+/// Write all of the supplied data at the specified offset before returning.
+/**
+ * This function is used to write a certain number of bytes of data to a random
+ * access device at a specified offset. The call will block until one of the
+ * following conditions is true:
+ *
+ * @li All of the data in the supplied buffers has been written. That is, the
+ * bytes transferred is equal to the sum of the buffer sizes.
+ *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the device's
+ * write_some_at function.
+ *
+ * @param d The device to which the data is to be written. The type must support
+ * the SyncRandomAccessWriteDevice concept.
+ *
+ * @param offset The offset at which the data will be written.
+ *
+ * @param buffers One or more buffers containing the data to be written. The sum
+ * of the buffer sizes indicates the maximum number of bytes to write to the
+ * device.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @par Example
+ * To write a single data buffer use the @ref buffer function as follows:
+ * @code boost::asio::write_at(d, 42,
+ * boost::asio::buffer(data, size), ec); @endcode
+ * See the @ref buffer documentation for information on writing multiple
+ * buffers in one go, and how to use it with arrays, boost::array or
+ * std::vector.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::write_at(
+ * d, offset, buffers,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncRandomAccessWriteDevice, typename ConstBufferSequence>
+std::size_t write_at(SyncRandomAccessWriteDevice& d,
+ boost::uint64_t offset, const ConstBufferSequence& buffers,
+ boost::system::error_code& ec);
+
 /// Write a certain amount of data at a specified offset before returning.
 /**
  * This function is used to write a certain number of bytes of data to a random
@@ -214,6 +259,40 @@
 std::size_t write_at(SyncRandomAccessWriteDevice& d,
     boost::uint64_t offset, basic_streambuf<Allocator>& b);
 
+/// Write all of the supplied data at the specified offset before returning.
+/**
+ * This function is used to write a certain number of bytes of data to a random
+ * access device at a specified offset. The call will block until one of the
+ * following conditions is true:
+ *
+ * @li All of the data in the supplied basic_streambuf has been written.
+ *
+ * @li An error occurred.
+ *
+ * This operation is implemented in terms of zero or more calls to the device's
+ * write_some_at function.
+ *
+ * @param d The device to which the data is to be written. The type must support
+ * the SyncRandomAccessWriteDevice concept.
+ *
+ * @param offset The offset at which the data will be written.
+ *
+ * @param b The basic_streambuf object from which data will be written.
+ *
+ * @param ec Set to indicate what error occurred, if any.
+ *
+ * @returns The number of bytes transferred.
+ *
+ * @note This overload is equivalent to calling:
+ * @code boost::asio::write_at(
+ * d, 42, b,
+ * boost::asio::transfer_all(), ec); @endcode
+ */
+template <typename SyncRandomAccessWriteDevice, typename Allocator>
+std::size_t write_at(SyncRandomAccessWriteDevice& d,
+ boost::uint64_t offset, basic_streambuf<Allocator>& b,
+ boost::system::error_code& ec);
+
 /// Write a certain amount of data at a specified offset before returning.
 /**
  * This function is used to write a certain number of bytes of data to a random

Modified: trunk/libs/asio/doc/asio.qbk
==============================================================================
--- trunk/libs/asio/doc/asio.qbk (original)
+++ trunk/libs/asio/doc/asio.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -7,7 +7,7 @@
 
 [library Boost.Asio
     [quickbook 1.4]
- [copyright 2003 - 2010 Christopher M. Kohlhoff]
+ [copyright 2003 - 2011 Christopher M. Kohlhoff]
     [purpose Networking library]
     [license
         Distributed under the Boost Software License, Version 1.0.
@@ -37,9 +37,9 @@
 
 [/=============================================================================]
 
-Boost.Asio is a cross-platform C++ library for network and low-level I/O
-programming that provides developers with a consistent asynchronous model using
-a modern C++ approach.
+Boost.Asio is a cross-platform C++ library for network and low-level I/O programming
+that provides developers with a consistent asynchronous model using a modern
+C++ approach.
 
 [variablelist
   [
@@ -74,8 +74,7 @@
       [link boost_asio.examples Examples]
     ]
     [
- Examples that illustrate the use of Boost.Asio in more complex
- applications.
+ Examples that illustrate the use of Boost.Asio in more complex applications.
     ]
   ]
   [

Modified: trunk/libs/asio/doc/examples.qbk
==============================================================================
--- trunk/libs/asio/doc/examples.qbk (original)
+++ trunk/libs/asio/doc/examples.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -34,8 +34,8 @@
 * [@boost_asio/example/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.
+[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]
 
@@ -182,6 +182,7 @@
 
 * [@boost_asio/example/iostreams/daytime_client.cpp]
 * [@boost_asio/example/iostreams/daytime_server.cpp]
+* [@boost_asio/example/iostreams/http_client.cpp]
 
 
 [heading Multicast]
@@ -231,8 +232,7 @@
 [heading SSL]
 
 Example client and server programs showing the use of the [link
-boost_asio.reference.ssl__stream ssl::stream<>] template with asynchronous
-operations.
+boost_asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations.
 
 * [@boost_asio/example/ssl/client.cpp]
 * [@boost_asio/example/ssl/server.cpp]

Modified: trunk/libs/asio/doc/overview/basics.qbk
==============================================================================
--- trunk/libs/asio/doc/overview/basics.qbk (original)
+++ trunk/libs/asio/doc/overview/basics.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,13 +43,13 @@
 4. The [*operating system] returns the result of the operation to the
 [*io_service].
 
-5. The [*io_service] translates any error resulting from the operation into a
-`boost::system::error_code`. An `error_code` may be compared with specific
-values, or tested as a boolean (where a `false` result means that no error
-occurred). The result is then forwarded back up to the [*I/O object].
+5. The [*io_service] translates any error resulting from the operation into an
+object of type `boost::system::error_code`. An `error_code` may be compared with
+specific values, or tested as a boolean (where a `false` result means that no
+error occurred). The result is then forwarded back up to the [*I/O object].
 
-6. The [*I/O object] throws an exception of type `boost::system::system_error`
-if the operation failed. If the code to initiate the operation had instead been
+6. The [*I/O object] throws an exception of type `boost::system::system_error` if the
+operation failed. If the code to initiate the operation had instead been
 written as:
 
   boost::system::error_code ec;

Modified: trunk/libs/asio/doc/overview/implementation.qbk
==============================================================================
--- trunk/libs/asio/doc/overview/implementation.qbk (original)
+++ trunk/libs/asio/doc/overview/implementation.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -241,6 +241,10 @@
 `io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
 `io_service::poll_one()`.
 
+* An additional thread per `io_service` is used to trigger timers. This thread
+is created on construction of the first `deadline_timer` or
+`deadline_timer_service` objects.
+
 * An additional thread per `io_service` is used for the `select`
 demultiplexing. This thread is created on the first call to `async_connect()`.
 

Modified: trunk/libs/asio/doc/overview/serial_ports.qbk
==============================================================================
--- trunk/libs/asio/doc/overview/serial_ports.qbk (original)
+++ trunk/libs/asio/doc/overview/serial_ports.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -15,12 +15,11 @@
 where name is something like `"COM1"` on Windows, and `"/dev/ttyS0"` on POSIX
 platforms.
 
-Once opened, the serial port may be used as a [link
-boost_asio.overview.core.streams stream]. This means the objects can be used
-with any of the [link boost_asio.reference.read read()], [link
-boost_asio.reference.async_read async_read()], [link boost_asio.reference.write
-write()], [link boost_asio.reference.async_write async_write()], [link
-boost_asio.reference.read_until read_until()] or [link
+Once opened, the serial port may be used as a [link boost_asio.overview.core.streams
+stream]. This means the objects can be used with any of the [link
+boost_asio.reference.read read()], [link boost_asio.reference.async_read async_read()],
+[link boost_asio.reference.write write()], [link boost_asio.reference.async_write
+async_write()], [link boost_asio.reference.read_until read_until()] or [link
 boost_asio.reference.async_read_until async_read_until()] free functions.
 
 The serial port implementation also includes option classes for configuring the

Modified: trunk/libs/asio/doc/overview/ssl.qbk
==============================================================================
--- trunk/libs/asio/doc/overview/ssl.qbk (original)
+++ trunk/libs/asio/doc/overview/ssl.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,9 +41,8 @@
 
 SSL handshaking must be performed prior to transmitting or receiving data over
 an encrypted connection. This is accomplished using the `ssl::stream`
-template's [link boost_asio.reference.ssl__stream.handshake handshake()] or
-[link boost_asio.reference.ssl__stream.async_handshake async_handshake()] member
-functions.
+template's [link boost_asio.reference.ssl__stream.handshake handshake()] or [link
+boost_asio.reference.ssl__stream.async_handshake async_handshake()] member functions.
 
 Once connected, SSL stream objects are used as synchronous or asynchronous read
 and write streams. This means the objects can be used with any of the [link

Modified: trunk/libs/asio/doc/quickref.xml
==============================================================================
--- trunk/libs/asio/doc/quickref.xml (original)
+++ trunk/libs/asio/doc/quickref.xml 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -63,6 +63,9 @@
             <member><link linkend="boost_asio.reference.async_write">async_write</link></member>
             <member><link linkend="boost_asio.reference.async_write_at">async_write_at</link></member>
             <member><link linkend="boost_asio.reference.buffer">buffer</link></member>
+ <member><link linkend="boost_asio.reference.buffer_cast">buffer_cast</link></member>
+ <member><link linkend="boost_asio.reference.buffer_copy">buffer_copy</link></member>
+ <member><link linkend="boost_asio.reference.buffer_size">buffer_size</link></member>
             <member><link linkend="boost_asio.reference.buffers_begin">buffers_begin</link></member>
             <member><link linkend="boost_asio.reference.buffers_end">buffers_end</link></member>
             <member><link linkend="boost_asio.reference.has_service">has_service</link></member>
@@ -71,6 +74,7 @@
             <member><link linkend="boost_asio.reference.read_until">read_until</link></member>
             <member><link linkend="boost_asio.reference.transfer_all">transfer_all</link></member>
             <member><link linkend="boost_asio.reference.transfer_at_least">transfer_at_least</link></member>
+ <member><link linkend="boost_asio.reference.transfer_exactly">transfer_exactly</link></member>
             <member><link linkend="boost_asio.reference.use_service">use_service</link></member>
             <member><link linkend="boost_asio.reference.write">write</link></member>
             <member><link linkend="boost_asio.reference.write_at">write_at</link></member>
@@ -163,6 +167,8 @@
           </simplelist>
           <bridgehead renderas="sect3">Free Functions</bridgehead>
           <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.async_connect">async_connect</link></member>
+ <member><link linkend="boost_asio.reference.connect">connect</link></member>
             <member><link linkend="boost_asio.reference.ip__host_name">ip::host_name</link></member>
           </simplelist>
         </entry>
@@ -171,8 +177,9 @@
           <simplelist type="vert" columns="1">
             <member><link linkend="boost_asio.reference.basic_datagram_socket">basic_datagram_socket</link></member>
             <member><link linkend="boost_asio.reference.basic_deadline_timer">basic_deadline_timer</link></member>
- <member><link linkend="boost_asio.reference.basic_socket">basic_socket</link></member>
             <member><link linkend="boost_asio.reference.basic_raw_socket">basic_raw_socket</link></member>
+ <member><link linkend="boost_asio.reference.basic_seq_packet_socket">basic_seq_packet_socket</link></member>
+ <member><link linkend="boost_asio.reference.basic_socket">basic_socket</link></member>
             <member><link linkend="boost_asio.reference.basic_socket_acceptor">basic_socket_acceptor</link></member>
             <member><link linkend="boost_asio.reference.basic_socket_iostream">basic_socket_iostream</link></member>
             <member><link linkend="boost_asio.reference.basic_socket_streambuf">basic_socket_streambuf</link></member>
@@ -188,6 +195,7 @@
             <member><link linkend="boost_asio.reference.datagram_socket_service">datagram_socket_service</link></member>
             <member><link linkend="boost_asio.reference.ip__resolver_service">ip::resolver_service</link></member>
             <member><link linkend="boost_asio.reference.raw_socket_service">raw_socket_service</link></member>
+ <member><link linkend="boost_asio.reference.seq_packet_socket_service">seq_packet_socket_service</link></member>
             <member><link linkend="boost_asio.reference.socket_acceptor_service">socket_acceptor_service</link></member>
             <member><link linkend="boost_asio.reference.stream_socket_service">stream_socket_service</link></member>
           </simplelist>
@@ -225,6 +233,7 @@
           <bridgehead renderas="sect3">Type Requirements</bridgehead>
           <simplelist type="vert" columns="1">
             <member><link linkend="boost_asio.reference.AcceptHandler">AcceptHandler</link></member>
+ <member><link linkend="boost_asio.reference.ComposedConnectHandler">ComposedConnectHandler</link></member>
             <member><link linkend="boost_asio.reference.ConnectHandler">ConnectHandler</link></member>
             <member><link linkend="boost_asio.reference.DatagramSocketService">DatagramSocketService</link></member>
             <member><link linkend="boost_asio.reference.Endpoint">Endpoint</link></member>
@@ -235,6 +244,7 @@
             <member><link linkend="boost_asio.reference.RawSocketService">RawSocketService</link></member>
             <member><link linkend="boost_asio.reference.ResolveHandler">ResolveHandler</link></member>
             <member><link linkend="boost_asio.reference.ResolverService">ResolverService</link></member>
+ <member><link linkend="boost_asio.reference.SeqPacketSocketService">SeqPacketSocketService</link></member>
             <member><link linkend="boost_asio.reference.SettableSocketOption">SettableSocketOption</link></member>
             <member><link linkend="boost_asio.reference.SocketAcceptorService">SocketAcceptorService</link></member>
             <member><link linkend="boost_asio.reference.SocketService">SocketService</link></member>

Modified: trunk/libs/asio/doc/reference.qbk
==============================================================================
--- trunk/libs/asio/doc/reference.qbk (original)
+++ trunk/libs/asio/doc/reference.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,6 +16,7 @@
 [include requirements/AsyncReadStream.qbk]
 [include requirements/AsyncWriteStream.qbk]
 [include requirements/CompletionHandler.qbk]
+[include requirements/ComposedConnectHandler.qbk]
 [include requirements/ConnectHandler.qbk]
 [include requirements/ConstBufferSequence.qbk]
 [include requirements/ConvertibleToConstBuffer.qbk]
@@ -37,6 +38,7 @@
 [include requirements/ReadHandler.qbk]
 [include requirements/ResolveHandler.qbk]
 [include requirements/ResolverService.qbk]
+[include requirements/SeqPacketSocketService.qbk]
 [include requirements/SerialPortService.qbk]
 [include requirements/Service.qbk]
 [include requirements/SettableSerialPortOption.qbk]
@@ -261,6 +263,518 @@
 [endsect]
 
 
+[section:async_connect async_connect]
+
+[indexterm1 async_connect]
+Asynchronously establishes a socket connection by trying each endpoint in a sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void ``[link boost_asio.reference.async_connect.overload1 async_connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ComposedConnectHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.async_connect.overload1 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void ``[link boost_asio.reference.async_connect.overload2 async_connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ComposedConnectHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.async_connect.overload2 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void ``[link boost_asio.reference.async_connect.overload3 async_connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition,
+ ComposedConnectHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.async_connect.overload3 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void ``[link boost_asio.reference.async_connect.overload4 async_connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition,
+ ComposedConnectHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.async_connect.overload4 more...]]``
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/connect.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:overload1 async_connect (1 of 4 overloads)]
+
+
+Asynchronously establishes a socket connection by trying each endpoint in a sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void async_connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ComposedConnectHandler handler);
+
+
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
+
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
+
+[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ // Result of operation. if the sequence is empty, set to
+ // boost::asio::error::not_found. Otherwise, contains the
+ // error from the last connection attempt.
+ const boost::system::error_code& error,
+
+ // On success, an iterator denoting the successfully
+ // connected endpoint. Otherwise, the end iterator.
+ Iterator iterator
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Remarks]
+
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
+
+
+[heading Example]
+
+
+
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+
+ // ...
+
+ r.async_resolve(q, resolve_handler);
+
+ // ...
+
+ void resolve_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (!ec)
+ {
+ boost::asio::async_connect(s, i, connect_handler);
+ }
+ }
+
+ // ...
+
+ void connect_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 async_connect (2 of 4 overloads)]
+
+
+Asynchronously establishes a socket connection by trying each endpoint in a sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void async_connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ComposedConnectHandler handler);
+
+
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
+
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
+
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
+
+[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ // Result of operation. if the sequence is empty, set to
+ // boost::asio::error::not_found. Otherwise, contains the
+ // error from the last connection attempt.
+ const boost::system::error_code& error,
+
+ // On success, an iterator denoting the successfully
+ // connected endpoint. Otherwise, the end iterator.
+ Iterator iterator
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Example]
+
+
+
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+
+ // ...
+
+ r.async_resolve(q, resolve_handler);
+
+ // ...
+
+ void resolve_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (!ec)
+ {
+ tcp::resolver::iterator end;
+ boost::asio::async_connect(s, i, end, connect_handler);
+ }
+ }
+
+ // ...
+
+ void connect_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ // ...
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 async_connect (3 of 4 overloads)]
+
+
+Asynchronously establishes a socket connection by trying each endpoint in a sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void async_connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition,
+ ComposedConnectHandler handler);
+
+
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
+
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
+
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
+
+[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ // Result of operation. if the sequence is empty, set to
+ // boost::asio::error::not_found. Otherwise, contains the
+ // error from the last connection attempt.
+ const boost::system::error_code& error,
+
+ // On success, an iterator denoting the successfully
+ // connected endpoint. Otherwise, the end iterator.
+ Iterator iterator
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Remarks]
+
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
+
+
+[heading Example]
+
+The following connect condition function object can be used to output information about the individual connection attempts:
+
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
+
+
+It would be used with the `boost::asio::connect` function as follows:
+
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+
+ // ...
+
+ r.async_resolve(q, resolve_handler);
+
+ // ...
+
+ void resolve_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (!ec)
+ {
+ boost::asio::async_connect(s, i,
+ my_connect_condition(),
+ connect_handler);
+ }
+ }
+
+ // ...
+
+ void connect_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
+ }
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload4 async_connect (4 of 4 overloads)]
+
+
+Asynchronously establishes a socket connection by trying each endpoint in a sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition,
+ typename ``[link boost_asio.reference.ComposedConnectHandler ComposedConnectHandler]``>
+ void async_connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition,
+ ComposedConnectHandler handler);
+
+
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `async_connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
+
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
+
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
+
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
+
+[[handler][The handler to be called when the connect operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ // Result of operation. if the sequence is empty, set to
+ // boost::asio::error::not_found. Otherwise, contains the
+ // error from the last connection attempt.
+ const boost::system::error_code& error,
+
+ // On success, an iterator denoting the successfully
+ // connected endpoint. Otherwise, the end iterator.
+ Iterator iterator
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Example]
+
+The following connect condition function object can be used to output information about the individual connection attempts:
+
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
+
+
+It would be used with the `boost::asio::connect` function as follows:
+
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+
+ // ...
+
+ r.async_resolve(q, resolve_handler);
+
+ // ...
+
+ void resolve_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (!ec)
+ {
+ tcp::resolver::iterator end;
+ boost::asio::async_connect(s, i, end,
+ my_connect_condition(),
+ connect_handler);
+ }
+ }
+
+ // ...
+
+ void connect_handler(
+ const boost::system::error_code& ec,
+ tcp::resolver::iterator i)
+ {
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
+ }
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
 [section:async_read async_read]
 
 [indexterm1 async_read]
@@ -2311,15 +2825,22 @@
 
   [
 
- [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
@@ -2472,11 +2993,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
@@ -2495,10 +3011,29 @@
   
   [
     [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
+ [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
@@ -2555,6 +3090,11 @@
   ]
 
   [
+ [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
@@ -2607,12 +3147,12 @@
 
   void ``[link boost_asio.reference.basic_datagram_socket.assign.overload1 assign]``(
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
   `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.assign.overload1 more...]]``
 
   boost::system::error_code ``[link boost_asio.reference.basic_datagram_socket.assign.overload2 assign]``(
       const protocol_type & protocol,
- const native_type & native_socket,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.assign.overload2 more...]]``
 
@@ -2628,7 +3168,7 @@
 
   void assign(
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
 
 
 
@@ -2647,7 +3187,7 @@
 
   boost::system::error_code assign(
       const protocol_type & protocol,
- const native_type & native_socket,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
@@ -3464,7 +4004,7 @@
   ``[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 basic_datagram_socket]``(
       boost::asio::io_service & io_service,
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
   `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.basic_datagram_socket.overload4 more...]]``
 
 
@@ -3590,7 +4130,7 @@
   basic_datagram_socket(
       boost::asio::io_service & io_service,
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
 
 
 This constructor creates a datagram socket object to hold an existing native socket.
@@ -4716,32 +5256,6 @@
 [endsect]
 
 
-[section:io_service basic_datagram_socket::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..basic_datagram_socket]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:is_open basic_datagram_socket::is_open]
 
 
@@ -5150,15 +5664,22 @@
 
   [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
@@ -5291,11 +5812,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
@@ -5314,10 +5830,29 @@
   
   [
     [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_socket.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
@@ -5365,6 +5900,11 @@
   ]
 
   [
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
@@ -5449,6 +5989,23 @@
 
 
 
+[section:message_end_of_record basic_datagram_socket::message_end_of_record]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 message_end_of_record..basic_datagram_socket]
+Specifies that the data marks the end of a record.
+
+
+ static const int message_end_of_record = implementation_defined;
+
+
+
+[endsect]
+
+
+
 [section:message_flags basic_datagram_socket::message_flags]
 
 
@@ -5513,7 +6070,7 @@
 ['Inherited from basic_socket.]
 
 [indexterm2 native..basic_datagram_socket]
-Get the native socket representation.
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
 
   native_type native();
@@ -5526,13 +6083,32 @@
 
 
 
-[section:native_type basic_datagram_socket::native_type]
+[section:native_handle basic_datagram_socket::native_handle]
 
-[indexterm2 native_type..basic_datagram_socket]
+
+['Inherited from basic_socket.]
+
+[indexterm2 native_handle..basic_datagram_socket]
+Get the native socket representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle_type basic_datagram_socket::native_handle_type]
+
+[indexterm2 native_handle_type..basic_datagram_socket]
 The native representation of a socket.
 
 
- typedef DatagramSocketService::native_type native_type;
+ typedef DatagramSocketService::native_handle_type native_handle_type;
 
 
 
@@ -5546,78 +6122,147 @@
 [endsect]
 
 
+[section:native_non_blocking basic_datagram_socket::native_non_blocking]
 
-[section:non_blocking_io basic_datagram_socket::non_blocking_io]
+[indexterm2 native_non_blocking..basic_datagram_socket]
+Gets the non-blocking mode of the native socket implementation.
 
 
-['Inherited from socket_base.]
+ bool ``[link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload1 more...]]``
 
-[indexterm2 non_blocking_io..basic_datagram_socket]
-IO control command to set the blocking mode of the socket.
 
+Sets the non-blocking mode of the native socket implementation.
 
- typedef implementation_defined non_blocking_io;
 
+ void ``[link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.native_non_blocking.overload3 more...]]``
 
-Implements the FIONBIO IO control command.
 
+[section:overload1 basic_datagram_socket::native_non_blocking (1 of 3 overloads)]
 
-[heading Example]
-
 
+['Inherited from basic_socket.]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
 
+Gets the non-blocking mode of the native socket implementation.
 
 
+ bool native_non_blocking() const;
 
 
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
 
 
-[heading Requirements]
+[heading Return Value]
+
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
-[*Header: ][^boost/asio/basic_datagram_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Remarks]
+
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
 
 
-[endsect]
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
-[section:open basic_datagram_socket::open]
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
-[indexterm2 open..basic_datagram_socket]
-Open the socket using the specified protocol.
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
- void ``[link boost_asio.reference.basic_datagram_socket.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
- `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.open.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_datagram_socket.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.open.overload2 more...]]``
 
 
-[section:overload1 basic_datagram_socket::open (1 of 2 overloads)]
+
+
+[endsect]
+
+
+
+[section:overload2 basic_datagram_socket::native_non_blocking (2 of 3 overloads)]
 
 
 ['Inherited from basic_socket.]
 
 
-Open the socket using the specified protocol.
+Sets the non-blocking mode of the native socket implementation.
 
 
- void open(
- const protocol_type & protocol = protocol_type());
+ void native_non_blocking(
+ bool mode);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Parameters]
@@ -5625,7 +6270,7 @@
 
 [variablelist
   
-[[protocol][An object specifying protocol parameters to be used.]]
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
 ]
 
@@ -5635,17 +6280,79 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
 [heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
@@ -5657,21 +6364,21 @@
 
 
 
-[section:overload2 basic_datagram_socket::open (2 of 2 overloads)]
+[section:overload3 basic_datagram_socket::native_non_blocking (3 of 3 overloads)]
 
 
 ['Inherited from basic_socket.]
 
 
-Open the socket using the specified protocol.
+Sets the non-blocking mode of the native socket implementation.
 
 
- boost::system::error_code open(
- const protocol_type & protocol,
+ boost::system::error_code native_non_blocking(
+ bool mode,
       boost::system::error_code & ec);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Parameters]
@@ -5679,24 +6386,81 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
 [heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::system::error_code ec;
- socket.open(boost::asio::ip::tcp::v4(), ec);
- if (ec)
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
    {
- // An error occurred.
- }
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
@@ -5710,13 +6474,13 @@
 [endsect]
 
 
-[section:protocol_type basic_datagram_socket::protocol_type]
+[section:native_type basic_datagram_socket::native_type]
 
-[indexterm2 protocol_type..basic_datagram_socket]
-The protocol type.
+[indexterm2 native_type..basic_datagram_socket]
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
 
- typedef Protocol protocol_type;
+ typedef DatagramSocketService::native_handle_type native_type;
 
 
 
@@ -5730,66 +6494,386 @@
 [endsect]
 
 
-[section:receive basic_datagram_socket::receive]
+[section:non_blocking basic_datagram_socket::non_blocking]
 
-[indexterm2 receive..basic_datagram_socket]
-Receive some data on a connected socket.
+[indexterm2 non_blocking..basic_datagram_socket]
+Gets the non-blocking mode of the socket.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload1 receive]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload1 more...]]``
+ bool ``[link boost_asio.reference.basic_datagram_socket.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.non_blocking.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload2 receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags);
- `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload2 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload3 receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload3 more...]]``
+Sets the non-blocking mode of the socket.
 
 
-[section:overload1 basic_datagram_socket::receive (1 of 3 overloads)]
+ void ``[link boost_asio.reference.basic_datagram_socket.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.non_blocking.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_datagram_socket.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.non_blocking.overload3 more...]]``
 
-Receive some data on a connected socket.
 
+[section:overload1 basic_datagram_socket::non_blocking (1 of 3 overloads)]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers);
 
+['Inherited from basic_socket.]
 
-This function is used to receive data on the datagram socket. The function call will block until data has been received successfully or an error occurs.
 
+Gets the non-blocking mode of the socket.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be received.]]
+ bool non_blocking() const;
 
-]
 
 
 [heading Return Value]
       
-The number of bytes received.
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
 
-[heading Exceptions]
-
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_datagram_socket::non_blocking (2 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the socket.
+
+
+ void non_blocking(
+ bool mode);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 basic_datagram_socket::non_blocking (3 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the socket.
+
+
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:non_blocking_io basic_datagram_socket::non_blocking_io]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 non_blocking_io..basic_datagram_socket]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
+
+
+ typedef implementation_defined non_blocking_io;
+
+
+
+Implements the FIONBIO IO control command.
+
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_datagram_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:open basic_datagram_socket::open]
+
+[indexterm2 open..basic_datagram_socket]
+Open the socket using the specified protocol.
+
+
+ void ``[link boost_asio.reference.basic_datagram_socket.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.open.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_datagram_socket.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.open.overload2 more...]]``
+
+
+[section:overload1 basic_datagram_socket::open (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Open the socket using the specified protocol.
+
+
+ void open(
+ const protocol_type & protocol = protocol_type());
+
+
+This function opens the socket so that it will use the specified protocol.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_datagram_socket::open (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Open the socket using the specified protocol.
+
+
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+This function opens the socket so that it will use the specified protocol.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][An object specifying which protocol is to be used.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::system::error_code ec;
+ socket.open(boost::asio::ip::tcp::v4(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:protocol_type basic_datagram_socket::protocol_type]
+
+[indexterm2 protocol_type..basic_datagram_socket]
+The protocol type.
+
+
+ typedef Protocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_datagram_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:receive basic_datagram_socket::receive]
+
+[indexterm2 receive..basic_datagram_socket]
+Receive some data on a connected socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload1 receive]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload1 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload2 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload2 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_datagram_socket.receive.overload3 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_datagram_socket.receive.overload3 more...]]``
+
+
+[section:overload1 basic_datagram_socket::receive (1 of 3 overloads)]
+
+
+Receive some data on a connected socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers);
+
+
+This function is used to receive data on the datagram socket. The function call will block until data has been received successfully or an error occurs.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes received.
+
+
+[heading Exceptions]
+
 
 [variablelist
   
@@ -7297,6 +8381,11 @@
   ]
   
   [
+ [[link boost_asio.reference.basic_deadline_timer.cancel_one [*cancel_one]]]
+ [Cancels one asynchronous operation that is waiting on the timer. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_deadline_timer.expires_at [*expires_at]]]
     [Get the timer's expiry time as an absolute time.
 
@@ -7316,11 +8405,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_deadline_timer.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_deadline_timer.wait [*wait]]]
     [Perform a blocking wait on the timer. ]
   ]
@@ -7719,6 +8803,114 @@
 
 [endsect]
 
+[section:cancel_one basic_deadline_timer::cancel_one]
+
+[indexterm2 cancel_one..basic_deadline_timer]
+Cancels one asynchronous operation that is waiting on the timer.
+
+
+ std::size_t ``[link boost_asio.reference.basic_deadline_timer.cancel_one.overload1 cancel_one]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_deadline_timer.cancel_one.overload1 more...]]``
+
+ std::size_t ``[link boost_asio.reference.basic_deadline_timer.cancel_one.overload2 cancel_one]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_deadline_timer.cancel_one.overload2 more...]]``
+
+
+[section:overload1 basic_deadline_timer::cancel_one (1 of 2 overloads)]
+
+
+Cancels one asynchronous operation that is waiting on the timer.
+
+
+ std::size_t cancel_one();
+
+
+This function forces the completion of one pending asynchronous wait operation against the timer. Handlers are cancelled in FIFO order. The handler for the cancelled operation will be invoked with the `boost::asio::error::operation_aborted` error code.
+
+Cancelling the timer does not change the expiry time.
+
+
+[heading Return Value]
+
+The number of asynchronous operations that were cancelled. That is, either 0 or 1.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+If the timer has already expired when `cancel_one()` is called, then the handlers for asynchronous wait operations will:
+
+
+* have already been invoked; or
+
+
+* have been queued for invocation in the near future.
+
+These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
+
+
+[endsect]
+
+
+
+[section:overload2 basic_deadline_timer::cancel_one (2 of 2 overloads)]
+
+
+Cancels one asynchronous operation that is waiting on the timer.
+
+
+ std::size_t cancel_one(
+ boost::system::error_code & ec);
+
+
+This function forces the completion of one pending asynchronous wait operation against the timer. Handlers are cancelled in FIFO order. The handler for the cancelled operation will be invoked with the `boost::asio::error::operation_aborted` error code.
+
+Cancelling the timer does not change the expiry time.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of asynchronous operations that were cancelled. That is, either 0 or 1.
+
+
+[heading Remarks]
+
+If the timer has already expired when `cancel_one()` is called, then the handlers for asynchronous wait operations will:
+
+
+* have already been invoked; or
+
+
+* have been queued for invocation in the near future.
+
+These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.
+
+
+[endsect]
+
+
+[endsect]
+
 
 [section:duration_type basic_deadline_timer::duration_type]
 
@@ -8094,32 +9286,6 @@
 
 
 
-[section:io_service basic_deadline_timer::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..basic_deadline_timer]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:service basic_deadline_timer::service]
 
 
@@ -8318,11 +9484,6 @@
     [Get the io_service associated with the object. ]
   ]
   
- [
- [[link boost_asio.reference.basic_io_object.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
 ]
 
 [heading Protected Member Functions]
@@ -8444,29 +9605,6 @@
 
 
 
-[section:io_service basic_io_object::io_service]
-
-[indexterm2 io_service..basic_io_object]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:service basic_io_object::service]
 
 [indexterm2 service..basic_io_object]
@@ -8621,15 +9759,22 @@
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_raw_socket.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
@@ -8782,11 +9927,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_raw_socket.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
@@ -8805,10 +9945,29 @@
   
   [
     [[link boost_asio.reference.basic_raw_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
+ [[link boost_asio.reference.basic_raw_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_raw_socket.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
@@ -8865,6 +10024,11 @@
   ]
 
   [
+ [[link boost_asio.reference.basic_raw_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_raw_socket.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
@@ -8917,12 +10081,12 @@
 
   void ``[link boost_asio.reference.basic_raw_socket.assign.overload1 assign]``(
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
   `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.assign.overload1 more...]]``
 
   boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.assign.overload2 assign]``(
       const protocol_type & protocol,
- const native_type & native_socket,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.assign.overload2 more...]]``
 
@@ -8938,7 +10102,7 @@
 
   void assign(
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
 
 
 
@@ -8957,7 +10121,7 @@
 
   boost::system::error_code assign(
       const protocol_type & protocol,
- const native_type & native_socket,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
@@ -9774,7 +10938,7 @@
   ``[link boost_asio.reference.basic_raw_socket.basic_raw_socket.overload4 basic_raw_socket]``(
       boost::asio::io_service & io_service,
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
   `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.basic_raw_socket.overload4 more...]]``
 
 
@@ -9900,7 +11064,7 @@
   basic_raw_socket(
       boost::asio::io_service & io_service,
       const protocol_type & protocol,
- const native_type & native_socket);
+ const native_handle_type & native_socket);
 
 
 This constructor creates a raw socket object to hold an existing native socket.
@@ -11026,32 +12190,6 @@
 [endsect]
 
 
-[section:io_service basic_raw_socket::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..basic_raw_socket]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:is_open basic_raw_socket::is_open]
 
 
@@ -11460,15 +12598,22 @@
 
   [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
@@ -11601,11 +12746,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
@@ -11624,10 +12764,29 @@
   
   [
     [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_socket.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
@@ -11675,6 +12834,11 @@
   ]
 
   [
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
     [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
@@ -11759,6 +12923,23 @@
 
 
 
+[section:message_end_of_record basic_raw_socket::message_end_of_record]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 message_end_of_record..basic_raw_socket]
+Specifies that the data marks the end of a record.
+
+
+ static const int message_end_of_record = implementation_defined;
+
+
+
+[endsect]
+
+
+
 [section:message_flags basic_raw_socket::message_flags]
 
 
@@ -11823,7 +13004,7 @@
 ['Inherited from basic_socket.]
 
 [indexterm2 native..basic_raw_socket]
-Get the native socket representation.
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
 
   native_type native();
@@ -11836,13 +13017,404 @@
 
 
 
+[section:native_handle basic_raw_socket::native_handle]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 native_handle..basic_raw_socket]
+Get the native socket representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle_type basic_raw_socket::native_handle_type]
+
+[indexterm2 native_handle_type..basic_raw_socket]
+The native representation of a socket.
+
+
+ typedef RawSocketService::native_handle_type native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_raw_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:native_non_blocking basic_raw_socket::native_non_blocking]
+
+[indexterm2 native_non_blocking..basic_raw_socket]
+Gets the non-blocking mode of the native socket implementation.
+
+
+ bool ``[link boost_asio.reference.basic_raw_socket.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.native_non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the native socket implementation.
+
+
+ void ``[link boost_asio.reference.basic_raw_socket.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.native_non_blocking.overload2 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.native_non_blocking.overload3 more...]]``
+
+
+[section:overload1 basic_raw_socket::native_non_blocking (1 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Gets the non-blocking mode of the native socket implementation.
+
+
+ bool native_non_blocking() const;
+
+
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
+
+
+[heading Return Value]
+
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
+
+
+[heading Remarks]
+
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
+
+
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
+
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
+
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_raw_socket::native_non_blocking (2 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the native socket implementation.
+
+
+ void native_non_blocking(
+ bool mode);
+
+
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
+
+]
+
+
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
+
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
+
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 basic_raw_socket::native_non_blocking (3 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the native socket implementation.
+
+
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
+
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
+
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
+
+]
+
+
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
+
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
+
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
 [section:native_type basic_raw_socket::native_type]
 
 [indexterm2 native_type..basic_raw_socket]
-The native representation of a socket.
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
 
- typedef RawSocketService::native_type native_type;
+ typedef RawSocketService::native_handle_type native_type;
 
 
 
@@ -11856,6 +13428,142 @@
 [endsect]
 
 
+[section:non_blocking basic_raw_socket::non_blocking]
+
+[indexterm2 non_blocking..basic_raw_socket]
+Gets the non-blocking mode of the socket.
+
+
+ bool ``[link boost_asio.reference.basic_raw_socket.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the socket.
+
+
+ void ``[link boost_asio.reference.basic_raw_socket.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.non_blocking.overload2 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_raw_socket.non_blocking.overload3 more...]]``
+
+
+[section:overload1 basic_raw_socket::non_blocking (1 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Gets the non-blocking mode of the socket.
+
+
+ bool non_blocking() const;
+
+
+
+[heading Return Value]
+
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_raw_socket::non_blocking (2 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the socket.
+
+
+ void non_blocking(
+ bool mode);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 basic_raw_socket::non_blocking (3 of 3 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Sets the non-blocking mode of the socket.
+
+
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+[endsect]
+
 
 [section:non_blocking_io basic_raw_socket::non_blocking_io]
 
@@ -11863,7 +13571,7 @@
 ['Inherited from socket_base.]
 
 [indexterm2 non_blocking_io..basic_raw_socket]
-IO control command to set the blocking mode of the socket.
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
 
   typedef implementation_defined non_blocking_io;
@@ -13528,17 +15236,17 @@
 
 [endsect]
 
-[section:basic_serial_port basic_serial_port]
+[section:basic_seq_packet_socket basic_seq_packet_socket]
 
 
-Provides serial port functionality.
+Provides sequenced packet socket functionality.
 
 
   template<
- typename ``[link boost_asio.reference.SerialPortService SerialPortService]`` = serial_port_service>
- class basic_serial_port :
- public basic_io_object< SerialPortService >,
- public serial_port_base
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SeqPacketSocketService SeqPacketSocketService]`` = seq_packet_socket_service<Protocol>>
+ class basic_seq_packet_socket :
+ public basic_socket< Protocol, SeqPacketSocketService >
 
 
 [heading Types]
@@ -13547,151 +15255,366 @@
 
   [
 
- [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_seq_packet_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.implementation_type [*implementation_type]]]
     [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
- [A basic_serial_port is always the lowest layer. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
- [The native representation of a serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
   
   ]
 
-]
+ [
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.basic_seq_packet_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
 
   [
- [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
- [Assign an existing native serial port to the serial port. ]
+
+ [[link boost_asio.reference.basic_seq_packet_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
   ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
+
+ [[link boost_asio.reference.basic_seq_packet_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
   ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
+
+ [[link boost_asio.reference.basic_seq_packet_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
   ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_serial_port.basic_serial_port [*basic_serial_port]]]
- [Construct a basic_serial_port without opening it.
 
- Construct and open a basic_serial_port.
+ [[link boost_asio.reference.basic_seq_packet_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
 
- Construct a basic_serial_port on an existing native serial port. ]
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
   ]
+
+ [
+
+ [[link boost_asio.reference.basic_seq_packet_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_serial_port.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the serial port. ]
+
+ [[link boost_asio.reference.basic_seq_packet_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.close [*close]]]
- [Close the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.get_option [*get_option]]]
- [Get an option from the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.async_send [*async_send]]]
+ [Start an asynchronous send. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
- [Determine whether the serial port is open. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+ [[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket [*basic_seq_packet_socket]]]
+ [Construct a basic_seq_packet_socket without opening it.
 
- Get a const reference to the lowest layer. ]
+ Construct and open a basic_seq_packet_socket.
+
+ Construct a basic_seq_packet_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_seq_packet_socket on an existing native socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.native [*native]]]
- [Get the native serial port representation. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.open [*open]]]
- [Open the serial port using the specified device name. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.read_some [*read_some]]]
- [Read some data from the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.close [*close]]]
+ [Close the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.send_break [*send_break]]]
- [Send a break sequence to the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.set_option [*set_option]]]
- [Set an option on the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.write_some [*write_some]]]
- [Write some data to the serial port. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
   ]
   
-]
-
-[heading Protected Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.basic_serial_port.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_serial_port.service [*service]]]
- [The service associated with the I/O object. ]
+ [[link boost_asio.reference.basic_seq_packet_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
   ]
-
-]
-
-The [link boost_asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports.
-
-
-[heading Thread Safety]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.receive [*receive]]]
+ [Receive some data on the socket.
+
+ Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.send [*send]]]
+ [Send some data on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_seq_packet_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] class template provides asynchronous and blocking sequenced packet socket functionality.
+
+
+[heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
@@ -13701,34 +15624,40 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_serial_port.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:assign basic_serial_port::assign]
+[section:assign basic_seq_packet_socket::assign]
 
-[indexterm2 assign..basic_serial_port]
-Assign an existing native serial port to the serial port.
+[indexterm2 assign..basic_seq_packet_socket]
+Assign an existing native socket to the socket.
 
 
- void ``[link boost_asio.reference.basic_serial_port.assign.overload1 assign]``(
- const native_type & native_serial_port);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.assign.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_seq_packet_socket.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.assign.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.assign.overload2 assign]``(
- const native_type & native_serial_port,
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.assign.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.assign.overload2 more...]]``
 
 
-[section:overload1 basic_serial_port::assign (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::assign (1 of 2 overloads)]
 
 
-Assign an existing native serial port to the serial port.
+['Inherited from basic_socket.]
+
+
+Assign an existing native socket to the socket.
 
 
   void assign(
- const native_type & native_serial_port);
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
 
@@ -13736,14 +15665,18 @@
 
 
 
-[section:overload2 basic_serial_port::assign (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::assign (2 of 2 overloads)]
 
 
-Assign an existing native serial port to the serial port.
+['Inherited from basic_socket.]
+
+
+Assign an existing native socket to the socket.
 
 
   boost::system::error_code assign(
- const native_type & native_serial_port,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
@@ -13754,21 +15687,25 @@
 [endsect]
 
 
-[section:async_read_some basic_serial_port::async_read_some]
+[section:async_connect basic_seq_packet_socket::async_connect]
 
-[indexterm2 async_read_some..basic_serial_port]
-Start an asynchronous read.
+
+['Inherited from basic_socket.]
+
+[indexterm2 async_connect..basic_seq_packet_socket]
+Start an asynchronous connect.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
 
 
-This function is used to asynchronously read data from the serial port. The function call always returns immediately.
+This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
 [heading Parameters]
@@ -13776,13 +15713,12 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
 
-[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
 ``
    void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes read.
+ const boost::system::error_code& error // Result of operation
    );
 ``
 Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
@@ -13790,19 +15726,27 @@
 ]
 
 
-[heading Remarks]
-
-The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
-
-
 [heading Example]
   
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- serial_port.async_read_some(boost::asio::buffer(data, size), handler);
+
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
+
+ ...
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_connect(endpoint, connect_handler);
+
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -13810,22 +15754,48 @@
 [endsect]
 
 
+[section:async_receive basic_seq_packet_socket::async_receive]
 
-[section:async_write_some basic_serial_port::async_write_some]
+[indexterm2 async_receive..basic_seq_packet_socket]
+Start an asynchronous receive.
 
-[indexterm2 async_write_some..basic_serial_port]
-Start an asynchronous write.
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_seq_packet_socket.async_receive.overload1 async_receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags & out_flags,
+ ReadHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.async_receive.overload1 more...]]``
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_seq_packet_socket.async_receive.overload2 async_receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
+ ReadHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.async_receive.overload2 more...]]``
 
 
-This function is used to asynchronously write data to the serial port. The function call always returns immediately.
+[section:overload1 basic_seq_packet_socket::async_receive (1 of 2 overloads)]
+
+
+Start an asynchronous receive.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags & out_flags,
+ ReadHandler handler);
+
+
+This function is used to asynchronously receive data from the sequenced packet socket. The function call always returns immediately.
 
 
 [heading Parameters]
@@ -13833,13 +15803,15 @@
 
 [variablelist
   
-[[buffers][One or more data buffers to be written to the serial port. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+[[out_flags][Once the asynchronous operation completes, contains flags associated with the received data. For example, if the `socket_base::message_end_of_record` bit is set then the received data marks the end of a record. The caller must guarantee that the referenced variable remains valid until the handler is called.]]
+
+[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
 ``
    void handler(
      const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes written.
+ std::size_t bytes_transferred // Number of bytes received.
    );
 ``
 Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
@@ -13847,19 +15819,14 @@
 ]
 
 
-[heading Remarks]
-
-The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
-
-
 [heading Example]
   
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- serial_port.async_write_some(boost::asio::buffer(data, size), handler);
+ socket.async_receive(boost::asio::buffer(data, size), out_flags, handler);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -13867,61 +15834,59 @@
 [endsect]
 
 
-[section:basic_serial_port basic_serial_port::basic_serial_port]
-
-[indexterm2 basic_serial_port..basic_serial_port]
-Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] without opening it.
-
-
- explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 basic_serial_port]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 more...]]``
-
-
-Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
 
+[section:overload2 basic_seq_packet_socket::async_receive (2 of 2 overloads)]
 
- explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``(
- boost::asio::io_service & io_service,
- const char * device);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 more...]]``
 
- explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 basic_serial_port]``(
- boost::asio::io_service & io_service,
- const std::string & device);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 more...]]``
+Start an asynchronous receive.
 
 
-Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] on an existing native serial port.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
+ ReadHandler handler);
 
 
- ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload4 basic_serial_port]``(
- boost::asio::io_service & io_service,
- const native_type & native_serial_port);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload4 more...]]``
+This function is used to asynchronously receive data from the sequenced data socket. The function call always returns immediately.
 
 
-[section:overload1 basic_serial_port::basic_serial_port (1 of 4 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] without opening it.
+[[in_flags][Flags specifying how the receive call is to be made.]]
 
+[[out_flags][Once the asynchronous operation completes, contains flags associated with the received data. For example, if the `socket_base::message_end_of_record` bit is set then the received data marks the end of a record. The caller must guarantee that the referenced variable remains valid until the handler is called.]]
 
- basic_serial_port(
- boost::asio::io_service & io_service);
+[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes received.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
-This constructor creates a serial port without opening it.
 
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[heading Parameters]
-
+ socket.async_receive(
+ boost::asio::buffer(data, size),
+ 0, out_flags, handler);
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]]
 
-]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -13929,19 +15894,25 @@
 [endsect]
 
 
+[endsect]
 
-[section:overload2 basic_serial_port::basic_serial_port (2 of 4 overloads)]
 
+[section:async_send basic_seq_packet_socket::async_send]
 
-Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
+[indexterm2 async_send..basic_seq_packet_socket]
+Start an asynchronous send.
 
 
- basic_serial_port(
- boost::asio::io_service & io_service,
- const char * device);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
 
-This constructor creates and opens a serial port for the specified device name.
+This function is used to asynchronously send data on the sequenced packet socket. The function call always returns immediately.
 
 
 [heading Parameters]
@@ -13949,41 +15920,77 @@
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
+[[buffers][One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[device][The platform-specific device name for this serial port. ]]
+[[flags][Flags specifying how the send call is to be made.]]
+
+[[handler][The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes sent.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
 ]
 
 
+[heading Example]
+
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+
+ socket.async_send(boost::asio::buffer(data, size), 0, handler);
+
+
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
 
 
 [endsect]
 
 
+[section:at_mark basic_seq_packet_socket::at_mark]
 
-[section:overload3 basic_serial_port::basic_serial_port (3 of 4 overloads)]
+[indexterm2 at_mark..basic_seq_packet_socket]
+Determine whether the socket is at the out-of-band data mark.
 
 
-Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
+ bool ``[link boost_asio.reference.basic_seq_packet_socket.at_mark.overload1 at_mark]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.at_mark.overload1 more...]]``
 
+ bool ``[link boost_asio.reference.basic_seq_packet_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.at_mark.overload2 more...]]``
 
- basic_serial_port(
- boost::asio::io_service & io_service,
- const std::string & device);
 
+[section:overload1 basic_seq_packet_socket::at_mark (1 of 2 overloads)]
 
-This constructor creates and opens a serial port for the specified device name.
 
+['Inherited from basic_socket.]
 
-[heading Parameters]
+
+Determine whether the socket is at the out-of-band data mark.
+
+
+ bool at_mark() const;
+
+
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+
+
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
+
+
+[heading Exceptions]
     
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
-
-[[device][The platform-specific device name for this serial port. ]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
@@ -13994,18 +16001,20 @@
 
 
 
-[section:overload4 basic_serial_port::basic_serial_port (4 of 4 overloads)]
+[section:overload2 basic_seq_packet_socket::at_mark (2 of 2 overloads)]
 
 
-Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] on an existing native serial port.
+['Inherited from basic_socket.]
 
 
- basic_serial_port(
- boost::asio::io_service & io_service,
- const native_type & native_serial_port);
+Determine whether the socket is at the out-of-band data mark.
 
 
-This constructor creates a serial port object to hold an existing native serial port.
+ bool at_mark(
+ boost::system::error_code & ec) const;
+
+
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
 
 [heading Parameters]
@@ -14013,54 +16022,55 @@
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
-
-[[native_serial_port][A native serial port.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Exceptions]
-
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
 
 
+[endsect]
 
 
 [endsect]
 
+[section:available basic_seq_packet_socket::available]
 
-[endsect]
+[indexterm2 available..basic_seq_packet_socket]
+Determine the number of bytes available for reading.
 
-[section:cancel basic_serial_port::cancel]
 
-[indexterm2 cancel..basic_serial_port]
-Cancel all asynchronous operations associated with the serial port.
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.available.overload1 available]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.available.overload1 more...]]``
 
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.available.overload2 more...]]``
 
- void ``[link boost_asio.reference.basic_serial_port.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.cancel.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.cancel.overload2 more...]]``
+[section:overload1 basic_seq_packet_socket::available (1 of 2 overloads)]
 
 
-[section:overload1 basic_serial_port::cancel (1 of 2 overloads)]
+['Inherited from basic_socket.]
 
 
-Cancel all asynchronous operations associated with the serial port.
+Determine the number of bytes available for reading.
 
 
- void cancel();
+ std::size_t available() const;
 
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+This function is used to determine the number of bytes that may be read without blocking.
+
+
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
 
 [heading Exceptions]
@@ -14079,17 +16089,20 @@
 
 
 
-[section:overload2 basic_serial_port::cancel (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::available (2 of 2 overloads)]
 
 
-Cancel all asynchronous operations associated with the serial port.
+['Inherited from basic_socket.]
 
 
- boost::system::error_code cancel(
- boost::system::error_code & ec);
+Determine the number of bytes available for reading.
 
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+ std::size_t available(
+ boost::system::error_code & ec) const;
+
+
+This function is used to determine the number of bytes that may be read without blocking.
 
 
 [heading Parameters]
@@ -14097,71 +16110,73 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any. ]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
 
-[endsect]
 
 
 [endsect]
 
-[section:close basic_serial_port::close]
-
-[indexterm2 close..basic_serial_port]
-Close the serial port.
-
-
- void ``[link boost_asio.reference.basic_serial_port.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.close.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.close.overload2 more...]]``
 
+[endsect]
 
-[section:overload1 basic_serial_port::close (1 of 2 overloads)]
+[section:basic_seq_packet_socket basic_seq_packet_socket::basic_seq_packet_socket]
 
+[indexterm2 basic_seq_packet_socket..basic_seq_packet_socket]
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] without opening it.
 
-Close the serial port.
 
+ explicit ``[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload1 basic_seq_packet_socket]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload1 more...]]``
 
- void close();
 
+Construct and open a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`].
 
-This function is used to close the serial port. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
+ ``[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 basic_seq_packet_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload2 more...]]``
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`], opening it and binding it to the given local endpoint.
 
-]
 
+ ``[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload3 basic_seq_packet_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload3 more...]]``
 
 
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] on an existing native socket.
 
-[endsect]
 
+ ``[link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 basic_seq_packet_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.basic_seq_packet_socket.overload4 more...]]``
 
 
-[section:overload2 basic_serial_port::close (2 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::basic_seq_packet_socket (1 of 4 overloads)]
 
 
-Close the serial port.
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] without opening it.
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+ basic_seq_packet_socket(
+ boost::asio::io_service & io_service);
 
 
-This function is used to close the serial port. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+This constructor creates a sequenced packet socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it.
 
 
 [heading Parameters]
@@ -14169,7 +16184,7 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any. ]]
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
 
 ]
 
@@ -14179,67 +16194,61 @@
 [endsect]
 
 
-[endsect]
 
+[section:overload2 basic_seq_packet_socket::basic_seq_packet_socket (2 of 4 overloads)]
 
-[section:get_io_service basic_serial_port::get_io_service]
 
+Construct and open a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`].
 
-['Inherited from basic_io_object.]
 
-[indexterm2 get_io_service..basic_serial_port]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+ basic_seq_packet_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
 
 
- boost::asio::io_service & get_io_service();
+This constructor creates and opens a sequenced\_packet socket. The socket needs to be connected or accepted before data can be sent or received on it.
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[[protocol][An object specifying protocol parameters to be used.]]
 
+]
 
 
+[heading Exceptions]
+
 
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
-[section:get_option basic_serial_port::get_option]
 
-[indexterm2 get_option..basic_serial_port]
-Get an option from the serial port.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
- void ``[link boost_asio.reference.basic_serial_port.get_option.overload1 get_option]``(
- GettableSerialPortOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.get_option.overload1 more...]]``
+[endsect]
 
- template<
- typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.get_option.overload2 get_option]``(
- GettableSerialPortOption & option,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.get_option.overload2 more...]]``
 
 
-[section:overload1 basic_serial_port::get_option (1 of 2 overloads)]
+[section:overload3 basic_seq_packet_socket::basic_seq_packet_socket (3 of 4 overloads)]
 
 
-Get an option from the serial port.
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`], opening it and binding it to the given local endpoint.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
- void get_option(
- GettableSerialPortOption & option);
+ basic_seq_packet_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
 
 
-This function is used to get the current value of an option on the serial port.
+This constructor creates a sequenced packet socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
 
 
 [heading Parameters]
@@ -14247,7 +16256,9 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the serial port.]]
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+
+[[endpoint][An endpoint on the local machine to which the sequenced packet socket will be bound.]]
 
 ]
 
@@ -14257,32 +16268,30 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
 
 
 
-
 [endsect]
 
 
 
-[section:overload2 basic_serial_port::get_option (2 of 2 overloads)]
+[section:overload4 basic_seq_packet_socket::basic_seq_packet_socket (4 of 4 overloads)]
 
 
-Get an option from the serial port.
+Construct a [link boost_asio.reference.basic_seq_packet_socket `basic_seq_packet_socket`] on an existing native socket.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
- boost::system::error_code get_option(
- GettableSerialPortOption & option,
- boost::system::error_code & ec);
+ basic_seq_packet_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
-This function is used to get the current value of an option on the serial port.
+This constructor creates a sequenced packet socket object to hold an existing native socket.
 
 
 [heading Parameters]
@@ -14290,463 +16299,363 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the serial port.]]
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the sequenced packet socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[[ec][Set to indicate what error occured, if any.]]
+[[protocol][An object specifying protocol parameters to be used.]]
 
-]
+[[native_socket][The new underlying socket implementation.]]
 
+]
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-[endsect]
+]
 
 
-[endsect]
 
 
-[section:implementation basic_serial_port::implementation]
+[endsect]
 
 
-['Inherited from basic_io_object.]
+[endsect]
 
-[indexterm2 implementation..basic_serial_port]
-The underlying implementation of the I/O object.
+[section:bind basic_seq_packet_socket::bind]
 
+[indexterm2 bind..basic_seq_packet_socket]
+Bind the socket to the given local endpoint.
 
- implementation_type implementation;
 
+ void ``[link boost_asio.reference.basic_seq_packet_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.bind.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.bind.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 basic_seq_packet_socket::bind (1 of 2 overloads)]
 
 
-[section:implementation_type basic_serial_port::implementation_type]
+['Inherited from basic_socket.]
 
 
-['Inherited from basic_io_object.]
+Bind the socket to the given local endpoint.
 
-[indexterm2 implementation_type..basic_serial_port]
-The underlying implementation type of I/O object.
 
+ void bind(
+ const endpoint_type & endpoint);
 
- typedef service_type::implementation_type implementation_type;
 
+This function binds the socket to the specified endpoint on the local machine.
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/basic_serial_port.hpp]
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+]
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:io_service basic_serial_port::io_service]
 
+[heading Example]
+
 
-['Inherited from basic_io_object.]
 
-[indexterm2 io_service..basic_serial_port]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
 
 
- boost::asio::io_service & io_service();
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+[endsect]
 
 
 
-[endsect]
+[section:overload2 basic_seq_packet_socket::bind (2 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[section:is_open basic_serial_port::is_open]
 
-[indexterm2 is_open..basic_serial_port]
-Determine whether the serial port is open.
+Bind the socket to the given local endpoint.
 
 
- bool is_open() const;
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
 
 
+This function binds the socket to the specified endpoint on the local machine.
 
-[endsect]
 
+[heading Parameters]
+
 
-[section:lowest_layer basic_serial_port::lowest_layer]
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
-[indexterm2 lowest_layer..basic_serial_port]
-Get a reference to the lowest layer.
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
- lowest_layer_type & ``[link boost_asio.reference.basic_serial_port.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.lowest_layer.overload1 more...]]``
 
+[heading Example]
+
 
-Get a const reference to the lowest layer.
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ boost::system::error_code ec;
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
- const lowest_layer_type & ``[link boost_asio.reference.basic_serial_port.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.lowest_layer.overload2 more...]]``
 
 
-[section:overload1 basic_serial_port::lowest_layer (1 of 2 overloads)]
 
 
-Get a reference to the lowest layer.
 
 
- lowest_layer_type & lowest_layer();
+[endsect]
 
 
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_serial_port `basic_serial_port`] cannot contain any further layers, it simply returns a reference to itself.
+[endsect]
 
 
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+[section:broadcast basic_seq_packet_socket::broadcast]
 
 
+['Inherited from socket_base.]
 
+[indexterm2 broadcast..basic_seq_packet_socket]
+Socket option to permit sending of broadcast messages.
 
-[endsect]
 
+ typedef implementation_defined broadcast;
 
 
-[section:overload2 basic_serial_port::lowest_layer (2 of 2 overloads)]
 
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
 
-Get a const reference to the lowest layer.
 
+[heading Examples]
+
+Setting the option:
 
- const lowest_layer_type & lowest_layer() const;
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
 
 
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_serial_port `basic_serial_port`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[endsect]
 
 
-[endsect]
 
 
-[section:lowest_layer_type basic_serial_port::lowest_layer_type]
 
-[indexterm2 lowest_layer_type..basic_serial_port]
-A [link boost_asio.reference.basic_serial_port `basic_serial_port`] is always the lowest layer.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
- typedef basic_serial_port< SerialPortService > lowest_layer_type;
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+[section:bytes_readable basic_seq_packet_socket::bytes_readable]
 
- [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
- [A basic_serial_port is always the lowest layer. ]
-
- ]
 
- [
+['Inherited from socket_base.]
 
- [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
- [The native representation of a serial port. ]
-
- ]
+[indexterm2 bytes_readable..basic_seq_packet_socket]
+IO control command to get the amount of data that can be read without blocking.
 
- [
 
- [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+ typedef implementation_defined bytes_readable;
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
- [Assign an existing native serial port to the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.basic_serial_port [*basic_serial_port]]]
- [Construct a basic_serial_port without opening it.
+Implements the FIONREAD IO control command.
 
- Construct and open a basic_serial_port.
 
- Construct a basic_serial_port on an existing native serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.close [*close]]]
- [Close the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.get_option [*get_option]]]
- [Get an option from the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
- [Determine whether the serial port is open. ]
- ]
+[heading Example]
   
- [
- [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.native [*native]]]
- [Get the native serial port representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.open [*open]]]
- [Open the serial port using the specified device name. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.read_some [*read_some]]]
- [Read some data from the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.send_break [*send_break]]]
- [Send a break sequence to the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.set_option [*set_option]]]
- [Set an option on the serial port. ]
- ]
-
- [
- [[link boost_asio.reference.basic_serial_port.write_some [*write_some]]]
- [Write some data to the serial port. ]
- ]
-
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
- [
- [[link boost_asio.reference.basic_serial_port.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_serial_port.service [*service]]]
- [The service associated with the I/O object. ]
- ]
 
-]
 
-The [link boost_asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/basic_serial_port.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:cancel basic_seq_packet_socket::cancel]
 
+[indexterm2 cancel..basic_seq_packet_socket]
+Cancel all asynchronous operations associated with the socket.
 
-[endsect]
 
+ void ``[link boost_asio.reference.basic_seq_packet_socket.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.cancel.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.cancel.overload2 more...]]``
 
-[section:native basic_serial_port::native]
 
-[indexterm2 native..basic_serial_port]
-Get the native serial port representation.
+[section:overload1 basic_seq_packet_socket::cancel (1 of 2 overloads)]
 
 
- native_type native();
+['Inherited from basic_socket.]
 
 
-This function may be used to obtain the underlying representation of the serial port. This is intended to allow access to native serial port functionality that is not otherwise provided.
+Cancel all asynchronous operations associated with the socket.
 
 
-[endsect]
+ void cancel();
 
 
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
-[section:native_type basic_serial_port::native_type]
 
-[indexterm2 native_type..basic_serial_port]
-The native representation of a serial port.
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
- typedef SerialPortService::native_type native_type;
+]
 
 
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_serial_port.hpp]
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
-[endsect]
+For portable cancellation, consider using one of the following alternatives:
 
 
-[section:open basic_serial_port::open]
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
-[indexterm2 open..basic_serial_port]
-Open the serial port using the specified device name.
 
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
- void ``[link boost_asio.reference.basic_serial_port.open.overload1 open]``(
- const std::string & device);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.open.overload1 more...]]``
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.open.overload2 open]``(
- const std::string & device,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.open.overload2 more...]]``
 
+[endsect]
 
-[section:overload1 basic_serial_port::open (1 of 2 overloads)]
 
 
-Open the serial port using the specified device name.
+[section:overload2 basic_seq_packet_socket::cancel (2 of 2 overloads)]
 
 
- void open(
- const std::string & device);
+['Inherited from basic_socket.]
 
 
-This function opens the serial port for the specified device name.
+Cancel all asynchronous operations associated with the socket.
 
 
-[heading Parameters]
-
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
 
-[variablelist
-
-[[device][The platform-specific device name.]]
 
-]
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Exceptions]
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
 
-[endsect]
-
-
-
-[section:overload2 basic_serial_port::open (2 of 2 overloads)]
-
-
-Open the serial port using the specified device name.
-
-
- boost::system::error_code open(
- const std::string & device,
- boost::system::error_code & ec);
-
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
-This function opens the serial port using the given platform-specific device name.
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
-[heading Parameters]
-
+For portable cancellation, consider using one of the following alternatives:
 
-[variablelist
-
-[[device][The platform-specific device name.]]
 
-[[ec][Set the indicate what error occurred, if any. ]]
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
-]
 
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
@@ -14754,54 +16663,33 @@
 
 [endsect]
 
-[section:read_some basic_serial_port::read_some]
+[section:close basic_seq_packet_socket::close]
 
-[indexterm2 read_some..basic_serial_port]
-Read some data from the serial port.
+[indexterm2 close..basic_seq_packet_socket]
+Close the socket.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_serial_port.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.read_some.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_seq_packet_socket.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.close.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_serial_port.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.close.overload2 close]``(
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.read_some.overload2 more...]]``
-
-
-[section:overload1 basic_serial_port::read_some (1 of 2 overloads)]
-
-
-Read some data from the serial port.
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.close.overload2 more...]]``
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+[section:overload1 basic_seq_packet_socket::close (1 of 2 overloads)]
 
 
-This function is used to read data from the serial port. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+['Inherited from basic_socket.]
 
 
-[heading Parameters]
-
+Close the socket.
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
 
-]
+ void close();
 
 
-[heading Return Value]
-
-The number of bytes read.
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
 [heading Exceptions]
@@ -14809,46 +16697,36 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
 [heading Remarks]
       
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
-
-
-[heading Example]
-
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
-
- serial_port.read_some(boost::asio::buffer(data, size));
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
+[endsect]
 
 
-[endsect]
 
+[section:overload2 basic_seq_packet_socket::close (2 of 2 overloads)]
 
 
-[section:overload2 basic_serial_port::read_some (2 of 2 overloads)]
+['Inherited from basic_socket.]
 
 
-Read some data from the serial port.
+Close the socket.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
+ boost::system::error_code close(
       boost::system::error_code & ec);
 
 
-This function is used to read data from the serial port. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -14856,21 +16734,31 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be read.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
 
 
 [heading Remarks]
       
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
 
@@ -14880,59 +16768,96 @@
 
 [endsect]
 
-[section:send_break basic_serial_port::send_break]
+[section:connect basic_seq_packet_socket::connect]
 
-[indexterm2 send_break..basic_serial_port]
-Send a break sequence to the serial port.
+[indexterm2 connect..basic_seq_packet_socket]
+Connect the socket to the specified endpoint.
 
 
- void ``[link boost_asio.reference.basic_serial_port.send_break.overload1 send_break]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.send_break.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_seq_packet_socket.connect.overload1 connect]``(
+ const endpoint_type & peer_endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.connect.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.send_break.overload2 send_break]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.send_break.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.connect.overload2 more...]]``
 
 
-[section:overload1 basic_serial_port::send_break (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::connect (1 of 2 overloads)]
 
 
-Send a break sequence to the serial port.
+['Inherited from basic_socket.]
 
 
- void send_break();
+Connect the socket to the specified endpoint.
 
 
-This function causes a break sequence of platform-specific duration to be sent out the serial port.
+ void connect(
+ const endpoint_type & peer_endpoint);
 
 
-[heading Exceptions]
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+
+
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
 
 ]
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
-
+]
 
 
-[section:overload2 basic_serial_port::send_break (2 of 2 overloads)]
+[heading Example]
+
 
 
-Send a break sequence to the serial port.
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.connect(endpoint);
 
 
- boost::system::error_code send_break(
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_seq_packet_socket::connect (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Connect the socket to the specified endpoint.
+
+
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
 
 
-This function causes a break sequence of platform-specific duration to be sent out the serial port.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
 [heading Parameters]
@@ -14940,11 +16865,31 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any. ]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ boost::system::error_code ec;
+ socket.connect(endpoint, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
 
 
 [endsect]
@@ -14953,39 +16898,52 @@
 [endsect]
 
 
-[section:service basic_serial_port::service]
+[section:debug basic_seq_packet_socket::debug]
 
 
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
 
-[indexterm2 service..basic_serial_port]
-The service associated with the I/O object.
+[indexterm2 debug..basic_seq_packet_socket]
+Socket option to enable socket-level debugging.
 
 
- service_type & service;
+ typedef implementation_defined debug;
 
 
 
-[endsect]
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[section:service_type basic_serial_port::service_type]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
 
 
-['Inherited from basic_io_object.]
 
-[indexterm2 service_type..basic_serial_port]
-The type of the service that will be used to provide I/O operations.
 
 
- typedef SerialPortService service_type;
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
+
+
+
+
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_serial_port.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -14993,137 +16951,193 @@
 [endsect]
 
 
-[section:set_option basic_serial_port::set_option]
 
-[indexterm2 set_option..basic_serial_port]
-Set an option on the serial port.
+[section:do_not_route basic_seq_packet_socket::do_not_route]
 
 
- template<
- typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
- void ``[link boost_asio.reference.basic_serial_port.set_option.overload1 set_option]``(
- const SettableSerialPortOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.set_option.overload1 more...]]``
+['Inherited from socket_base.]
 
- template<
- typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_serial_port.set_option.overload2 set_option]``(
- const SettableSerialPortOption & option,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.set_option.overload2 more...]]``
+[indexterm2 do_not_route..basic_seq_packet_socket]
+Socket option to prevent routing, use local interfaces only.
 
 
-[section:overload1 basic_serial_port::set_option (1 of 2 overloads)]
+ typedef implementation_defined do_not_route;
 
 
-Set an option on the serial port.
 
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
- template<
- typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
- void set_option(
- const SettableSerialPortOption & option);
 
+[heading Examples]
+
+Setting the option:
 
-This function is used to set an option on the serial port.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[option][The option value to be set on the serial port.]]
 
-]
+
+Getting the current option value:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
 
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 basic_serial_port::set_option (2 of 2 overloads)]
+[section:enable_connection_aborted basic_seq_packet_socket::enable_connection_aborted]
 
 
-Set an option on the serial port.
+['Inherited from socket_base.]
 
+[indexterm2 enable_connection_aborted..basic_seq_packet_socket]
+Socket option to report aborted connections on accept.
 
- template<
- typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
- boost::system::error_code set_option(
- const SettableSerialPortOption & option,
- boost::system::error_code & ec);
 
+ typedef implementation_defined enable_connection_aborted;
 
-This function is used to set an option on the serial port.
 
 
-[heading Parameters]
-
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
-[variablelist
+
+[heading Examples]
   
-[[option][The option value to be set on the serial port.]]
+Setting the option:
 
-[[ec][Set to indicate what error occurred, if any.]]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
 
-]
 
 
 
 
+Getting the current option value:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:endpoint_type basic_seq_packet_socket::endpoint_type]
+
+[indexterm2 endpoint_type..basic_seq_packet_socket]
+The endpoint type.
+
+
+ typedef Protocol::endpoint endpoint_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
 
 [endsect]
 
 
+
+[section:get_io_service basic_seq_packet_socket::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..basic_seq_packet_socket]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+
+
+
+
 [endsect]
 
-[section:write_some basic_serial_port::write_some]
 
-[indexterm2 write_some..basic_serial_port]
-Write some data to the serial port.
+[section:get_option basic_seq_packet_socket::get_option]
 
+[indexterm2 get_option..basic_seq_packet_socket]
+Get an option from the socket.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_serial_port.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.write_some.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_serial_port.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.write_some.overload2 more...]]``
+ void ``[link boost_asio.reference.basic_seq_packet_socket.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.get_option.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.get_option.overload2 more...]]``
 
 
-[section:overload1 basic_serial_port::write_some (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::get_option (1 of 2 overloads)]
 
 
-Write some data to the serial port.
+['Inherited from basic_socket.]
+
+
+Get an option from the socket.
 
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option) const;
 
 
-This function is used to write data to the serial port. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+This function is used to get the current value of an option on the socket.
 
 
 [heading Parameters]
@@ -15131,39 +17145,34 @@
 
 [variablelist
   
-[[buffers][One or more data buffers to be written to the serial port.]]
+[[option][The option value to be obtained from the socket.]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes written.
-
-
 [heading Exceptions]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
-
 
 [heading Example]
   
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
 
- serial_port.write_some(boost::asio::buffer(data, size));
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -15172,20 +17181,23 @@
 
 
 
-[section:overload2 basic_serial_port::write_some (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::get_option (2 of 2 overloads)]
 
 
-Write some data to the serial port.
+['Inherited from basic_socket.]
+
+
+Get an option from the socket.
 
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
-This function is used to write data to the serial port. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+This function is used to get the current value of an option on the socket.
 
 
 [heading Parameters]
@@ -15193,26 +17205,33 @@
 
 [variablelist
   
-[[buffers][One or more data buffers to be written to the serial port.]]
+[[option][The option value to be obtained from the socket.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
 
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ boost::system::error_code ec;
+ socket.get_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ bool is_set = option.get();
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
 
 
-[endsect]
 
 
 [endsect]
@@ -15220,590 +17239,338 @@
 
 [endsect]
 
-[section:basic_socket basic_socket]
-
 
-Provides socket functionality.
+[section:implementation basic_seq_packet_socket::implementation]
 
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- class basic_socket :
- public basic_io_object< SocketService >,
- public socket_base
+['Inherited from basic_io_object.]
 
+[indexterm2 implementation..basic_seq_packet_socket]
+The underlying implementation of the I/O object.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+ implementation_type implementation;
 
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
 
- [
+[section:implementation_type basic_seq_packet_socket::implementation_type]
 
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
 
- [
+['Inherited from basic_io_object.]
 
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+[indexterm2 implementation_type..basic_seq_packet_socket]
+The underlying implementation type of I/O object.
 
- [
 
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+ typedef service_type::implementation_type implementation_type;
 
- [
 
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+[heading Requirements]
 
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
 
- [
+[section:io_control basic_seq_packet_socket::io_control]
 
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+[indexterm2 io_control..basic_seq_packet_socket]
+Perform an IO control command on the socket.
 
- [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+ void ``[link boost_asio.reference.basic_seq_packet_socket.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.io_control.overload1 more...]]``
 
- [
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.io_control.overload2 more...]]``
 
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
 
- [
+[section:overload1 basic_seq_packet_socket::io_control (1 of 2 overloads)]
 
- [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
+['Inherited from basic_socket.]
 
- [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
 
- [
+Perform an IO control command on the socket.
 
- [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
 
- [
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
- [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
 
- [
+This function is used to execute an IO control command on the socket.
 
- [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+[variablelist
   
- ]
+[[command][The IO control command to be performed on the socket.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
 
- [
+[heading Exceptions]
+
 
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
+
+[heading Example]
   
- [
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it.
+Getting the number of bytes ready to read:
 
- Construct and open a basic_socket.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
- Construct a basic_socket, opening it and binding it to the given local endpoint.
 
- Construct a basic_socket on an existing native socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.close [*close]]]
- [Close the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
-
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
-
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
 
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[section:overload2 basic_seq_packet_socket::io_control (2 of 2 overloads)]
 
- [
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+['Inherited from basic_socket.]
 
-]
 
-The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+Perform an IO control command on the socket.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
-[*Shared] [*objects:] Unsafe.
 
+This function is used to execute an IO control command on the socket.
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+[[ec][Set to indicate what error occurred, if any.]]
 
-[section:assign basic_socket::assign]
+]
 
-[indexterm2 assign..basic_socket]
-Assign an existing native socket to the socket.
 
 
- void ``[link boost_asio.reference.basic_socket.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.assign.overload1 more...]]``
+[heading Example]
+
+Getting the number of bytes ready to read:
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.assign.overload2 more...]]``
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ boost::system::error_code ec;
+ socket.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
 
 
-[section:overload1 basic_socket::assign (1 of 2 overloads)]
 
 
-Assign an existing native socket to the socket.
 
 
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
 
+[endsect]
 
 
 [endsect]
 
 
+[section:is_open basic_seq_packet_socket::is_open]
 
-[section:overload2 basic_socket::assign (2 of 2 overloads)]
 
+['Inherited from basic_socket.]
 
-Assign an existing native socket to the socket.
+[indexterm2 is_open..basic_seq_packet_socket]
+Determine whether the socket is open.
 
 
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+ bool is_open() const;
 
 
 
 [endsect]
 
 
-[endsect]
 
+[section:keep_alive basic_seq_packet_socket::keep_alive]
 
-[section:async_connect basic_socket::async_connect]
 
-[indexterm2 async_connect..basic_socket]
-Start an asynchronous connect.
+['Inherited from socket_base.]
 
+[indexterm2 keep_alive..basic_seq_packet_socket]
+Socket option to send keep-alives.
 
- template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
 
+ typedef implementation_defined keep_alive;
 
-This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
-[heading Parameters]
-
 
-[variablelist
+[heading Examples]
   
-[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
+Setting the option:
 
-[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
 
-]
 
 
-[heading Example]
-
 
 
- void connect_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Connect succeeded.
- }
- }
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
-
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.async_connect(endpoint, connect_handler);
-
-
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
 
 
 
-[endsect]
 
 
-[section:at_mark basic_socket::at_mark]
+[heading Requirements]
 
-[indexterm2 at_mark..basic_socket]
-Determine whether the socket is at the out-of-band data mark.
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- bool ``[link boost_asio.reference.basic_socket.at_mark.overload1 at_mark]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.at_mark.overload1 more...]]``
 
- bool ``[link boost_asio.reference.basic_socket.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.at_mark.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 basic_socket::at_mark (1 of 2 overloads)]
 
+[section:linger basic_seq_packet_socket::linger]
 
-Determine whether the socket is at the out-of-band data mark.
 
+['Inherited from socket_base.]
 
- bool at_mark() const;
+[indexterm2 linger..basic_seq_packet_socket]
+Socket option to specify whether the socket lingers on close if unsent data is present.
 
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+ typedef implementation_defined linger;
 
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
 
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
-[heading Exceptions]
-
 
-[variablelist
+[heading Examples]
   
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
-
-
-
-
-[endsect]
-
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
 
-[section:overload2 basic_socket::at_mark (2 of 2 overloads)]
 
 
-Determine whether the socket is at the out-of-band data mark.
 
 
- bool at_mark(
- boost::system::error_code & ec) const;
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option;
+ socket.get_option(option);
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
 
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
-
-[section:available basic_socket::available]
+[section:local_endpoint basic_seq_packet_socket::local_endpoint]
 
-[indexterm2 available..basic_socket]
-Determine the number of bytes available for reading.
+[indexterm2 local_endpoint..basic_seq_packet_socket]
+Get the local endpoint of the socket.
 
 
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.available.overload1 more...]]``
+ endpoint_type ``[link boost_asio.reference.basic_seq_packet_socket.local_endpoint.overload1 local_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.local_endpoint.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
+ endpoint_type ``[link boost_asio.reference.basic_seq_packet_socket.local_endpoint.overload2 local_endpoint]``(
       boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.available.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.local_endpoint.overload2 more...]]``
 
 
-[section:overload1 basic_socket::available (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::local_endpoint (1 of 2 overloads)]
 
 
-Determine the number of bytes available for reading.
+['Inherited from basic_socket.]
 
 
- std::size_t available() const;
+Get the local endpoint of the socket.
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+ endpoint_type local_endpoint() const;
+
+
+This function is used to obtain the locally bound endpoint of the socket.
 
 
 [heading Return Value]
       
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+An object that represents the local endpoint of the socket.
 
 
 [heading Exceptions]
@@ -15811,28 +17578,43 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+
+
+
 
 
 [endsect]
 
 
 
-[section:overload2 basic_socket::available (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::local_endpoint (2 of 2 overloads)]
 
 
-Determine the number of bytes available for reading.
+['Inherited from basic_socket.]
 
 
- std::size_t available(
+Get the local endpoint of the socket.
+
+
+ endpoint_type local_endpoint(
       boost::system::error_code & ec) const;
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to obtain the locally bound endpoint of the socket.
 
 
 [heading Parameters]
@@ -15847,76 +17629,68 @@
 
 [heading Return Value]
       
-The number of bytes that may be read without blocking, or 0 if an error occurs.
-
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
 
+[heading Example]
+
 
-[endsect]
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-[endsect]
 
-[section:basic_socket basic_socket::basic_socket]
 
-[indexterm2 basic_socket..basic_socket]
-Construct a [link boost_asio.reference.basic_socket `basic_socket`] without opening it.
 
 
- explicit ``[link boost_asio.reference.basic_socket.basic_socket.overload1 basic_socket]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload1 more...]]``
 
 
-Construct and open a [link boost_asio.reference.basic_socket `basic_socket`].
+[endsect]
 
 
- ``[link boost_asio.reference.basic_socket.basic_socket.overload2 basic_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload2 more...]]``
+[endsect]
 
+[section:lowest_layer basic_seq_packet_socket::lowest_layer]
 
-Construct a [link boost_asio.reference.basic_socket `basic_socket`], opening it and binding it to the given local endpoint.
+[indexterm2 lowest_layer..basic_seq_packet_socket]
+Get a reference to the lowest layer.
 
 
- ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload3 more...]]``
+ lowest_layer_type & ``[link boost_asio.reference.basic_seq_packet_socket.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.lowest_layer.overload1 more...]]``
 
 
-Construct a [link boost_asio.reference.basic_socket `basic_socket`] on an existing native socket.
+Get a const reference to the lowest layer.
 
 
- ``[link boost_asio.reference.basic_socket.basic_socket.overload4 basic_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload4 more...]]``
+ const lowest_layer_type & ``[link boost_asio.reference.basic_seq_packet_socket.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.lowest_layer.overload2 more...]]``
 
 
-[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
+[section:overload1 basic_seq_packet_socket::lowest_layer (1 of 2 overloads)]
 
 
-Construct a [link boost_asio.reference.basic_socket `basic_socket`] without opening it.
+['Inherited from basic_socket.]
 
 
- basic_socket(
- boost::asio::io_service & io_service);
+Get a reference to the lowest layer.
 
 
-This constructor creates a socket without opening it.
+ lowest_layer_type & lowest_layer();
 
 
-[heading Parameters]
-
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
 
-]
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
 
 
@@ -15925,302 +17699,487 @@
 
 
 
-[section:overload2 basic_socket::basic_socket (2 of 4 overloads)]
-
-
-Construct and open a [link boost_asio.reference.basic_socket `basic_socket`].
-
+[section:overload2 basic_seq_packet_socket::lowest_layer (2 of 2 overloads)]
 
- basic_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
 
+['Inherited from basic_socket.]
 
-This constructor creates and opens a socket.
 
+Get a const reference to the lowest layer.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+ const lowest_layer_type & lowest_layer() const;
 
-[[protocol][An object specifying protocol parameters to be used.]]
 
-]
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Exceptions]
-
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
 
 
+[endsect]
 
 
 [endsect]
 
 
-
-[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
+[section:lowest_layer_type basic_seq_packet_socket::lowest_layer_type]
 
 
-Construct a [link boost_asio.reference.basic_socket `basic_socket`], opening it and binding it to the given local endpoint.
+['Inherited from basic_socket.]
 
+[indexterm2 lowest_layer_type..basic_seq_packet_socket]
+A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
- basic_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
 
+ typedef basic_socket< Protocol, SeqPacketSocketService > lowest_layer_type;
 
-This constructor creates a socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[heading Parameters]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+ ]
 
-]
+ [
 
+ [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
 
-[heading Exceptions]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
   
-[[boost::system::system_error][Thrown on failure. ]]
+ ]
 
-]
+ [
 
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
+ [
 
-[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
+ [
 
-Construct a [link boost_asio.reference.basic_socket `basic_socket`] on an existing native socket.
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
 
+ [
 
- basic_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
 
+ [
 
-This constructor creates a socket object to hold an existing native socket.
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
 
+ [
 
-[heading Parameters]
-
-
-[variablelist
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+ ]
 
-[[protocol][An object specifying protocol parameters to be used.]]
+ [
 
-[[native_socket][A native socket.]]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
 
-]
+ [
 
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
 
-[heading Exceptions]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
 
-[section:bind basic_socket::bind]
+ [
 
-[indexterm2 bind..basic_socket]
-Bind the socket to the given local endpoint.
+ [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
 
+ [
 
- void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.bind.overload1 more...]]``
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.bind.overload2 more...]]``
+ [
 
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
 
-[section:overload1 basic_socket::bind (1 of 2 overloads)]
+ [
 
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
 
-Bind the socket to the given local endpoint.
+ [
 
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
 
- void bind(
- const endpoint_type & endpoint);
+]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-This function binds the socket to the specified endpoint on the local machine.
+ [
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it.
 
+ Construct and open a basic_socket.
 
-[heading Parameters]
-
+ Construct a basic_socket, opening it and binding it to the given local endpoint.
 
-[variablelist
+ Construct a basic_socket on an existing native socket. ]
+ ]
   
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-
-]
-
+ [
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
 
-[heading Exceptions]
-
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
-[variablelist
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
   
-[[boost::system::system_error][Thrown on failure.]]
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
 ]
 
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
 
-[heading Example]
+ [
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
   
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345));
+ [
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
 
+]
 
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
 
+]
 
-[section:overload2 basic_socket::bind (2 of 2 overloads)]
+The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
 
 
-Bind the socket to the given local endpoint.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
+[*Shared] [*objects:] Unsafe.
 
- boost::system::error_code bind(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
 
 
-This function binds the socket to the specified endpoint on the local machine.
 
+[heading Requirements]
 
-[heading Parameters]
-
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[*Convenience header: ][^boost/asio.hpp]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[endsect]
 
 
-[heading Example]
-
 
+[section:max_connections basic_seq_packet_socket::max_connections]
 
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
- if (ec)
- {
- // An error occurred.
- }
 
+['Inherited from socket_base.]
 
+[indexterm2 max_connections..basic_seq_packet_socket]
+The maximum length of the queue of pending incoming connections.
 
 
+ static const int max_connections = implementation_defined;
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:broadcast basic_socket::broadcast]
+[section:message_do_not_route basic_seq_packet_socket::message_do_not_route]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 broadcast..basic_socket]
-Socket option to permit sending of broadcast messages.
+[indexterm2 message_do_not_route..basic_seq_packet_socket]
+Specify that the data should not be subject to routing.
 
 
- typedef implementation_defined broadcast;
+ static const int message_do_not_route = implementation_defined;
 
 
 
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[endsect]
 
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+[section:message_end_of_record basic_seq_packet_socket::message_end_of_record]
 
 
+['Inherited from socket_base.]
 
+[indexterm2 message_end_of_record..basic_seq_packet_socket]
+Specifies that the data marks the end of a record.
 
 
-Getting the current option value:
+ static const int message_end_of_record = implementation_defined;
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+
+
+[endsect]
 
 
 
+[section:message_flags basic_seq_packet_socket::message_flags]
 
 
+['Inherited from socket_base.]
+
+[indexterm2 message_flags..basic_seq_packet_socket]
+Bitmask type for flags that can be passed to send and receive operations.
+
+
+ typedef int message_flags;
+
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -16229,182 +18188,249 @@
 
 
 
-[section:bytes_readable basic_socket::bytes_readable]
+[section:message_out_of_band basic_seq_packet_socket::message_out_of_band]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 bytes_readable..basic_socket]
-IO control command to get the amount of data that can be read without blocking.
+[indexterm2 message_out_of_band..basic_seq_packet_socket]
+Process out-of-band data.
 
 
- typedef implementation_defined bytes_readable;
+ static const int message_out_of_band = implementation_defined;
 
 
 
-Implements the FIONREAD IO control command.
+[endsect]
 
 
-[heading Example]
-
 
+[section:message_peek basic_seq_packet_socket::message_peek]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
 
+['Inherited from socket_base.]
 
+[indexterm2 message_peek..basic_seq_packet_socket]
+Peek at incoming data without removing it from the input queue.
 
 
+ static const int message_peek = implementation_defined;
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:native basic_seq_packet_socket::native]
 
-[endsect]
 
+['Inherited from basic_socket.]
 
-[section:cancel basic_socket::cancel]
+[indexterm2 native..basic_seq_packet_socket]
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
-[indexterm2 cancel..basic_socket]
-Cancel all asynchronous operations associated with the socket.
 
+ native_type native();
 
- void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.cancel.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.cancel.overload2 more...]]``
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
-[section:overload1 basic_socket::cancel (1 of 2 overloads)]
+[endsect]
 
 
-Cancel all asynchronous operations associated with the socket.
 
+[section:native_handle basic_seq_packet_socket::native_handle]
 
- void cancel();
 
+['Inherited from basic_socket.]
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+[indexterm2 native_handle..basic_seq_packet_socket]
+Get the native socket representation.
 
 
-[heading Exceptions]
-
+ native_handle_type native_handle();
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
-[heading Remarks]
-
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
+[endsect]
 
 
-* It will only cancel asynchronous operations that were initiated in the current thread.
 
+[section:native_handle_type basic_seq_packet_socket::native_handle_type]
 
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+[indexterm2 native_handle_type..basic_seq_packet_socket]
+The native representation of a socket.
 
-For portable cancellation, consider using one of the following alternatives:
 
+ typedef SeqPacketSocketService::native_handle_type native_handle_type;
 
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
 
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
+[heading Requirements]
 
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:native_non_blocking basic_seq_packet_socket::native_non_blocking]
 
-[section:overload2 basic_socket::cancel (2 of 2 overloads)]
+[indexterm2 native_non_blocking..basic_seq_packet_socket]
+Gets the non-blocking mode of the native socket implementation.
 
 
-Cancel all asynchronous operations associated with the socket.
+ bool ``[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload1 more...]]``
 
 
- boost::system::error_code cancel(
+Sets the non-blocking mode of the native socket implementation.
+
+
+ void ``[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload2 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.native_non_blocking.overload3 more...]]``
 
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+[section:overload1 basic_seq_packet_socket::native_non_blocking (1 of 3 overloads)]
 
 
-[heading Parameters]
-
+['Inherited from basic_socket.]
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+Gets the non-blocking mode of the native socket implementation.
+
+
+ bool native_non_blocking() const;
+
+
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
+
+
+[heading Return Value]
+
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
 
 [heading Remarks]
       
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
 
 
-* It will only cancel asynchronous operations that were initiated in the current thread.
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
-For portable cancellation, consider using one of the following alternatives:
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
 
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
 
-[endsect]
 
-[section:close basic_socket::close]
+[section:overload2 basic_seq_packet_socket::native_non_blocking (2 of 3 overloads)]
 
-[indexterm2 close..basic_socket]
-Close the socket.
 
+['Inherited from basic_socket.]
 
- void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.close.overload2 more...]]``
+Sets the non-blocking mode of the native socket implementation.
 
 
-[section:overload1 basic_socket::close (1 of 2 overloads)]
+ void native_non_blocking(
+ bool mode);
 
 
-Close the socket.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
- void close();
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
-This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+]
 
 
 [heading Exceptions]
@@ -16412,14 +18438,82 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
+
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
+
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
+
+
+
 
 
 
@@ -16428,17 +18522,21 @@
 
 
 
-[section:overload2 basic_socket::close (2 of 2 overloads)]
+[section:overload3 basic_seq_packet_socket::native_non_blocking (3 of 3 overloads)]
 
 
-Close the socket.
+['Inherited from basic_socket.]
 
 
- boost::system::error_code close(
+Sets the non-blocking mode of the native socket implementation.
+
+
+ boost::system::error_code native_non_blocking(
+ bool mode,
       boost::system::error_code & ec);
 
 
-This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Parameters]
@@ -16446,31 +18544,84 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any.]]
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
+
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
 [heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- socket.close(ec);
- if (ec)
+ template <typename Handler>
+ struct sendfile_op
    {
- // An error occurred.
- }
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
 
@@ -16480,120 +18631,71 @@
 
 [endsect]
 
-[section:connect basic_socket::connect]
 
-[indexterm2 connect..basic_socket]
-Connect the socket to the specified endpoint.
+[section:native_type basic_seq_packet_socket::native_type]
 
+[indexterm2 native_type..basic_seq_packet_socket]
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
- void ``[link boost_asio.reference.basic_socket.connect.overload1 connect]``(
- const endpoint_type & peer_endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.connect.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.connect.overload2 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.connect.overload2 more...]]``
+ typedef SeqPacketSocketService::native_handle_type native_type;
 
 
-[section:overload1 basic_socket::connect (1 of 2 overloads)]
 
+[heading Requirements]
 
-Connect the socket to the specified endpoint.
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- void connect(
- const endpoint_type & peer_endpoint);
 
+[endsect]
 
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+[section:non_blocking basic_seq_packet_socket::non_blocking]
 
+[indexterm2 non_blocking..basic_seq_packet_socket]
+Gets the non-blocking mode of the socket.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+ bool ``[link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload1 more...]]``
 
-]
 
+Sets the non-blocking mode of the socket.
 
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
-
-
-[heading Example]
-
-
-
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.connect(endpoint);
-
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:overload2 basic_socket::connect (2 of 2 overloads)]
-
-
-Connect the socket to the specified endpoint.
 
+ void ``[link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload2 more...]]``
 
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload3 non_blocking]``(
+ bool mode,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.non_blocking.overload3 more...]]``
 
 
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
-
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
-
+[section:overload1 basic_seq_packet_socket::non_blocking (1 of 3 overloads)]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+['Inherited from basic_socket.]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+Gets the non-blocking mode of the socket.
 
 
-[heading Example]
-
+ bool non_blocking() const;
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- boost::system::error_code ec;
- socket.connect(endpoint, ec);
- if (ec)
- {
- // An error occurred.
- }
 
+[heading Return Value]
+
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
 
@@ -16601,184 +18703,126 @@
 [endsect]
 
 
-[endsect]
-
 
-[section:debug basic_socket::debug]
+[section:overload2 basic_seq_packet_socket::non_blocking (2 of 3 overloads)]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
 
-[indexterm2 debug..basic_socket]
-Socket option to enable socket-level debugging.
 
+Sets the non-blocking mode of the socket.
 
- typedef implementation_defined debug;
 
+ void non_blocking(
+ bool mode);
 
 
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
-
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option;
- socket.get_option(option);
- bool is_set = option.value();
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
+]
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-[heading Requirements]
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:do_not_route basic_socket::do_not_route]
+[section:overload3 basic_seq_packet_socket::non_blocking (3 of 3 overloads)]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
 
-[indexterm2 do_not_route..basic_socket]
-Socket option to prevent routing, use local interfaces only.
 
+Sets the non-blocking mode of the socket.
 
- typedef implementation_defined do_not_route;
 
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
 
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option(true);
- socket.set_option(option);
-
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option;
- socket.get_option(option);
- bool is_set = option.value();
-
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
-
-[section:enable_connection_aborted basic_socket::enable_connection_aborted]
+[section:non_blocking_io basic_seq_packet_socket::non_blocking_io]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 enable_connection_aborted..basic_socket]
-Socket option to report aborted connections on accept.
+[indexterm2 non_blocking_io..basic_seq_packet_socket]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
 
- typedef implementation_defined enable_connection_aborted;
+ typedef implementation_defined non_blocking_io;
 
 
 
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
+Implements the FIONBIO IO control command.
 
 
-[heading Examples]
+[heading Example]
   
-Setting the option:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
-
 
 
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
-
-
-
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[endsect]
-
-
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
 
-[section:endpoint_type basic_socket::endpoint_type]
 
-[indexterm2 endpoint_type..basic_socket]
-The endpoint type.
 
 
- typedef Protocol::endpoint endpoint_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -16786,65 +18830,36 @@
 [endsect]
 
 
+[section:open basic_seq_packet_socket::open]
 
-[section:get_io_service basic_socket::get_io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 get_io_service..basic_socket]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & get_io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
+[indexterm2 open..basic_seq_packet_socket]
+Open the socket using the specified protocol.
 
-[section:get_option basic_socket::get_option]
 
-[indexterm2 get_option..basic_socket]
-Get an option from the socket.
+ void ``[link boost_asio.reference.basic_seq_packet_socket.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.open.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.open.overload2 more...]]``
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.get_option.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.get_option.overload2 get_option]``(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.get_option.overload2 more...]]``
+[section:overload1 basic_seq_packet_socket::open (1 of 2 overloads)]
 
 
-[section:overload1 basic_socket::get_option (1 of 2 overloads)]
+['Inherited from basic_socket.]
 
 
-Get an option from the socket.
+Open the socket using the specified protocol.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option) const;
+ void open(
+ const protocol_type & protocol = protocol_type());
 
 
-This function is used to get the current value of an option on the socket.
+This function opens the socket so that it will use the specified protocol.
 
 
 [heading Parameters]
@@ -16852,7 +18867,7 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the socket.]]
+[[protocol][An object specifying protocol parameters to be used.]]
 
 ]
 
@@ -16867,16 +18882,12 @@
 ]
 
 
-
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+
 
    boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::keep_alive option;
- socket.get_option(option);
- bool is_set = option.get();
+ socket.open(boost::asio::ip::tcp::v4());
 
 
 
@@ -16888,20 +18899,21 @@
 
 
 
-[section:overload2 basic_socket::get_option (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::open (2 of 2 overloads)]
 
 
-Get an option from the socket.
+['Inherited from basic_socket.]
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+Open the socket using the specified protocol.
 
 
-This function is used to get the current value of an option on the socket.
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+This function opens the socket so that it will use the specified protocol.
 
 
 [heading Parameters]
@@ -16909,74 +18921,50 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the socket.]]
+[[protocol][An object specifying which protocol is to be used.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+
 
    boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::keep_alive option;
    boost::system::error_code ec;
- socket.get_option(option, ec);
+ socket.open(boost::asio::ip::tcp::v4(), ec);
    if (ec)
    {
      // An error occurred.
    }
- bool is_set = option.get();
-
 
 
 
 
 
 
-[endsect]
-
 
 [endsect]
 
 
-[section:implementation basic_socket::implementation]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 implementation..basic_socket]
-The underlying implementation of the I/O object.
-
-
- implementation_type implementation;
-
-
-
 [endsect]
 
 
+[section:protocol_type basic_seq_packet_socket::protocol_type]
 
-[section:implementation_type basic_socket::implementation_type]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 implementation_type..basic_socket]
-The underlying implementation type of I/O object.
+[indexterm2 protocol_type..basic_seq_packet_socket]
+The protocol type.
 
 
- typedef service_type::implementation_type implementation_type;
+ typedef Protocol protocol_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -16984,39 +18972,55 @@
 [endsect]
 
 
-[section:io_control basic_socket::io_control]
+[section:receive basic_seq_packet_socket::receive]
 
-[indexterm2 io_control..basic_socket]
-Perform an IO control command on the socket.
+[indexterm2 receive..basic_seq_packet_socket]
+Receive some data on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void ``[link boost_asio.reference.basic_socket.io_control.overload1 io_control]``(
- IoControlCommand & command);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.io_control.overload1 more...]]``
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.receive.overload1 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags & out_flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.receive.overload1 more...]]``
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.receive.overload2 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.receive.overload2 more...]]``
+
+
+Receive some data on a connected socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.receive.overload3 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.io_control.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.receive.overload3 more...]]``
 
 
-[section:overload1 basic_socket::io_control (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::receive (1 of 3 overloads)]
 
 
-Perform an IO control command on the socket.
+Receive some data on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags & out_flags);
 
 
-This function is used to execute an IO control command on the socket.
+This function is used to receive data on the sequenced packet socket. The function call will block until data has been received successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -17024,34 +19028,36 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[buffers][One or more buffers into which the data will be received.]]
+
+[[out_flags][After the receive call completes, contains flags associated with the received data. For example, if the `socket_base::message_end_of_record` bit is set then the received data marks the end of a record.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes received.
+
+
 [heading Exceptions]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
 ]
 
 
-
 [heading Example]
   
-Getting the number of bytes ready to read:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.receive(boost::asio::buffer(data, size), out_flags);
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -17060,20 +19066,21 @@
 
 
 
-[section:overload2 basic_socket::io_control (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::receive (2 of 3 overloads)]
 
 
-Perform an IO control command on the socket.
+Receive some data on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
- boost::system::error_code & ec);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags);
 
 
-This function is used to execute an IO control command on the socket.
+This function is used to receive data on the sequenced packet socket. The function call will block until data has been received successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -17081,95 +19088,117 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[buffers][One or more buffers into which the data will be received.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[[in_flags][Flags specifying how the receive call is to be made.]]
+
+[[out_flags][After the receive call completes, contains flags associated with the received data. For example, if the `socket_base::message_end_of_record` bit is set then the received data marks the end of a record.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes received.
+
 
-[heading Example]
+[heading Exceptions]
+
+
+[variablelist
   
-Getting the number of bytes ready to read:
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- boost::system::error_code ec;
- socket.io_control(command, ec);
- if (ec)
- {
- // An error occurred.
- }
- std::size_t bytes_readable = command.get();
+]
 
 
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.receive(boost::asio::buffer(data, size), 0, out_flags);
+
+
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:io_service basic_socket::io_service]
 
+[section:overload3 basic_seq_packet_socket::receive (3 of 3 overloads)]
 
-['Inherited from basic_io_object.]
 
-[indexterm2 io_service..basic_socket]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+Receive some data on a connected socket.
 
 
- boost::asio::io_service & io_service();
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
+ boost::system::error_code & ec);
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+This function is used to receive data on the sequenced packet socket. The function call will block until data has been received successfully, or until an error occurs.
 
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
 
+[[in_flags][Flags specifying how the receive call is to be made.]]
 
+[[out_flags][After the receive call completes, contains flags associated with the received data. For example, if the `socket_base::message_end_of_record` bit is set then the received data marks the end of a record.]]
 
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[section:is_open basic_socket::is_open]
+[heading Return Value]
+
+The number of bytes received. Returns 0 if an error occurred.
 
-[indexterm2 is_open..basic_socket]
-Determine whether the socket is open.
 
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
- bool is_open() const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:keep_alive basic_socket::keep_alive]
+
+[section:receive_buffer_size basic_seq_packet_socket::receive_buffer_size]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 keep_alive..basic_socket]
-Socket option to send keep-alives.
+[indexterm2 receive_buffer_size..basic_seq_packet_socket]
+Socket option for the receive buffer size of a socket.
 
 
- typedef implementation_defined keep_alive;
+ typedef implementation_defined receive_buffer_size;
 
 
 
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
 
 [heading Examples]
@@ -17178,7 +19207,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::keep_alive option(true);
+ boost::asio::socket_base::receive_buffer_size option(8192);
    socket.set_option(option);
 
 
@@ -17189,9 +19218,9 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::keep_alive option;
+ boost::asio::socket_base::receive_buffer_size option;
    socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
 
 
 
@@ -17201,7 +19230,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -17210,20 +19239,20 @@
 
 
 
-[section:linger basic_socket::linger]
+[section:receive_low_watermark basic_seq_packet_socket::receive_low_watermark]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 linger..basic_socket]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[indexterm2 receive_low_watermark..basic_seq_packet_socket]
+Socket option for the receive low watermark.
 
 
- typedef implementation_defined linger;
+ typedef implementation_defined receive_low_watermark;
 
 
 
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
 
 [heading Examples]
@@ -17232,7 +19261,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::linger option(true, 30);
+ boost::asio::socket_base::receive_low_watermark option(1024);
    socket.set_option(option);
 
 
@@ -17243,10 +19272,9 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::linger option;
+ boost::asio::socket_base::receive_low_watermark option;
    socket.get_option(option);
- bool is_set = option.enabled();
- unsigned short timeout = option.timeout();
+ int size = option.value();
 
 
 
@@ -17256,7 +19284,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -17264,35 +19292,38 @@
 [endsect]
 
 
-[section:local_endpoint basic_socket::local_endpoint]
+[section:remote_endpoint basic_seq_packet_socket::remote_endpoint]
 
-[indexterm2 local_endpoint..basic_socket]
-Get the local endpoint of the socket.
+[indexterm2 remote_endpoint..basic_seq_packet_socket]
+Get the remote endpoint of the socket.
 
 
- endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload1 local_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.local_endpoint.overload1 more...]]``
+ endpoint_type ``[link boost_asio.reference.basic_seq_packet_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.remote_endpoint.overload1 more...]]``
 
- endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload2 local_endpoint]``(
+ endpoint_type ``[link boost_asio.reference.basic_seq_packet_socket.remote_endpoint.overload2 remote_endpoint]``(
       boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.local_endpoint.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.remote_endpoint.overload2 more...]]``
 
 
-[section:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::remote_endpoint (1 of 2 overloads)]
 
 
-Get the local endpoint of the socket.
+['Inherited from basic_socket.]
 
 
- endpoint_type local_endpoint() const;
+Get the remote endpoint of the socket.
 
 
-This function is used to obtain the locally bound endpoint of the socket.
+ endpoint_type remote_endpoint() const;
+
+
+This function is used to obtain the remote endpoint of the socket.
 
 
 [heading Return Value]
       
-An object that represents the local endpoint of the socket.
+An object that represents the remote endpoint of the socket.
 
 
 [heading Exceptions]
@@ -17311,7 +19342,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
 
 
@@ -17323,17 +19354,20 @@
 
 
 
-[section:overload2 basic_socket::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::remote_endpoint (2 of 2 overloads)]
 
 
-Get the local endpoint of the socket.
+['Inherited from basic_socket.]
 
 
- endpoint_type local_endpoint(
+Get the remote endpoint of the socket.
+
+
+ endpoint_type remote_endpoint(
       boost::system::error_code & ec) const;
 
 
-This function is used to obtain the locally bound endpoint of the socket.
+This function is used to obtain the remote endpoint of the socket.
 
 
 [heading Parameters]
@@ -17348,7 +19382,7 @@
 
 [heading Return Value]
       
-An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
 
 [heading Example]
@@ -17358,7 +19392,7 @@
    boost::asio::ip::tcp::socket socket(io_service);
    ...
    boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
    if (ec)
    {
      // An error occurred.
@@ -17375,420 +19409,236 @@
 
 [endsect]
 
-[section:lowest_layer basic_socket::lowest_layer]
 
-[indexterm2 lowest_layer..basic_socket]
-Get a reference to the lowest layer.
+[section:reuse_address basic_seq_packet_socket::reuse_address]
 
 
- lowest_layer_type & ``[link boost_asio.reference.basic_socket.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.lowest_layer.overload1 more...]]``
-
+['Inherited from socket_base.]
 
-Get a const reference to the lowest layer.
+[indexterm2 reuse_address..basic_seq_packet_socket]
+Socket option to allow the socket to be bound to an address that is already in use.
 
 
- const lowest_layer_type & ``[link boost_asio.reference.basic_socket.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.lowest_layer.overload2 more...]]``
+ typedef implementation_defined reuse_address;
 
 
-[section:overload1 basic_socket::lowest_layer (1 of 2 overloads)]
 
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
-Get a reference to the lowest layer.
 
+[heading Examples]
+
+Setting the option:
 
- lowest_layer_type & lowest_layer();
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
 
 
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
+Getting the current option value:
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
 
-[endsect]
 
 
 
-[section:overload2 basic_socket::lowest_layer (2 of 2 overloads)]
 
 
-Get a const reference to the lowest layer.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
- const lowest_layer_type & lowest_layer() const;
+[*Convenience header: ][^boost/asio.hpp]
 
 
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
+[endsect]
 
 
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+[section:send basic_seq_packet_socket::send]
 
+[indexterm2 send..basic_seq_packet_socket]
+Send some data on the socket.
 
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.send.overload1 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.send.overload1 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_seq_packet_socket.send.overload2 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.send.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 basic_seq_packet_socket::send (1 of 2 overloads)]
 
 
-[section:lowest_layer_type basic_socket::lowest_layer_type]
+Send some data on the socket.
 
-[indexterm2 lowest_layer_type..basic_socket]
-A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
 
- typedef basic_socket< Protocol, SocketService > lowest_layer_type;
 
+This function is used to send data on the sequenced packet socket. The function call will block until the data has been sent successfully, or an until error occurs.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
+[variablelist
   
- ]
-
- [
+[[buffers][One or more data buffers to be sent on the socket.]]
 
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+[[flags][Flags specifying how the send call is to be made.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
 
- [
+[heading Return Value]
+
+The number of bytes sent.
 
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
 
- [
+[heading Exceptions]
+
 
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+
+[heading Example]
   
- ]
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- [
+ socket.send(boost::asio::buffer(data, size), 0);
 
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+[section:overload2 basic_seq_packet_socket::send (2 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+Send some data on the socket.
 
- [
 
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
- [
 
- [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+This function is used to send data on the sequenced packet socket. The function call will block the data has been sent successfully, or an until error occurs.
 
- [
 
- [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[buffers][One or more data buffers to be sent on the socket.]]
 
- [
+[[flags][Flags specifying how the send call is to be made.]]
 
- [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+[[ec][Set to indicate what error occurred, if any.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
 
- [
+[heading Return Value]
+
+The number of bytes sent. Returns 0 if an error occurred.
 
- [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
 
- [
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
 
-]
+[endsect]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it.
+[section:send_buffer_size basic_seq_packet_socket::send_buffer_size]
 
- Construct and open a basic_socket.
 
- Construct a basic_socket, opening it and binding it to the given local endpoint.
+['Inherited from socket_base.]
 
- Construct a basic_socket on an existing native socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.close [*close]]]
- [Close the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+[indexterm2 send_buffer_size..basic_seq_packet_socket]
+Socket option for the send buffer size of a socket.
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
-
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ typedef implementation_defined send_buffer_size;
 
- [
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
- [
- [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
+[heading Examples]
+
+Setting the option:
 
- [
- [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
 
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
 
-]
+Getting the current option value:
 
-The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
 
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -17797,56 +19647,52 @@
 
 
 
-[section:max_connections basic_socket::max_connections]
+[section:send_low_watermark basic_seq_packet_socket::send_low_watermark]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 max_connections..basic_socket]
-The maximum length of the queue of pending incoming connections.
-
-
- static const int max_connections = implementation_defined;
-
-
-
-[endsect]
-
+[indexterm2 send_low_watermark..basic_seq_packet_socket]
+Socket option for the send low watermark.
 
 
-[section:message_do_not_route basic_socket::message_do_not_route]
+ typedef implementation_defined send_low_watermark;
 
 
-['Inherited from socket_base.]
 
-[indexterm2 message_do_not_route..basic_socket]
-Specify that the data should not be subject to routing.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
 
- static const int message_do_not_route = implementation_defined;
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
 
 
-[endsect]
 
 
 
-[section:message_flags basic_socket::message_flags]
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
-['Inherited from socket_base.]
 
-[indexterm2 message_flags..basic_socket]
-Bitmask type for flags that can be passed to send and receive operations.
 
 
- typedef int message_flags;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -17855,16 +19701,16 @@
 
 
 
-[section:message_out_of_band basic_socket::message_out_of_band]
+[section:service basic_seq_packet_socket::service]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_io_object.]
 
-[indexterm2 message_out_of_band..basic_socket]
-Process out-of-band data.
+[indexterm2 service..basic_seq_packet_socket]
+The service associated with the I/O object.
 
 
- static const int message_out_of_band = implementation_defined;
+ service_type & service;
 
 
 
@@ -17872,128 +19718,190 @@
 
 
 
-[section:message_peek basic_socket::message_peek]
+[section:service_type basic_seq_packet_socket::service_type]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_io_object.]
 
-[indexterm2 message_peek..basic_socket]
-Peek at incoming data without removing it from the input queue.
+[indexterm2 service_type..basic_seq_packet_socket]
+The type of the service that will be used to provide I/O operations.
 
 
- static const int message_peek = implementation_defined;
+ typedef SeqPacketSocketService service_type;
 
 
 
-[endsect]
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_seq_packet_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:native basic_socket::native]
 
-[indexterm2 native..basic_socket]
-Get the native socket representation.
+[endsect]
 
 
- native_type native();
+[section:set_option basic_seq_packet_socket::set_option]
 
+[indexterm2 set_option..basic_seq_packet_socket]
+Set an option on the socket.
 
-This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
+ void ``[link boost_asio.reference.basic_seq_packet_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.set_option.overload1 more...]]``
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.set_option.overload2 more...]]``
 
 
+[section:overload1 basic_seq_packet_socket::set_option (1 of 2 overloads)]
 
-[section:native_type basic_socket::native_type]
 
-[indexterm2 native_type..basic_socket]
-The native representation of a socket.
+['Inherited from basic_socket.]
 
 
- typedef SocketService::native_type native_type;
+Set an option on the socket.
 
 
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+This function is used to set an option on the socket.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
 
+]
 
 
-[section:non_blocking_io basic_socket::non_blocking_io]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-['Inherited from socket_base.]
+]
 
-[indexterm2 non_blocking_io..basic_socket]
-IO control command to set the blocking mode of the socket.
 
 
- typedef implementation_defined non_blocking_io;
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
 
 
-Implements the FIONBIO IO control command.
 
 
-[heading Example]
-
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
 
+[endsect]
 
 
 
+[section:overload2 basic_seq_packet_socket::set_option (2 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+Set an option on the socket.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
-[endsect]
 
+This function is used to set an option on the socket.
 
-[section:open basic_socket::open]
 
-[indexterm2 open..basic_socket]
-Open the socket using the specified protocol.
+[heading Parameters]
+
 
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
 
- void ``[link boost_asio.reference.basic_socket.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.open.overload1 more...]]``
+[[ec][Set to indicate what error occurred, if any.]]
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.open.overload2 open]``(
- const protocol_type & protocol,
+]
+
+
+
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ boost::system::error_code ec;
+ socket.set_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:shutdown basic_seq_packet_socket::shutdown]
+
+[indexterm2 shutdown..basic_seq_packet_socket]
+Disable sends or receives on the socket.
+
+
+ void ``[link boost_asio.reference.basic_seq_packet_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.shutdown.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_seq_packet_socket.shutdown.overload2 shutdown]``(
+ shutdown_type what,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.open.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_seq_packet_socket.shutdown.overload2 more...]]``
 
 
-[section:overload1 basic_socket::open (1 of 2 overloads)]
+[section:overload1 basic_seq_packet_socket::shutdown (1 of 2 overloads)]
 
 
-Open the socket using the specified protocol.
+['Inherited from basic_socket.]
 
 
- void open(
- const protocol_type & protocol = protocol_type());
+Disable sends or receives on the socket.
 
 
-This function opens the socket so that it will use the specified protocol.
+ void shutdown(
+ shutdown_type what);
+
+
+This function is used to disable send operations, receive operations, or both.
 
 
 [heading Parameters]
@@ -18001,7 +19909,7 @@
 
 [variablelist
   
-[[protocol][An object specifying protocol parameters to be used.]]
+[[what][Determines what types of operation will no longer be allowed.]]
 
 ]
 
@@ -18018,10 +19926,11 @@
 
 [heading Example]
   
-
+Shutting down the send side of the socket:
 
    boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ ...
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
 
 
 
@@ -18033,18 +19942,21 @@
 
 
 
-[section:overload2 basic_socket::open (2 of 2 overloads)]
+[section:overload2 basic_seq_packet_socket::shutdown (2 of 2 overloads)]
 
 
-Open the socket using the specified protocol.
+['Inherited from basic_socket.]
 
 
- boost::system::error_code open(
- const protocol_type & protocol,
+Disable sends or receives on the socket.
+
+
+ boost::system::error_code shutdown(
+ shutdown_type what,
       boost::system::error_code & ec);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function is used to disable send operations, receive operations, or both.
 
 
 [heading Parameters]
@@ -18052,7 +19964,7 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[what][Determines what types of operation will no longer be allowed.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -18061,11 +19973,12 @@
 
 [heading Example]
   
-
+Shutting down the send side of the socket:
 
    boost::asio::ip::tcp::socket socket(io_service);
+ ...
    boost::system::error_code ec;
- socket.open(boost::asio::ip::tcp::v4(), ec);
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
    if (ec)
    {
      // An error occurred.
@@ -18083,185 +19996,331 @@
 [endsect]
 
 
-[section:protocol_type basic_socket::protocol_type]
-
-[indexterm2 protocol_type..basic_socket]
-The protocol type.
+[section:shutdown_type basic_seq_packet_socket::shutdown_type]
 
 
- typedef Protocol protocol_type;
-
+['Inherited from socket_base.]
 
+[indexterm2 shutdown_type..basic_seq_packet_socket]
+Different ways a socket may be shutdown.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+ enum shutdown_type
 
-[*Convenience header: ][^boost/asio.hpp]
+[indexterm2 shutdown_receive..basic_seq_packet_socket]
+[indexterm2 shutdown_send..basic_seq_packet_socket]
+[indexterm2 shutdown_both..basic_seq_packet_socket]
 
+[heading Values]
+[variablelist
 
-[endsect]
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
 
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
 
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
 
-[section:receive_buffer_size basic_socket::receive_buffer_size]
+]
 
 
-['Inherited from socket_base.]
 
-[indexterm2 receive_buffer_size..basic_socket]
-Socket option for the receive buffer size of a socket.
+[endsect]
 
 
- typedef implementation_defined receive_buffer_size;
 
+[endsect]
 
+[section:basic_serial_port basic_serial_port]
 
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
+Provides serial port functionality.
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
+ template<
+ typename ``[link boost_asio.reference.SerialPortService SerialPortService]`` = serial_port_service>
+ class basic_serial_port :
+ public basic_io_object< SerialPortService >,
+ public serial_port_base
 
 
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
-Getting the current option value:
+ [
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+ [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_serial_port is always the lowest layer. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_serial_port.native_handle_type [*native_handle_type]]]
+ [The native representation of a serial port. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a serial port. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
+ [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
+ [Assign an existing native serial port to the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.basic_serial_port [*basic_serial_port]]]
+ [Construct a basic_serial_port without opening it.
 
+ Construct and open a basic_serial_port.
 
-[endsect]
+ Construct a basic_serial_port on an existing native serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.close [*close]]]
+ [Close the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.get_option [*get_option]]]
+ [Get an option from the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
+ [Determine whether the serial port is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
 
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native serial port representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.native_handle [*native_handle]]]
+ [Get the native serial port representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.open [*open]]]
+ [Open the serial port using the specified device name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.read_some [*read_some]]]
+ [Read some data from the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.send_break [*send_break]]]
+ [Send a break sequence to the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.set_option [*set_option]]]
+ [Set an option on the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.write_some [*write_some]]]
+ [Write some data to the serial port. ]
+ ]
+
+]
 
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
 
-[section:receive_low_watermark basic_socket::receive_low_watermark]
+ [
+ [[link boost_asio.reference.basic_serial_port.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_serial_port.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
 
-['Inherited from socket_base.]
+]
 
-[indexterm2 receive_low_watermark..basic_socket]
-Socket option for the receive low watermark.
+The [link boost_asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports.
 
 
- typedef implementation_defined receive_low_watermark;
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
+[*Shared] [*objects:] Unsafe.
 
 
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
+[heading Requirements]
 
-[heading Examples]
-
-Setting the option:
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+[*Convenience header: ][^boost/asio.hpp]
 
+[section:assign basic_serial_port::assign]
 
+[indexterm2 assign..basic_serial_port]
+Assign an existing native serial port to the serial port.
 
 
+ void ``[link boost_asio.reference.basic_serial_port.assign.overload1 assign]``(
+ const native_handle_type & native_serial_port);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.assign.overload1 more...]]``
 
-Getting the current option value:
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.assign.overload2 assign]``(
+ const native_handle_type & native_serial_port,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.assign.overload2 more...]]``
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
 
+[section:overload1 basic_serial_port::assign (1 of 2 overloads)]
 
 
+Assign an existing native serial port to the serial port.
 
 
+ void assign(
+ const native_handle_type & native_serial_port);
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload2 basic_serial_port::assign (2 of 2 overloads)]
 
 
-[section:remote_endpoint basic_socket::remote_endpoint]
+Assign an existing native serial port to the serial port.
 
-[indexterm2 remote_endpoint..basic_socket]
-Get the remote endpoint of the socket.
 
+ boost::system::error_code assign(
+ const native_handle_type & native_serial_port,
+ boost::system::error_code & ec);
 
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.remote_endpoint.overload1 more...]]``
 
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.remote_endpoint.overload2 more...]]``
 
+[endsect]
 
-[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
 
+[endsect]
 
-Get the remote endpoint of the socket.
 
+[section:async_read_some basic_serial_port::async_read_some]
 
- endpoint_type remote_endpoint() const;
+[indexterm2 async_read_some..basic_serial_port]
+Start an asynchronous read.
 
 
-This function is used to obtain the remote endpoint of the socket.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
 
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket.
+This function is used to asynchronously read data from the serial port. The function call always returns immediately.
 
 
-[heading Exceptions]
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+
+[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes read.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
 ]
 
 
-[heading Example]
-
+[heading Remarks]
+
+The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ serial_port.async_read_some(boost::asio::buffer(data, size), handler);
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -18270,17 +20329,21 @@
 
 
 
-[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
-
+[section:async_write_some basic_serial_port::async_write_some]
 
-Get the remote endpoint of the socket.
+[indexterm2 async_write_some..basic_serial_port]
+Start an asynchronous write.
 
 
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
 
-This function is used to obtain the remote endpoint of the socket.
+This function is used to asynchronously write data to the serial port. The function call always returns immediately.
 
 
 [heading Parameters]
@@ -18288,310 +20351,316 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any.]]
+[[buffers][One or more data buffers to be written to the serial port. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes written.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
 ]
 
 
-[heading Return Value]
+[heading Remarks]
       
-An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
 [heading Example]
   
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
-
+ serial_port.async_write_some(boost::asio::buffer(data, size), handler);
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:reuse_address basic_socket::reuse_address]
+[section:basic_serial_port basic_serial_port::basic_serial_port]
 
+[indexterm2 basic_serial_port..basic_serial_port]
+Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] without opening it.
 
-['Inherited from socket_base.]
 
-[indexterm2 reuse_address..basic_socket]
-Socket option to allow the socket to be bound to an address that is already in use.
+ explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 basic_serial_port]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 more...]]``
 
 
- typedef implementation_defined reuse_address;
+Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
 
 
+ explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const char * device);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 more...]]``
 
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+ explicit ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const std::string & device);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 more...]]``
 
 
-[heading Examples]
-
-Setting the option:
+Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] on an existing native serial port.
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
 
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload4 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_serial_port);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.basic_serial_port.overload4 more...]]``
 
 
+[section:overload1 basic_serial_port::basic_serial_port (1 of 4 overloads)]
 
 
-Getting the current option value:
+Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] without opening it.
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
 
+ basic_serial_port(
+ boost::asio::io_service & io_service);
 
 
+This constructor creates a serial port without opening it.
 
 
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:send_buffer_size basic_socket::send_buffer_size]
-
+[section:overload2 basic_serial_port::basic_serial_port (2 of 4 overloads)]
 
-['Inherited from socket_base.]
 
-[indexterm2 send_buffer_size..basic_socket]
-Socket option for the send buffer size of a socket.
+Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
 
 
- typedef implementation_defined send_buffer_size;
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const char * device);
 
 
+This constructor creates and opens a serial port for the specified device name.
 
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
 
+[[device][The platform-specific device name for this serial port. ]]
 
+]
 
 
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+[endsect]
 
 
 
+[section:overload3 basic_serial_port::basic_serial_port (3 of 4 overloads)]
 
 
+Construct and open a [link boost_asio.reference.basic_serial_port `basic_serial_port`].
 
 
-[heading Requirements]
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const std::string & device);
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+This constructor creates and opens a serial port for the specified device name.
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
 
+[[device][The platform-specific device name for this serial port. ]]
 
-[section:send_low_watermark basic_socket::send_low_watermark]
+]
 
 
-['Inherited from socket_base.]
 
-[indexterm2 send_low_watermark..basic_socket]
-Socket option for the send low watermark.
 
+[endsect]
 
- typedef implementation_defined send_low_watermark;
 
 
+[section:overload4 basic_serial_port::basic_serial_port (4 of 4 overloads)]
 
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
+Construct a [link boost_asio.reference.basic_serial_port `basic_serial_port`] on an existing native serial port.
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option(1024);
- socket.set_option(option);
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_serial_port);
 
 
+This constructor creates a serial port object to hold an existing native serial port.
 
 
+[heading Parameters]
+
 
-Getting the current option value:
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+[[native_serial_port][A native serial port.]]
 
+]
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
+[section:cancel basic_serial_port::cancel]
 
+[indexterm2 cancel..basic_serial_port]
+Cancel all asynchronous operations associated with the serial port.
 
-[section:service basic_socket::service]
 
+ void ``[link boost_asio.reference.basic_serial_port.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.cancel.overload1 more...]]``
 
-['Inherited from basic_io_object.]
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.cancel.overload2 more...]]``
 
-[indexterm2 service..basic_socket]
-The service associated with the I/O object.
 
+[section:overload1 basic_serial_port::cancel (1 of 2 overloads)]
 
- service_type & service;
 
+Cancel all asynchronous operations associated with the serial port.
 
 
-[endsect]
+ void cancel();
 
 
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
-[section:service_type basic_socket::service_type]
 
+[heading Exceptions]
+
 
-['Inherited from basic_io_object.]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-[indexterm2 service_type..basic_socket]
-The type of the service that will be used to provide I/O operations.
+]
 
 
- typedef SocketService service_type;
 
 
+[endsect]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:overload2 basic_serial_port::cancel (2 of 2 overloads)]
 
 
-[endsect]
+Cancel all asynchronous operations associated with the serial port.
 
 
-[section:set_option basic_socket::set_option]
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
 
-[indexterm2 set_option..basic_socket]
-Set an option on the socket.
 
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.set_option.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.set_option.overload2 set_option]``(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.set_option.overload2 more...]]``
+[heading Parameters]
+
 
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
 
-[section:overload1 basic_socket::set_option (1 of 2 overloads)]
+]
 
 
-Set an option on the socket.
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+[endsect]
 
 
-This function is used to set an option on the socket.
+[endsect]
 
+[section:close basic_serial_port::close]
 
-[heading Parameters]
-
+[indexterm2 close..basic_serial_port]
+Close the serial port.
 
-[variablelist
-
-[[option][The new option value to be set on the socket.]]
 
-]
+ void ``[link boost_asio.reference.basic_serial_port.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.close.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.close.overload2 more...]]``
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[section:overload1 basic_serial_port::close (1 of 2 overloads)]
 
-]
 
+Close the serial port.
 
 
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+ void close();
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
+
+This function is used to close the serial port. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
 
 
@@ -18600,20 +20669,17 @@
 
 
 
-[section:overload2 basic_socket::set_option (2 of 2 overloads)]
+[section:overload2 basic_serial_port::close (2 of 2 overloads)]
 
 
-Set an option on the socket.
+Close the serial port.
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
+ boost::system::error_code close(
       boost::system::error_code & ec);
 
 
-This function is used to set an option on the socket.
+This function is used to close the serial port. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -18621,66 +20687,77 @@
 
 [variablelist
   
-[[option][The new option value to be set on the socket.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occurred, if any. ]]
 
 ]
 
 
 
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- boost::system::error_code ec;
- socket.set_option(option, ec);
- if (ec)
- {
- // An error occurred.
- }
+[endsect]
+
+
+[endsect]
 
 
+[section:get_io_service basic_serial_port::get_io_service]
 
 
+['Inherited from basic_io_object.]
 
+[indexterm2 get_io_service..basic_serial_port]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
 
-[endsect]
 
 
 [endsect]
 
-[section:shutdown basic_socket::shutdown]
 
-[indexterm2 shutdown..basic_socket]
-Disable sends or receives on the socket.
+[section:get_option basic_serial_port::get_option]
 
+[indexterm2 get_option..basic_serial_port]
+Get an option from the serial port.
 
- void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.shutdown.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket.shutdown.overload2 shutdown]``(
- shutdown_type what,
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.get_option.overload1 get_option]``(
+ GettableSerialPortOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.get_option.overload1 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.get_option.overload2 get_option]``(
+ GettableSerialPortOption & option,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket.shutdown.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.get_option.overload2 more...]]``
 
 
-[section:overload1 basic_socket::shutdown (1 of 2 overloads)]
+[section:overload1 basic_serial_port::get_option (1 of 2 overloads)]
 
 
-Disable sends or receives on the socket.
+Get an option from the serial port.
 
 
- void shutdown(
- shutdown_type what);
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ void get_option(
+ GettableSerialPortOption & option);
 
 
-This function is used to disable send operations, receive operations, or both.
+This function is used to get the current value of an option on the serial port.
 
 
 [heading Parameters]
@@ -18688,7 +20765,7 @@
 
 [variablelist
   
-[[what][Determines what types of operation will no longer be allowed.]]
+[[option][The option value to be obtained from the serial port.]]
 
 ]
 
@@ -18703,17 +20780,6 @@
 ]
 
 
-[heading Example]
-
-Shutting down the send side of the socket:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
-
-
-
-
 
 
 
@@ -18721,18 +20787,20 @@
 
 
 
-[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
+[section:overload2 basic_serial_port::get_option (2 of 2 overloads)]
 
 
-Disable sends or receives on the socket.
+Get an option from the serial port.
 
 
- boost::system::error_code shutdown(
- shutdown_type what,
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ boost::system::error_code get_option(
+ GettableSerialPortOption & option,
       boost::system::error_code & ec);
 
 
-This function is used to disable send operations, receive operations, or both.
+This function is used to get the current value of an option on the serial port.
 
 
 [heading Parameters]
@@ -18740,250 +20808,186 @@
 
 [variablelist
   
-[[what][Determines what types of operation will no longer be allowed.]]
+[[option][The option value to be obtained from the serial port.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occured, if any.]]
 
 ]
 
 
-[heading Example]
-
-Shutting down the send side of the socket:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
- if (ec)
- {
- // An error occurred.
- }
 
 
+[endsect]
 
 
+[endsect]
 
 
+[section:implementation basic_serial_port::implementation]
 
-[endsect]
 
+['Inherited from basic_io_object.]
 
-[endsect]
+[indexterm2 implementation..basic_serial_port]
+The underlying implementation of the I/O object.
 
 
-[section:shutdown_type basic_socket::shutdown_type]
+ implementation_type implementation;
 
 
-['Inherited from socket_base.]
 
-[indexterm2 shutdown_type..basic_socket]
-Different ways a socket may be shutdown.
+[endsect]
 
 
- enum shutdown_type
 
-[indexterm2 shutdown_receive..basic_socket]
-[indexterm2 shutdown_send..basic_socket]
-[indexterm2 shutdown_both..basic_socket]
+[section:implementation_type basic_serial_port::implementation_type]
 
-[heading Values]
-[variablelist
 
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+['Inherited from basic_io_object.]
 
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+[indexterm2 implementation_type..basic_serial_port]
+The underlying implementation type of I/O object.
 
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
 
-]
+ typedef service_type::implementation_type implementation_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:_basic_socket basic_socket::~basic_socket]
+[section:is_open basic_serial_port::is_open]
 
-[indexterm2 ~basic_socket..basic_socket]
-Protected destructor to prevent deletion through this type.
+[indexterm2 is_open..basic_serial_port]
+Determine whether the serial port is open.
 
 
- ~basic_socket();
+ bool is_open() const;
 
 
 
 [endsect]
 
 
+[section:lowest_layer basic_serial_port::lowest_layer]
 
-[endsect]
+[indexterm2 lowest_layer..basic_serial_port]
+Get a reference to the lowest layer.
 
-[section:basic_socket_acceptor basic_socket_acceptor]
 
+ lowest_layer_type & ``[link boost_asio.reference.basic_serial_port.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.lowest_layer.overload1 more...]]``
 
-Provides the ability to accept new connections.
 
+Get a const reference to the lowest layer.
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketAcceptorService SocketAcceptorService]`` = socket_acceptor_service<Protocol>>
- class basic_socket_acceptor :
- public basic_io_object< SocketAcceptorService >,
- public socket_base
 
+ const lowest_layer_type & ``[link boost_asio.reference.basic_serial_port.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.lowest_layer.overload2 more...]]``
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:overload1 basic_serial_port::lowest_layer (1 of 2 overloads)]
 
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
+Get a reference to the lowest layer.
 
- [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
+ lowest_layer_type & lowest_layer();
 
- [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
 
- [
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_serial_port `basic_serial_port`] cannot contain any further layers, it simply returns a reference to itself.
 
- [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
 
- [
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[section:overload2 basic_serial_port::lowest_layer (2 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+Get a const reference to the lowest layer.
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+ const lowest_layer_type & lowest_layer() const;
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_serial_port `basic_serial_port`] cannot contain any further layers, it simply returns a reference to itself.
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+[endsect]
+
+
+[section:lowest_layer_type basic_serial_port::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..basic_serial_port]
+A [link boost_asio.reference.basic_serial_port `basic_serial_port`] is always the lowest layer.
+
+
+ typedef basic_serial_port< SerialPortService > lowest_layer_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
+ [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_serial_port is always the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.basic_serial_port.native_handle_type [*native_handle_type]]]
+ [The native representation of a serial port. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a serial port. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
@@ -18994,119 +20998,96 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
- [Accept a new connection.
-
- Accept a new connection and obtain the endpoint of the peer. ]
+ [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
+ [Assign an existing native serial port to the serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
- [Assigns an existing native acceptor to the acceptor. ]
+ [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
- [Start an asynchronous accept. ]
+ [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
- [Construct an acceptor without opening it.
-
- Construct an open acceptor.
+ [[link boost_asio.reference.basic_serial_port.basic_serial_port [*basic_serial_port]]]
+ [Construct a basic_serial_port without opening it.
 
- Construct an acceptor opened on the given endpoint.
+ Construct and open a basic_serial_port.
 
- Construct a basic_socket_acceptor on an existing native acceptor. ]
+ Construct a basic_serial_port on an existing native serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
- [Bind the acceptor to the given local endpoint. ]
+ [[link boost_asio.reference.basic_serial_port.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
- [Close the acceptor. ]
+ [[link boost_asio.reference.basic_serial_port.close [*close]]]
+ [Close the serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_serial_port.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
- [Get an option from the acceptor. ]
+ [[link boost_asio.reference.basic_serial_port.get_option [*get_option]]]
+ [Get an option from the serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
+ [Determine whether the serial port is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
- [Determine whether the acceptor is open. ]
+ [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
- [Place the acceptor into the state where it will listen for new connections. ]
+ [[link boost_asio.reference.basic_serial_port.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native serial port representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the acceptor. ]
+ [[link boost_asio.reference.basic_serial_port.native_handle [*native_handle]]]
+ [Get the native serial port representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
- [Get the native acceptor representation. ]
+ [[link boost_asio.reference.basic_serial_port.open [*open]]]
+ [Open the serial port using the specified device name. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
- [Open the acceptor using the specified protocol. ]
+ [[link boost_asio.reference.basic_serial_port.read_some [*read_some]]]
+ [Read some data from the serial port. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
- [Set an option on the acceptor. ]
+ [[link boost_asio.reference.basic_serial_port.send_break [*send_break]]]
+ [Send a break sequence to the serial port. ]
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
-
   [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
+ [[link boost_asio.reference.basic_serial_port.set_option [*set_option]]]
+ [Set an option on the serial port. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
+ [[link boost_asio.reference.basic_serial_port.write_some [*write_some]]]
+ [Write some data to the serial port. ]
   ]
-
+
 ]
 
 [heading Protected Data Members]
@@ -19114,208 +21095,140 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_serial_port.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
+ [[link boost_asio.reference.basic_serial_port.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
+The [link boost_asio.reference.basic_serial_port `basic_serial_port`] class template provides functionality that is common to all serial ports.
 
 
 [heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
-
-
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
- acceptor.open(endpoint.protocol());
- acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen();
-
-
+[*Shared] [*objects:] Unsafe.
 
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:accept basic_socket_acceptor::accept]
-
-[indexterm2 accept..basic_socket_acceptor]
-Accept a new connection.
 
+[endsect]
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.accept.overload1 accept]``(
- basic_socket< protocol_type, SocketService > & peer);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload1 more...]]``
-
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.accept.overload2 accept]``(
- basic_socket< protocol_type, SocketService > & peer,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload2 more...]]``
 
 
-Accept a new connection and obtain the endpoint of the peer.
+[section:native basic_serial_port::native]
 
+[indexterm2 native..basic_serial_port]
+(Deprecated: Use `native_handle()`.) Get the native serial port representation.
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.accept.overload3 accept]``(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload3 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.accept.overload4 accept]``(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload4 more...]]``
+ native_type native();
 
 
-[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)]
+This function may be used to obtain the underlying representation of the serial port. This is intended to allow access to native serial port functionality that is not otherwise provided.
 
 
-Accept a new connection.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer);
 
+[section:native_handle basic_serial_port::native_handle]
 
-This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
+[indexterm2 native_handle..basic_serial_port]
+Get the native serial port representation.
 
 
-[heading Parameters]
-
+ native_handle_type native_handle();
 
-[variablelist
-
-[[peer][The socket into which the new connection will be accepted.]]
 
-]
+This function may be used to obtain the underlying representation of the serial port. This is intended to allow access to native serial port functionality that is not otherwise provided.
 
 
-[heading Exceptions]
-
+[endsect]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
+[section:native_handle_type basic_serial_port::native_handle_type]
 
-[heading Example]
-
+[indexterm2 native_handle_type..basic_serial_port]
+The native representation of a serial port.
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- acceptor.accept(socket);
+ typedef SerialPortService::native_handle_type native_handle_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)]
-
-
-Accept a new connection.
-
-
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
- boost::system::error_code & ec);
-
-
-This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
-
+[section:native_type basic_serial_port::native_type]
 
-[heading Parameters]
-
+[indexterm2 native_type..basic_serial_port]
+(Deprecated: Use native\_handle\_type.) The native representation of a serial port.
 
-[variablelist
-
-[[peer][The socket into which the new connection will be accepted.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+ typedef SerialPortService::native_handle_type native_type;
 
-]
 
 
-[heading Example]
-
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::soocket socket(io_service);
- boost::system::error_code ec;
- acceptor.accept(socket, ec);
- if (ec)
- {
- // An error occurred.
- }
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
 
+[section:open basic_serial_port::open]
 
+[indexterm2 open..basic_serial_port]
+Open the serial port using the specified device name.
 
 
-[endsect]
+ void ``[link boost_asio.reference.basic_serial_port.open.overload1 open]``(
+ const std::string & device);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.open.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.open.overload2 open]``(
+ const std::string & device,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.open.overload2 more...]]``
 
 
-[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
+[section:overload1 basic_serial_port::open (1 of 2 overloads)]
 
 
-Accept a new connection and obtain the endpoint of the peer.
+Open the serial port using the specified device name.
 
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint);
+ void open(
+ const std::string & device);
 
 
-This function is used to accept a new connection from a peer into the given socket, and additionally provide the endpoint of the remote peer. The function call will block until a new connection has been accepted successfully or an error occurs.
+This function opens the serial port for the specified device name.
 
 
 [heading Parameters]
@@ -19323,9 +21236,7 @@
 
 [variablelist
   
-[[peer][The socket into which the new connection will be accepted.]]
-
-[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
+[[device][The platform-specific device name.]]
 
 ]
 
@@ -19335,46 +21246,29 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
 
-[heading Example]
-
-
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint;
- acceptor.accept(socket, endpoint);
-
-
-
-
-
 
 
 [endsect]
 
 
 
-[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)]
+[section:overload2 basic_serial_port::open (2 of 2 overloads)]
 
 
-Accept a new connection and obtain the endpoint of the peer.
+Open the serial port using the specified device name.
 
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
+ boost::system::error_code open(
+ const std::string & device,
       boost::system::error_code & ec);
 
 
-This function is used to accept a new connection from a peer into the given socket, and additionally provide the endpoint of the remote peer. The function call will block until a new connection has been accepted successfully or an error occurs.
+This function opens the serial port using the given platform-specific device name.
 
 
 [heading Parameters]
@@ -19382,132 +21276,115 @@
 
 [variablelist
   
-[[peer][The socket into which the new connection will be accepted.]]
-
-[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
+[[device][The platform-specific device name.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set the indicate what error occurred, if any. ]]
 
 ]
 
 
-[heading Example]
-
-
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint;
- boost::system::error_code ec;
- acceptor.accept(socket, endpoint, ec);
- if (ec)
- {
- // An error occurred.
- }
-
 
 
+[endsect]
 
 
+[endsect]
 
+[section:read_some basic_serial_port::read_some]
 
-[endsect]
+[indexterm2 read_some..basic_serial_port]
+Read some data from the serial port.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_serial_port.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.read_some.overload1 more...]]``
 
-[section:assign basic_socket_acceptor::assign]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_serial_port.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.read_some.overload2 more...]]``
 
-[indexterm2 assign..basic_socket_acceptor]
-Assigns an existing native acceptor to the acceptor.
 
+[section:overload1 basic_serial_port::read_some (1 of 2 overloads)]
 
- void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_acceptor);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.assign.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.assign.overload2 more...]]``
+Read some data from the serial port.
 
 
-[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
 
-Assigns an existing native acceptor to the acceptor.
+This function is used to read data from the serial port. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
 
- void assign(
- const protocol_type & protocol,
- const native_type & native_acceptor);
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
 
+]
 
-[endsect]
 
+[heading Return Value]
+
+The number of bytes read.
 
 
-[section:overload2 basic_socket_acceptor::assign (2 of 2 overloads)]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-Assigns an existing native acceptor to the acceptor.
+]
 
 
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[endsect]
+ serial_port.read_some(boost::asio::buffer(data, size));
 
 
-[endsect]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[section:async_accept basic_socket_acceptor::async_accept]
 
-[indexterm2 async_accept..basic_socket_acceptor]
-Start an asynchronous accept.
 
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``,
- typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.async_accept.overload1 async_accept]``(
- basic_socket< protocol_type, SocketService > & peer,
- AcceptHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.async_accept.overload1 more...]]``
+[endsect]
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``,
- typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.async_accept.overload2 async_accept]``(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
- AcceptHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.async_accept.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
+[section:overload2 basic_serial_port::read_some (2 of 2 overloads)]
 
 
-Start an asynchronous accept.
+Read some data from the serial port.
 
 
   template<
- typename ``[link boost_asio.reference.SocketService SocketService]``,
- typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
- void async_accept(
- basic_socket< protocol_type, SocketService > & peer,
- AcceptHandler handler);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
-This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
+This function is used to read data from the serial port. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -19515,82 +21392,62 @@
 
 [variablelist
   
-[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
+[[buffers][One or more buffers into which the data will be read.]]
 
-[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Example]
-
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
 
 
- void accept_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Accept succeeded.
- }
- }
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+
 
- ...
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- acceptor.async_accept(socket, accept_handler);
 
+[endsect]
 
 
+[endsect]
 
+[section:send_break basic_serial_port::send_break]
 
+[indexterm2 send_break..basic_serial_port]
+Send a break sequence to the serial port.
 
 
-[endsect]
+ void ``[link boost_asio.reference.basic_serial_port.send_break.overload1 send_break]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.send_break.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.send_break.overload2 send_break]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.send_break.overload2 more...]]``
 
 
-[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
+[section:overload1 basic_serial_port::send_break (1 of 2 overloads)]
 
 
-Start an asynchronous accept.
+Send a break sequence to the serial port.
 
 
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``,
- typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
- void async_accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
- AcceptHandler handler);
+ void send_break();
 
 
-This function is used to asynchronously accept a new connection into a socket, and additionally obtain the endpoint of the remote peer. The function call always returns immediately.
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
 
 
-[heading Parameters]
+[heading Exceptions]
     
 
 [variablelist
   
-[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
-
-[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written. Ownership of the peer\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
-
-[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`. ]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
@@ -19600,132 +21457,111 @@
 [endsect]
 
 
-[endsect]
 
-[section:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
+[section:overload2 basic_serial_port::send_break (2 of 2 overloads)]
 
-[indexterm2 basic_socket_acceptor..basic_socket_acceptor]
-Construct an acceptor without opening it.
 
+Send a break sequence to the serial port.
 
- explicit ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 more...]]``
 
+ boost::system::error_code send_break(
+ boost::system::error_code & ec);
 
-Construct an open acceptor.
 
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
 
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 more...]]``
 
+[heading Parameters]
+
 
-Construct an acceptor opened on the given endpoint.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
 
+]
 
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 basic_socket_acceptor]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint,
- bool reuse_addr = true);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 more...]]``
 
 
-Construct a [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] on an existing native acceptor.
 
+[endsect]
 
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 basic_socket_acceptor]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_acceptor);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 more...]]``
 
+[endsect]
 
-[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
 
+[section:service basic_serial_port::service]
 
-Construct an acceptor without opening it.
 
+['Inherited from basic_io_object.]
 
- basic_socket_acceptor(
- boost::asio::io_service & io_service);
+[indexterm2 service..basic_serial_port]
+The service associated with the I/O object.
 
 
-This constructor creates an acceptor without opening it to listen for new connections. The `open()` function must be called before the acceptor can accept new socket connections.
+ service_type & service;
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
+[endsect]
 
-]
 
 
+[section:service_type basic_serial_port::service_type]
 
 
-[endsect]
+['Inherited from basic_io_object.]
 
+[indexterm2 service_type..basic_serial_port]
+The type of the service that will be used to provide I/O operations.
 
 
-[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
+ typedef SerialPortService service_type;
 
 
-Construct an open acceptor.
 
+[heading Requirements]
 
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
-
-
-This constructor creates an acceptor and automatically opens it.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
-
-[[protocol][An object specifying protocol parameters to be used.]]
-
-]
+[*Header: ][^boost/asio/basic_serial_port.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[endsect]
 
-]
 
+[section:set_option basic_serial_port::set_option]
 
+[indexterm2 set_option..basic_serial_port]
+Set an option on the serial port.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.set_option.overload1 set_option]``(
+ const SettableSerialPortOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.set_option.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.set_option.overload2 set_option]``(
+ const SettableSerialPortOption & option,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.set_option.overload2 more...]]``
 
 
-[section:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
+[section:overload1 basic_serial_port::set_option (1 of 2 overloads)]
 
 
-Construct an acceptor opened on the given endpoint.
+Set an option on the serial port.
 
 
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint,
- bool reuse_addr = true);
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void set_option(
+ const SettableSerialPortOption & option);
 
 
-This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
+This function is used to set an option on the serial port.
 
 
 [heading Parameters]
@@ -19733,11 +21569,7 @@
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
-
-[[endpoint][An endpoint on the local machine on which the acceptor will listen for new connections.]]
-
-[[reuse_addr][Whether the constructor should set the socket option `socket_base::reuse_address`.]]
+[[option][The option value to be set on the serial port.]]
 
 ]
 
@@ -19752,20 +21584,6 @@
 ]
 
 
-[heading Remarks]
-
-This constructor is equivalent to the following code:
-
- basic_socket_acceptor<Protocol> acceptor(io_service);
- acceptor.open(endpoint.protocol());
- if (reuse_addr)
- acceptor.set_option(socket_base::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen(listen_backlog);
-
-
-
-
 
 
 
@@ -19773,19 +21591,20 @@
 
 
 
-[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
+[section:overload2 basic_serial_port::set_option (2 of 2 overloads)]
 
 
-Construct a [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] on an existing native acceptor.
+Set an option on the serial port.
 
 
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_acceptor);
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ boost::system::error_code set_option(
+ const SettableSerialPortOption & option,
+ boost::system::error_code & ec);
 
 
-This constructor creates an acceptor object to hold an existing native acceptor.
+This function is used to set an option on the serial port.
 
 
 [heading Parameters]
@@ -19793,24 +21612,13 @@
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
-
-[[protocol][An object specifying protocol parameters to be used.]]
+[[option][The option value to be set on the serial port.]]
 
-[[native_acceptor][A native acceptor.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
-
 
 
 
@@ -19819,33 +21627,39 @@
 
 [endsect]
 
-[section:bind basic_socket_acceptor::bind]
+[section:write_some basic_serial_port::write_some]
 
-[indexterm2 bind..basic_socket_acceptor]
-Bind the acceptor to the given local endpoint.
+[indexterm2 write_some..basic_serial_port]
+Write some data to the serial port.
 
 
- void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.bind.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_serial_port.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.write_some.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.bind.overload2 bind]``(
- const endpoint_type & endpoint,
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_serial_port.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.bind.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_serial_port.write_some.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
+[section:overload1 basic_serial_port::write_some (1 of 2 overloads)]
 
 
-Bind the acceptor to the given local endpoint.
+Write some data to the serial port.
 
 
- void bind(
- const endpoint_type & endpoint);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
 
-This function binds the socket acceptor to the specified endpoint on the local machine.
+This function is used to write data to the serial port. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -19853,31 +21667,39 @@
 
 [variablelist
   
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+[[buffers][One or more data buffers to be written to the serial port.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes written.
+
+
 [heading Exceptions]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
 ]
 
 
-[heading Example]
-
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
- acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ serial_port.write_some(boost::asio::buffer(data, size));
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -19886,18 +21708,20 @@
 
 
 
-[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
+[section:overload2 basic_serial_port::write_some (2 of 2 overloads)]
 
 
-Bind the acceptor to the given local endpoint.
+Write some data to the serial port.
 
 
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
       boost::system::error_code & ec);
 
 
-This function binds the socket acceptor to the specified endpoint on the local machine.
+This function is used to write data to the serial port. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -19905,30 +21729,26 @@
 
 [variablelist
   
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+[[buffers][One or more data buffers to be written to the serial port.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Example]
-
-
+[heading Return Value]
+
+The number of bytes written. Returns 0 if an error occurred.
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
- boost::system::error_code ec;
- acceptor.bind(boost::asio::ip::tcp::endpoint(12345), ec);
- if (ec)
- {
- // An error occurred.
- }
 
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
 
 
+[endsect]
 
 
 [endsect]
@@ -19936,138 +21756,415 @@
 
 [endsect]
 
-
-[section:broadcast basic_socket_acceptor::broadcast]
+[section:basic_socket basic_socket]
 
 
-['Inherited from socket_base.]
+Provides socket functionality.
 
-[indexterm2 broadcast..basic_socket_acceptor]
-Socket option to permit sending of broadcast messages.
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ class basic_socket :
+ public basic_io_object< SocketService >,
+ public socket_base
 
- typedef implementation_defined broadcast;
 
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
 
+ [
 
-[heading Examples]
+ [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
   
-Setting the option:
-
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
 
-Getting the current option value:
+ [
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
 
-[heading Requirements]
+ [
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
 
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
 
+ [
 
-[section:bytes_readable basic_socket_acceptor::bytes_readable]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
 
+ [
 
-['Inherited from socket_base.]
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
 
-[indexterm2 bytes_readable..basic_socket_acceptor]
-IO control command to get the amount of data that can be read without blocking.
+ [
 
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
 
- typedef implementation_defined bytes_readable;
+ [
 
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
 
+ [
 
-Implements the FIONREAD IO control command.
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
 
+ [
 
-[heading Example]
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
   
+ ]
 
+ [
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
-
+ [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
 
+ [
 
-[heading Requirements]
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+ [
 
-[*Convenience header: ][^boost/asio.hpp]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
 
+]
 
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it.
 
-[section:cancel basic_socket_acceptor::cancel]
+ Construct and open a basic_socket.
 
-[indexterm2 cancel..basic_socket_acceptor]
-Cancel all asynchronous operations associated with the acceptor.
+ Construct a basic_socket, opening it and binding it to the given local endpoint.
 
+ Construct a basic_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
 
- void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.cancel.overload1 more...]]``
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.cancel.overload2 more...]]``
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
 
-[section:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
 
-Cancel all asynchronous operations associated with the acceptor.
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
 
- void cancel();
+ [
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+ [
+ [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
 
-[heading Exceptions]
-
+]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
 
 ]
 
+The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:assign basic_socket::assign]
+
+[indexterm2 assign..basic_socket]
+Assign an existing native socket to the socket.
+
+
+ void ``[link boost_asio.reference.basic_socket.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.assign.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.assign.overload2 more...]]``
+
+
+[section:overload1 basic_socket::assign (1 of 2 overloads)]
+
+
+Assign an existing native socket to the socket.
+
+
+ void assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
 
@@ -20075,17 +22172,41 @@
 
 
 
-[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
+[section:overload2 basic_socket::assign (2 of 2 overloads)]
 
 
-Cancel all asynchronous operations associated with the acceptor.
+Assign an existing native socket to the socket.
 
 
- boost::system::error_code cancel(
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+
+[endsect]
+
+
+[endsect]
+
+
+[section:async_connect basic_socket::async_connect]
+
+[indexterm2 async_connect..basic_socket]
+Start an asynchronous connect.
+
+
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
+
+
+This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
 [heading Parameters]
@@ -20093,44 +22214,76 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any. ]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
+
+[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
 ]
 
 
+[heading Example]
+
+
+
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
+
+ ...
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_connect(endpoint, connect_handler);
+
+
+
 
 
-[endsect]
 
 
 [endsect]
 
-[section:close basic_socket_acceptor::close]
 
-[indexterm2 close..basic_socket_acceptor]
-Close the acceptor.
+[section:at_mark basic_socket::at_mark]
 
+[indexterm2 at_mark..basic_socket]
+Determine whether the socket is at the out-of-band data mark.
 
- void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.close.overload2 more...]]``
+ bool ``[link boost_asio.reference.basic_socket.at_mark.overload1 at_mark]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.at_mark.overload1 more...]]``
 
+ bool ``[link boost_asio.reference.basic_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.at_mark.overload2 more...]]``
 
-[section:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
 
+[section:overload1 basic_socket::at_mark (1 of 2 overloads)]
 
-Close the acceptor.
 
+Determine whether the socket is at the out-of-band data mark.
 
- void close();
 
+ bool at_mark() const;
 
-This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
 
-A subsequent call to `open()` is required before the acceptor can again be used to again perform socket accept operations.
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+
+
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
 
 [heading Exceptions]
@@ -20149,19 +22302,17 @@
 
 
 
-[section:overload2 basic_socket_acceptor::close (2 of 2 overloads)]
-
+[section:overload2 basic_socket::at_mark (2 of 2 overloads)]
 
-Close the acceptor.
 
+Determine whether the socket is at the out-of-band data mark.
 
- boost::system::error_code close(
- boost::system::error_code & ec);
 
+ bool at_mark(
+ boost::system::error_code & ec) const;
 
-This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
 
-A subsequent call to `open()` is required before the acceptor can again be used to again perform socket accept operations.
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
 
 [heading Parameters]
@@ -20174,232 +22325,289 @@
 ]
 
 
-[heading Example]
-
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::system::error_code ec;
- acceptor.close(ec);
- if (ec)
- {
- // An error occurred.
- }
 
 
+[endsect]
 
 
+[endsect]
 
+[section:available basic_socket::available]
 
+[indexterm2 available..basic_socket]
+Determine the number of bytes available for reading.
 
-[endsect]
 
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.available.overload1 more...]]``
 
-[endsect]
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.available.overload2 more...]]``
 
 
-[section:debug basic_socket_acceptor::debug]
+[section:overload1 basic_socket::available (1 of 2 overloads)]
 
 
-['Inherited from socket_base.]
+Determine the number of bytes available for reading.
 
-[indexterm2 debug..basic_socket_acceptor]
-Socket option to enable socket-level debugging.
 
+ std::size_t available() const;
 
- typedef implementation_defined debug;
 
+This function is used to determine the number of bytes that may be read without blocking.
 
 
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
 
-[heading Examples]
+[heading Exceptions]
+
+
+[variablelist
   
-Setting the option:
+[[boost::system::system_error][Thrown on failure. ]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+]
 
 
 
 
+[endsect]
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option;
- socket.get_option(option);
- bool is_set = option.value();
 
+[section:overload2 basic_socket::available (2 of 2 overloads)]
 
 
+Determine the number of bytes available for reading.
 
 
+ std::size_t available(
+ boost::system::error_code & ec) const;
 
 
-[heading Requirements]
+This function is used to determine the number of bytes that may be read without blocking.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:do_not_route basic_socket_acceptor::do_not_route]
+[section:basic_socket basic_socket::basic_socket]
 
+[indexterm2 basic_socket..basic_socket]
+Construct a [link boost_asio.reference.basic_socket `basic_socket`] without opening it.
 
-['Inherited from socket_base.]
 
-[indexterm2 do_not_route..basic_socket_acceptor]
-Socket option to prevent routing, use local interfaces only.
+ explicit ``[link boost_asio.reference.basic_socket.basic_socket.overload1 basic_socket]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload1 more...]]``
 
 
- typedef implementation_defined do_not_route;
+Construct and open a [link boost_asio.reference.basic_socket `basic_socket`].
+
 
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload2 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload2 more...]]``
 
 
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+Construct a [link boost_asio.reference.basic_socket `basic_socket`], opening it and binding it to the given local endpoint.
 
 
-[heading Examples]
-
-Setting the option:
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload3 more...]]``
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option(true);
- socket.set_option(option);
 
+Construct a [link boost_asio.reference.basic_socket `basic_socket`] on an existing native socket.
 
 
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload4 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.basic_socket.overload4 more...]]``
 
 
-Getting the current option value:
+[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
+
+
+Construct a [link boost_asio.reference.basic_socket `basic_socket`] without opening it.
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option;
- socket.get_option(option);
- bool is_set = option.value();
 
+ basic_socket(
+ boost::asio::io_service & io_service);
 
 
+This constructor creates a socket without opening it.
 
 
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
-
+[section:overload2 basic_socket::basic_socket (2 of 4 overloads)]
 
-['Inherited from socket_base.]
 
-[indexterm2 enable_connection_aborted..basic_socket_acceptor]
-Socket option to report aborted connections on accept.
+Construct and open a [link boost_asio.reference.basic_socket `basic_socket`].
 
 
- typedef implementation_defined enable_connection_aborted;
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
 
 
+This constructor creates and opens a socket.
 
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+[[protocol][An object specifying protocol parameters to be used.]]
 
+]
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-Getting the current option value:
+]
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
 
 
 
+[endsect]
 
 
 
+[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+Construct a [link boost_asio.reference.basic_socket `basic_socket`], opening it and binding it to the given local endpoint.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
 
-[endsect]
 
+This constructor creates a socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
 
 
-[section:endpoint_type basic_socket_acceptor::endpoint_type]
+[heading Parameters]
+
 
-[indexterm2 endpoint_type..basic_socket_acceptor]
-The endpoint type.
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
- typedef Protocol::endpoint endpoint_type;
+]
 
 
+[heading Exceptions]
+
 
-[heading Requirements]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:get_io_service basic_socket_acceptor::get_io_service]
+[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
 
 
-['Inherited from basic_io_object.]
+Construct a [link boost_asio.reference.basic_socket `basic_socket`] on an existing native socket.
 
-[indexterm2 get_io_service..basic_socket_acceptor]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
- boost::asio::io_service & get_io_service();
 
+This constructor creates a socket object to hold an existing native socket.
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+[heading Parameters]
+
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+
+[[protocol][An object specifying protocol parameters to be used.]]
+
+[[native_socket][A native socket.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
 
 
 
@@ -20407,39 +22615,35 @@
 [endsect]
 
 
-[section:get_option basic_socket_acceptor::get_option]
+[endsect]
 
-[indexterm2 get_option..basic_socket_acceptor]
-Get an option from the acceptor.
+[section:bind basic_socket::bind]
 
+[indexterm2 bind..basic_socket]
+Bind the socket to the given local endpoint.
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
- GettableSocketOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.get_option.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload2 get_option]``(
- GettableSocketOption & option,
+ void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.bind.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.get_option.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.bind.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
+[section:overload1 basic_socket::bind (1 of 2 overloads)]
 
 
-Get an option from the acceptor.
+Bind the socket to the given local endpoint.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option);
+ void bind(
+ const endpoint_type & endpoint);
 
 
-This function is used to get the current value of an option on the acceptor.
+This function binds the socket to the specified endpoint on the local machine.
 
 
 [heading Parameters]
@@ -20447,7 +22651,7 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the acceptor.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
 ]
 
@@ -20462,16 +22666,14 @@
 ]
 
 
-
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::acceptor::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.get();
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
 
 
 
@@ -20483,20 +22685,18 @@
 
 
 
-[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
+[section:overload2 basic_socket::bind (2 of 2 overloads)]
 
 
-Get an option from the acceptor.
+Bind the socket to the given local endpoint.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
       boost::system::error_code & ec);
 
 
-This function is used to get the current value of an option on the acceptor.
+This function binds the socket to the specified endpoint on the local machine.
 
 
 [heading Parameters]
@@ -20504,28 +22704,26 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the acceptor.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::acceptor::reuse_address option;
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
    boost::system::error_code ec;
- acceptor.get_option(option, ec);
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
    if (ec)
    {
      // An error occurred.
    }
- bool is_set = option.get();
 
 
 
@@ -20539,39 +22737,52 @@
 [endsect]
 
 
-[section:implementation basic_socket_acceptor::implementation]
+[section:broadcast basic_socket::broadcast]
 
 
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
 
-[indexterm2 implementation..basic_socket_acceptor]
-The underlying implementation of the I/O object.
+[indexterm2 broadcast..basic_socket]
+Socket option to permit sending of broadcast messages.
 
 
- implementation_type implementation;
+ typedef implementation_defined broadcast;
 
 
 
-[endsect]
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[section:implementation_type basic_socket_acceptor::implementation_type]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
 
 
-['Inherited from basic_io_object.]
 
-[indexterm2 implementation_type..basic_socket_acceptor]
-The underlying implementation type of I/O object.
 
 
- typedef service_type::implementation_type implementation_type;
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -20580,201 +22791,197 @@
 
 
 
-[section:io_service basic_socket_acceptor::io_service]
+[section:bytes_readable basic_socket::bytes_readable]
 
 
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
 
-[indexterm2 io_service..basic_socket_acceptor]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[indexterm2 bytes_readable..basic_socket]
+IO control command to get the amount of data that can be read without blocking.
 
 
- boost::asio::io_service & io_service();
+ typedef implementation_defined bytes_readable;
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+Implements the FIONREAD IO control command.
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+[heading Example]
+
 
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
-[endsect]
 
 
 
-[section:is_open basic_socket_acceptor::is_open]
 
-[indexterm2 is_open..basic_socket_acceptor]
-Determine whether the acceptor is open.
 
 
- bool is_open() const;
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:cancel basic_socket::cancel]
 
-[section:keep_alive basic_socket_acceptor::keep_alive]
+[indexterm2 cancel..basic_socket]
+Cancel all asynchronous operations associated with the socket.
 
 
-['Inherited from socket_base.]
+ void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.cancel.overload1 more...]]``
 
-[indexterm2 keep_alive..basic_socket_acceptor]
-Socket option to send keep-alives.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.cancel.overload2 more...]]``
 
 
- typedef implementation_defined keep_alive;
+[section:overload1 basic_socket::cancel (1 of 2 overloads)]
 
 
+Cancel all asynchronous operations associated with the socket.
 
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
+ void cancel();
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-Getting the current option value:
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option;
- socket.get_option(option);
- bool is_set = option.value();
 
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
+For portable cancellation, consider using one of the following alternatives:
 
 
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-[*Convenience header: ][^boost/asio.hpp]
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
 
 
-[section:linger basic_socket_acceptor::linger]
-
+[section:overload2 basic_socket::cancel (2 of 2 overloads)]
 
-['Inherited from socket_base.]
 
-[indexterm2 linger..basic_socket_acceptor]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+Cancel all asynchronous operations associated with the socket.
 
 
- typedef implementation_defined linger;
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
 
 
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option(true, 30);
- socket.set_option(option);
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
 
-Getting the current option value:
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option;
- socket.get_option(option);
- bool is_set = option.enabled();
- unsigned short timeout = option.timeout();
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
+For portable cancellation, consider using one of the following alternatives:
 
 
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
 
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-[heading Requirements]
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
+[section:close basic_socket::close]
 
-[section:listen basic_socket_acceptor::listen]
-
-[indexterm2 listen..basic_socket_acceptor]
-Place the acceptor into the state where it will listen for new connections.
+[indexterm2 close..basic_socket]
+Close the socket.
 
 
- void ``[link boost_asio.reference.basic_socket_acceptor.listen.overload1 listen]``(
- int backlog = socket_base::max_connections);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.listen.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.listen.overload2 listen]``(
- int backlog,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.listen.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.close.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::listen (1 of 2 overloads)]
+[section:overload1 basic_socket::close (1 of 2 overloads)]
 
 
-Place the acceptor into the state where it will listen for new connections.
+Close the socket.
 
 
- void listen(
- int backlog = socket_base::max_connections);
+ void close();
 
 
-This function puts the socket acceptor into the state where it may accept new connections.
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
-[heading Parameters]
+[heading Exceptions]
     
 
 [variablelist
   
-[[backlog][The maximum length of the queue of pending connections.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
 
@@ -20783,18 +22990,17 @@
 
 
 
-[section:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
+[section:overload2 basic_socket::close (2 of 2 overloads)]
 
 
-Place the acceptor into the state where it will listen for new connections.
+Close the socket.
 
 
- boost::system::error_code listen(
- int backlog,
+ boost::system::error_code close(
       boost::system::error_code & ec);
 
 
-This function puts the socket acceptor into the state where it may accept new connections.
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -20802,8 +23008,6 @@
 
 [variablelist
   
-[[backlog][The maximum length of the queue of pending connections.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
@@ -20813,10 +23017,10 @@
   
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
    boost::system::error_code ec;
- acceptor.listen(boost::asio::socket_base::max_connections, ec);
+ socket.close(ec);
    if (ec)
    {
      // An error occurred.
@@ -20826,6 +23030,11 @@
 
 
 
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
+
+
 
 
 [endsect]
@@ -20833,35 +23042,45 @@
 
 [endsect]
 
-[section:local_endpoint basic_socket_acceptor::local_endpoint]
+[section:connect basic_socket::connect]
 
-[indexterm2 local_endpoint..basic_socket_acceptor]
-Get the local endpoint of the acceptor.
+[indexterm2 connect..basic_socket]
+Connect the socket to the specified endpoint.
 
 
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket.connect.overload1 connect]``(
+ const endpoint_type & peer_endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.connect.overload1 more...]]``
 
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 more...]]``
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.connect.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_socket::connect (1 of 2 overloads)]
 
 
-Get the local endpoint of the acceptor.
+Connect the socket to the specified endpoint.
 
 
- endpoint_type local_endpoint() const;
+ void connect(
+ const endpoint_type & peer_endpoint);
 
 
-This function is used to obtain the locally bound endpoint of the acceptor.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
 
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
-[heading Return Value]
-
-An object that represents the local endpoint of the acceptor.
+
+[heading Parameters]
+
+
+[variablelist
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+
+]
 
 
 [heading Exceptions]
@@ -20878,9 +23097,10 @@
   
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.connect(endpoint);
 
 
 
@@ -20892,17 +23112,20 @@
 
 
 
-[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_socket::connect (2 of 2 overloads)]
 
 
-Get the local endpoint of the acceptor.
+Connect the socket to the specified endpoint.
 
 
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
 
 
-This function is used to obtain the locally bound endpoint of the acceptor.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
 [heading Parameters]
@@ -20910,24 +23133,22 @@
 
 [variablelist
   
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-An object that represents the local endpoint of the acceptor. Returns a default-constructed endpoint object if an error occurred and the error handler did not throw an exception.
-
-
 [heading Example]
   
 
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
    boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
+ socket.connect(endpoint, ec);
    if (ec)
    {
      // An error occurred.
@@ -20945,127 +23166,160 @@
 [endsect]
 
 
-[section:max_connections basic_socket_acceptor::max_connections]
+[section:debug basic_socket::debug]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 max_connections..basic_socket_acceptor]
-The maximum length of the queue of pending incoming connections.
+[indexterm2 debug..basic_socket]
+Socket option to enable socket-level debugging.
 
 
- static const int max_connections = implementation_defined;
+ typedef implementation_defined debug;
 
 
 
-[endsect]
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
 
 
-['Inherited from socket_base.]
 
-[indexterm2 message_do_not_route..basic_socket_acceptor]
-Specify that the data should not be subject to routing.
 
 
- static const int message_do_not_route = implementation_defined;
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
+
+
+
 
 
 
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
 [endsect]
 
 
 
-[section:message_flags basic_socket_acceptor::message_flags]
+[section:do_not_route basic_socket::do_not_route]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 message_flags..basic_socket_acceptor]
-Bitmask type for flags that can be passed to send and receive operations.
+[indexterm2 do_not_route..basic_socket]
+Socket option to prevent routing, use local interfaces only.
 
 
- typedef int message_flags;
+ typedef implementation_defined do_not_route;
 
 
 
-[heading Requirements]
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
 
 
-[endsect]
 
 
 
-[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
-['Inherited from socket_base.]
 
-[indexterm2 message_out_of_band..basic_socket_acceptor]
-Process out-of-band data.
 
 
- static const int message_out_of_band = implementation_defined;
 
 
 
-[endsect]
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:message_peek basic_socket_acceptor::message_peek]
 
+[endsect]
 
-['Inherited from socket_base.]
 
-[indexterm2 message_peek..basic_socket_acceptor]
-Peek at incoming data without removing it from the input queue.
+
+[section:enable_connection_aborted basic_socket::enable_connection_aborted]
 
 
- static const int message_peek = implementation_defined;
+['Inherited from socket_base.]
 
+[indexterm2 enable_connection_aborted..basic_socket]
+Socket option to report aborted connections on accept.
 
 
-[endsect]
+ typedef implementation_defined enable_connection_aborted;
 
 
 
-[section:native basic_socket_acceptor::native]
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
-[indexterm2 native..basic_socket_acceptor]
-Get the native acceptor representation.
 
+[heading Examples]
+
+Setting the option:
 
- native_type native();
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
 
 
-This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided.
 
 
-[endsect]
 
+Getting the current option value:
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
-[section:native_type basic_socket_acceptor::native_type]
 
-[indexterm2 native_type..basic_socket_acceptor]
-The native representation of an acceptor.
 
 
- typedef SocketAcceptorService::native_type native_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -21074,74 +23328,85 @@
 
 
 
-[section:non_blocking_io basic_socket_acceptor::non_blocking_io]
+[section:endpoint_type basic_socket::endpoint_type]
 
+[indexterm2 endpoint_type..basic_socket]
+The endpoint type.
 
-['Inherited from socket_base.]
 
-[indexterm2 non_blocking_io..basic_socket_acceptor]
-IO control command to set the blocking mode of the socket.
+ typedef Protocol::endpoint endpoint_type;
 
 
- typedef implementation_defined non_blocking_io;
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
-Implements the FIONBIO IO control command.
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Example]
-
+[endsect]
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
 
+[section:get_io_service basic_socket::get_io_service]
+
+
+['Inherited from basic_io_object.]
 
+[indexterm2 get_io_service..basic_socket]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
+ boost::asio::io_service & get_io_service();
 
 
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:open basic_socket_acceptor::open]
+[section:get_option basic_socket::get_option]
 
-[indexterm2 open..basic_socket_acceptor]
-Open the acceptor using the specified protocol.
+[indexterm2 get_option..basic_socket]
+Get an option from the socket.
 
 
- void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.open.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.get_option.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.open.overload2 more...]]``
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.get_option.overload2 more...]]``
 
 
-[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
+[section:overload1 basic_socket::get_option (1 of 2 overloads)]
 
 
-Open the acceptor using the specified protocol.
+Get an option from the socket.
 
 
- void open(
- const protocol_type & protocol = protocol_type());
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option) const;
 
 
-This function opens the socket acceptor so that it will use the specified protocol.
+This function is used to get the current value of an option on the socket.
 
 
 [heading Parameters]
@@ -21149,7 +23414,7 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[option][The option value to be obtained from the socket.]]
 
 ]
 
@@ -21164,12 +23429,16 @@
 ]
 
 
+
 [heading Example]
   
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
 
 
 
@@ -21181,18 +23450,20 @@
 
 
 
-[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
+[section:overload2 basic_socket::get_option (2 of 2 overloads)]
 
 
-Open the acceptor using the specified protocol.
+Get an option from the socket.
 
 
- boost::system::error_code open(
- const protocol_type & protocol,
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
-This function opens the socket acceptor so that it will use the specified protocol.
+This function is used to get the current value of an option on the socket.
 
 
 [heading Parameters]
@@ -21200,24 +23471,28 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[option][The option value to be obtained from the socket.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+
 [heading Example]
   
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
    boost::system::error_code ec;
- acceptor.open(boost::asio::ip::tcp::v4(), ec);
+ socket.get_option(option, ec);
    if (ec)
    {
      // An error occurred.
    }
+ bool is_set = option.get();
 
 
 
@@ -21231,117 +23506,111 @@
 [endsect]
 
 
-[section:protocol_type basic_socket_acceptor::protocol_type]
-
-[indexterm2 protocol_type..basic_socket_acceptor]
-The protocol type.
-
+[section:implementation basic_socket::implementation]
 
- typedef Protocol protocol_type;
 
+['Inherited from basic_io_object.]
 
+[indexterm2 implementation..basic_socket]
+The underlying implementation of the I/O object.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+ implementation_type implementation;
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
+[section:implementation_type basic_socket::implementation_type]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_io_object.]
 
-[indexterm2 receive_buffer_size..basic_socket_acceptor]
-Socket option for the receive buffer size of a socket.
+[indexterm2 implementation_type..basic_socket]
+The underlying implementation type of I/O object.
 
 
- typedef implementation_defined receive_buffer_size;
+ typedef service_type::implementation_type implementation_type;
 
 
 
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
-[heading Examples]
-
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
-
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option;
- socket.get_option(option);
- int size = option.value();
-
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
 
+[section:io_control basic_socket::io_control]
 
+[indexterm2 io_control..basic_socket]
+Perform an IO control command on the socket.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void ``[link boost_asio.reference.basic_socket.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.io_control.overload1 more...]]``
 
-[*Convenience header: ][^boost/asio.hpp]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.io_control.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 basic_socket::io_control (1 of 2 overloads)]
 
 
+Perform an IO control command on the socket.
 
-[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
 
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
-['Inherited from socket_base.]
 
-[indexterm2 receive_low_watermark..basic_socket_acceptor]
-Socket option for the receive low watermark.
+This function is used to execute an IO control command on the socket.
 
 
- typedef implementation_defined receive_low_watermark;
+[heading Parameters]
+
 
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
 
+]
 
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
+[heading Exceptions]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
-
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
 
-Getting the current option value:
+[heading Example]
+
+Getting the number of bytes ready to read:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
 
@@ -21349,85 +23618,94 @@
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:overload2 basic_socket::io_control (2 of 2 overloads)]
 
-[endsect]
 
+Perform an IO control command on the socket.
 
 
-[section:reuse_address basic_socket_acceptor::reuse_address]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
 
-['Inherited from socket_base.]
+This function is used to execute an IO control command on the socket.
 
-[indexterm2 reuse_address..basic_socket_acceptor]
-Socket option to allow the socket to be bound to an address that is already in use.
 
+[heading Parameters]
+
 
- typedef implementation_defined reuse_address;
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
 
-[heading Examples]
+[heading Example]
   
-Setting the option:
+Getting the number of bytes ready to read:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ boost::system::error_code ec;
+ socket.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
 
 
 
 
 
-Getting the current option value:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
 
+[endsect]
 
 
+[endsect]
 
 
+[section:is_open basic_socket::is_open]
 
+[indexterm2 is_open..basic_socket]
+Determine whether the socket is open.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+ bool is_open() const;
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
+[section:keep_alive basic_socket::keep_alive]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 send_buffer_size..basic_socket_acceptor]
-Socket option for the send buffer size of a socket.
+[indexterm2 keep_alive..basic_socket]
+Socket option to send keep-alives.
 
 
- typedef implementation_defined send_buffer_size;
+ typedef implementation_defined keep_alive;
 
 
 
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
 
 [heading Examples]
@@ -21436,7 +23714,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_buffer_size option(8192);
+ boost::asio::socket_base::keep_alive option(true);
    socket.set_option(option);
 
 
@@ -21447,9 +23725,9 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_buffer_size option;
+ boost::asio::socket_base::keep_alive option;
    socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
 
 
 
@@ -21459,7 +23737,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -21468,20 +23746,20 @@
 
 
 
-[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
+[section:linger basic_socket::linger]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 send_low_watermark..basic_socket_acceptor]
-Socket option for the send low watermark.
+[indexterm2 linger..basic_socket]
+Socket option to specify whether the socket lingers on close if unsent data is present.
 
 
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined linger;
 
 
 
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
 
 [heading Examples]
@@ -21490,7 +23768,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_low_watermark option(1024);
+ boost::asio::socket_base::linger option(true, 30);
    socket.set_option(option);
 
 
@@ -21501,60 +23779,20 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_low_watermark option;
+ boost::asio::socket_base::linger option;
    socket.get_option(option);
- int size = option.value();
-
-
-
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[endsect]
-
-
-
-[section:service basic_socket_acceptor::service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 service..basic_socket_acceptor]
-The service associated with the I/O object.
-
-
- service_type & service;
-
-
-
-[endsect]
-
-
-
-[section:service_type basic_socket_acceptor::service_type]
-
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
 
-['Inherited from basic_io_object.]
 
-[indexterm2 service_type..basic_socket_acceptor]
-The type of the service that will be used to provide I/O operations.
 
 
- typedef SocketAcceptorService service_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -21562,49 +23800,35 @@
 [endsect]
 
 
-[section:set_option basic_socket_acceptor::set_option]
-
-[indexterm2 set_option..basic_socket_acceptor]
-Set an option on the acceptor.
-
+[section:local_endpoint basic_socket::local_endpoint]
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.set_option.overload1 more...]]``
+[indexterm2 local_endpoint..basic_socket]
+Get the local endpoint of the socket.
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload2 set_option]``(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.set_option.overload2 more...]]``
 
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload1 local_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.local_endpoint.overload1 more...]]``
 
-[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.local_endpoint.overload2 more...]]``
 
 
-Set an option on the acceptor.
+[section:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+Get the local endpoint of the socket.
 
 
-This function is used to set an option on the acceptor.
+ endpoint_type local_endpoint() const;
 
 
-[heading Parameters]
-
+This function is used to obtain the locally bound endpoint of the socket.
 
-[variablelist
-
-[[option][The new option value to be set on the acceptor.]]
 
-]
+[heading Return Value]
+
+An object that represents the local endpoint of the socket.
 
 
 [heading Exceptions]
@@ -21617,15 +23841,13 @@
 ]
 
 
-
 [heading Example]
   
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::acceptor::reuse_address option(true);
- acceptor.set_option(option);
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
 
 
 
@@ -21637,20 +23859,17 @@
 
 
 
-[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
+[section:overload2 basic_socket::local_endpoint (2 of 2 overloads)]
 
 
-Set an option on the acceptor.
+Get the local endpoint of the socket.
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
 
 
-This function is used to set an option on the acceptor.
+This function is used to obtain the locally bound endpoint of the socket.
 
 
 [heading Parameters]
@@ -21658,23 +23877,24 @@
 
 [variablelist
   
-[[option][The new option value to be set on the acceptor.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Return Value]
+
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+
 
 [heading Example]
   
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::acceptor::reuse_address option(true);
    boost::system::error_code ec;
- acceptor.set_option(option, ec);
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
    if (ec)
    {
      // An error occurred.
@@ -21691,166 +23911,39 @@
 
 [endsect]
 
+[section:lowest_layer basic_socket::lowest_layer]
 
-[section:shutdown_type basic_socket_acceptor::shutdown_type]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 shutdown_type..basic_socket_acceptor]
-Different ways a socket may be shutdown.
-
-
- enum shutdown_type
-
-[indexterm2 shutdown_receive..basic_socket_acceptor]
-[indexterm2 shutdown_send..basic_socket_acceptor]
-[indexterm2 shutdown_both..basic_socket_acceptor]
-
-[heading Values]
-[variablelist
-
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
-
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
-
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:basic_socket_iostream basic_socket_iostream]
-
-
-Iostream interface for a socket.
-
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
- class basic_socket_iostream
-
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
- [Construct a basic_socket_iostream without establishing a connection.
-
- Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
- [Close the connection. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
- [Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
- [Return a pointer to the underlying streambuf. ]
- ]
-
-]
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_iostream.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-[section:basic_socket_iostream basic_socket_iostream::basic_socket_iostream]
-
-[indexterm2 basic_socket_iostream..basic_socket_iostream]
-Construct a [link boost_asio.reference.basic_socket_iostream `basic_socket_iostream`] without establishing a connection.
-
-
- ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 basic_socket_iostream]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 more...]]``
-
-
-Establish a connection to an endpoint corresponding to a resolver query.
-
-
- template<
- typename T1,
- ... ,
- typename TN>
- explicit ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 basic_socket_iostream]``(
- T1 t1,
- ... ,
- TN tn);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 more...]]``
-
-
-[section:overload1 basic_socket_iostream::basic_socket_iostream (1 of 2 overloads)]
-
-
-Construct a [link boost_asio.reference.basic_socket_iostream `basic_socket_iostream`] without establishing a connection.
-
-
- basic_socket_iostream();
-
-
-
-[endsect]
-
+[indexterm2 lowest_layer..basic_socket]
+Get a reference to the lowest layer.
 
 
-[section:overload2 basic_socket_iostream::basic_socket_iostream (2 of 2 overloads)]
+ lowest_layer_type & ``[link boost_asio.reference.basic_socket.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.lowest_layer.overload1 more...]]``
 
 
-Establish a connection to an endpoint corresponding to a resolver query.
+Get a const reference to the lowest layer.
 
 
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_iostream(
- T1 t1,
- ... ,
- TN tn);
+ const lowest_layer_type & ``[link boost_asio.reference.basic_socket.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.lowest_layer.overload2 more...]]``
 
 
-This constructor automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
+[section:overload1 basic_socket::lowest_layer (1 of 2 overloads)]
 
 
-[endsect]
+Get a reference to the lowest layer.
 
 
-[endsect]
+ lowest_layer_type & lowest_layer();
 
 
-[section:close basic_socket_iostream::close]
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
-[indexterm2 close..basic_socket_iostream]
-Close the connection.
 
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- void close();
 
 
 
@@ -21858,56 +23951,38 @@
 
 
 
-[section:connect basic_socket_iostream::connect]
-
-[indexterm2 connect..basic_socket_iostream]
-Establish a connection to an endpoint corresponding to a resolver query.
-
-
- template<
- typename T1,
- ... ,
- typename TN>
- void connect(
- T1 t1,
- ... ,
- TN tn);
-
+[section:overload2 basic_socket::lowest_layer (2 of 2 overloads)]
 
-This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
 
+Get a const reference to the lowest layer.
 
-[endsect]
 
+ const lowest_layer_type & lowest_layer() const;
 
 
-[section:rdbuf basic_socket_iostream::rdbuf]
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
-[indexterm2 rdbuf..basic_socket_iostream]
-Return a pointer to the underlying streambuf.
 
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- basic_socket_streambuf< Protocol, StreamSocketService > * rdbuf() const;
 
 
 
 [endsect]
 
 
-
 [endsect]
 
-[section:basic_socket_streambuf basic_socket_streambuf]
 
+[section:lowest_layer_type basic_socket::lowest_layer_type]
 
-Iostream streambuf for a socket.
+[indexterm2 lowest_layer_type..basic_socket]
+A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
- class basic_socket_streambuf :
- public basic_socket< Protocol, StreamSocketService >
+ typedef basic_socket< Protocol, SocketService > lowest_layer_type;
 
 
 [heading Types]
@@ -21916,147 +23991,154 @@
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
     [Socket option to permit sending of broadcast messages. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.bytes_readable [*bytes_readable]]]
+ [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
     [IO control command to get the amount of data that can be read without blocking. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
     [Socket option to enable socket-level debugging. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.do_not_route [*do_not_route]]]
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
     [Socket option to prevent routing, use local interfaces only. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.enable_connection_aborted [*enable_connection_aborted]]]
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
     [Socket option to report aborted connections on accept. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
     [The endpoint type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
     [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.keep_alive [*keep_alive]]]
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
     [Socket option to send keep-alives. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.linger [*linger]]]
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
     [Socket option to specify whether the socket lingers on close if unsent data is present. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.lowest_layer_type [*lowest_layer_type]]]
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
     [A basic_socket is always the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.message_flags [*message_flags]]]
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
     [Bitmask type for flags that can be passed to send and receive operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
     [The protocol type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.receive_buffer_size [*receive_buffer_size]]]
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
     [Socket option for the receive buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.receive_low_watermark [*receive_low_watermark]]]
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
     [Socket option for the receive low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.reuse_address [*reuse_address]]]
+ [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
     [Socket option to allow the socket to be bound to an address that is already in use. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.send_buffer_size [*send_buffer_size]]]
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
     [Socket option for the send buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.send_low_watermark [*send_low_watermark]]]
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
     [Socket option for the send low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.service_type [*service_type]]]
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_streambuf.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
     [Different ways a socket may be shutdown. ]
   
   ]
@@ -22068,121 +24150,132 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.assign [*assign]]]
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
     [Assign an existing native socket to the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.async_connect [*async_connect]]]
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
     [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.at_mark [*at_mark]]]
+ [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
     [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.available [*available]]]
+ [[link boost_asio.reference.basic_socket.available [*available]]]
     [Determine the number of bytes available for reading. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.basic_socket_streambuf [*basic_socket_streambuf]]]
- [Construct a basic_socket_streambuf without establishing a connection. ]
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it.
+
+ Construct and open a basic_socket.
+
+ Construct a basic_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_socket on an existing native socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.bind [*bind]]]
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
     [Bind the socket to the given local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.cancel [*cancel]]]
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
     [Cancel all asynchronous operations associated with the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.close [*close]]]
- [Close the connection.
-
- Close the socket. ]
+ [[link boost_asio.reference.basic_socket.close [*close]]]
+ [Close the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.connect [*connect]]]
- [Establish a connection.
-
- Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.get_option [*get_option]]]
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
     [Get an option from the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.io_control [*io_control]]]
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
     [Perform an IO control command on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.is_open [*is_open]]]
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.local_endpoint [*local_endpoint]]]
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
     [Get the local endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
      Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.native [*native]]]
+ [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.open [*open]]]
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.remote_endpoint [*remote_endpoint]]]
+ [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
     [Get the remote endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.set_option [*set_option]]]
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
     [Set an option on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_streambuf.shutdown [*shutdown]]]
+ [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
     [Disable sends or receives on the socket. ]
   ]
   
- [
- [[link boost_asio.reference.basic_socket_streambuf._basic_socket_streambuf [*~basic_socket_streambuf]]]
- [Destructor flushes buffered data. ]
- ]
-
 ]
 
 [heading Protected Member Functions]
@@ -22190,23 +24283,8 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.overflow [*overflow]]]
- []
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.setbuf [*setbuf]]]
- []
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.sync [*sync]]]
- []
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.underflow [*underflow]]]
- []
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
   ]
   
 ]
@@ -22216,22 +24294,27 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.max_connections [*max_connections]]]
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
     [The maximum length of the queue of pending incoming connections. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.message_do_not_route [*message_do_not_route]]]
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
     [Specify that the data should not be subject to routing. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.message_out_of_band [*message_out_of_band]]]
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.message_peek [*message_peek]]]
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
     [Peek at incoming data without removing it from the input queue. ]
   ]
 
@@ -22242,192 +24325,125 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_streambuf.service [*service]]]
+ [[link boost_asio.reference.basic_socket.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-[section:assign basic_socket_streambuf::assign]
-
-[indexterm2 assign..basic_socket_streambuf]
-Assign an existing native socket to the socket.
-
-
- void ``[link boost_asio.reference.basic_socket_streambuf.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.assign.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.assign.overload2 more...]]``
+The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
 
 
-[section:overload1 basic_socket_streambuf::assign (1 of 2 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
+[*Shared] [*objects:] Unsafe.
 
-['Inherited from basic_socket.]
 
 
-Assign an existing native socket to the socket.
 
+[heading Requirements]
 
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
+[*Header: ][^boost/asio/basic_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 basic_socket_streambuf::assign (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
+[section:max_connections basic_socket::max_connections]
 
-Assign an existing native socket to the socket.
 
+['Inherited from socket_base.]
 
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+[indexterm2 max_connections..basic_socket]
+The maximum length of the queue of pending incoming connections.
 
 
+ static const int max_connections = implementation_defined;
 
-[endsect]
 
 
 [endsect]
 
 
-[section:async_connect basic_socket_streambuf::async_connect]
-
-
-['Inherited from basic_socket.]
-
-[indexterm2 async_connect..basic_socket_streambuf]
-Start an asynchronous connect.
-
-
- template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
-
 
-This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
+[section:message_do_not_route basic_socket::message_do_not_route]
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
+['Inherited from socket_base.]
 
-[heading Parameters]
-
+[indexterm2 message_do_not_route..basic_socket]
+Specify that the data should not be subject to routing.
 
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
 
-[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+ static const int message_do_not_route = implementation_defined;
 
-]
 
 
-[heading Example]
-
+[endsect]
 
 
- void connect_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Connect succeeded.
- }
- }
 
- ...
+[section:message_end_of_record basic_socket::message_end_of_record]
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.async_connect(endpoint, connect_handler);
 
+['Inherited from socket_base.]
 
+[indexterm2 message_end_of_record..basic_socket]
+Specifies that the data marks the end of a record.
 
 
+ static const int message_end_of_record = implementation_defined;
 
 
 
 [endsect]
 
 
-[section:at_mark basic_socket_streambuf::at_mark]
 
-[indexterm2 at_mark..basic_socket_streambuf]
-Determine whether the socket is at the out-of-band data mark.
+[section:message_flags basic_socket::message_flags]
 
 
- bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 at_mark]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 more...]]``
+['Inherited from socket_base.]
 
- bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 more...]]``
+[indexterm2 message_flags..basic_socket]
+Bitmask type for flags that can be passed to send and receive operations.
 
 
-[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
+ typedef int message_flags;
 
 
-['Inherited from basic_socket.]
 
+[heading Requirements]
 
-Determine whether the socket is at the out-of-band data mark.
+[*Header: ][^boost/asio/basic_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- bool at_mark() const;
 
+[endsect]
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+[section:message_out_of_band basic_socket::message_out_of_band]
 
 
-[heading Exceptions]
-
+['Inherited from socket_base.]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 message_out_of_band..basic_socket]
+Process out-of-band data.
 
-]
 
+ static const int message_out_of_band = implementation_defined;
 
 
 
@@ -22435,176 +24451,210 @@
 
 
 
-[section:overload2 basic_socket_streambuf::at_mark (2 of 2 overloads)]
+[section:message_peek basic_socket::message_peek]
 
 
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
 
+[indexterm2 message_peek..basic_socket]
+Peek at incoming data without removing it from the input queue.
 
-Determine whether the socket is at the out-of-band data mark.
 
+ static const int message_peek = implementation_defined;
 
- bool at_mark(
- boost::system::error_code & ec) const;
 
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+[endsect]
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+[section:native basic_socket::native]
 
-]
+[indexterm2 native..basic_socket]
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+ native_type native();
 
 
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
 [endsect]
 
 
-[endsect]
-
-[section:available basic_socket_streambuf::available]
 
-[indexterm2 available..basic_socket_streambuf]
-Determine the number of bytes available for reading.
+[section:native_handle basic_socket::native_handle]
 
+[indexterm2 native_handle..basic_socket]
+Get the native socket representation.
 
- std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload1 available]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.available.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload2 available]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.available.overload2 more...]]``
+ native_handle_type native_handle();
 
 
-[section:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
-['Inherited from basic_socket.]
+[endsect]
 
 
-Determine the number of bytes available for reading.
 
+[section:native_handle_type basic_socket::native_handle_type]
 
- std::size_t available() const;
+[indexterm2 native_handle_type..basic_socket]
+The native representation of a socket.
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+ typedef SocketService::native_handle_type native_handle_type;
 
 
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
 
+[heading Requirements]
 
-[heading Exceptions]
-
+[*Header: ][^boost/asio/basic_socket.hpp]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[*Convenience header: ][^boost/asio.hpp]
 
-]
 
+[endsect]
 
 
+[section:native_non_blocking basic_socket::native_non_blocking]
 
-[endsect]
+[indexterm2 native_non_blocking..basic_socket]
+Gets the non-blocking mode of the native socket implementation.
 
 
+ bool ``[link boost_asio.reference.basic_socket.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.native_non_blocking.overload1 more...]]``
 
-[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
 
+Sets the non-blocking mode of the native socket implementation.
 
-['Inherited from basic_socket.]
 
+ void ``[link boost_asio.reference.basic_socket.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.native_non_blocking.overload2 more...]]``
 
-Determine the number of bytes available for reading.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.native_non_blocking.overload3 more...]]``
 
 
- std::size_t available(
- boost::system::error_code & ec) const;
+[section:overload1 basic_socket::native_non_blocking (1 of 3 overloads)]
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+Gets the non-blocking mode of the native socket implementation.
 
 
-[heading Parameters]
-
+ bool native_non_blocking() const;
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Return Value]
       
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
 
+[heading Remarks]
+
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
 
 
-[endsect]
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
-[endsect]
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
-[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
 
-[indexterm2 basic_socket_streambuf..basic_socket_streambuf]
-Construct a [link boost_asio.reference.basic_socket_streambuf `basic_socket_streambuf`] without establishing a connection.
 
 
- basic_socket_streambuf();
 
 
 
 [endsect]
 
 
-[section:bind basic_socket_streambuf::bind]
-
-[indexterm2 bind..basic_socket_streambuf]
-Bind the socket to the given local endpoint.
-
-
- void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.bind.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.bind.overload2 more...]]``
-
 
-[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::native_non_blocking (2 of 3 overloads)]
 
 
-Bind the socket to the given local endpoint.
+Sets the non-blocking mode of the native socket implementation.
 
 
- void bind(
- const endpoint_type & endpoint);
+ void native_non_blocking(
+ bool mode);
 
 
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Parameters]
@@ -22612,7 +24662,7 @@
 
 [variablelist
   
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
 ]
 
@@ -22622,45 +24672,102 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
 [heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345));
-
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
 
 
-[endsect]
 
 
+[endsect]
 
-[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
+[section:overload3 basic_socket::native_non_blocking (3 of 3 overloads)]
 
 
-Bind the socket to the given local endpoint.
+Sets the non-blocking mode of the native socket implementation.
 
 
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ boost::system::error_code native_non_blocking(
+ bool mode,
       boost::system::error_code & ec);
 
 
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
 [heading Parameters]
@@ -22668,282 +24775,341 @@
 
 [variablelist
   
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
 ]
 
 
 [heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
-
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
- if (ec)
+ template <typename Handler>
+ struct sendfile_op
    {
- // An error occurred.
- }
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:broadcast basic_socket_streambuf::broadcast]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 broadcast..basic_socket_streambuf]
-Socket option to permit sending of broadcast messages.
+[endsect]
 
 
- typedef implementation_defined broadcast;
+[section:native_type basic_socket::native_type]
 
+[indexterm2 native_type..basic_socket]
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
 
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+ typedef SocketService::native_handle_type native_type;
 
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
-Getting the current option value:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+[section:non_blocking basic_socket::non_blocking]
 
+[indexterm2 non_blocking..basic_socket]
+Gets the non-blocking mode of the socket.
 
 
+ bool ``[link boost_asio.reference.basic_socket.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.non_blocking.overload1 more...]]``
 
 
+Sets the non-blocking mode of the socket.
 
 
-[heading Requirements]
+ void ``[link boost_asio.reference.basic_socket.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.non_blocking.overload2 more...]]``
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.non_blocking.overload3 more...]]``
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:overload1 basic_socket::non_blocking (1 of 3 overloads)]
 
-[endsect]
 
+Gets the non-blocking mode of the socket.
 
 
-[section:bytes_readable basic_socket_streambuf::bytes_readable]
+ bool non_blocking() const;
 
 
-['Inherited from socket_base.]
 
-[indexterm2 bytes_readable..basic_socket_streambuf]
-IO control command to get the amount of data that can be read without blocking.
+[heading Return Value]
+
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
 
- typedef implementation_defined bytes_readable;
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
 
-Implements the FIONREAD IO control command.
 
+[endsect]
 
-[heading Example]
-
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+[section:overload2 basic_socket::non_blocking (2 of 3 overloads)]
 
 
+Sets the non-blocking mode of the socket.
 
 
+ void non_blocking(
+ bool mode);
 
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+]
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[section:cancel basic_socket_streambuf::cancel]
+]
 
-[indexterm2 cancel..basic_socket_streambuf]
-Cancel all asynchronous operations associated with the socket.
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
- void ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.cancel.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.cancel.overload2 more...]]``
 
 
-[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from basic_socket.]
 
+[section:overload3 basic_socket::non_blocking (3 of 3 overloads)]
 
-Cancel all asynchronous operations associated with the socket.
 
+Sets the non-blocking mode of the socket.
 
- void cancel();
 
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Exceptions]
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
 [heading Remarks]
       
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
-* It will only cancel asynchronous operations that were initiated in the current thread.
 
 
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+[endsect]
 
-For portable cancellation, consider using one of the following alternatives:
 
+[endsect]
 
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
+[section:non_blocking_io basic_socket::non_blocking_io]
 
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
+['Inherited from socket_base.]
 
+[indexterm2 non_blocking_io..basic_socket]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
-[endsect]
 
+ typedef implementation_defined non_blocking_io;
 
 
-[section:overload2 basic_socket_streambuf::cancel (2 of 2 overloads)]
 
+Implements the FIONBIO IO control command.
 
-['Inherited from basic_socket.]
 
+[heading Example]
+
 
-Cancel all asynchronous operations associated with the socket.
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
 
- boost::system::error_code cancel(
- boost::system::error_code & ec);
 
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
-[heading Remarks]
-
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
+[*Convenience header: ][^boost/asio.hpp]
 
 
-* It will only cancel asynchronous operations that were initiated in the current thread.
+[endsect]
 
 
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+[section:open basic_socket::open]
 
-For portable cancellation, consider using one of the following alternatives:
+[indexterm2 open..basic_socket]
+Open the socket using the specified protocol.
 
 
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
+ void ``[link boost_asio.reference.basic_socket.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.open.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.open.overload2 more...]]``
 
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
+[section:overload1 basic_socket::open (1 of 2 overloads)]
 
 
-[endsect]
+Open the socket using the specified protocol.
 
 
-[endsect]
+ void open(
+ const protocol_type & protocol = protocol_type());
 
-[section:close basic_socket_streambuf::close]
 
-[indexterm2 close..basic_socket_streambuf]
-Close the connection.
+This function opens the socket so that it will use the specified protocol.
 
 
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.close.overload1 more...]]``
+[heading Parameters]
+
 
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
 
-Close the socket.
+]
 
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.close.overload2 more...]]``
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
+]
 
 
-Close the connection.
+[heading Example]
+
 
 
- basic_socket_streambuf< Protocol, StreamSocketService > * close();
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
 
 
 
-[heading Return Value]
-
-`this` if a connection was successfully established, a null pointer otherwise.
 
 
 
@@ -22952,20 +25118,18 @@
 
 
 
-[section:overload2 basic_socket_streambuf::close (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::open (2 of 2 overloads)]
 
 
-Close the socket.
+Open the socket using the specified protocol.
 
 
- boost::system::error_code close(
+ boost::system::error_code open(
+ const protocol_type & protocol,
       boost::system::error_code & ec);
 
 
-This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+This function opens the socket so that it will use the specified protocol.
 
 
 [heading Parameters]
@@ -22973,6 +25137,8 @@
 
 [variablelist
   
+[[protocol][An object specifying which protocol is to be used.]]
+
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
@@ -22983,9 +25149,8 @@
 
 
    boost::asio::ip::tcp::socket socket(io_service);
- ...
    boost::system::error_code ec;
- socket.close(ec);
+ socket.open(boost::asio::ip::tcp::v4(), ec);
    if (ec)
    {
      // An error occurred.
@@ -22995,119 +25160,212 @@
 
 
 
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
+[endsect]
 
 
 [endsect]
 
 
+[section:protocol_type basic_socket::protocol_type]
+
+[indexterm2 protocol_type..basic_socket]
+The protocol type.
+
+
+ typedef Protocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
 [endsect]
 
-[section:connect basic_socket_streambuf::connect]
 
-[indexterm2 connect..basic_socket_streambuf]
-Establish a connection.
 
+[section:receive_buffer_size basic_socket::receive_buffer_size]
 
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload1 connect]``(
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload1 more...]]``
 
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload2 connect]``(
- T1 t1,
- ... ,
- TN tn);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload2 more...]]``
+['Inherited from socket_base.]
+
+[indexterm2 receive_buffer_size..basic_socket]
+Socket option for the receive buffer size of a socket.
 
 
-Connect the socket to the specified endpoint.
+ typedef implementation_defined receive_buffer_size;
 
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.connect.overload3 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload3 more...]]``
 
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
-[section:overload1 basic_socket_streambuf::connect (1 of 3 overloads)]
 
+[heading Examples]
+
+Setting the option:
 
-Establish a connection.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
 
 
- basic_socket_streambuf< Protocol, StreamSocketService > * connect(
- const endpoint_type & endpoint);
 
 
-This function establishes a connection to the specified endpoint.
+
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-[heading Return Value]
-
-`this` if a connection was successfully established, a null pointer otherwise.
 
 
 
 
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
 [endsect]
 
 
 
-[section:overload2 basic_socket_streambuf::connect (2 of 3 overloads)]
+[section:receive_low_watermark basic_socket::receive_low_watermark]
 
 
-Establish a connection.
+['Inherited from socket_base.]
 
+[indexterm2 receive_low_watermark..basic_socket]
+Socket option for the receive low watermark.
 
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_streambuf< Protocol, StreamSocketService > * connect(
- T1 t1,
- ... ,
- TN tn);
 
+ typedef implementation_defined receive_low_watermark;
+
+
+
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:remote_endpoint basic_socket::remote_endpoint]
+
+[indexterm2 remote_endpoint..basic_socket]
+Get the remote endpoint of the socket.
+
+
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.remote_endpoint.overload1 more...]]``
+
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.remote_endpoint.overload2 more...]]``
+
+
+[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
+
+
+Get the remote endpoint of the socket.
+
+
+ endpoint_type remote_endpoint() const;
 
-This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
+
+This function is used to obtain the remote endpoint of the socket.
 
 
 [heading Return Value]
       
-`this` if a connection was successfully established, a null pointer otherwise.
+An object that represents the remote endpoint of the socket.
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
+[heading Example]
+
 
-[section:overload3 basic_socket_streambuf::connect (3 of 3 overloads)]
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
-['Inherited from basic_socket.]
 
 
-Connect the socket to the specified endpoint.
 
 
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
 
 
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+[endsect]
+
+
+
+[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
+
+
+Get the remote endpoint of the socket.
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
+
+
+This function is used to obtain the remote endpoint of the socket.
 
 
 [heading Parameters]
@@ -23115,22 +25373,24 @@
 
 [variablelist
   
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+
+
 [heading Example]
   
 
 
    boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ ...
    boost::system::error_code ec;
- socket.connect(endpoint, ec);
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
    if (ec)
    {
      // An error occurred.
@@ -23148,30 +25408,30 @@
 [endsect]
 
 
-[section:debug basic_socket_streambuf::debug]
+[section:reuse_address basic_socket::reuse_address]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 debug..basic_socket_streambuf]
-Socket option to enable socket-level debugging.
+[indexterm2 reuse_address..basic_socket]
+Socket option to allow the socket to be bound to an address that is already in use.
 
 
- typedef implementation_defined debug;
+ typedef implementation_defined reuse_address;
 
 
 
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
 
 
 
@@ -23179,10 +25439,10 @@
 
 Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::socket_base::debug option;
- socket.get_option(option);
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
    bool is_set = option.value();
 
 
@@ -23193,7 +25453,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -23202,29 +25462,29 @@
 
 
 
-[section:do_not_route basic_socket_streambuf::do_not_route]
+[section:send_buffer_size basic_socket::send_buffer_size]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 do_not_route..basic_socket_streambuf]
-Socket option to prevent routing, use local interfaces only.
+[indexterm2 send_buffer_size..basic_socket]
+Socket option for the send buffer size of a socket.
 
 
- typedef implementation_defined do_not_route;
+ typedef implementation_defined send_buffer_size;
 
 
 
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::do_not_route option(true);
+ boost::asio::socket_base::send_buffer_size option(8192);
    socket.set_option(option);
 
 
@@ -23233,11 +25493,11 @@
 
 Getting the current option value:
 
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::do_not_route option;
+ boost::asio::socket_base::send_buffer_size option;
    socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
 
 
 
@@ -23247,7 +25507,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -23256,30 +25516,30 @@
 
 
 
-[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
+[section:send_low_watermark basic_socket::send_low_watermark]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 enable_connection_aborted..basic_socket_streambuf]
-Socket option to report aborted connections on accept.
+[indexterm2 send_low_watermark..basic_socket]
+Socket option for the send low watermark.
 
 
- typedef implementation_defined enable_connection_aborted;
+ typedef implementation_defined send_low_watermark;
 
 
 
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
 
 
 
@@ -23287,11 +25547,11 @@
 
 Getting the current option value:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
 
 
@@ -23301,7 +25561,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -23310,84 +25570,79 @@
 
 
 
-[section:endpoint_type basic_socket_streambuf::endpoint_type]
-
-[indexterm2 endpoint_type..basic_socket_streambuf]
-The endpoint type.
-
+[section:service basic_socket::service]
 
- typedef Protocol::endpoint endpoint_type;
 
+['Inherited from basic_io_object.]
 
+[indexterm2 service..basic_socket]
+The service associated with the I/O object.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+ service_type & service;
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:get_io_service basic_socket_streambuf::get_io_service]
+[section:service_type basic_socket::service_type]
 
 
 ['Inherited from basic_io_object.]
 
-[indexterm2 get_io_service..basic_socket_streambuf]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
+[indexterm2 service_type..basic_socket]
+The type of the service that will be used to provide I/O operations.
 
- boost::asio::io_service & get_io_service();
 
+ typedef SocketService service_type;
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:get_option basic_socket_streambuf::get_option]
-
-[indexterm2 get_option..basic_socket_streambuf]
-Get an option from the socket.
-
+[section:set_option basic_socket::set_option]
 
- void ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.get_option.overload1 more...]]``
+[indexterm2 set_option..basic_socket]
+Set an option on the socket.
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload2 get_option]``(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.get_option.overload2 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.set_option.overload1 more...]]``
 
-[section:overload1 basic_socket_streambuf::get_option (1 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.set_option.overload2 more...]]``
 
 
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::set_option (1 of 2 overloads)]
 
 
-Get an option from the socket.
+Set an option on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option) const;
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
 
 
-This function is used to get the current value of an option on the socket.
+This function is used to set an option on the socket.
 
 
 [heading Parameters]
@@ -23395,7 +25650,7 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the socket.]]
+[[option][The new option value to be set on the socket.]]
 
 ]
 
@@ -23413,13 +25668,12 @@
 
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::socket::keep_alive option;
- socket.get_option(option);
- bool is_set = option.get();
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
 
 
 
@@ -23431,23 +25685,20 @@
 
 
 
-[section:overload2 basic_socket_streambuf::get_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::set_option (2 of 2 overloads)]
 
 
-Get an option from the socket.
+Set an option on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
 
-This function is used to get the current value of an option on the socket.
+This function is used to set an option on the socket.
 
 
 [heading Parameters]
@@ -23455,7 +25706,7 @@
 
 [variablelist
   
-[[option][The option value to be obtained from the socket.]]
+[[option][The new option value to be set on the socket.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -23465,18 +25716,17 @@
 
 [heading Example]
   
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::socket::keep_alive option;
+ boost::asio::ip::tcp::no_delay option(true);
    boost::system::error_code ec;
- socket.get_option(option, ec);
+ socket.set_option(option, ec);
    if (ec)
    {
      // An error occurred.
    }
- bool is_set = option.get();
 
 
 
@@ -23489,79 +25739,33 @@
 
 [endsect]
 
+[section:shutdown basic_socket::shutdown]
 
-[section:implementation basic_socket_streambuf::implementation]
+[indexterm2 shutdown..basic_socket]
+Disable sends or receives on the socket.
 
 
-['Inherited from basic_io_object.]
+ void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.shutdown.overload1 more...]]``
 
-[indexterm2 implementation..basic_socket_streambuf]
-The underlying implementation of the I/O object.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.shutdown.overload2 shutdown]``(
+ shutdown_type what,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket.shutdown.overload2 more...]]``
 
 
- implementation_type implementation;
+[section:overload1 basic_socket::shutdown (1 of 2 overloads)]
 
 
+Disable sends or receives on the socket.
 
-[endsect]
 
+ void shutdown(
+ shutdown_type what);
 
 
-[section:implementation_type basic_socket_streambuf::implementation_type]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 implementation_type..basic_socket_streambuf]
-The underlying implementation type of I/O object.
-
-
- typedef service_type::implementation_type implementation_type;
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[endsect]
-
-
-[section:io_control basic_socket_streambuf::io_control]
-
-[indexterm2 io_control..basic_socket_streambuf]
-Perform an IO control command on the socket.
-
-
- void ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload1 io_control]``(
- IoControlCommand & command);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.io_control.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload2 io_control]``(
- IoControlCommand & command,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.io_control.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::io_control (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Perform an IO control command on the socket.
-
-
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
-
-
-This function is used to execute an IO control command on the socket.
+This function is used to disable send operations, receive operations, or both.
 
 
 [heading Parameters]
@@ -23569,7 +25773,7 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[what][Determines what types of operation will no longer be allowed.]]
 
 ]
 
@@ -23584,16 +25788,13 @@
 ]
 
 
-
 [heading Example]
   
-Getting the number of bytes ready to read:
+Shutting down the send side of the socket:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
 
 
 
@@ -23605,23 +25806,18 @@
 
 
 
-[section:overload2 basic_socket_streambuf::io_control (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
 
 
-Perform an IO control command on the socket.
+Disable sends or receives on the socket.
 
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
+ boost::system::error_code shutdown(
+ shutdown_type what,
       boost::system::error_code & ec);
 
 
-This function is used to execute an IO control command on the socket.
+This function is used to disable send operations, receive operations, or both.
 
 
 [heading Parameters]
@@ -23629,345 +25825,86 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[what][Determines what types of operation will no longer be allowed.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-
 [heading Example]
   
-Getting the number of bytes ready to read:
+Shutting down the send side of the socket:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::socket::bytes_readable command;
    boost::system::error_code ec;
- socket.io_control(command, ec);
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
    if (ec)
    {
      // An error occurred.
    }
- std::size_t bytes_readable = command.get();
-
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:io_service basic_socket_streambuf::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..basic_socket_streambuf]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
 
 
-[section:is_open basic_socket_streambuf::is_open]
-
-
-['Inherited from basic_socket.]
 
-[indexterm2 is_open..basic_socket_streambuf]
-Determine whether the socket is open.
 
 
- bool is_open() const;
-
 
 
 [endsect]
 
 
-
-[section:keep_alive basic_socket_streambuf::keep_alive]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 keep_alive..basic_socket_streambuf]
-Socket option to send keep-alives.
-
-
- typedef implementation_defined keep_alive;
-
-
-
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-
-
-[heading Examples]
-
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
-
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option;
- socket.get_option(option);
- bool is_set = option.value();
-
-
-
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
 [endsect]
 
 
-
-[section:linger basic_socket_streambuf::linger]
+[section:shutdown_type basic_socket::shutdown_type]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 linger..basic_socket_streambuf]
-Socket option to specify whether the socket lingers on close if unsent data is present.
-
-
- typedef implementation_defined linger;
-
-
-
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
-
-
-[heading Examples]
-
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option(true, 30);
- socket.set_option(option);
-
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option;
- socket.get_option(option);
- bool is_set = option.enabled();
- unsigned short timeout = option.timeout();
-
-
-
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[endsect]
-
-
-[section:local_endpoint basic_socket_streambuf::local_endpoint]
-
-[indexterm2 local_endpoint..basic_socket_streambuf]
-Get the local endpoint of the socket.
-
-
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 local_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 more...]]``
-
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::local_endpoint (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Get the local endpoint of the socket.
-
-
- endpoint_type local_endpoint() const;
-
-
-This function is used to obtain the locally bound endpoint of the socket.
-
+[indexterm2 shutdown_type..basic_socket]
+Different ways a socket may be shutdown.
 
-[heading Return Value]
-
-An object that represents the local endpoint of the socket.
 
+ enum shutdown_type
 
-[heading Exceptions]
-
+[indexterm2 shutdown_receive..basic_socket]
+[indexterm2 shutdown_send..basic_socket]
+[indexterm2 shutdown_both..basic_socket]
 
+[heading Values]
 [variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
-
-
-[heading Example]
-
-
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
-
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:overload2 basic_socket_streambuf::local_endpoint (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Get the local endpoint of the socket.
-
-
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
-
-
-This function is used to obtain the locally bound endpoint of the socket.
 
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
 
-[heading Parameters]
-
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
 
 ]
 
 
-[heading Return Value]
-
-An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
-
-
-[heading Example]
-
-
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
-
-
-
-
-
-[endsect]
-
 
 [endsect]
 
-[section:lowest_layer basic_socket_streambuf::lowest_layer]
-
-[indexterm2 lowest_layer..basic_socket_streambuf]
-Get a reference to the lowest layer.
-
-
- lowest_layer_type & ``[link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload1 more...]]``
-
-
-Get a const reference to the lowest layer.
-
-
- const lowest_layer_type & ``[link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::lowest_layer (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Get a reference to the lowest layer.
 
 
- lowest_layer_type & lowest_layer();
-
-
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
+[section:_basic_socket basic_socket::~basic_socket]
 
+[indexterm2 ~basic_socket..basic_socket]
+Protected destructor to prevent deletion through this type.
 
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
+ ~basic_socket();
 
 
 
@@ -23975,44 +25912,20 @@
 
 
 
-[section:overload2 basic_socket_streambuf::lowest_layer (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Get a const reference to the lowest layer.
-
-
- const lowest_layer_type & lowest_layer() const;
-
-
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
-
-
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
 [endsect]
 
+[section:basic_socket_acceptor basic_socket_acceptor]
 
-[section:lowest_layer_type basic_socket_streambuf::lowest_layer_type]
-
-
-['Inherited from basic_socket.]
 
-[indexterm2 lowest_layer_type..basic_socket_streambuf]
-A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
+Provides the ability to accept new connections.
 
 
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketAcceptorService SocketAcceptorService]`` = socket_acceptor_service<Protocol>>
+ class basic_socket_acceptor :
+ public basic_io_object< SocketAcceptorService >,
+ public socket_base
 
 
 [heading Types]
@@ -24021,147 +25934,147 @@
 
   [
 
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
     [Socket option to permit sending of broadcast messages. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
     [IO control command to get the amount of data that can be read without blocking. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
     [Socket option to enable socket-level debugging. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
     [Socket option to prevent routing, use local interfaces only. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
     [Socket option to report aborted connections on accept. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
     [The endpoint type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
     [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
     [Socket option to send keep-alives. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
     [Socket option to specify whether the socket lingers on close if unsent data is present. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
+ [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle_type [*native_handle_type]]]
+ [The native representation of an acceptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
     [The protocol type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
     [Socket option for the receive buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
     [Socket option for the receive low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
     [Socket option to allow the socket to be bound to an address that is already in use. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
     [Socket option for the send buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
     [Socket option for the send low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
     [Different ways a socket may be shutdown. ]
   
   ]
@@ -24173,127 +26086,110 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection.
+
+ Accept a new connection and obtain the endpoint of the peer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
+ [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
+ [Assigns an existing native acceptor to the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it.
+ [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
+ [Construct an acceptor without opening it.
 
- Construct and open a basic_socket.
+ Construct an open acceptor.
 
- Construct a basic_socket, opening it and binding it to the given local endpoint.
+ Construct an acceptor opened on the given endpoint.
 
- Construct a basic_socket on an existing native socket. ]
+ Construct a basic_socket_acceptor on an existing native acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
+ [Bind the acceptor to the given local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.close [*close]]]
- [Close the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
+ [Close the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
+ [Get an option from the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_socket_acceptor.io_control [*io_control]]]
+ [Perform an IO control command on the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
+ [Place the acceptor into the state where it will listen for new connections. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
-
- Get a const reference to the lowest layer. ]
+ [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.native [*native]]]
- [Get the native socket representation. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native acceptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle [*native_handle]]]
+ [Get the native acceptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native acceptor implementation.
+
+ Sets the non-blocking mode of the native acceptor implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the acceptor.
+
+ Sets the non-blocking mode of the acceptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
+ [Open the acceptor using the specified protocol. ]
   ]
   
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
+ [Set an option on the acceptor. ]
   ]
   
 ]
@@ -24303,22 +26199,27 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
     [The maximum length of the queue of pending incoming connections. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
     [Specify that the data should not be subject to routing. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [[link boost_asio.reference.basic_socket_acceptor.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
     [Peek at incoming data without removing it from the input queue. ]
   ]
 
@@ -24329,246 +26230,208 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.service [*service]]]
+ [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
 
 
 [heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[endsect]
-
-
-
-[section:max_connections basic_socket_streambuf::max_connections]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 max_connections..basic_socket_streambuf]
-The maximum length of the queue of pending incoming connections.
-
-
- static const int max_connections = implementation_defined;
-
-
-
-[endsect]
-
-
-
-[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 message_do_not_route..basic_socket_streambuf]
-Specify that the data should not be subject to routing.
-
-
- static const int message_do_not_route = implementation_defined;
-
-
-
-[endsect]
-
-
+[*Shared] [*objects:] Unsafe.
 
-[section:message_flags basic_socket_streambuf::message_flags]
 
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
 
-['Inherited from socket_base.]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
 
-[indexterm2 message_flags..basic_socket_streambuf]
-Bitmask type for flags that can be passed to send and receive operations.
 
 
- typedef int message_flags;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
+[section:accept basic_socket_acceptor::accept]
 
-[endsect]
-
-
-
-[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
-
-
-['Inherited from socket_base.]
-
-[indexterm2 message_out_of_band..basic_socket_streambuf]
-Process out-of-band data.
-
-
- static const int message_out_of_band = implementation_defined;
-
-
-
-[endsect]
+[indexterm2 accept..basic_socket_acceptor]
+Accept a new connection.
 
 
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.accept.overload1 accept]``(
+ basic_socket< protocol_type, SocketService > & peer);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload1 more...]]``
 
-[section:message_peek basic_socket_streambuf::message_peek]
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.accept.overload2 accept]``(
+ basic_socket< protocol_type, SocketService > & peer,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload2 more...]]``
 
 
-['Inherited from socket_base.]
+Accept a new connection and obtain the endpoint of the peer.
 
-[indexterm2 message_peek..basic_socket_streambuf]
-Peek at incoming data without removing it from the input queue.
 
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.accept.overload3 accept]``(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload3 more...]]``
 
- static const int message_peek = implementation_defined;
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.accept.overload4 accept]``(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.accept.overload4 more...]]``
 
 
+[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)]
 
-[endsect]
 
+Accept a new connection.
 
 
-[section:native basic_socket_streambuf::native]
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer);
 
 
-['Inherited from basic_socket.]
+This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
 
-[indexterm2 native..basic_socket_streambuf]
-Get the native socket representation.
 
+[heading Parameters]
+
 
- native_type native();
+[variablelist
+
+[[peer][The socket into which the new connection will be accepted.]]
 
+]
 
-This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
+[heading Exceptions]
+
 
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-[section:native_type basic_socket_streambuf::native_type]
+[heading Example]
+
 
 
-['Inherited from basic_socket.]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ acceptor.accept(socket);
 
-[indexterm2 native_type..basic_socket_streambuf]
-The native representation of a socket.
 
 
- typedef StreamSocketService::native_type native_type;
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)]
 
 
+Accept a new connection.
 
-[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
 
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ boost::system::error_code & ec);
 
-['Inherited from socket_base.]
 
-[indexterm2 non_blocking_io..basic_socket_streambuf]
-IO control command to set the blocking mode of the socket.
+This function is used to accept a new connection from a peer into the given socket. The function call will block until a new connection has been accepted successfully or an error occurs.
 
 
- typedef implementation_defined non_blocking_io;
+[heading Parameters]
+
 
+[variablelist
+
+[[peer][The socket into which the new connection will be accepted.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
-Implements the FIONBIO IO control command.
+]
 
 
 [heading Example]
   
 
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
-
-
-
-
+ boost::asio::ip::tcp::soocket socket(io_service);
+ boost::system::error_code ec;
+ acceptor.accept(socket, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:open basic_socket_streambuf::open]
-
-[indexterm2 open..basic_socket_streambuf]
-Open the socket using the specified protocol.
-
-
- void ``[link boost_asio.reference.basic_socket_streambuf.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.open.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.open.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::open (1 of 2 overloads)]
-
 
-['Inherited from basic_socket.]
+[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
 
 
-Open the socket using the specified protocol.
+Accept a new connection and obtain the endpoint of the peer.
 
 
- void open(
- const protocol_type & protocol = protocol_type());
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function is used to accept a new connection from a peer into the given socket, and additionally provide the endpoint of the remote peer. The function call will block until a new connection has been accepted successfully or an error occurs.
 
 
 [heading Parameters]
@@ -24576,7 +26439,9 @@
 
 [variablelist
   
-[[protocol][An object specifying protocol parameters to be used.]]
+[[peer][The socket into which the new connection will be accepted.]]
+
+[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
 
 ]
 
@@ -24595,8 +26460,11 @@
   
 
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
    boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ boost::asio::ip::tcp::endpoint endpoint;
+ acceptor.accept(socket, endpoint);
 
 
 
@@ -24608,21 +26476,21 @@
 
 
 
-[section:overload2 basic_socket_streambuf::open (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)]
 
 
-Open the socket using the specified protocol.
+Accept a new connection and obtain the endpoint of the peer.
 
 
- boost::system::error_code open(
- const protocol_type & protocol,
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function is used to accept a new connection from a peer into the given socket, and additionally provide the endpoint of the remote peer. The function call will block until a new connection has been accepted successfully or an error occurs.
 
 
 [heading Parameters]
@@ -24630,7 +26498,9 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[peer][The socket into which the new connection will be accepted.]]
+
+[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -24641,9 +26511,12 @@
   
 
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
    boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint;
    boost::system::error_code ec;
- socket.open(boost::asio::ip::tcp::v4(), ec);
+ acceptor.accept(socket, endpoint, ec);
    if (ec)
    {
      // An error occurred.
@@ -24660,400 +26533,549 @@
 
 [endsect]
 
+[section:assign basic_socket_acceptor::assign]
 
-[section:overflow basic_socket_streambuf::overflow]
+[indexterm2 assign..basic_socket_acceptor]
+Assigns an existing native acceptor to the acceptor.
 
-[indexterm2 overflow..basic_socket_streambuf]
 
- int_type overflow(
- int_type c);
+ void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.assign.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.assign.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
 
 
+Assigns an existing native acceptor to the acceptor.
 
-[section:protocol_type basic_socket_streambuf::protocol_type]
 
+ void assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor);
 
-['Inherited from basic_socket.]
 
-[indexterm2 protocol_type..basic_socket_streambuf]
-The protocol type.
 
+[endsect]
 
- typedef Protocol protocol_type;
 
 
+[section:overload2 basic_socket_acceptor::assign (2 of 2 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+Assigns an existing native acceptor to the acceptor.
+
+
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
+[section:async_accept basic_socket_acceptor::async_accept]
 
+[indexterm2 async_accept..basic_socket_acceptor]
+Start an asynchronous accept.
 
-['Inherited from socket_base.]
 
-[indexterm2 receive_buffer_size..basic_socket_streambuf]
-Socket option for the receive buffer size of a socket.
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.async_accept.overload1 async_accept]``(
+ basic_socket< protocol_type, SocketService > & peer,
+ AcceptHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.async_accept.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.async_accept.overload2 async_accept]``(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint,
+ AcceptHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.async_accept.overload2 more...]]``
 
- typedef implementation_defined receive_buffer_size;
 
+[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
 
 
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+Start an asynchronous accept.
 
 
-[heading Examples]
-
-Setting the option:
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void async_accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ AcceptHandler handler);
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
 
+This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
 
 
+[heading Parameters]
+
 
+[variablelist
+
+[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
 
-Getting the current option value:
+[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+]
 
 
+[heading Example]
+
 
 
+ void accept_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Accept succeeded.
+ }
+ }
 
+ ...
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ acceptor.async_accept(socket, accept_handler);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
 
 
+[endsect]
 
-[section:receive_low_watermark basic_socket_streambuf::receive_low_watermark]
 
 
-['Inherited from socket_base.]
+[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
 
-[indexterm2 receive_low_watermark..basic_socket_streambuf]
-Socket option for the receive low watermark.
 
+Start an asynchronous accept.
 
- typedef implementation_defined receive_low_watermark;
+
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void async_accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint,
+ AcceptHandler handler);
 
 
+This function is used to asynchronously accept a new connection into a socket, and additionally obtain the endpoint of the remote peer. The function call always returns immediately.
 
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
+[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written. Ownership of the peer\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
 
+[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`. ]]
 
+]
 
 
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+[endsect]
 
 
+[endsect]
 
+[section:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
 
+[indexterm2 basic_socket_acceptor..basic_socket_acceptor]
+Construct an acceptor without opening it.
 
 
+ explicit ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+Construct an open acceptor.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 more...]]``
 
-[endsect]
 
+Construct an acceptor opened on the given endpoint.
 
-[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
 
-[indexterm2 remote_endpoint..basic_socket_streambuf]
-Get the remote endpoint of the socket.
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint,
+ bool reuse_addr = true);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload3 more...]]``
 
 
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 more...]]``
+Construct a [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] on an existing native acceptor.
 
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 more...]]``
 
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 more...]]``
 
-[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
 
+[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
 
-['Inherited from basic_socket.]
 
+Construct an acceptor without opening it.
 
-Get the remote endpoint of the socket.
 
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service);
 
- endpoint_type remote_endpoint() const;
 
+This constructor creates an acceptor without opening it to listen for new connections. The `open()` function must be called before the acceptor can accept new socket connections.
 
-This function is used to obtain the remote endpoint of the socket.
 
+[heading Parameters]
+
 
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket.
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
+
+]
 
 
-[heading Exceptions]
+
+
+[endsect]
+
+
+
+[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
+
+
+Construct an open acceptor.
+
+
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+
+
+This constructor creates an acceptor and automatically opens it.
+
+
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
+
+[[protocol][An object specifying protocol parameters to be used.]]
 
 ]
 
 
-[heading Example]
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
 
 
+[endsect]
 
 
 
+[section:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
 
-[endsect]
 
+Construct an acceptor opened on the given endpoint.
 
 
-[section:overload2 basic_socket_streambuf::remote_endpoint (2 of 2 overloads)]
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint,
+ bool reuse_addr = true);
 
 
-['Inherited from basic_socket.]
+This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
 
 
-Get the remote endpoint of the socket.
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
 
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+[[endpoint][An endpoint on the local machine on which the acceptor will listen for new connections.]]
 
+[[reuse_addr][Whether the constructor should set the socket option `socket_base::reuse_address`.]]
 
-This function is used to obtain the remote endpoint of the socket.
+]
 
 
-[heading Parameters]
+[heading Exceptions]
     
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
-[heading Return Value]
+[heading Remarks]
       
-An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+This constructor is equivalent to the following code:
 
+ basic_socket_acceptor<Protocol> acceptor(io_service);
+ acceptor.open(endpoint.protocol());
+ if (reuse_addr)
+ acceptor.set_option(socket_base::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen(listen_backlog);
 
-[heading Example]
-
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
 
 
 
 
+[endsect]
 
 
 
-[endsect]
+[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
 
 
-[endsect]
+Construct a [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] on an existing native acceptor.
 
 
-[section:reuse_address basic_socket_streambuf::reuse_address]
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_acceptor);
 
 
-['Inherited from socket_base.]
+This constructor creates an acceptor object to hold an existing native acceptor.
 
-[indexterm2 reuse_address..basic_socket_streambuf]
-Socket option to allow the socket to be bound to an address that is already in use.
 
+[heading Parameters]
+
 
- typedef implementation_defined reuse_address;
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
 
+[[protocol][An object specifying protocol parameters to be used.]]
 
+[[native_acceptor][A native acceptor.]]
 
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+]
 
 
-[heading Examples]
-
-Setting the option:
+[heading Exceptions]
+
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
 
 
 
-Getting the current option value:
+[endsect]
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
 
+[endsect]
 
+[section:bind basic_socket_acceptor::bind]
 
+[indexterm2 bind..basic_socket_acceptor]
+Bind the acceptor to the given local endpoint.
 
 
+ void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.bind.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.bind.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Bind the acceptor to the given local endpoint.
 
-[endsect]
 
+ void bind(
+ const endpoint_type & endpoint);
 
 
-[section:send_buffer_size basic_socket_streambuf::send_buffer_size]
+This function binds the socket acceptor to the specified endpoint on the local machine.
 
 
-['Inherited from socket_base.]
+[heading Parameters]
+
 
-[indexterm2 send_buffer_size..basic_socket_streambuf]
-Socket option for the send buffer size of a socket.
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
 
+]
 
- typedef implementation_defined send_buffer_size;
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+]
 
 
-[heading Examples]
+[heading Example]
   
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
+ acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
 
 
 
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option;
- socket.get_option(option);
- int size = option.value();
 
 
+[endsect]
 
 
 
+[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
+
+
+Bind the acceptor to the given local endpoint.
+
+
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+This function binds the socket acceptor to the specified endpoint on the local machine.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
+ boost::system::error_code ec;
+ acceptor.bind(boost::asio::ip::tcp::endpoint(12345), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:send_low_watermark basic_socket_streambuf::send_low_watermark]
+
+[section:broadcast basic_socket_acceptor::broadcast]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 send_low_watermark..basic_socket_streambuf]
-Socket option for the send low watermark.
+[indexterm2 broadcast..basic_socket_acceptor]
+Socket option to permit sending of broadcast messages.
 
 
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined broadcast;
 
 
 
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_low_watermark option(1024);
+ boost::asio::socket_base::broadcast option(true);
    socket.set_option(option);
 
 
@@ -25062,11 +27084,11 @@
 
 Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_low_watermark option;
+ boost::asio::socket_base::broadcast option;
    socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
 
 
 
@@ -25076,7 +27098,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -25085,39 +27107,41 @@
 
 
 
-[section:service basic_socket_streambuf::service]
+[section:bytes_readable basic_socket_acceptor::bytes_readable]
 
 
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
 
-[indexterm2 service..basic_socket_streambuf]
-The service associated with the I/O object.
+[indexterm2 bytes_readable..basic_socket_acceptor]
+IO control command to get the amount of data that can be read without blocking.
 
 
- service_type & service;
+ typedef implementation_defined bytes_readable;
 
 
 
-[endsect]
+Implements the FIONREAD IO control command.
 
 
+[heading Example]
+
 
-[section:service_type basic_socket_streambuf::service_type]
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
-['Inherited from basic_io_object.]
 
-[indexterm2 service_type..basic_socket_streambuf]
-The type of the service that will be used to provide I/O operations.
 
 
- typedef StreamSocketService service_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -25125,48 +27149,30 @@
 [endsect]
 
 
-[section:set_option basic_socket_streambuf::set_option]
+[section:cancel basic_socket_acceptor::cancel]
 
-[indexterm2 set_option..basic_socket_streambuf]
-Set an option on the socket.
+[indexterm2 cancel..basic_socket_acceptor]
+Cancel all asynchronous operations associated with the acceptor.
 
 
- void ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.set_option.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.cancel.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload2 set_option]``(
- const SettableSocketOption & option,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.set_option.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::set_option (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Set an option on the socket.
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.cancel.overload2 more...]]``
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+[section:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
 
 
-This function is used to set an option on the socket.
+Cancel all asynchronous operations associated with the acceptor.
 
 
-[heading Parameters]
-
+ void cancel();
 
-[variablelist
-
-[[option][The new option value to be set on the socket.]]
 
-]
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
 [heading Exceptions]
@@ -25174,48 +27180,28 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
 
 
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
-
-
-
-
-
-
 
 [endsect]
 
 
 
-[section:overload2 basic_socket_streambuf::set_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
 
 
-Set an option on the socket.
+Cancel all asynchronous operations associated with the acceptor.
 
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
+ boost::system::error_code cancel(
       boost::system::error_code & ec);
 
 
-This function is used to set an option on the socket.
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -25223,93 +27209,44 @@
 
 [variablelist
   
-[[option][The new option value to be set on the socket.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occurred, if any. ]]
 
 ]
 
 
 
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- boost::system::error_code ec;
- socket.set_option(option, ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
-
-
-
-
-
-[endsect]
-
 
 [endsect]
 
 
-[section:setbuf basic_socket_streambuf::setbuf]
-
-[indexterm2 setbuf..basic_socket_streambuf]
-
- std::streambuf * setbuf(
- char_type * s,
- std::streamsize n);
-
-
-
 [endsect]
 
+[section:close basic_socket_acceptor::close]
 
-[section:shutdown basic_socket_streambuf::shutdown]
-
-[indexterm2 shutdown..basic_socket_streambuf]
-Disable sends or receives on the socket.
+[indexterm2 close..basic_socket_acceptor]
+Close the acceptor.
 
 
- void ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 shutdown]``(
- shutdown_type what);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 shutdown]``(
- shutdown_type what,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 more...]]``
-
-
-[section:overload1 basic_socket_streambuf::shutdown (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.close.overload2 more...]]``
 
-Disable sends or receives on the socket.
 
+[section:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
 
- void shutdown(
- shutdown_type what);
 
+Close the acceptor.
 
-This function is used to disable send operations, receive operations, or both.
 
+ void close();
 
-[heading Parameters]
-
 
-[variablelist
-
-[[what][Determines what types of operation will no longer be allowed.]]
+This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
 
-]
+A subsequent call to `open()` is required before the acceptor can again be used to again perform socket accept operations.
 
 
 [heading Exceptions]
@@ -25317,44 +27254,30 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
 
-[heading Example]
-
-Shutting down the send side of the socket:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
-
-
-
-
-
 
 
 [endsect]
 
 
 
-[section:overload2 basic_socket_streambuf::shutdown (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::close (2 of 2 overloads)]
 
 
-Disable sends or receives on the socket.
+Close the acceptor.
 
 
- boost::system::error_code shutdown(
- shutdown_type what,
+ boost::system::error_code close(
       boost::system::error_code & ec);
 
 
-This function is used to disable send operations, receive operations, or both.
+This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
+
+A subsequent call to `open()` is required before the acceptor can again be used to again perform socket accept operations.
 
 
 [heading Parameters]
@@ -25362,8 +27285,6 @@
 
 [variablelist
   
-[[what][Determines what types of operation will no longer be allowed.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
@@ -25371,12 +27292,12 @@
 
 [heading Example]
   
-Shutting down the send side of the socket:
 
- boost::asio::ip::tcp::socket socket(io_service);
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
    boost::system::error_code ec;
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
+ acceptor.close(ec);
    if (ec)
    {
      // An error occurred.
@@ -25394,552 +27315,304 @@
 [endsect]
 
 
-[section:shutdown_type basic_socket_streambuf::shutdown_type]
+[section:debug basic_socket_acceptor::debug]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 shutdown_type..basic_socket_streambuf]
-Different ways a socket may be shutdown.
+[indexterm2 debug..basic_socket_acceptor]
+Socket option to enable socket-level debugging.
 
 
- enum shutdown_type
+ typedef implementation_defined debug;
 
-[indexterm2 shutdown_receive..basic_socket_streambuf]
-[indexterm2 shutdown_send..basic_socket_streambuf]
-[indexterm2 shutdown_both..basic_socket_streambuf]
 
-[heading Values]
-[variablelist
 
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
 
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
+[heading Examples]
+
+Setting the option:
 
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
 
 
 
-[endsect]
 
 
+Getting the current option value:
 
-[section:sync basic_socket_streambuf::sync]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
-[indexterm2 sync..basic_socket_streambuf]
 
- int sync();
 
 
 
-[endsect]
 
 
+[heading Requirements]
 
-[section:underflow basic_socket_streambuf::underflow]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[indexterm2 underflow..basic_socket_streambuf]
+[*Convenience header: ][^boost/asio.hpp]
 
- int_type underflow();
 
+[endsect]
 
 
-[endsect]
 
+[section:do_not_route basic_socket_acceptor::do_not_route]
 
 
-[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
+['Inherited from socket_base.]
 
-[indexterm2 ~basic_socket_streambuf..basic_socket_streambuf]
-Destructor flushes buffered data.
+[indexterm2 do_not_route..basic_socket_acceptor]
+Socket option to prevent routing, use local interfaces only.
 
 
- virtual ~basic_socket_streambuf();
+ typedef implementation_defined do_not_route;
 
 
 
-[endsect]
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[endsect]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
 
-[section:basic_stream_socket basic_stream_socket]
 
 
-Provides stream-oriented socket functionality.
 
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
- class basic_stream_socket :
- public basic_socket< Protocol, StreamSocketService >
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+[heading Requirements]
 
- [
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
- [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
+[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
 
- [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+['Inherited from socket_base.]
 
- [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[indexterm2 enable_connection_aborted..basic_socket_acceptor]
+Socket option to report aborted connections on accept.
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+ typedef implementation_defined enable_connection_aborted;
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
 
- [
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
- [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
+
+[heading Examples]
   
- ]
+Setting the option:
 
- [
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
 
- [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+Getting the current option value:
 
- [
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
- [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+[heading Requirements]
 
- [
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
- [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
 
-]
+[section:endpoint_type basic_socket_acceptor::endpoint_type]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 endpoint_type..basic_socket_acceptor]
+The endpoint type.
 
- [
- [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
- [Construct a basic_stream_socket without opening it.
 
- Construct and open a basic_stream_socket.
+ typedef Protocol::endpoint endpoint_type;
 
- Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
 
- Construct a basic_stream_socket on an existing native socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
- [Close the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
- [Read some data from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the socket.
+[heading Requirements]
 
- Receive some data on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.send [*send]]]
- [Send some data on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
- ]
-
-]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
 
- [
- [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
 
- [
- [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
 
-]
+[section:get_io_service basic_socket_acceptor::get_io_service]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+['Inherited from basic_io_object.]
 
- [
- [[link boost_asio.reference.basic_stream_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[indexterm2 get_io_service..basic_socket_acceptor]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
-]
 
-The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
+ boost::asio::io_service & get_io_service();
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
-[*Shared] [*objects:] Unsafe.
 
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
-[section:assign basic_stream_socket::assign]
+[section:get_option basic_socket_acceptor::get_option]
 
-[indexterm2 assign..basic_stream_socket]
-Assign an existing native socket to the socket.
+[indexterm2 get_option..basic_socket_acceptor]
+Get an option from the acceptor.
 
 
- void ``[link boost_asio.reference.basic_stream_socket.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.assign.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
+ GettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.get_option.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket,
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.assign.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.get_option.overload2 more...]]``
 
 
-[section:overload1 basic_stream_socket::assign (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
+Get an option from the acceptor.
 
 
-Assign an existing native socket to the socket.
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option);
 
 
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
+This function is used to get the current value of an option on the acceptor.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[option][The option value to be obtained from the acceptor.]]
 
+]
 
 
-[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-['Inherited from basic_socket.]
+]
 
 
-Assign an existing native socket to the socket.
+
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.get();
 
 
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
 
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:async_connect basic_stream_socket::async_connect]
 
+[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
 
-['Inherited from basic_socket.]
 
-[indexterm2 async_connect..basic_stream_socket]
-Start an asynchronous connect.
+Get an option from the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
-
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec);
 
-This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+This function is used to get the current value of an option on the acceptor.
 
 
 [heading Parameters]
@@ -25947,143 +27620,114 @@
 
 [variablelist
   
-[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
+[[option][The option value to be obtained from the acceptor.]]
 
-[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+
 [heading Example]
   
+Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
 
-
- void connect_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Connect succeeded.
- }
- }
-
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
+ boost::asio::ip::tcp::acceptor::reuse_address option;
+ boost::system::error_code ec;
+ acceptor.get_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ bool is_set = option.get();
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.async_connect(endpoint, connect_handler);
 
 
 
 
 
 
+[endsect]
+
 
 [endsect]
 
 
+[section:implementation basic_socket_acceptor::implementation]
 
-[section:async_read_some basic_stream_socket::async_read_some]
 
-[indexterm2 async_read_some..basic_stream_socket]
-Start an asynchronous read.
+['Inherited from basic_io_object.]
 
+[indexterm2 implementation..basic_socket_acceptor]
+The underlying implementation of the I/O object.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
 
+ implementation_type implementation;
 
-This function is used to asynchronously read data from the stream socket. The function call always returns immediately.
 
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes read.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
-]
+[section:implementation_type basic_socket_acceptor::implementation_type]
 
 
-[heading Remarks]
-
-The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
+['Inherited from basic_io_object.]
 
+[indexterm2 implementation_type..basic_socket_acceptor]
+The underlying implementation type of I/O object.
 
-[heading Example]
-
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.async_read_some(boost::asio::buffer(data, size), handler);
+ typedef service_type::implementation_type implementation_type;
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:async_receive basic_stream_socket::async_receive]
+[section:io_control basic_socket_acceptor::io_control]
 
-[indexterm2 async_receive..basic_stream_socket]
-Start an asynchronous receive.
+[indexterm2 io_control..basic_socket_acceptor]
+Perform an IO control command on the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void ``[link boost_asio.reference.basic_stream_socket.async_receive.overload1 async_receive]``(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_receive.overload1 more...]]``
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.io_control.overload1 more...]]``
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void ``[link boost_asio.reference.basic_stream_socket.async_receive.overload2 async_receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- ReadHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_receive.overload2 more...]]``
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.io_control.overload2 more...]]``
 
 
-[section:overload1 basic_stream_socket::async_receive (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::io_control (1 of 2 overloads)]
 
 
-Start an asynchronous receive.
+Perform an IO control command on the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
 
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+This function is used to execute an IO control command on the acceptor.
 
 
 [heading Parameters]
@@ -26091,33 +27735,33 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes received.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[[command][The IO control command to be performed on the acceptor.]]
 
 ]
 
 
-[heading Remarks]
-
-The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is received before the asynchronous operation completes.
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
 
 
 [heading Example]
   
-To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+Getting the number of bytes ready to read:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::non_blocking_io command(true);
+ socket.io_control(command);
 
- socket.async_receive(boost::asio::buffer(data, size), handler);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -26126,22 +27770,20 @@
 
 
 
-[section:overload2 basic_stream_socket::async_receive (2 of 2 overloads)]
+[section:overload2 basic_socket_acceptor::io_control (2 of 2 overloads)]
 
 
-Start an asynchronous receive.
+Perform an IO control command on the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- ReadHandler handler);
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
 
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+This function is used to execute an IO control command on the acceptor.
 
 
 [heading Parameters]
@@ -26149,35 +27791,30 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[flags][Flags specifying how the receive call is to be made.]]
+[[command][The IO control command to be performed on the acceptor.]]
 
-[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes received.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Remarks]
-
-The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is received before the asynchronous operation completes.
-
 
 [heading Example]
   
-To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+Getting the number of bytes ready to read:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::non_blocking_io command(true);
+ boost::system::error_code ec;
+ socket.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
- socket.async_receive(boost::asio::buffer(data, size), 0, handler);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -26187,237 +27824,166 @@
 
 [endsect]
 
-[section:async_send basic_stream_socket::async_send]
-
-[indexterm2 async_send..basic_stream_socket]
-Start an asynchronous send.
 
+[section:is_open basic_socket_acceptor::is_open]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void ``[link boost_asio.reference.basic_stream_socket.async_send.overload1 async_send]``(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_send.overload1 more...]]``
+[indexterm2 is_open..basic_socket_acceptor]
+Determine whether the acceptor is open.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void ``[link boost_asio.reference.basic_stream_socket.async_send.overload2 async_send]``(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- WriteHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_send.overload2 more...]]``
 
+ bool is_open() const;
 
-[section:overload1 basic_stream_socket::async_send (1 of 2 overloads)]
 
 
-Start an asynchronous send.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
 
+[section:keep_alive basic_socket_acceptor::keep_alive]
 
-This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
 
+['Inherited from socket_base.]
 
-[heading Parameters]
-
+[indexterm2 keep_alive..basic_socket_acceptor]
+Socket option to send keep-alives.
 
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[handler][The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes sent.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+ typedef implementation_defined keep_alive;
 
-]
 
 
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
 
-[heading Example]
+[heading Examples]
   
-To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
-
- socket.async_send(boost::asio::buffer(data, size), handler);
-
-
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-
-
-
-
-[endsect]
-
-
+Setting the option:
 
-[section:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
 
 
-Start an asynchronous send.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- WriteHandler handler);
 
+Getting the current option value:
 
-This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[flags][Flags specifying how the send call is to be made.]]
 
-[[handler][The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes sent.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
-]
 
+[heading Requirements]
 
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Example]
-
-To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.async_send(boost::asio::buffer(data, size), 0, handler);
+[endsect]
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
+[section:linger basic_socket_acceptor::linger]
 
 
+['Inherited from socket_base.]
 
-[endsect]
+[indexterm2 linger..basic_socket_acceptor]
+Socket option to specify whether the socket lingers on close if unsent data is present.
 
 
-[endsect]
+ typedef implementation_defined linger;
 
 
-[section:async_write_some basic_stream_socket::async_write_some]
 
-[indexterm2 async_write_some..basic_stream_socket]
-Start an asynchronous write.
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
 
-This function is used to asynchronously write data to the stream socket. The function call always returns immediately.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes written.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+Getting the current option value:
 
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option;
+ socket.get_option(option);
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
 
 
-[heading Remarks]
-
-The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
-[heading Example]
-
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.async_write_some(boost::asio::buffer(data, size), handler);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:at_mark basic_stream_socket::at_mark]
+[section:listen basic_socket_acceptor::listen]
 
-[indexterm2 at_mark..basic_stream_socket]
-Determine whether the socket is at the out-of-band data mark.
+[indexterm2 listen..basic_socket_acceptor]
+Place the acceptor into the state where it will listen for new connections.
 
 
- bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload1 at_mark]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.at_mark.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket_acceptor.listen.overload1 listen]``(
+ int backlog = socket_base::max_connections);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.listen.overload1 more...]]``
 
- bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.at_mark.overload2 more...]]``
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.listen.overload2 listen]``(
+ int backlog,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.listen.overload2 more...]]``
 
 
-[section:overload1 basic_stream_socket::at_mark (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::listen (1 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
+Place the acceptor into the state where it will listen for new connections.
 
 
-Determine whether the socket is at the out-of-band data mark.
+ void listen(
+ int backlog = socket_base::max_connections);
 
 
- bool at_mark() const;
+This function puts the socket acceptor into the state where it may accept new connections.
 
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+[heading Parameters]
+
 
+[variablelist
+
+[[backlog][The maximum length of the queue of pending connections.]]
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+]
 
 
 [heading Exceptions]
@@ -26436,20 +28002,18 @@
 
 
 
-[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
 
 
-Determine whether the socket is at the out-of-band data mark.
+Place the acceptor into the state where it will listen for new connections.
 
 
- bool at_mark(
- boost::system::error_code & ec) const;
+ boost::system::error_code listen(
+ int backlog,
+ boost::system::error_code & ec);
 
 
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+This function puts the socket acceptor into the state where it may accept new connections.
 
 
 [heading Parameters]
@@ -26457,55 +28021,66 @@
 
 [variablelist
   
+[[backlog][The maximum length of the queue of pending connections.]]
+
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::system::error_code ec;
+ acceptor.listen(boost::asio::socket_base::max_connections, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
 
 
 
 
-[endsect]
 
 
 [endsect]
 
-[section:available basic_stream_socket::available]
 
-[indexterm2 available..basic_stream_socket]
-Determine the number of bytes available for reading.
+[endsect]
 
+[section:local_endpoint basic_socket_acceptor::local_endpoint]
 
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload1 available]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.available.overload1 more...]]``
+[indexterm2 local_endpoint..basic_socket_acceptor]
+Get the local endpoint of the acceptor.
 
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload2 available]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.available.overload2 more...]]``
 
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 more...]]``
 
-[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 more...]]``
 
 
-['Inherited from basic_socket.]
+[section:overload1 basic_socket_acceptor::local_endpoint (1 of 2 overloads)]
 
 
-Determine the number of bytes available for reading.
+Get the local endpoint of the acceptor.
 
 
- std::size_t available() const;
+ endpoint_type local_endpoint() const;
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to obtain the locally bound endpoint of the acceptor.
 
 
 [heading Return Value]
       
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+An object that represents the local endpoint of the acceptor.
 
 
 [heading Exceptions]
@@ -26513,31 +28088,40 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
+[heading Example]
+
 
 
-[endsect]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
 
 
 
-[section:overload2 basic_stream_socket::available (2 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
 
 
-Determine the number of bytes available for reading.
+[endsect]
 
 
- std::size_t available(
+
+[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
+
+
+Get the local endpoint of the acceptor.
+
+
+ endpoint_type local_endpoint(
       boost::system::error_code & ec) const;
 
 
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to obtain the locally bound endpoint of the acceptor.
 
 
 [heading Parameters]
@@ -26552,161 +28136,136 @@
 
 [heading Return Value]
       
-The number of bytes that may be read without blocking, or 0 if an error occurs.
-
+An object that represents the local endpoint of the acceptor. Returns a default-constructed endpoint object if an error occurred and the error handler did not throw an exception.
 
 
+[heading Example]
+
 
-[endsect]
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-[endsect]
 
-[section:basic_stream_socket basic_stream_socket::basic_stream_socket]
 
-[indexterm2 basic_stream_socket..basic_stream_socket]
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] without opening it.
 
 
- explicit ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 basic_stream_socket]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 more...]]``
 
 
-Construct and open a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`].
+[endsect]
 
 
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 more...]]``
+[endsect]
 
 
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`], opening it and binding it to the given local endpoint.
+[section:max_connections basic_socket_acceptor::max_connections]
 
 
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 more...]]``
+['Inherited from socket_base.]
 
+[indexterm2 max_connections..basic_socket_acceptor]
+The maximum length of the queue of pending incoming connections.
 
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] on an existing native socket.
 
+ static const int max_connections = implementation_defined;
 
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload4 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload4 more...]]``
 
 
-[section:overload1 basic_stream_socket::basic_stream_socket (1 of 4 overloads)]
+[endsect]
 
 
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] without opening it.
 
+[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
 
- basic_stream_socket(
- boost::asio::io_service & io_service);
 
+['Inherited from socket_base.]
 
-This constructor creates a stream socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it.
+[indexterm2 message_do_not_route..basic_socket_acceptor]
+Specify that the data should not be subject to routing.
 
 
-[heading Parameters]
-
+ static const int message_do_not_route = implementation_defined;
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
 
-]
 
+[endsect]
 
 
 
-[endsect]
+[section:message_end_of_record basic_socket_acceptor::message_end_of_record]
 
 
+['Inherited from socket_base.]
 
-[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
+[indexterm2 message_end_of_record..basic_socket_acceptor]
+Specifies that the data marks the end of a record.
 
 
-Construct and open a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`].
+ static const int message_end_of_record = implementation_defined;
 
 
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
 
+[endsect]
 
-This constructor creates and opens a stream socket. The socket needs to be connected or accepted before data can be sent or received on it.
 
 
-[heading Parameters]
-
+[section:message_flags basic_socket_acceptor::message_flags]
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[[protocol][An object specifying protocol parameters to be used.]]
+['Inherited from socket_base.]
 
-]
+[indexterm2 message_flags..basic_socket_acceptor]
+Bitmask type for flags that can be passed to send and receive operations.
 
 
-[heading Exceptions]
-
+ typedef int message_flags;
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload3 basic_stream_socket::basic_stream_socket (3 of 4 overloads)]
+[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
 
 
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`], opening it and binding it to the given local endpoint.
+['Inherited from socket_base.]
 
+[indexterm2 message_out_of_band..basic_socket_acceptor]
+Process out-of-band data.
 
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
 
+ static const int message_out_of_band = implementation_defined;
 
-This constructor creates a stream socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
 
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[[endpoint][An endpoint on the local machine to which the stream socket will be bound.]]
 
-]
+[section:message_peek basic_socket_acceptor::message_peek]
 
 
-[heading Exceptions]
-
+['Inherited from socket_base.]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 message_peek..basic_socket_acceptor]
+Peek at incoming data without removing it from the input queue.
 
-]
 
+ static const int message_peek = implementation_defined;
 
 
 
@@ -26714,115 +28273,101 @@
 
 
 
-[section:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
+[section:native basic_socket_acceptor::native]
 
+[indexterm2 native..basic_socket_acceptor]
+(Deprecated: Use `native_handle()`.) Get the native acceptor representation.
 
-Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] on an existing native socket.
 
+ native_type native();
 
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
 
+This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided.
 
-This constructor creates a stream socket object to hold an existing native socket.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[[protocol][An object specifying protocol parameters to be used.]]
+[section:native_handle basic_socket_acceptor::native_handle]
 
-[[native_socket][The new underlying socket implementation.]]
+[indexterm2 native_handle..basic_socket_acceptor]
+Get the native acceptor representation.
 
-]
 
+ native_handle_type native_handle();
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+This function may be used to obtain the underlying representation of the acceptor. This is intended to allow access to native acceptor functionality that is not otherwise provided.
 
-]
 
+[endsect]
 
 
 
-[endsect]
+[section:native_handle_type basic_socket_acceptor::native_handle_type]
 
+[indexterm2 native_handle_type..basic_socket_acceptor]
+The native representation of an acceptor.
 
-[endsect]
 
-[section:bind basic_stream_socket::bind]
+ typedef SocketAcceptorService::native_handle_type native_handle_type;
 
-[indexterm2 bind..basic_stream_socket]
-Bind the socket to the given local endpoint.
 
 
- void ``[link boost_asio.reference.basic_stream_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.bind.overload1 more...]]``
+[heading Requirements]
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.bind.overload2 more...]]``
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:overload1 basic_stream_socket::bind (1 of 2 overloads)]
 
+[endsect]
 
-['Inherited from basic_socket.]
 
+[section:native_non_blocking basic_socket_acceptor::native_non_blocking]
 
-Bind the socket to the given local endpoint.
+[indexterm2 native_non_blocking..basic_socket_acceptor]
+Gets the non-blocking mode of the native acceptor implementation.
 
 
- void bind(
- const endpoint_type & endpoint);
+ bool ``[link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload1 more...]]``
 
 
-This function binds the socket to the specified endpoint on the local machine.
+Sets the non-blocking mode of the native acceptor implementation.
 
 
-[heading Parameters]
-
+ void ``[link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload2 more...]]``
 
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.native_non_blocking.overload3 more...]]``
 
-]
 
+[section:overload1 basic_socket_acceptor::native_non_blocking (1 of 3 overloads)]
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+Gets the non-blocking mode of the native acceptor implementation.
 
-]
 
+ bool native_non_blocking() const;
 
-[heading Example]
-
 
+This function is used to retrieve the non-blocking mode of the underlying native acceptor. This mode has no effect on the behaviour of the acceptor object's synchronous operations.
 
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345));
 
+[heading Return Value]
+
+`true` if the underlying acceptor is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
 
+[heading Remarks]
+
+The current non-blocking mode is cached by the acceptor object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native acceptor.
 
 
 
@@ -26831,21 +28376,17 @@
 
 
 
-[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::native_non_blocking (2 of 3 overloads)]
 
 
-Bind the socket to the given local endpoint.
+Sets the non-blocking mode of the native acceptor implementation.
 
 
- boost::system::error_code bind(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ void native_non_blocking(
+ bool mode);
 
 
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to modify the non-blocking mode of the underlying native acceptor. It has no effect on the behaviour of the acceptor object's synchronous operations.
 
 
 [heading Parameters]
@@ -26853,29 +28394,19 @@
 
 [variablelist
   
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[mode][If `true`, the underlying acceptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
 ]
 
 
-[heading Example]
-
-
-
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
- boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
- if (ec)
- {
- // An error occurred.
- }
-
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
 
+]
 
 
 
@@ -26883,55 +28414,54 @@
 [endsect]
 
 
-[endsect]
 
+[section:overload3 basic_socket_acceptor::native_non_blocking (3 of 3 overloads)]
 
-[section:broadcast basic_stream_socket::broadcast]
 
+Sets the non-blocking mode of the native acceptor implementation.
 
-['Inherited from socket_base.]
 
-[indexterm2 broadcast..basic_stream_socket]
-Socket option to permit sending of broadcast messages.
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
 
- typedef implementation_defined broadcast;
+This function is used to modify the non-blocking mode of the underlying native acceptor. It has no effect on the behaviour of the acceptor object's synchronous operations.
 
 
+[heading Parameters]
+
 
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[variablelist
+
+[[mode][If `true`, the underlying acceptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
 
-[heading Examples]
-
-Setting the option:
+]
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
 
 
 
+[endsect]
 
 
-Getting the current option value:
+[endsect]
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
 
+[section:native_type basic_socket_acceptor::native_type]
 
+[indexterm2 native_type..basic_socket_acceptor]
+(Deprecated: Use native\_handle\_type.) The native representation of an acceptor.
 
 
+ typedef SocketAcceptorService::native_handle_type native_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -26939,76 +28469,74 @@
 [endsect]
 
 
+[section:non_blocking basic_socket_acceptor::non_blocking]
 
-[section:bytes_readable basic_stream_socket::bytes_readable]
-
+[indexterm2 non_blocking..basic_socket_acceptor]
+Gets the non-blocking mode of the acceptor.
 
-['Inherited from socket_base.]
 
-[indexterm2 bytes_readable..basic_stream_socket]
-IO control command to get the amount of data that can be read without blocking.
+ bool ``[link boost_asio.reference.basic_socket_acceptor.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.non_blocking.overload1 more...]]``
 
 
- typedef implementation_defined bytes_readable;
+Sets the non-blocking mode of the acceptor.
 
 
+ void ``[link boost_asio.reference.basic_socket_acceptor.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.non_blocking.overload2 more...]]``
 
-Implements the FIONREAD IO control command.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.non_blocking.overload3 more...]]``
 
 
-[heading Example]
-
+[section:overload1 basic_socket_acceptor::non_blocking (1 of 3 overloads)]
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+Gets the non-blocking mode of the acceptor.
 
 
+ bool non_blocking() const;
 
 
 
+[heading Return Value]
+
+`true` if the acceptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
 
-[heading Requirements]
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:cancel basic_stream_socket::cancel]
-
-[indexterm2 cancel..basic_stream_socket]
-Cancel all asynchronous operations associated with the socket.
-
-
- void ``[link boost_asio.reference.basic_stream_socket.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.cancel.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.cancel.overload2 more...]]``
 
+[section:overload2 basic_socket_acceptor::non_blocking (2 of 3 overloads)]
 
-[section:overload1 basic_stream_socket::cancel (1 of 2 overloads)]
 
+Sets the non-blocking mode of the acceptor.
 
-['Inherited from basic_socket.]
 
+ void non_blocking(
+ bool mode);
 
-Cancel all asynchronous operations associated with the socket.
 
 
- void cancel();
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the acceptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+]
 
 
 [heading Exceptions]
@@ -27023,50 +28551,34 @@
 
 [heading Remarks]
       
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
-
-
-* It will only cancel asynchronous operations that were initiated in the current thread.
-
-
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
-
-For portable cancellation, consider using one of the following alternatives:
-
-
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
-
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
 
 
-[section:overload2 basic_stream_socket::cancel (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload3 basic_socket_acceptor::non_blocking (3 of 3 overloads)]
 
 
-Cancel all asynchronous operations associated with the socket.
+Sets the non-blocking mode of the acceptor.
 
 
- boost::system::error_code cancel(
+ boost::system::error_code non_blocking(
+ bool mode,
       boost::system::error_code & ec);
 
 
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
-
 
 [heading Parameters]
     
 
 [variablelist
   
+[[mode][If `true`, the acceptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
@@ -27074,167 +28586,85 @@
 
 [heading Remarks]
       
-Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
-
-
-* It will only cancel asynchronous operations that were initiated in the current thread.
-
-
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
-
-For portable cancellation, consider using one of the following alternatives:
-
-
-* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
-
-
-* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
-
-When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
-[endsect]
 
 
 [endsect]
 
-[section:close basic_stream_socket::close]
-
-[indexterm2 close..basic_stream_socket]
-Close the socket.
-
-
- void ``[link boost_asio.reference.basic_stream_socket.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.close.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.close.overload2 more...]]``
-
-
-[section:overload1 basic_stream_socket::close (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Close the socket.
-
-
- void close();
-
-
-This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
-
-
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
-
-
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
-
-
-
 
 [endsect]
 
 
-
-[section:overload2 basic_stream_socket::close (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Close the socket.
+[section:non_blocking_io basic_socket_acceptor::non_blocking_io]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+['Inherited from socket_base.]
 
+[indexterm2 non_blocking_io..basic_socket_acceptor]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
-This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
+ typedef implementation_defined non_blocking_io;
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+Implements the FIONBIO IO control command.
 
 
 [heading Example]
   
 
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::system::error_code ec;
- socket.close(ec);
- if (ec)
- {
- // An error occurred.
- }
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
 
 
 
 
 
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-[section:connect basic_stream_socket::connect]
-
-[indexterm2 connect..basic_stream_socket]
-Connect the socket to the specified endpoint.
-
 
- void ``[link boost_asio.reference.basic_stream_socket.connect.overload1 connect]``(
- const endpoint_type & peer_endpoint);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.connect.overload1 more...]]``
+[section:open basic_socket_acceptor::open]
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.connect.overload2 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.connect.overload2 more...]]``
+[indexterm2 open..basic_socket_acceptor]
+Open the acceptor using the specified protocol.
 
 
-[section:overload1 basic_stream_socket::connect (1 of 2 overloads)]
+ void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.open.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.open.overload2 more...]]``
 
-['Inherited from basic_socket.]
 
+[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
 
-Connect the socket to the specified endpoint.
 
+Open the acceptor using the specified protocol.
 
- void connect(
- const endpoint_type & peer_endpoint);
 
+ void open(
+ const protocol_type & protocol = protocol_type());
 
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
 
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+This function opens the socket acceptor so that it will use the specified protocol.
 
 
 [heading Parameters]
@@ -27242,7 +28672,7 @@
 
 [variablelist
   
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[[protocol][An object specifying which protocol is to be used.]]
 
 ]
 
@@ -27261,10 +28691,8 @@
   
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.connect(endpoint);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
 
 
 
@@ -27276,23 +28704,18 @@
 
 
 
-[section:overload2 basic_stream_socket::connect (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
 
 
-Connect the socket to the specified endpoint.
+Open the acceptor using the specified protocol.
 
 
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
+ boost::system::error_code open(
+ const protocol_type & protocol,
       boost::system::error_code & ec);
 
 
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
-
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
+This function opens the socket acceptor so that it will use the specified protocol.
 
 
 [heading Parameters]
@@ -27300,7 +28723,7 @@
 
 [variablelist
   
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[[protocol][An object specifying which protocol is to be used.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -27311,11 +28734,9 @@
   
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    boost::system::error_code ec;
- socket.connect(endpoint, ec);
+ acceptor.open(boost::asio::ip::tcp::v4(), ec);
    if (ec)
    {
      // An error occurred.
@@ -27333,20 +28754,41 @@
 [endsect]
 
 
-[section:debug basic_stream_socket::debug]
+[section:protocol_type basic_socket_acceptor::protocol_type]
+
+[indexterm2 protocol_type..basic_socket_acceptor]
+The protocol type.
+
+
+ typedef Protocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 debug..basic_stream_socket]
-Socket option to enable socket-level debugging.
+[indexterm2 receive_buffer_size..basic_socket_acceptor]
+Socket option for the receive buffer size of a socket.
 
 
- typedef implementation_defined debug;
+ typedef implementation_defined receive_buffer_size;
 
 
 
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
 
 [heading Examples]
@@ -27355,7 +28797,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::debug option(true);
+ boost::asio::socket_base::receive_buffer_size option(8192);
    socket.set_option(option);
 
 
@@ -27366,9 +28808,9 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::debug option;
+ boost::asio::socket_base::receive_buffer_size option;
    socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
 
 
 
@@ -27378,7 +28820,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -27387,29 +28829,29 @@
 
 
 
-[section:do_not_route basic_stream_socket::do_not_route]
+[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 do_not_route..basic_stream_socket]
-Socket option to prevent routing, use local interfaces only.
+[indexterm2 receive_low_watermark..basic_socket_acceptor]
+Socket option for the receive low watermark.
 
 
- typedef implementation_defined do_not_route;
+ typedef implementation_defined receive_low_watermark;
 
 
 
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::do_not_route option(true);
+ boost::asio::socket_base::receive_low_watermark option(1024);
    socket.set_option(option);
 
 
@@ -27418,11 +28860,11 @@
 
 Getting the current option value:
 
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::do_not_route option;
+ boost::asio::socket_base::receive_low_watermark option;
    socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
 
 
 
@@ -27432,7 +28874,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -27441,20 +28883,20 @@
 
 
 
-[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
+[section:reuse_address basic_socket_acceptor::reuse_address]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 enable_connection_aborted..basic_stream_socket]
-Socket option to report aborted connections on accept.
+[indexterm2 reuse_address..basic_socket_acceptor]
+Socket option to allow the socket to be bound to an address that is already in use.
 
 
- typedef implementation_defined enable_connection_aborted;
+ typedef implementation_defined reuse_address;
 
 
 
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
 
 [heading Examples]
@@ -27463,7 +28905,7 @@
 
    boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::socket_base::enable_connection_aborted option(true);
+ boost::asio::socket_base::reuse_address option(true);
    acceptor.set_option(option);
 
 
@@ -27474,7 +28916,7 @@
 
    boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::socket_base::enable_connection_aborted option;
+ boost::asio::socket_base::reuse_address option;
    acceptor.get_option(option);
    bool is_set = option.value();
 
@@ -27486,7 +28928,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -27495,196 +28937,124 @@
 
 
 
-[section:endpoint_type basic_stream_socket::endpoint_type]
-
-[indexterm2 endpoint_type..basic_stream_socket]
-The endpoint type.
-
-
- typedef Protocol::endpoint endpoint_type;
-
+[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
 
 
-[heading Requirements]
+['Inherited from socket_base.]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[indexterm2 send_buffer_size..basic_socket_acceptor]
+Socket option for the send buffer size of a socket.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ typedef implementation_defined send_buffer_size;
 
-[endsect]
 
 
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
-[section:get_io_service basic_stream_socket::get_io_service]
 
+[heading Examples]
+
+Setting the option:
 
-['Inherited from basic_io_object.]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
 
-[indexterm2 get_io_service..basic_stream_socket]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
- boost::asio::io_service & get_io_service();
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
 
 
 
-[endsect]
 
 
-[section:get_option basic_stream_socket::get_option]
+[heading Requirements]
 
-[indexterm2 get_option..basic_stream_socket]
-Get an option from the socket.
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- void ``[link boost_asio.reference.basic_stream_socket.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.get_option.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.get_option.overload2 get_option]``(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.get_option.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 basic_stream_socket::get_option (1 of 2 overloads)]
 
+[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
 
-['Inherited from basic_socket.]
 
+['Inherited from socket_base.]
 
-Get an option from the socket.
+[indexterm2 send_low_watermark..basic_socket_acceptor]
+Socket option for the send low watermark.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option) const;
+ typedef implementation_defined send_low_watermark;
 
 
-This function is used to get the current value of an option on the socket.
 
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
-[heading Parameters]
-
 
-[variablelist
+[heading Examples]
   
-[[option][The option value to be obtained from the socket.]]
-
-]
-
+Setting the option:
 
-[heading Exceptions]
-
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
 
 
-[heading Example]
-
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::socket::keep_alive option;
+ boost::asio::socket_base::send_low_watermark option;
    socket.get_option(option);
- bool is_set = option.get();
-
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-
-Get an option from the socket.
-
-
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
-
-
-This function is used to get the current value of an option on the socket.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[option][The option value to be obtained from the socket.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
+ int size = option.value();
 
 
 
-[heading Example]
-
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::keep_alive option;
- boost::system::error_code ec;
- socket.get_option(option, ec);
- if (ec)
- {
- // An error occurred.
- }
- bool is_set = option.get();
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:implementation basic_stream_socket::implementation]
+[section:service basic_socket_acceptor::service]
 
 
 ['Inherited from basic_io_object.]
 
-[indexterm2 implementation..basic_stream_socket]
-The underlying implementation of the I/O object.
+[indexterm2 service..basic_socket_acceptor]
+The service associated with the I/O object.
 
 
- implementation_type implementation;
+ service_type & service;
 
 
 
@@ -27692,22 +29062,22 @@
 
 
 
-[section:implementation_type basic_stream_socket::implementation_type]
+[section:service_type basic_socket_acceptor::service_type]
 
 
 ['Inherited from basic_io_object.]
 
-[indexterm2 implementation_type..basic_stream_socket]
-The underlying implementation type of I/O object.
+[indexterm2 service_type..basic_socket_acceptor]
+The type of the service that will be used to provide I/O operations.
 
 
- typedef service_type::implementation_type implementation_type;
+ typedef SocketAcceptorService service_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_acceptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -27715,38 +29085,39 @@
 [endsect]
 
 
-[section:io_control basic_stream_socket::io_control]
+[section:set_option basic_socket_acceptor::set_option]
 
-[indexterm2 io_control..basic_stream_socket]
-Perform an IO control command on the socket.
+[indexterm2 set_option..basic_socket_acceptor]
+Set an option on the acceptor.
 
 
- void ``[link boost_asio.reference.basic_stream_socket.io_control.overload1 io_control]``(
- IoControlCommand & command);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.io_control.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.set_option.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.io_control.overload2 more...]]``
-
-
-[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_acceptor.set_option.overload2 more...]]``
 
 
-['Inherited from basic_socket.]
+[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
 
 
-Perform an IO control command on the socket.
+Set an option on the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
 
 
-This function is used to execute an IO control command on the socket.
+This function is used to set an option on the acceptor.
 
 
 [heading Parameters]
@@ -27754,7 +29125,7 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[option][The new option value to be set on the acceptor.]]
 
 ]
 
@@ -27772,13 +29143,12 @@
 
 [heading Example]
   
-Getting the number of bytes ready to read:
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
+ acceptor.set_option(option);
 
 
 
@@ -27790,23 +29160,20 @@
 
 
 
-[section:overload2 basic_stream_socket::io_control (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
 
 
-Perform an IO control command on the socket.
+Set an option on the acceptor.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
       boost::system::error_code & ec);
 
 
-This function is used to execute an IO control command on the socket.
+This function is used to set an option on the acceptor.
 
 
 [heading Parameters]
@@ -27814,7 +29181,7 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the socket.]]
+[[option][The new option value to be set on the acceptor.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -27824,18 +29191,17 @@
 
 [heading Example]
   
-Getting the number of bytes ready to read:
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
    ...
- boost::asio::ip::tcp::socket::bytes_readable command;
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
    boost::system::error_code ec;
- socket.io_control(command, ec);
+ acceptor.set_option(option, ec);
    if (ec)
    {
      // An error occurred.
    }
- std::size_t bytes_readable = command.get();
 
 
 
@@ -27849,25 +29215,40 @@
 [endsect]
 
 
-[section:io_service basic_stream_socket::io_service]
+[section:shutdown_type basic_socket_acceptor::shutdown_type]
 
 
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
 
-[indexterm2 io_service..basic_stream_socket]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[indexterm2 shutdown_type..basic_socket_acceptor]
+Different ways a socket may be shutdown.
 
 
- boost::asio::io_service & io_service();
+ enum shutdown_type
+
+[indexterm2 shutdown_receive..basic_socket_acceptor]
+[indexterm2 shutdown_send..basic_socket_acceptor]
+[indexterm2 shutdown_both..basic_socket_acceptor]
 
+[heading Values]
+[variablelist
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
 
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
 
+]
 
 
 
@@ -27875,124 +29256,216 @@
 
 
 
-[section:is_open basic_stream_socket::is_open]
+[endsect]
 
+[section:basic_socket_iostream basic_socket_iostream]
 
-['Inherited from basic_socket.]
 
-[indexterm2 is_open..basic_stream_socket]
-Determine whether the socket is open.
+Iostream interface for a socket.
 
 
- bool is_open() const;
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>,
+ typename Time = boost::posix_time::ptime,
+ typename ``[link boost_asio.reference.TimeTraits TimeTraits]`` = boost::asio::time_traits<Time>,
+ typename ``[link boost_asio.reference.TimerService TimerService]`` = deadline_timer_service<Time, TimeTraits>>
+ class basic_socket_iostream
 
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket_iostream.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
 
+ [
 
-[section:keep_alive basic_stream_socket::keep_alive]
+ [[link boost_asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
+ [
 
-['Inherited from socket_base.]
+ [[link boost_asio.reference.basic_socket_iostream.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
 
-[indexterm2 keep_alive..basic_stream_socket]
-Socket option to send keep-alives.
+]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
- typedef implementation_defined keep_alive;
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection.
 
+ Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
+ [Close the connection. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
+ [Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.error [*error]]]
+ [Get the last error associated with the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_at [*expires_at]]]
+ [Get the stream's expiry time as an absolute time.
 
+ Set the stream's expiry time as an absolute time. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]]
+ [Get the timer's expiry time relative to now.
 
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+ Set the stream's expiry time relative to now. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
+ [Return a pointer to the underlying streambuf. ]
+ ]
+
+]
 
+[heading Requirements]
 
-[heading Examples]
-
-Setting the option:
+[*Header: ][^boost/asio/basic_socket_iostream.hpp]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:basic_socket_iostream basic_socket_iostream::basic_socket_iostream]
 
+[indexterm2 basic_socket_iostream..basic_socket_iostream]
+Construct a [link boost_asio.reference.basic_socket_iostream `basic_socket_iostream`] without establishing a connection.
 
 
+ ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 basic_socket_iostream]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 more...]]``
 
 
-Getting the current option value:
+Establish a connection to an endpoint corresponding to a resolver query.
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option;
- socket.get_option(option);
- bool is_set = option.value();
+
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ explicit ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 basic_socket_iostream]``(
+ T1 t1,
+ ... ,
+ TN tn);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 more...]]``
+
+
+[section:overload1 basic_socket_iostream::basic_socket_iostream (1 of 2 overloads)]
 
 
+Construct a [link boost_asio.reference.basic_socket_iostream `basic_socket_iostream`] without establishing a connection.
 
 
+ basic_socket_iostream();
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+
+[section:overload2 basic_socket_iostream::basic_socket_iostream (2 of 2 overloads)]
+
+
+Establish a connection to an endpoint corresponding to a resolver query.
+
+
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ basic_socket_iostream(
+ T1 t1,
+ ... ,
+ TN tn);
+
+
+This constructor automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
 
 
 [endsect]
 
 
+[endsect]
 
-[section:linger basic_stream_socket::linger]
 
+[section:close basic_socket_iostream::close]
 
-['Inherited from socket_base.]
+[indexterm2 close..basic_socket_iostream]
+Close the connection.
 
-[indexterm2 linger..basic_stream_socket]
-Socket option to specify whether the socket lingers on close if unsent data is present.
 
+ void close();
 
- typedef implementation_defined linger;
 
 
+[endsect]
 
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
 
-[heading Examples]
-
-Setting the option:
+[section:connect basic_socket_iostream::connect]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option(true, 30);
- socket.set_option(option);
+[indexterm2 connect..basic_socket_iostream]
+Establish a connection to an endpoint corresponding to a resolver query.
+
+
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ void connect(
+ T1 t1,
+ ... ,
+ TN tn);
 
 
+This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
 
 
+[endsect]
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option;
- socket.get_option(option);
- bool is_set = option.enabled();
- unsigned short timeout = option.timeout();
 
+[section:duration_type basic_socket_iostream::duration_type]
 
+[indexterm2 duration_type..basic_socket_iostream]
+The duration type.
 
 
+ typedef TimeTraits::duration_type duration_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_iostream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -28000,57 +29473,52 @@
 [endsect]
 
 
-[section:local_endpoint basic_stream_socket::local_endpoint]
 
-[indexterm2 local_endpoint..basic_stream_socket]
-Get the local endpoint of the socket.
+[section:endpoint_type basic_socket_iostream::endpoint_type]
 
+[indexterm2 endpoint_type..basic_socket_iostream]
+The endpoint type.
 
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 more...]]``
 
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 more...]]``
+ typedef Protocol::endpoint endpoint_type;
 
 
-[section:overload1 basic_stream_socket::local_endpoint (1 of 2 overloads)]
 
+[heading Requirements]
 
-['Inherited from basic_socket.]
+[*Header: ][^boost/asio/basic_socket_iostream.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-Get the local endpoint of the socket.
 
+[endsect]
 
- endpoint_type local_endpoint() const;
 
 
-This function is used to obtain the locally bound endpoint of the socket.
+[section:error basic_socket_iostream::error]
 
+[indexterm2 error..basic_socket_iostream]
+Get the last error associated with the stream.
 
-[heading Return Value]
-
-An object that represents the local endpoint of the socket.
 
+ const boost::system::error_code & error() const;
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+[heading Return Value]
+
+An `error_code` corresponding to the last error from the stream.
 
 
 [heading Example]
   
+To print the error associated with a failure to establish a connection:
 
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+ tcp::iostream s("www.boost.org", "http");
+ if (!s)
+ {
+ std::cout << "Error: " << s.error().message() << std::endl;
+ }
 
 
 
@@ -28061,97 +29529,106 @@
 [endsect]
 
 
+[section:expires_at basic_socket_iostream::expires_at]
 
-[section:overload2 basic_stream_socket::local_endpoint (2 of 2 overloads)]
+[indexterm2 expires_at..basic_socket_iostream]
+Get the stream's expiry time as an absolute time.
 
 
-['Inherited from basic_socket.]
+ time_type ``[link boost_asio.reference.basic_socket_iostream.expires_at.overload1 expires_at]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.expires_at.overload1 more...]]``
 
 
-Get the local endpoint of the socket.
+Set the stream's expiry time as an absolute time.
 
 
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
+ void ``[link boost_asio.reference.basic_socket_iostream.expires_at.overload2 expires_at]``(
+ const time_type & expiry_time);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.expires_at.overload2 more...]]``
 
 
-This function is used to obtain the locally bound endpoint of the socket.
+[section:overload1 basic_socket_iostream::expires_at (1 of 2 overloads)]
 
 
-[heading Parameters]
-
+Get the stream's expiry time as an absolute time.
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+ time_type expires_at() const;
+
 
 
 [heading Return Value]
       
-An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+An absolute time value representing the stream's expiry time.
 
 
-[heading Example]
-
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
+[endsect]
 
 
 
+[section:overload2 basic_socket_iostream::expires_at (2 of 2 overloads)]
 
 
+Set the stream's expiry time as an absolute time.
 
 
-[endsect]
+ void expires_at(
+ const time_type & expiry_time);
 
 
-[endsect]
+This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `boost::asio::error::operation_aborted`.
 
-[section:lowest_layer basic_stream_socket::lowest_layer]
 
-[indexterm2 lowest_layer..basic_stream_socket]
-Get a reference to the lowest layer.
+[heading Parameters]
+
 
+[variablelist
+
+[[expiry_time][The expiry time to be used for the stream. ]]
 
- lowest_layer_type & ``[link boost_asio.reference.basic_stream_socket.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.lowest_layer.overload1 more...]]``
+]
 
 
-Get a const reference to the lowest layer.
 
 
- const lowest_layer_type & ``[link boost_asio.reference.basic_stream_socket.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.lowest_layer.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 basic_stream_socket::lowest_layer (1 of 2 overloads)]
+[endsect]
 
+[section:expires_from_now basic_socket_iostream::expires_from_now]
 
-['Inherited from basic_socket.]
+[indexterm2 expires_from_now..basic_socket_iostream]
+Get the timer's expiry time relative to now.
 
 
-Get a reference to the lowest layer.
+ duration_type ``[link boost_asio.reference.basic_socket_iostream.expires_from_now.overload1 expires_from_now]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.expires_from_now.overload1 more...]]``
 
 
- lowest_layer_type & lowest_layer();
+Set the stream's expiry time relative to now.
 
 
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
+ void ``[link boost_asio.reference.basic_socket_iostream.expires_from_now.overload2 expires_from_now]``(
+ const duration_type & expiry_time);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_iostream.expires_from_now.overload2 more...]]``
+
+
+[section:overload1 basic_socket_iostream::expires_from_now (1 of 2 overloads)]
+
+
+Get the timer's expiry time relative to now.
+
+
+ duration_type expires_from_now() const;
+
 
 
 [heading Return Value]
       
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+A relative time value representing the stream's expiry time.
 
 
 
@@ -28160,24 +29637,27 @@
 
 
 
-[section:overload2 basic_stream_socket::lowest_layer (2 of 2 overloads)]
+[section:overload2 basic_socket_iostream::expires_from_now (2 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
+Set the stream's expiry time relative to now.
 
 
-Get a const reference to the lowest layer.
+ void expires_from_now(
+ const duration_type & expiry_time);
 
 
- const lowest_layer_type & lowest_layer() const;
+This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `boost::asio::error::operation_aborted`.
 
 
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
+[heading Parameters]
+
 
+[variablelist
+
+[[expiry_time][The expiry time to be used for the timer. ]]
 
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+]
 
 
 
@@ -28188,16 +29668,57 @@
 [endsect]
 
 
-[section:lowest_layer_type basic_stream_socket::lowest_layer_type]
+[section:rdbuf basic_socket_iostream::rdbuf]
+
+[indexterm2 rdbuf..basic_socket_iostream]
+Return a pointer to the underlying streambuf.
 
 
-['Inherited from basic_socket.]
+ basic_socket_streambuf< Protocol, StreamSocketService, Time, TimeTraits, TimerService > * rdbuf() const;
 
-[indexterm2 lowest_layer_type..basic_stream_socket]
-A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
 
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+[endsect]
+
+
+
+[section:time_type basic_socket_iostream::time_type]
+
+[indexterm2 time_type..basic_socket_iostream]
+The time type.
+
+
+ typedef TimeTraits::time_type time_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_iostream.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:basic_socket_streambuf basic_socket_streambuf]
+
+
+Iostream streambuf for a socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>,
+ typename Time = boost::posix_time::ptime,
+ typename ``[link boost_asio.reference.TimeTraits TimeTraits]`` = boost::asio::time_traits<Time>,
+ typename ``[link boost_asio.reference.TimerService TimerService]`` = deadline_timer_service<Time, TimeTraits>>
+ class basic_socket_streambuf :
+ public basic_socket< Protocol, StreamSocketService >
 
 
 [heading Types]
@@ -28206,151 +29727,172 @@
 
   [
 
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
     [Socket option to permit sending of broadcast messages. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [[link boost_asio.reference.basic_socket_streambuf.bytes_readable [*bytes_readable]]]
     [IO control command to get the amount of data that can be read without blocking. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket_streambuf.debug [*debug]]]
     [Socket option to enable socket-level debugging. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [[link boost_asio.reference.basic_socket_streambuf.do_not_route [*do_not_route]]]
     [Socket option to prevent routing, use local interfaces only. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [[link boost_asio.reference.basic_socket_streambuf.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_streambuf.enable_connection_aborted [*enable_connection_aborted]]]
     [Socket option to report aborted connections on accept. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.endpoint_type [*endpoint_type]]]
     [The endpoint type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.implementation_type [*implementation_type]]]
     [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [[link boost_asio.reference.basic_socket_streambuf.keep_alive [*keep_alive]]]
     [Socket option to send keep-alives. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [[link boost_asio.reference.basic_socket_streambuf.linger [*linger]]]
     [Socket option to specify whether the socket lingers on close if unsent data is present. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.lowest_layer_type [*lowest_layer_type]]]
     [A basic_socket is always the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [[link boost_asio.reference.basic_socket_streambuf.message_flags [*message_flags]]]
     [Bitmask type for flags that can be passed to send and receive operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.native_handle_type [*native_handle_type]]]
     [The native representation of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [[link boost_asio.reference.basic_socket_streambuf.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_streambuf.protocol_type [*protocol_type]]]
     [The protocol type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [[link boost_asio.reference.basic_socket_streambuf.receive_buffer_size [*receive_buffer_size]]]
     [Socket option for the receive buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [[link boost_asio.reference.basic_socket_streambuf.receive_low_watermark [*receive_low_watermark]]]
     [Socket option for the receive low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [[link boost_asio.reference.basic_socket_streambuf.reuse_address [*reuse_address]]]
     [Socket option to allow the socket to be bound to an address that is already in use. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [[link boost_asio.reference.basic_socket_streambuf.send_buffer_size [*send_buffer_size]]]
     [Socket option for the send buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [[link boost_asio.reference.basic_socket_streambuf.send_low_watermark [*send_low_watermark]]]
     [Socket option for the send low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.shutdown_type [*shutdown_type]]]
     [Different ways a socket may be shutdown. ]
   
   ]
 
+ [
+
+ [[link boost_asio.reference.basic_socket_streambuf.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
+
 ]
 
 [heading Member Functions]
@@ -28358,118 +29900,154 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [[link boost_asio.reference.basic_socket_streambuf.assign [*assign]]]
     [Assign an existing native socket to the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
+ [[link boost_asio.reference.basic_socket_streambuf.async_connect [*async_connect]]]
     [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
+ [[link boost_asio.reference.basic_socket_streambuf.at_mark [*at_mark]]]
     [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.available [*available]]]
+ [[link boost_asio.reference.basic_socket_streambuf.available [*available]]]
     [Determine the number of bytes available for reading. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it.
-
- Construct and open a basic_socket.
-
- Construct a basic_socket, opening it and binding it to the given local endpoint.
-
- Construct a basic_socket on an existing native socket. ]
+ [[link boost_asio.reference.basic_socket_streambuf.basic_socket_streambuf [*basic_socket_streambuf]]]
+ [Construct a basic_socket_streambuf without establishing a connection. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [[link boost_asio.reference.basic_socket_streambuf.bind [*bind]]]
     [Bind the socket to the given local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
+ [[link boost_asio.reference.basic_socket_streambuf.cancel [*cancel]]]
     [Cancel all asynchronous operations associated with the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.basic_socket_streambuf.close [*close]]]
+ [Close the connection.
+
+ Close the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket_streambuf.connect [*connect]]]
+ [Establish a connection.
+
+ Connect the socket to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_socket_streambuf.expires_at [*expires_at]]]
+ [Get the stream buffer's expiry time as an absolute time.
+
+ Set the stream buffer's expiry time as an absolute time. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
+ [[link boost_asio.reference.basic_socket_streambuf.expires_from_now [*expires_from_now]]]
+ [Get the stream buffer's expiry time relative to now.
+
+ Set the stream buffer's expiry time relative to now. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.basic_socket_streambuf.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_socket_streambuf.get_option [*get_option]]]
+ [Get an option from the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
+ [[link boost_asio.reference.basic_socket_streambuf.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
+ [[link boost_asio.reference.basic_socket_streambuf.local_endpoint [*local_endpoint]]]
     [Get the local endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_socket_streambuf.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
      Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.native [*native]]]
+ [[link boost_asio.reference.basic_socket_streambuf.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.native_handle [*native_handle]]]
     [Get the native socket representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.open [*open]]]
+ [[link boost_asio.reference.basic_socket_streambuf.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.open [*open]]]
     [Open the socket using the specified protocol. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [[link boost_asio.reference.basic_socket_streambuf.puberror [*puberror]]]
+ [Get the last error associated with the stream buffer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.remote_endpoint [*remote_endpoint]]]
     [Get the remote endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
+ [[link boost_asio.reference.basic_socket_streambuf.set_option [*set_option]]]
     [Set an option on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
+ [[link boost_asio.reference.basic_socket_streambuf.shutdown [*shutdown]]]
     [Disable sends or receives on the socket. ]
   ]
   
+ [
+ [[link boost_asio.reference.basic_socket_streambuf._basic_socket_streambuf [*~basic_socket_streambuf]]]
+ [Destructor flushes buffered data. ]
+ ]
+
 ]
 
 [heading Protected Member Functions]
@@ -28477,8 +30055,28 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.basic_socket_streambuf.error [*error]]]
+ [Get the last error associated with the stream buffer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.overflow [*overflow]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.setbuf [*setbuf]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.sync [*sync]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.underflow [*underflow]]]
+ []
   ]
   
 ]
@@ -28488,22 +30086,27 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [[link boost_asio.reference.basic_socket_streambuf.max_connections [*max_connections]]]
     [The maximum length of the queue of pending incoming connections. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [[link boost_asio.reference.basic_socket_streambuf.message_do_not_route [*message_do_not_route]]]
     [Specify that the data should not be subject to routing. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [[link boost_asio.reference.basic_socket_streambuf.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [[link boost_asio.reference.basic_socket_streambuf.message_peek [*message_peek]]]
     [Peek at incoming data without removing it from the input queue. ]
   ]
 
@@ -28514,50 +30117,69 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket_streambuf.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket.service [*service]]]
+ [[link boost_asio.reference.basic_socket_streambuf.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
-
+[heading Friends]
+[table
+ [[Name][Description]]
 
-[heading Thread Safety]
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.io_handler [*io_handler]]]
+ []
+ ]
   
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.timer_handler [*timer_handler]]]
+ []
+ ]
+
+]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Requirements]
+[section:assign basic_socket_streambuf::assign]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[indexterm2 assign..basic_socket_streambuf]
+Assign an existing native socket to the socket.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.assign.overload1 more...]]``
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.assign.overload2 more...]]``
 
 
+[section:overload1 basic_socket_streambuf::assign (1 of 2 overloads)]
 
-[section:max_connections basic_stream_socket::max_connections]
 
+['Inherited from basic_socket.]
 
-['Inherited from socket_base.]
 
-[indexterm2 max_connections..basic_stream_socket]
-The maximum length of the queue of pending incoming connections.
+Assign an existing native socket to the socket.
 
 
- static const int max_connections = implementation_defined;
+ void assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
 
@@ -28565,192 +30187,247 @@
 
 
 
-[section:message_do_not_route basic_stream_socket::message_do_not_route]
+[section:overload2 basic_socket_streambuf::assign (2 of 2 overloads)]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
 
-[indexterm2 message_do_not_route..basic_stream_socket]
-Specify that the data should not be subject to routing.
+
+Assign an existing native socket to the socket.
 
 
- static const int message_do_not_route = implementation_defined;
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:message_flags basic_stream_socket::message_flags]
 
+[section:async_connect basic_socket_streambuf::async_connect]
 
-['Inherited from socket_base.]
 
-[indexterm2 message_flags..basic_stream_socket]
-Bitmask type for flags that can be passed to send and receive operations.
+['Inherited from basic_socket.]
 
+[indexterm2 async_connect..basic_socket_streambuf]
+Start an asynchronous connect.
 
- typedef int message_flags;
 
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
 
 
-[heading Requirements]
+This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
 
+[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
-[section:message_out_of_band basic_stream_socket::message_out_of_band]
 
+[heading Example]
+
 
-['Inherited from socket_base.]
 
-[indexterm2 message_out_of_band..basic_stream_socket]
-Process out-of-band data.
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
 
+ ...
 
- static const int message_out_of_band = implementation_defined;
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_connect(endpoint, connect_handler);
 
 
 
-[endsect]
 
 
 
-[section:message_peek basic_stream_socket::message_peek]
 
+[endsect]
 
-['Inherited from socket_base.]
 
-[indexterm2 message_peek..basic_stream_socket]
-Peek at incoming data without removing it from the input queue.
+[section:at_mark basic_socket_streambuf::at_mark]
 
+[indexterm2 at_mark..basic_socket_streambuf]
+Determine whether the socket is at the out-of-band data mark.
 
- static const int message_peek = implementation_defined;
 
+ bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 at_mark]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 more...]]``
 
+ bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
 
 
-[section:native basic_stream_socket::native]
+['Inherited from basic_socket.]
 
 
-['Inherited from basic_socket.]
+Determine whether the socket is at the out-of-band data mark.
 
-[indexterm2 native..basic_stream_socket]
-Get the native socket representation.
 
+ bool at_mark() const;
 
- native_type native();
 
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
-This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
-[endsect]
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-[section:native_type basic_stream_socket::native_type]
+]
 
-[indexterm2 native_type..basic_stream_socket]
-The native representation of a socket.
 
 
- typedef StreamSocketService::native_type native_type;
 
+[endsect]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[section:overload2 basic_socket_streambuf::at_mark (2 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+['Inherited from basic_socket.]
 
-[endsect]
 
+Determine whether the socket is at the out-of-band data mark.
 
 
-[section:non_blocking_io basic_stream_socket::non_blocking_io]
+ bool at_mark(
+ boost::system::error_code & ec) const;
 
 
-['Inherited from socket_base.]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
-[indexterm2 non_blocking_io..basic_stream_socket]
-IO control command to set the blocking mode of the socket.
 
+[heading Parameters]
+
 
- typedef implementation_defined non_blocking_io;
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-Implements the FIONBIO IO control command.
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
 
-[heading Example]
-
 
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
+[endsect]
 
 
+[endsect]
 
+[section:available basic_socket_streambuf::available]
 
+[indexterm2 available..basic_socket_streambuf]
+Determine the number of bytes available for reading.
 
 
+ std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload1 available]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.available.overload1 more...]]``
 
-[heading Requirements]
+ std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.available.overload2 more...]]``
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
 
 
-[endsect]
+['Inherited from basic_socket.]
 
 
-[section:open basic_stream_socket::open]
+Determine the number of bytes available for reading.
 
-[indexterm2 open..basic_stream_socket]
-Open the socket using the specified protocol.
 
+ std::size_t available() const;
 
- void ``[link boost_asio.reference.basic_stream_socket.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.open.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.open.overload2 more...]]``
+This function is used to determine the number of bytes that may be read without blocking.
 
 
-[section:overload1 basic_stream_socket::open (1 of 2 overloads)]
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
 
-['Inherited from basic_socket.]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-Open the socket using the specified protocol.
+]
 
 
- void open(
- const protocol_type & protocol = protocol_type());
 
 
-This function opens the socket so that it will use the specified protocol.
+[endsect]
+
+
+
+[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Determine the number of bytes available for reading.
+
+
+ std::size_t available(
+ boost::system::error_code & ec) const;
+
+
+This function is used to determine the number of bytes that may be read without blocking.
 
 
 [heading Parameters]
@@ -28758,7 +30435,75 @@
 
 [variablelist
   
-[[protocol][An object specifying protocol parameters to be used.]]
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
+
+[indexterm2 basic_socket_streambuf..basic_socket_streambuf]
+Construct a [link boost_asio.reference.basic_socket_streambuf `basic_socket_streambuf`] without establishing a connection.
+
+
+ basic_socket_streambuf();
+
+
+
+[endsect]
+
+
+[section:bind basic_socket_streambuf::bind]
+
+[indexterm2 bind..basic_socket_streambuf]
+Bind the socket to the given local endpoint.
+
+
+ void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.bind.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.bind.overload2 more...]]``
+
+
+[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Bind the socket to the given local endpoint.
+
+
+ void bind(
+ const endpoint_type & endpoint);
+
+
+This function binds the socket to the specified endpoint on the local machine.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
 ]
 
@@ -28779,6 +30524,8 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
 
 
 
@@ -28790,21 +30537,21 @@
 
 
 
-[section:overload2 basic_stream_socket::open (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
 
 
 ['Inherited from basic_socket.]
 
 
-Open the socket using the specified protocol.
+Bind the socket to the given local endpoint.
 
 
- boost::system::error_code open(
- const protocol_type & protocol,
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
       boost::system::error_code & ec);
 
 
-This function opens the socket so that it will use the specified protocol.
+This function binds the socket to the specified endpoint on the local machine.
 
 
 [heading Parameters]
@@ -28812,7 +30559,7 @@
 
 [variablelist
   
-[[protocol][An object specifying which protocol is to be used.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -28824,8 +30571,10 @@
 
 
    boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
    boost::system::error_code ec;
- socket.open(boost::asio::ip::tcp::v4(), ec);
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
    if (ec)
    {
      // An error occurred.
@@ -28843,19 +30592,52 @@
 [endsect]
 
 
-[section:protocol_type basic_stream_socket::protocol_type]
+[section:broadcast basic_socket_streambuf::broadcast]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 broadcast..basic_socket_streambuf]
+Socket option to permit sending of broadcast messages.
+
+
+ typedef implementation_defined broadcast;
+
+
+
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
+
 
-[indexterm2 protocol_type..basic_stream_socket]
-The protocol type.
 
 
- typedef Protocol protocol_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -28863,54 +30645,76 @@
 [endsect]
 
 
-[section:read_some basic_stream_socket::read_some]
 
-[indexterm2 read_some..basic_stream_socket]
-Read some data from the socket.
+[section:bytes_readable basic_socket_streambuf::bytes_readable]
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.read_some.overload1 more...]]``
+['Inherited from socket_base.]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.read_some.overload2 more...]]``
+[indexterm2 bytes_readable..basic_socket_streambuf]
+IO control command to get the amount of data that can be read without blocking.
 
 
-[section:overload1 basic_stream_socket::read_some (1 of 2 overloads)]
+ typedef implementation_defined bytes_readable;
 
 
-Read some data from the socket.
 
+Implements the FIONREAD IO control command.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+
+[heading Example]
+
 
 
-This function is used to read data from the stream socket. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
 
-]
 
 
-[heading Return Value]
-
-The number of bytes read.
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:cancel basic_socket_streambuf::cancel]
+
+[indexterm2 cancel..basic_socket_streambuf]
+Cancel all asynchronous operations associated with the socket.
+
+
+ void ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.cancel.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.cancel.overload2 more...]]``
+
+
+[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Cancel all asynchronous operations associated with the socket.
+
+
+ void cancel();
+
+
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
 [heading Exceptions]
@@ -28918,46 +30722,50 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
 [heading Remarks]
       
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
 
-[heading Example]
-
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
- socket.read_some(boost::asio::buffer(data, size));
+
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+
+For portable cancellation, consider using one of the following alternatives:
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
+
 
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
 
 
-[section:overload2 basic_stream_socket::read_some (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::cancel (2 of 2 overloads)]
 
 
-Read some data from the socket.
+['Inherited from basic_socket.]
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
+Cancel all asynchronous operations associated with the socket.
+
+
+ boost::system::error_code cancel(
       boost::system::error_code & ec);
 
 
-This function is used to read data from the stream socket. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -28965,75 +30773,90 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be read.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
+[heading Remarks]
       
-The number of bytes read. Returns 0 if an error occurred.
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
 
-[heading Remarks]
-
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
+
+For portable cancellation, consider using one of the following alternatives:
 
 
-[endsect]
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
+
+
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
+
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
-[section:receive basic_stream_socket::receive]
 
-[indexterm2 receive..basic_stream_socket]
-Receive some data on the socket.
+[endsect]
 
+[section:close basic_socket_streambuf::close]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload1 receive]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload1 more...]]``
+[indexterm2 close..basic_socket_streambuf]
+Close the connection.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload2 receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload2 more...]]``
 
+ basic_socket_streambuf< Protocol, StreamSocketService, Time, TimeTraits, TimerService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.close.overload1 more...]]``
 
-Receive some data on a connected socket.
 
+Close the socket.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload3 receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload3 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.close.overload2 more...]]``
 
 
-[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
+[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
 
 
-Receive some data on the socket.
+Close the connection.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers);
+ basic_socket_streambuf< Protocol, StreamSocketService, Time, TimeTraits, TimerService > * close();
 
 
-This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
+
+[heading Return Value]
+
+`this` if a connection was successfully established, a null pointer otherwise.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_socket_streambuf::close (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Close the socket.
+
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
 
 [heading Parameters]
@@ -29041,103 +30864,116 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be received.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes received.
+[heading Example]
+
 
 
-[heading Exceptions]
-
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-]
 
 
 [heading Remarks]
       
-The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
 
-[heading Example]
-
-To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.receive(boost::asio::buffer(data, size));
 
+[endsect]
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
+[endsect]
 
+[section:connect basic_socket_streambuf::connect]
 
+[indexterm2 connect..basic_socket_streambuf]
+Establish a connection.
 
-[endsect]
 
+ basic_socket_streambuf< Protocol, StreamSocketService, Time, TimeTraits, TimerService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload1 connect]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload1 more...]]``
 
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload2 connect]``(
+ T1 t1,
+ ... ,
+ TN tn);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload2 more...]]``
 
-[section:overload2 basic_stream_socket::receive (2 of 3 overloads)]
 
+Connect the socket to the specified endpoint.
 
-Receive some data on the socket.
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.connect.overload3 connect]``(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.connect.overload3 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags);
 
+[section:overload1 basic_socket_streambuf::connect (1 of 3 overloads)]
 
-This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
 
+Establish a connection.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be received.]]
+ basic_socket_streambuf< Protocol, StreamSocketService, Time, TimeTraits, TimerService > * connect(
+ const endpoint_type & endpoint);
 
-[[flags][Flags specifying how the receive call is to be made.]]
 
-]
+This function establishes a connection to the specified endpoint.
 
 
 [heading Return Value]
       
-The number of bytes received.
+`this` if a connection was successfully established, a null pointer otherwise.
 
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-]
+[endsect]
 
 
-[heading Remarks]
-
-The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
+[section:overload2 basic_socket_streambuf::connect (2 of 3 overloads)]
 
-[heading Example]
-
-To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.receive(boost::asio::buffer(data, size), 0);
+Establish a connection.
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ basic_socket_streambuf< Protocol, StreamSocketService > * connect(
+ T1 t1,
+ ... ,
+ TN tn);
+
+
+This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
+
+
+[heading Return Value]
+
+`this` if a connection was successfully established, a null pointer otherwise.
 
 
 
@@ -29146,21 +30982,23 @@
 
 
 
-[section:overload3 basic_stream_socket::receive (3 of 3 overloads)]
+[section:overload3 basic_socket_streambuf::connect (3 of 3 overloads)]
 
 
-Receive some data on a connected socket.
+['Inherited from basic_socket.]
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
+Connect the socket to the specified endpoint.
+
+
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
 
 
-This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
 [heading Parameters]
@@ -29168,23 +31006,29 @@
 
 [variablelist
   
-[[buffers][One or more buffers into which the data will be received.]]
-
-[[flags][Flags specifying how the receive call is to be made.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes received. Returns 0 if an error occurred.
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ boost::system::error_code ec;
+ socket.connect(endpoint, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
 
 
-[heading Remarks]
-
-The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
 
@@ -29195,20 +31039,20 @@
 [endsect]
 
 
-[section:receive_buffer_size basic_stream_socket::receive_buffer_size]
+[section:debug basic_socket_streambuf::debug]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 receive_buffer_size..basic_stream_socket]
-Socket option for the receive buffer size of a socket.
+[indexterm2 debug..basic_socket_streambuf]
+Socket option to enable socket-level debugging.
 
 
- typedef implementation_defined receive_buffer_size;
+ typedef implementation_defined debug;
 
 
 
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
 
 [heading Examples]
@@ -29217,7 +31061,7 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::receive_buffer_size option(8192);
+ boost::asio::socket_base::debug option(true);
    socket.set_option(option);
 
 
@@ -29228,9 +31072,9 @@
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::receive_buffer_size option;
+ boost::asio::socket_base::debug option;
    socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
 
 
 
@@ -29240,7 +31084,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -29249,29 +31093,29 @@
 
 
 
-[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
+[section:do_not_route basic_socket_streambuf::do_not_route]
 
 
 ['Inherited from socket_base.]
 
-[indexterm2 receive_low_watermark..basic_stream_socket]
-Socket option for the receive low watermark.
+[indexterm2 do_not_route..basic_socket_streambuf]
+Socket option to prevent routing, use local interfaces only.
 
 
- typedef implementation_defined receive_low_watermark;
+ typedef implementation_defined do_not_route;
 
 
 
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
 
 [heading Examples]
   
 Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
    ...
- boost::asio::socket_base::receive_low_watermark option(1024);
+ boost::asio::socket_base::do_not_route option(true);
    socket.set_option(option);
 
 
@@ -29280,11 +31124,11 @@
 
 Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
    ...
- boost::asio::socket_base::receive_low_watermark option;
+ boost::asio::socket_base::do_not_route option;
    socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
 
 
 
@@ -29294,7 +31138,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -29302,218 +31146,173 @@
 [endsect]
 
 
-[section:remote_endpoint basic_stream_socket::remote_endpoint]
-
-[indexterm2 remote_endpoint..basic_stream_socket]
-Get the remote endpoint of the socket.
-
-
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 remote_endpoint]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 more...]]``
-
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 more...]]``
-
-
-[section:overload1 basic_stream_socket::remote_endpoint (1 of 2 overloads)]
 
+[section:duration_type basic_socket_streambuf::duration_type]
 
-['Inherited from basic_socket.]
+[indexterm2 duration_type..basic_socket_streambuf]
+The duration type.
 
 
-Get the remote endpoint of the socket.
+ typedef TimeTraits::duration_type duration_type;
 
 
- endpoint_type remote_endpoint() const;
 
+[heading Requirements]
 
-This function is used to obtain the remote endpoint of the socket.
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket.
 
+[endsect]
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
 
 
-[heading Example]
-
+['Inherited from socket_base.]
 
+[indexterm2 enable_connection_aborted..basic_socket_streambuf]
+Socket option to report aborted connections on accept.
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
+ typedef implementation_defined enable_connection_aborted;
 
 
 
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
 
+[heading Examples]
+
+Setting the option:
 
-[endsect]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
 
 
 
-[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
+Getting the current option value:
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
-Get the remote endpoint of the socket.
 
 
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
 
 
-This function is used to obtain the remote endpoint of the socket.
 
 
-[heading Parameters]
-
+[heading Requirements]
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-]
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+[endsect]
 
 
-[heading Example]
-
 
+[section:endpoint_type basic_socket_streambuf::endpoint_type]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
+[indexterm2 endpoint_type..basic_socket_streambuf]
+The endpoint type.
 
 
+ typedef Protocol::endpoint endpoint_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:reuse_address basic_stream_socket::reuse_address]
-
 
-['Inherited from socket_base.]
+[section:error basic_socket_streambuf::error]
 
-[indexterm2 reuse_address..basic_stream_socket]
-Socket option to allow the socket to be bound to an address that is already in use.
+[indexterm2 error..basic_socket_streambuf]
+Get the last error associated with the stream buffer.
 
 
- typedef implementation_defined reuse_address;
+ virtual const boost::system::error_code & error() const;
 
 
 
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Return Value]
+
+An `error_code` corresponding to the last error from the stream buffer.
 
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
 
+[endsect]
 
 
+[section:expires_at basic_socket_streambuf::expires_at]
 
+[indexterm2 expires_at..basic_socket_streambuf]
+Get the stream buffer's expiry time as an absolute time.
 
-Getting the current option value:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
+ time_type ``[link boost_asio.reference.basic_socket_streambuf.expires_at.overload1 expires_at]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.expires_at.overload1 more...]]``
 
 
+Set the stream buffer's expiry time as an absolute time.
 
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.expires_at.overload2 expires_at]``(
+ const time_type & expiry_time);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.expires_at.overload2 more...]]``
 
 
+[section:overload1 basic_socket_streambuf::expires_at (1 of 2 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+Get the stream buffer's expiry time as an absolute time.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ time_type expires_at() const;
 
-[endsect]
 
 
-[section:send basic_stream_socket::send]
+[heading Return Value]
+
+An absolute time value representing the stream buffer's expiry time.
 
-[indexterm2 send..basic_stream_socket]
-Send some data on the socket.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload1 send]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload2 send]``(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload2 more...]]``
+[endsect]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload3 send]``(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload3 more...]]``
 
 
-[section:overload1 basic_stream_socket::send (1 of 3 overloads)]
+[section:overload2 basic_socket_streambuf::expires_at (2 of 2 overloads)]
 
 
-Send some data on the socket.
+Set the stream buffer's expiry time as an absolute time.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers);
+ void expires_at(
+ const time_type & expiry_time);
 
 
-This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
+This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `boost::asio::error::operation_aborted`.
 
 
 [heading Parameters]
@@ -29521,278 +31320,257 @@
 
 [variablelist
   
-[[buffers][One or more data buffers to be sent on the socket.]]
+[[expiry_time][The expiry time to be used for the stream. ]]
 
 ]
 
 
-[heading Return Value]
-
-The number of bytes sent.
-
-
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+[endsect]
 
 
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
+[endsect]
 
+[section:expires_from_now basic_socket_streambuf::expires_from_now]
 
-[heading Example]
-
-To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+[indexterm2 expires_from_now..basic_socket_streambuf]
+Get the stream buffer's expiry time relative to now.
 
- socket.send(boost::asio::buffer(data, size));
 
+ duration_type ``[link boost_asio.reference.basic_socket_streambuf.expires_from_now.overload1 expires_from_now]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.expires_from_now.overload1 more...]]``
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
+Set the stream buffer's expiry time relative to now.
 
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.expires_from_now.overload2 expires_from_now]``(
+ const duration_type & expiry_time);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.expires_from_now.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 basic_socket_streambuf::expires_from_now (1 of 2 overloads)]
 
 
-[section:overload2 basic_stream_socket::send (2 of 3 overloads)]
+Get the stream buffer's expiry time relative to now.
 
 
-Send some data on the socket.
+ duration_type expires_from_now() const;
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags);
 
+[heading Return Value]
+
+A relative time value representing the stream buffer's expiry time.
 
-This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket.]]
+[endsect]
 
-[[flags][Flags specifying how the send call is to be made.]]
 
-]
 
+[section:overload2 basic_socket_streambuf::expires_from_now (2 of 2 overloads)]
 
-[heading Return Value]
-
-The number of bytes sent.
 
+Set the stream buffer's expiry time relative to now.
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+ void expires_from_now(
+ const duration_type & expiry_time);
 
-]
 
+This function sets the expiry time associated with the stream. Stream operations performed after this time (where the operations cannot be completed using the internal buffers) will fail with the error `boost::asio::error::operation_aborted`.
 
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
+[heading Parameters]
+
 
-[heading Example]
+[variablelist
   
-To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+[[expiry_time][The expiry time to be used for the timer. ]]
 
- socket.send(boost::asio::buffer(data, size), 0);
+]
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
+[endsect]
 
 
 [endsect]
 
 
-
-[section:overload3 basic_stream_socket::send (3 of 3 overloads)]
+[section:get_io_service basic_socket_streambuf::get_io_service]
 
 
-Send some data on the socket.
+['Inherited from basic_io_object.]
 
+[indexterm2 get_io_service..basic_socket_streambuf]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
 
+ boost::asio::io_service & get_io_service();
 
-This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
 
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket.]]
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
-[[flags][Flags specifying how the send call is to be made.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
 
+[endsect]
 
-[heading Return Value]
-
-The number of bytes sent. Returns 0 if an error occurred.
 
+[section:get_option basic_socket_streambuf::get_option]
 
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
+[indexterm2 get_option..basic_socket_streambuf]
+Get an option from the socket.
 
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.get_option.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.get_option.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 basic_socket_streambuf::get_option (1 of 2 overloads)]
 
-[endsect]
 
+['Inherited from basic_socket.]
 
-[section:send_buffer_size basic_stream_socket::send_buffer_size]
 
+Get an option from the socket.
 
-['Inherited from socket_base.]
 
-[indexterm2 send_buffer_size..basic_stream_socket]
-Socket option for the send buffer size of a socket.
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option) const;
 
 
- typedef implementation_defined send_buffer_size;
+This function is used to get the current value of an option on the socket.
 
 
+[heading Parameters]
+
 
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+[variablelist
+
+[[option][The option value to be obtained from the socket.]]
 
+]
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
 
-Getting the current option value:
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_buffer_size option;
+ boost::asio::ip::tcp::socket::keep_alive option;
    socket.get_option(option);
- int size = option.value();
-
-
-
-
+ bool is_set = option.get();
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:send_low_watermark basic_stream_socket::send_low_watermark]
+[section:overload2 basic_socket_streambuf::get_option (2 of 2 overloads)]
 
 
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
 
-[indexterm2 send_low_watermark..basic_stream_socket]
-Socket option for the send low watermark.
+
+Get an option from the socket.
 
 
- typedef implementation_defined send_low_watermark;
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
+This function is used to get the current value of an option on the socket.
 
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option(1024);
- socket.set_option(option);
+[[option][The option value to be obtained from the socket.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
 
-Getting the current option value:
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::socket_base::send_low_watermark option;
- socket.get_option(option);
- int size = option.value();
-
-
+ boost::asio::ip::tcp::socket::keep_alive option;
+ boost::system::error_code ec;
+ socket.get_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ bool is_set = option.get();
 
 
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
-
-[section:service basic_stream_socket::service]
+[section:implementation basic_socket_streambuf::implementation]
 
 
 ['Inherited from basic_io_object.]
 
-[indexterm2 service..basic_stream_socket]
-The service associated with the I/O object.
+[indexterm2 implementation..basic_socket_streambuf]
+The underlying implementation of the I/O object.
 
 
- service_type & service;
+ implementation_type implementation;
 
 
 
@@ -29800,22 +31578,22 @@
 
 
 
-[section:service_type basic_stream_socket::service_type]
+[section:implementation_type basic_socket_streambuf::implementation_type]
 
 
 ['Inherited from basic_io_object.]
 
-[indexterm2 service_type..basic_stream_socket]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 implementation_type..basic_socket_streambuf]
+The underlying implementation type of I/O object.
 
 
- typedef StreamSocketService service_type;
+ typedef service_type::implementation_type implementation_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_stream_socket.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -29823,38 +31601,38 @@
 [endsect]
 
 
-[section:set_option basic_stream_socket::set_option]
+[section:io_control basic_socket_streambuf::io_control]
 
-[indexterm2 set_option..basic_stream_socket]
-Set an option on the socket.
+[indexterm2 io_control..basic_socket_streambuf]
+Perform an IO control command on the socket.
 
 
- void ``[link boost_asio.reference.basic_stream_socket.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.set_option.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.io_control.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.set_option.overload2 set_option]``(
- const SettableSocketOption & option,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload2 io_control]``(
+ IoControlCommand & command,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.set_option.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.io_control.overload2 more...]]``
 
 
-[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::io_control (1 of 2 overloads)]
 
 
 ['Inherited from basic_socket.]
 
 
-Set an option on the socket.
+Perform an IO control command on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
 
-This function is used to set an option on the socket.
+This function is used to execute an IO control command on the socket.
 
 
 [heading Parameters]
@@ -29862,7 +31640,7 @@
 
 [variablelist
   
-[[option][The new option value to be set on the socket.]]
+[[command][The IO control command to be performed on the socket.]]
 
 ]
 
@@ -29880,12 +31658,13 @@
 
 [heading Example]
   
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+Getting the number of bytes ready to read:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
 
@@ -29897,23 +31676,23 @@
 
 
 
-[section:overload2 basic_stream_socket::set_option (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::io_control (2 of 2 overloads)]
 
 
 ['Inherited from basic_socket.]
 
 
-Set an option on the socket.
+Perform an IO control command on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
       boost::system::error_code & ec);
 
 
-This function is used to set an option on the socket.
+This function is used to execute an IO control command on the socket.
 
 
 [heading Parameters]
@@ -29921,7 +31700,7 @@
 
 [variablelist
   
-[[option][The new option value to be set on the socket.]]
+[[command][The IO control command to be performed on the socket.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -29931,17 +31710,18 @@
 
 [heading Example]
   
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+Getting the number of bytes ready to read:
 
    boost::asio::ip::tcp::socket socket(io_service);
    ...
- boost::asio::ip::tcp::no_delay option(true);
+ boost::asio::ip::tcp::socket::bytes_readable command;
    boost::system::error_code ec;
- socket.set_option(option, ec);
+ socket.io_control(command, ec);
    if (ec)
    {
      // An error occurred.
    }
+ std::size_t bytes_readable = command.get();
 
 
 
@@ -29954,218 +31734,182 @@
 
 [endsect]
 
-[section:shutdown basic_stream_socket::shutdown]
 
-[indexterm2 shutdown..basic_stream_socket]
-Disable sends or receives on the socket.
+[section:io_handler basic_socket_streambuf::io_handler]
 
+[indexterm2 io_handler..basic_socket_streambuf]
 
- void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.shutdown.overload1 more...]]``
+ friend struct io_handler();
 
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.shutdown.overload2 shutdown]``(
- shutdown_type what,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.shutdown.overload2 more...]]``
 
+[heading Requirements]
 
-[section:overload1 basic_stream_socket::shutdown (1 of 2 overloads)]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-['Inherited from basic_socket.]
 
+[endsect]
 
-Disable sends or receives on the socket.
 
 
- void shutdown(
- shutdown_type what);
+[section:is_open basic_socket_streambuf::is_open]
 
 
-This function is used to disable send operations, receive operations, or both.
+['Inherited from basic_socket.]
 
+[indexterm2 is_open..basic_socket_streambuf]
+Determine whether the socket is open.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[what][Determines what types of operation will no longer be allowed.]]
+ bool is_open() const;
 
-]
 
 
-[heading Exceptions]
-
+[endsect]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
+[section:keep_alive basic_socket_streambuf::keep_alive]
 
-[heading Example]
-
-Shutting down the send side of the socket:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
+['Inherited from socket_base.]
 
+[indexterm2 keep_alive..basic_socket_streambuf]
+Socket option to send keep-alives.
 
 
+ typedef implementation_defined keep_alive;
 
 
 
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
-[endsect]
 
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
 
-[section:overload2 basic_stream_socket::shutdown (2 of 2 overloads)]
 
 
-['Inherited from basic_socket.]
 
 
-Disable sends or receives on the socket.
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
- boost::system::error_code shutdown(
- shutdown_type what,
- boost::system::error_code & ec);
 
 
-This function is used to disable send operations, receive operations, or both.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[what][Determines what types of operation will no longer be allowed.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[heading Requirements]
 
-]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Example]
-
-Shutting down the send side of the socket:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
- if (ec)
- {
- // An error occurred.
- }
+[endsect]
 
 
 
+[section:linger basic_socket_streambuf::linger]
 
 
+['Inherited from socket_base.]
 
+[indexterm2 linger..basic_socket_streambuf]
+Socket option to specify whether the socket lingers on close if unsent data is present.
 
-[endsect]
 
+ typedef implementation_defined linger;
 
-[endsect]
 
 
-[section:shutdown_type basic_stream_socket::shutdown_type]
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
 
-['Inherited from socket_base.]
+[heading Examples]
+
+Setting the option:
 
-[indexterm2 shutdown_type..basic_stream_socket]
-Different ways a socket may be shutdown.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
 
 
- enum shutdown_type
 
-[indexterm2 shutdown_receive..basic_stream_socket]
-[indexterm2 shutdown_send..basic_stream_socket]
-[indexterm2 shutdown_both..basic_stream_socket]
 
-[heading Values]
-[variablelist
 
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+Getting the current option value:
 
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option;
+ socket.get_option(option);
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
 
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
 
-]
 
 
 
-[endsect]
 
 
-[section:write_some basic_stream_socket::write_some]
+[heading Requirements]
 
-[indexterm2 write_some..basic_stream_socket]
-Write some data to the socket.
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.write_some.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.write_some.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
+[section:local_endpoint basic_socket_streambuf::local_endpoint]
 
+[indexterm2 local_endpoint..basic_socket_streambuf]
+Get the local endpoint of the socket.
 
-Write some data to the socket.
 
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 local_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 more...]]``
 
 
-This function is used to write data to the stream socket. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+[section:overload1 basic_socket_streambuf::local_endpoint (1 of 2 overloads)]
 
 
-[heading Parameters]
-
+['Inherited from basic_socket.]
 
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket.]]
 
-]
+Get the local endpoint of the socket.
+
+
+ endpoint_type local_endpoint() const;
+
+
+This function is used to obtain the locally bound endpoint of the socket.
 
 
 [heading Return Value]
       
-The number of bytes written.
+An object that represents the local endpoint of the socket.
 
 
 [heading Exceptions]
@@ -30173,24 +31917,21 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
-
-
 [heading Example]
   
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- socket.write_some(boost::asio::buffer(data, size));
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -30199,20 +31940,20 @@
 
 
 
-[section:overload2 basic_stream_socket::write_some (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::local_endpoint (2 of 2 overloads)]
 
 
-Write some data to the socket.
+['Inherited from basic_socket.]
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+Get the local endpoint of the socket.
 
 
-This function is used to write data to the stream socket. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
+
+
+This function is used to obtain the locally bound endpoint of the socket.
 
 
 [heading Parameters]
@@ -30220,8 +31961,6 @@
 
 [variablelist
   
-[[buffers][One or more data buffers to be written to the socket.]]
-
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
@@ -30229,342 +31968,482 @@
 
 [heading Return Value]
       
-The number of bytes written. Returns 0 if an error occurred.
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
+[heading Example]
+
+
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
 
-[endsect]
 
 
-[endsect]
 
 
 [endsect]
 
-[section:basic_streambuf basic_streambuf]
 
+[endsect]
 
-Automatically resizable buffer class based on std::streambuf.
+[section:lowest_layer basic_socket_streambuf::lowest_layer]
 
+[indexterm2 lowest_layer..basic_socket_streambuf]
+Get a reference to the lowest layer.
 
- template<
- typename Allocator = std::allocator<char>>
- class basic_streambuf :
- noncopyable
 
+ lowest_layer_type & ``[link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload1 more...]]``
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+Get a const reference to the lowest layer.
 
- [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
- [The type used to represent the input sequence as a list of buffers. ]
-
- ]
 
- [
+ const lowest_layer_type & ``[link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.lowest_layer.overload2 more...]]``
 
- [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
- [The type used to represent the output sequence as a list of buffers. ]
-
- ]
 
-]
+[section:overload1 basic_socket_streambuf::lowest_layer (1 of 2 overloads)]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
- [Construct a basic_streambuf object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
- [Move characters from the output sequence to the input sequence. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
- [Remove characters from the input sequence. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.data [*data]]]
- [Get a list of buffers that represents the input sequence. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
- [Get the maximum size of the basic_streambuf. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
- [Get a list of buffers that represents the output sequence, with the given size. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.size [*size]]]
- [Get the size of the input sequence. ]
- ]
-
-]
+['Inherited from basic_socket.]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
- [Override std::streambuf behaviour. ]
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
- []
- ]
-
- [
- [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
- [Override std::streambuf behaviour. ]
- ]
-
-]
+Get a reference to the lowest layer.
 
-The `basic_streambuf` class is derived from `std::streambuf` to associate the streambuf's input and output sequences with one or more character arrays. These character arrays are internal to the `basic_streambuf` object, but direct access to the array elements is provided to permit them to be used efficiently with I/O operations. Characters written to the output sequence of a `basic_streambuf` object are appended to the input sequence of the same object.
 
-The `basic_streambuf` class's public interface is intended to permit the following implementation strategies:
+ lowest_layer_type & lowest_layer();
 
 
-* A single contiguous character array, which is reallocated as necessary to accommodate changes in the size of the character sequence. This is the implementation approach currently used in Asio.
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-* A sequence of one or more character arrays, where each array is of the same size. Additional character array objects are appended to the sequence to accommodate changes in the size of the character sequence.
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
 
-* A sequence of one or more character arrays of varying sizes. Additional character array objects are appended to the sequence to accommodate changes in the size of the character sequence.
 
-The constructor for [link boost_asio.reference.basic_streambuf `basic_streambuf`] accepts a `size_t` argument specifying the maximum of the sum of the sizes of the input sequence and output sequence. During the lifetime of the `basic_streambuf` object, the following invariant holds:
 
- size() <= max_size()
+[endsect]
 
 
-Any member function that would, if successful, cause the invariant to be violated shall throw an exception of class `std::length_error`.
 
-The constructor for `basic_streambuf` takes an Allocator argument. A copy of this argument is used for any memory allocation performed, by the constructor and by all member functions, during the lifetime of each `basic_streambuf` object.
+[section:overload2 basic_socket_streambuf::lowest_layer (2 of 2 overloads)]
 
 
-[heading Examples]
-
-Writing directly from an streambuf to a socket:
+['Inherited from basic_socket.]
 
- boost::asio::streambuf b;
- std::ostream os(&b);
- os << "Hello, World!\n";
 
- // try sending some data in input sequence
- size_t n = sock.send(b.data());
+Get a const reference to the lowest layer.
 
- b.consume(n); // sent data is removed from input sequence
 
+ const lowest_layer_type & lowest_layer() const;
 
 
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
-Reading from a socket directly into a streambuf:
 
- boost::asio::streambuf b;
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- // reserve 512 bytes in output sequence
- boost::asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
 
- size_t n = sock.receive(bufs);
 
- // received data is "committed" from output sequence to input sequence
- b.commit(n);
 
- std::istream is(&b);
- std::string s;
- is >> s;
+[endsect]
 
 
+[endsect]
 
 
-[heading Requirements]
+[section:lowest_layer_type basic_socket_streambuf::lowest_layer_type]
 
-[*Header: ][^boost/asio/basic_streambuf.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+['Inherited from basic_socket.]
 
+[indexterm2 lowest_layer_type..basic_socket_streambuf]
+A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
-[section:basic_streambuf basic_streambuf::basic_streambuf]
 
-[indexterm2 basic_streambuf..basic_streambuf]
-Construct a [link boost_asio.reference.basic_streambuf `basic_streambuf`] object.
+ typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
 
 
- basic_streambuf(
- std::size_t max_size = (std::numeric_limits< std::size_t >::max)(),
- const Allocator & allocator = Allocator());
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
-Constructs a streambuf with the specified maximum size. The initial size of the streambuf's input sequence is 0.
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
 
-[section:commit basic_streambuf::commit]
+ [
 
-[indexterm2 commit..basic_streambuf]
-Move characters from the output sequence to the input sequence.
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
 
+ [
 
- void commit(
- std::size_t n);
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
 
+ [
 
-Appends `n` characters from the start of the output sequence to the input sequence. The beginning of the output sequence is advanced by `n` characters.
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
-Requires a preceding call `prepare(x)` where `x >= n`, and no intervening operations that modify the input or output sequence.
+ [
 
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
-[heading Exceptions]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
   
-[[std::length_error][If `n` is greater than the size of the output sequence. ]]
-
-]
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
 
-[section:const_buffers_type basic_streambuf::const_buffers_type]
+ [
 
-[indexterm2 const_buffers_type..basic_streambuf]
-The type used to represent the input sequence as a list of buffers.
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
 
+ [
 
- typedef implementation_defined const_buffers_type;
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
 
-[heading Requirements]
+ [
 
-[*Header: ][^boost/asio/basic_streambuf.hpp]
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
 
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
 
+ [
 
-[section:consume basic_streambuf::consume]
+ [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
 
-[indexterm2 consume..basic_streambuf]
-Remove characters from the input sequence.
+ [
 
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
 
- void consume(
- std::size_t n);
+ [
 
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
 
-Removes `n` characters from the beginning of the input sequence.
+ [
 
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
 
-[heading Exceptions]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
   
-[[std::length_error][If `n > size()`. ]]
+ ]
 
 ]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it.
 
+ Construct and open a basic_socket.
 
-[endsect]
-
-
-
-[section:data basic_streambuf::data]
-
-[indexterm2 data..basic_streambuf]
-Get a list of buffers that represents the input sequence.
-
-
- const_buffers_type data() const;
-
-
-
-[heading Return Value]
-
-An object of type `const_buffers_type` that satisfies ConstBufferSequence requirements, representing all character arrays in the input sequence.
-
-
-[heading Remarks]
-
-The returned object is invalidated by any `basic_streambuf` member function that modifies the input sequence or output sequence.
-
-
+ Construct a basic_socket, opening it and binding it to the given local endpoint.
 
+ Construct a basic_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
 
-[endsect]
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
 
-[section:max_size basic_streambuf::max_size]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
 
-[indexterm2 max_size..basic_streambuf]
-Get the maximum size of the [link boost_asio.reference.basic_streambuf `basic_streambuf`].
+ [
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
- std::size_t max_size() const;
+ [
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
 
-[heading Return Value]
-
-The allowed maximum of the sum of the sizes of the input sequence and output sequence.
+ [
+ [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
 
+]
 
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
 
+]
 
-[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
+The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
 
-[indexterm2 mutable_buffers_type..basic_streambuf]
-The type used to represent the output sequence as a list of buffers.
 
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
 
- typedef implementation_defined mutable_buffers_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/basic_streambuf.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -30573,101 +32452,91 @@
 
 
 
-[section:overflow basic_streambuf::overflow]
+[section:max_connections basic_socket_streambuf::max_connections]
 
-[indexterm2 overflow..basic_streambuf]
-Override std::streambuf behaviour.
 
+['Inherited from socket_base.]
 
- int_type overflow(
- int_type c);
+[indexterm2 max_connections..basic_socket_streambuf]
+The maximum length of the queue of pending incoming connections.
 
 
-Behaves according to the specification of `std::streambuf::overflow()`, with the specialisation that `std::length_error` is thrown if appending the character to the input sequence would require the condition `size() > max_size()` to be true.
+ static const int max_connections = implementation_defined;
+
 
 
 [endsect]
 
 
 
-[section:prepare basic_streambuf::prepare]
+[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
 
-[indexterm2 prepare..basic_streambuf]
-Get a list of buffers that represents the output sequence, with the given size.
 
+['Inherited from socket_base.]
 
- mutable_buffers_type prepare(
- std::size_t n);
+[indexterm2 message_do_not_route..basic_socket_streambuf]
+Specify that the data should not be subject to routing.
 
 
-Ensures that the output sequence can accommodate `n` characters, reallocating character array objects as necessary.
+ static const int message_do_not_route = implementation_defined;
 
 
-[heading Return Value]
-
-An object of type `mutable_buffers_type` that satisfies MutableBufferSequence requirements, representing character array objects at the start of the output sequence such that the sum of the buffer sizes is `n`.
 
+[endsect]
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[std::length_error][If `size() + n > max_size()`.]]
 
-]
+[section:message_end_of_record basic_socket_streambuf::message_end_of_record]
 
 
-[heading Remarks]
-
-The returned object is invalidated by any `basic_streambuf` member function that modifies the input sequence or output sequence.
+['Inherited from socket_base.]
+
+[indexterm2 message_end_of_record..basic_socket_streambuf]
+Specifies that the data marks the end of a record.
 
 
+ static const int message_end_of_record = implementation_defined;
+
 
 
 [endsect]
 
 
 
-[section:reserve basic_streambuf::reserve]
+[section:message_flags basic_socket_streambuf::message_flags]
 
-[indexterm2 reserve..basic_streambuf]
 
- void reserve(
- std::size_t n);
+['Inherited from socket_base.]
 
+[indexterm2 message_flags..basic_socket_streambuf]
+Bitmask type for flags that can be passed to send and receive operations.
 
 
-[endsect]
+ typedef int message_flags;
 
 
 
-[section:size basic_streambuf::size]
+[heading Requirements]
 
-[indexterm2 size..basic_streambuf]
-Get the size of the input sequence.
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- std::size_t size() const;
 
+[endsect]
 
 
-[heading Return Value]
-
-The size of the input sequence. The value is equal to that calculated for `s` in the following code:
 
- size_t s = 0;
- const_buffers_type bufs = data();
- const_buffers_type::const_iterator i = bufs.begin();
- while (i != bufs.end())
- {
- const_buffer buf(*i++);
- s += buffer_size(buf);
- }
+[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
+
 
+['Inherited from socket_base.]
 
+[indexterm2 message_out_of_band..basic_socket_streambuf]
+Process out-of-band data.
 
 
+ static const int message_out_of_band = implementation_defined;
 
 
 
@@ -30675,944 +32544,1032 @@
 
 
 
-[section:underflow basic_streambuf::underflow]
+[section:message_peek basic_socket_streambuf::message_peek]
 
-[indexterm2 underflow..basic_streambuf]
-Override std::streambuf behaviour.
 
+['Inherited from socket_base.]
 
- int_type underflow();
+[indexterm2 message_peek..basic_socket_streambuf]
+Peek at incoming data without removing it from the input queue.
 
 
-Behaves according to the specification of `std::streambuf::underflow()`.
+ static const int message_peek = implementation_defined;
 
 
-[endsect]
 
+[endsect]
 
 
-[endsect]
 
-[section:buffer buffer]
+[section:native basic_socket_streambuf::native]
 
-[indexterm1 buffer]
-The `boost::asio::buffer` function is used to create a buffer object to represent raw memory, an array of POD elements, a vector of POD elements, or a std::string.
 
-
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload1 buffer]``(
- const mutable_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload1 more...]]``
+['Inherited from basic_socket.]
 
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload2 buffer]``(
- const mutable_buffer & b,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload2 more...]]``
+[indexterm2 native..basic_socket_streambuf]
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
- const_buffers_1 ``[link boost_asio.reference.buffer.overload3 buffer]``(
- const const_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload3 more...]]``
 
- const_buffers_1 ``[link boost_asio.reference.buffer.overload4 buffer]``(
- const const_buffer & b,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload4 more...]]``
+ native_type native();
 
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload5 buffer]``(
- void * data,
- std::size_t size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload5 more...]]``
 
- const_buffers_1 ``[link boost_asio.reference.buffer.overload6 buffer]``(
- const void * data,
- std::size_t size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload6 more...]]``
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload7 buffer]``(
- PodType (&data)[N]);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload7 more...]]``
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload8 buffer]``(
- PodType (&data)[N],
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload8 more...]]``
+[endsect]
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
- const PodType (&data)[N]);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload9 more...]]``
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload10 buffer]``(
- const PodType (&data)[N],
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload10 more...]]``
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
- boost::array< PodType, N > & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload11 more...]]``
+[section:native_handle basic_socket_streambuf::native_handle]
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload12 buffer]``(
- boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload12 more...]]``
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload13 buffer]``(
- boost::array< const PodType, N > & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload13 more...]]``
+['Inherited from basic_socket.]
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload14 buffer]``(
- boost::array< const PodType, N > & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload14 more...]]``
+[indexterm2 native_handle..basic_socket_streambuf]
+Get the native socket representation.
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload15 buffer]``(
- const boost::array< PodType, N > & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload15 more...]]``
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload16 buffer]``(
- const boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload16 more...]]``
+ native_handle_type native_handle();
 
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload17 buffer]``(
- std::vector< PodType, Allocator > & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload17 more...]]``
 
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload18 buffer]``(
- std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload18 more...]]``
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload19 buffer]``(
- const std::vector< PodType, Allocator > & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload19 more...]]``
 
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload20 buffer]``(
- const std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload20 more...]]``
+[endsect]
 
- const_buffers_1 ``[link boost_asio.reference.buffer.overload21 buffer]``(
- const std::string & data);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload21 more...]]``
 
- const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
- const std::string & data,
- std::size_t max_size_in_bytes);
- `` [''''&raquo;''' [link boost_asio.reference.buffer.overload22 more...]]``
 
-A buffer object represents a contiguous region of memory as a 2-tuple consisting of a pointer and size in bytes. A tuple of the form `{void*, size_t}` specifies a mutable (modifiable) region of memory. Similarly, a tuple of the form `{const void*, size_t}` specifies a const (non-modifiable) region of memory. These two forms correspond to the classes [link boost_asio.reference.mutable_buffer `mutable_buffer`] and [link boost_asio.reference.const_buffer `const_buffer`], respectively. To mirror C++'s conversion rules, a [link boost_asio.reference.mutable_buffer `mutable_buffer`] is implicitly convertible to a [link boost_asio.reference.const_buffer `const_buffer`], and the opposite conversion is not permitted.
+[section:native_handle_type basic_socket_streambuf::native_handle_type]
 
-The simplest use case involves reading or writing a single buffer of a specified size:
 
+['Inherited from basic_socket.]
 
+[indexterm2 native_handle_type..basic_socket_streambuf]
+The native representation of a socket.
 
- sock.send(boost::asio::buffer(data, size));
 
+ typedef StreamSocketService::native_handle_type native_handle_type;
 
 
 
-In the above example, the return value of `boost::asio::buffer` meets the requirements of the ConstBufferSequence concept so that it may be directly passed to the socket's write function. A buffer created for modifiable memory also meets the requirements of the MutableBufferSequence concept.
+[heading Requirements]
 
-An individual buffer may be created from a builtin array, std::vector or boost::array of POD elements. This helps prevent buffer overruns by automatically determining the size of the buffer:
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
- char d1[128];
- size_t bytes_transferred = sock.receive(boost::asio::buffer(d1));
+[endsect]
 
- std::vector<char> d2(128);
- bytes_transferred = sock.receive(boost::asio::buffer(d2));
 
- boost::array<char, 128> d3;
- bytes_transferred = sock.receive(boost::asio::buffer(d3));
+[section:native_non_blocking basic_socket_streambuf::native_non_blocking]
 
+[indexterm2 native_non_blocking..basic_socket_streambuf]
+Gets the non-blocking mode of the native socket implementation.
 
 
+ bool ``[link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload1 more...]]``
 
-In all three cases above, the buffers created are exactly 128 bytes long. Note that a vector is [*never] automatically resized when creating or using a buffer. The buffer size is determined using the vector's `size()` member function, and not its capacity.
 
+Sets the non-blocking mode of the native socket implementation.
 
-[heading Accessing Buffer Contents]
-
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload2 more...]]``
 
-The contents of a buffer may be accessed using the boost::asio::buffer\_size and boost::asio::buffer\_cast functions:
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.native_non_blocking.overload3 more...]]``
 
 
+[section:overload1 basic_socket_streambuf::native_non_blocking (1 of 3 overloads)]
 
- boost::asio::mutable_buffer b1 = ...;
- std::size_t s1 = boost::asio::buffer_size(b1);
- unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
 
- boost::asio::const_buffer b2 = ...;
- std::size_t s2 = boost::asio::buffer_size(b2);
- const void* p2 = boost::asio::buffer_cast<const void*>(b2);
+['Inherited from basic_socket.]
 
 
+Gets the non-blocking mode of the native socket implementation.
 
 
-The boost::asio::buffer\_cast function permits violations of type safety, so uses of it in application code should be carefully considered.
+ bool native_non_blocking() const;
 
 
-[heading Buffer Invalidation]
-
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
 
 
-A buffer object does not have any ownership of the memory it refers to. It is the responsibility of the application to ensure the memory region remains valid until it is no longer required for an I/O operation. When the memory is no longer available, the buffer is said to have been invalidated.
+[heading Return Value]
+
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
-For the `boost::asio::buffer` overloads that accept an argument of type std::vector, the buffer objects returned are invalidated by any vector operation that also invalidates all references, pointers and iterators referring to the elements in the sequence (C++ Std, 23.2.4)
 
-For the `boost::asio::buffer` overloads that accept an argument of type std::string, the buffer objects returned are invalidated according to the rules defined for invalidation of references, pointers and iterators referring to elements of the sequence (C++ Std, 21.3).
+[heading Remarks]
+
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
 
 
-[heading Buffer Arithmetic]
+[heading Example]
   
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
-Buffer objects may be manipulated using simple arithmetic in a safe way which helps prevent buffer overruns. Consider an array initialised as follows:
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
- boost::array<char, 6> a = { 'a', 'b', 'c', 'd', 'e' };
 
 
 
 
-A buffer object `b1` created using:
 
+[endsect]
 
 
- b1 = boost::asio::buffer(a);
 
+[section:overload2 basic_socket_streambuf::native_non_blocking (2 of 3 overloads)]
 
 
+['Inherited from basic_socket.]
 
-represents the entire array, `{ 'a', 'b', 'c', 'd', 'e' }`. An optional second argument to the `boost::asio::buffer` function may be used to limit the size, in bytes, of the buffer:
 
+Sets the non-blocking mode of the native socket implementation.
 
 
- b2 = boost::asio::buffer(a, 3);
+ void native_non_blocking(
+ bool mode);
 
 
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
-such that `b2` represents the data `{ 'a', 'b', 'c' }`. Even if the size argument exceeds the actual size of the array, the size of the buffer object created will be limited to the array size.
+[heading Parameters]
+
 
-An offset may be applied to an existing buffer to create a new one:
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
+]
 
 
- b3 = b1 + 2;
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
+]
 
 
-where `b3` will set to represent `{ 'c', 'd', 'e' }`. If the offset exceeds the size of the existing buffer, the newly created buffer will be empty.
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
-Both an offset and size may be specified to create a buffer that corresponds to a specific range of bytes within an existing buffer:
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
- b4 = boost::asio::buffer(b1 + 1, 3);
 
 
 
 
-so that `b4` will refer to the bytes `{ 'b', 'c', 'd' }`.
 
 
-[heading Buffers and Scatter-Gather I/O]
-
+[endsect]
 
 
-To read or write using multiple buffers (i.e. scatter-gather I/O), multiple buffer objects may be assigned into a container that supports the MutableBufferSequence (for read) or ConstBufferSequence (for write) concepts:
 
+[section:overload3 basic_socket_streambuf::native_non_blocking (3 of 3 overloads)]
 
 
- char d1[128];
- std::vector<char> d2(128);
- boost::array<char, 128> d3;
+['Inherited from basic_socket.]
 
- boost::array<mutable_buffer, 3> bufs1 = {
- boost::asio::buffer(d1),
- boost::asio::buffer(d2),
- boost::asio::buffer(d3) };
- bytes_transferred = sock.receive(bufs1);
 
- std::vector<const_buffer> bufs2;
- bufs2.push_back(boost::asio::buffer(d1));
- bufs2.push_back(boost::asio::buffer(d2));
- bufs2.push_back(boost::asio::buffer(d3));
- bytes_transferred = sock.send(bufs2);
+Sets the non-blocking mode of the native socket implementation.
 
 
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
 
-[heading Requirements]
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
-[*Header: ][^boost/asio/buffer.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
-[section:overload1 buffer (1 of 22 overloads)]
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
+]
 
-Create a new modifiable buffer from an existing buffer.
 
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
- mutable_buffers_1 buffer(
- const mutable_buffer & b);
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
-[heading Return Value]
-
-`mutable_buffers_1(b)`.
 
 
 
 
-[endsect]
 
 
+[endsect]
 
-[section:overload2 buffer (2 of 22 overloads)]
 
+[endsect]
 
-Create a new modifiable buffer from an existing buffer.
 
+[section:native_type basic_socket_streambuf::native_type]
 
- mutable_buffers_1 buffer(
- const mutable_buffer & b,
- std::size_t max_size_in_bytes);
 
+['Inherited from basic_socket.]
 
+[indexterm2 native_type..basic_socket_streambuf]
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
- mutable_buffers_1(
- buffer_cast<void*>(b),
- min(buffer_size(b), max_size_in_bytes));
+ typedef StreamSocketService::native_handle_type native_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:non_blocking basic_socket_streambuf::non_blocking]
 
-[section:overload3 buffer (3 of 22 overloads)]
-
-
-Create a new non-modifiable buffer from an existing buffer.
-
+[indexterm2 non_blocking..basic_socket_streambuf]
+Gets the non-blocking mode of the socket.
 
- const_buffers_1 buffer(
- const const_buffer & b);
 
+ bool ``[link boost_asio.reference.basic_socket_streambuf.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.non_blocking.overload1 more...]]``
 
 
-[heading Return Value]
-
-`const_buffers_1(b)`.
+Sets the non-blocking mode of the socket.
 
 
+ void ``[link boost_asio.reference.basic_socket_streambuf.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.non_blocking.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.non_blocking.overload3 more...]]``
 
-[endsect]
 
+[section:overload1 basic_socket_streambuf::non_blocking (1 of 3 overloads)]
 
 
-[section:overload4 buffer (4 of 22 overloads)]
+['Inherited from basic_socket.]
 
 
-Create a new non-modifiable buffer from an existing buffer.
+Gets the non-blocking mode of the socket.
 
 
- const_buffers_1 buffer(
- const const_buffer & b,
- std::size_t max_size_in_bytes);
+ bool non_blocking() const;
 
 
 
 [heading Return Value]
       
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
- const_buffers_1(
- buffer_cast<const void*>(b),
- min(buffer_size(b), max_size_in_bytes));
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
 
 
+[endsect]
 
 
-[endsect]
 
+[section:overload2 basic_socket_streambuf::non_blocking (2 of 3 overloads)]
 
 
-[section:overload5 buffer (5 of 22 overloads)]
+['Inherited from basic_socket.]
 
 
-Create a new modifiable buffer that represents the given memory range.
+Sets the non-blocking mode of the socket.
 
 
- mutable_buffers_1 buffer(
- void * data,
- std::size_t size_in_bytes);
+ void non_blocking(
+ bool mode);
 
 
 
-[heading Return Value]
-
-`mutable_buffers_1(data, size_in_bytes)`.
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
+]
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:overload6 buffer (6 of 22 overloads)]
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
-Create a new non-modifiable buffer that represents the given memory range.
 
 
- const_buffers_1 buffer(
- const void * data,
- std::size_t size_in_bytes);
 
+[endsect]
 
 
-[heading Return Value]
-
-`const_buffers_1(data, size_in_bytes)`.
 
+[section:overload3 basic_socket_streambuf::non_blocking (3 of 3 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[endsect]
 
+Sets the non-blocking mode of the socket.
 
 
-[section:overload7 buffer (7 of 22 overloads)]
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
 
-Create a new modifiable buffer that represents the given POD array.
 
+[heading Parameters]
+
+
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- PodType (&data)[N]);
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[heading Return Value]
+[heading Remarks]
       
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
- mutable_buffers_1(
- static_cast<void*>(data),
- N * sizeof(PodType));
 
 
 
+[endsect]
 
 
+[endsect]
 
 
-[endsect]
+[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
 
 
+['Inherited from socket_base.]
 
-[section:overload8 buffer (8 of 22 overloads)]
+[indexterm2 non_blocking_io..basic_socket_streambuf]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
 
-Create a new modifiable buffer that represents the given POD array.
+ typedef implementation_defined non_blocking_io;
 
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- PodType (&data)[N],
- std::size_t max_size_in_bytes);
 
+Implements the FIONBIO IO control command.
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
+[heading Example]
+
 
- mutable_buffers_1(
- static_cast<void*>(data),
- min(N * sizeof(PodType), max_size_in_bytes));
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
 
 
 
 
 
 
-[endsect]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[section:overload9 buffer (9 of 22 overloads)]
+[*Convenience header: ][^boost/asio.hpp]
 
 
-Create a new non-modifiable buffer that represents the given POD array.
+[endsect]
 
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const PodType (&data)[N]);
+[section:open basic_socket_streambuf::open]
 
+[indexterm2 open..basic_socket_streambuf]
+Open the socket using the specified protocol.
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+ void ``[link boost_asio.reference.basic_socket_streambuf.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.open.overload1 more...]]``
 
- const_buffers_1(
- static_cast<const void*>(data),
- N * sizeof(PodType));
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.open.overload2 more...]]``
 
 
+[section:overload1 basic_socket_streambuf::open (1 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
 
+Open the socket using the specified protocol.
 
-[endsect]
 
+ void open(
+ const protocol_type & protocol = protocol_type());
 
 
-[section:overload10 buffer (10 of 22 overloads)]
+This function opens the socket so that it will use the specified protocol.
 
 
-Create a new non-modifiable buffer that represents the given POD array.
+[heading Parameters]
+
 
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const PodType (&data)[N],
- std::size_t max_size_in_bytes);
+]
 
 
+[heading Exceptions]
+
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
- const_buffers_1(
- static_cast<const void*>(data),
- min(N * sizeof(PodType), max_size_in_bytes));
+]
 
 
+[heading Example]
+
 
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
 
 
 
-[endsect]
 
 
 
-[section:overload11 buffer (11 of 22 overloads)]
 
+[endsect]
 
-Create a new modifiable buffer that represents the given POD array.
 
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- boost::array< PodType, N > & data);
+[section:overload2 basic_socket_streambuf::open (2 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
- mutable_buffers_1(
- data.data(),
- data.size() * sizeof(PodType));
+Open the socket using the specified protocol.
 
 
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
 
 
+This function opens the socket so that it will use the specified protocol.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[protocol][An object specifying which protocol is to be used.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-[section:overload12 buffer (12 of 22 overloads)]
 
+[heading Example]
+
 
-Create a new modifiable buffer that represents the given POD array.
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::system::error_code ec;
+ socket.open(boost::asio::ip::tcp::v4(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
 
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
- mutable_buffers_1(
- data.data(),
- min(data.size() * sizeof(PodType), max_size_in_bytes));
 
 
+[endsect]
+
 
+[endsect]
 
 
+[section:overflow basic_socket_streambuf::overflow]
 
+[indexterm2 overflow..basic_socket_streambuf]
 
-[endsect]
+ int_type overflow(
+ int_type c);
 
 
 
-[section:overload13 buffer (13 of 22 overloads)]
+[endsect]
 
 
-Create a new non-modifiable buffer that represents the given POD array.
 
+[section:protocol_type basic_socket_streambuf::protocol_type]
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- boost::array< const PodType, N > & data);
 
+['Inherited from basic_socket.]
 
+[indexterm2 protocol_type..basic_socket_streambuf]
+The protocol type.
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- const_buffers_1(
- data.data(),
- data.size() * sizeof(PodType));
+ typedef Protocol protocol_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload14 buffer (14 of 22 overloads)]
-
+[section:puberror basic_socket_streambuf::puberror]
 
-Create a new non-modifiable buffer that represents the given POD array.
+[indexterm2 puberror..basic_socket_streambuf]
+Get the last error associated with the stream buffer.
 
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- boost::array< const PodType, N > & data,
- std::size_t max_size_in_bytes);
+ const boost::system::error_code & puberror() const;
 
 
 
 [heading Return Value]
       
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+An `error_code` corresponding to the last error from the stream buffer.
 
- const_buffers_1(
- data.data(),
- min(data.size() * sizeof(PodType), max_size_in_bytes));
 
 
 
+[endsect]
 
 
 
+[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
 
-[endsect]
 
+['Inherited from socket_base.]
 
+[indexterm2 receive_buffer_size..basic_socket_streambuf]
+Socket option for the receive buffer size of a socket.
 
-[section:overload15 buffer (15 of 22 overloads)]
 
+ typedef implementation_defined receive_buffer_size;
 
-Create a new non-modifiable buffer that represents the given POD array.
 
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const boost::array< PodType, N > & data);
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
 
- const_buffers_1(
- data.data(),
- data.size() * sizeof(PodType));
 
 
 
 
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-[endsect]
 
 
 
-[section:overload16 buffer (16 of 22 overloads)]
 
 
-Create a new non-modifiable buffer that represents the given POD array.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- const_buffers_1(
- data.data(),
- min(data.size() * sizeof(PodType), max_size_in_bytes));
 
+[section:receive_low_watermark basic_socket_streambuf::receive_low_watermark]
 
 
+['Inherited from socket_base.]
 
+[indexterm2 receive_low_watermark..basic_socket_streambuf]
+Socket option for the receive low watermark.
 
 
+ typedef implementation_defined receive_low_watermark;
 
-[endsect]
 
 
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
-[section:overload17 buffer (17 of 22 overloads)]
 
+[heading Examples]
+
+Setting the option:
 
-Create a new modifiable buffer that represents the given POD vector.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
 
 
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data);
 
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
+Getting the current option value:
 
- mutable_buffers_1(
- data.size() ? &data[0] : 0,
- data.size() * sizeof(PodType));
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
 
 
 
 
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
 
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
 
-[section:overload18 buffer (18 of 22 overloads)]
+[indexterm2 remote_endpoint..basic_socket_streambuf]
+Get the remote endpoint of the socket.
 
 
-Create a new modifiable buffer that represents the given POD vector.
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 more...]]``
 
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 more...]]``
 
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
 
+[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
+['Inherited from basic_socket.]
 
- mutable_buffers_1(
- data.size() ? &data[0] : 0,
- min(data.size() * sizeof(PodType), max_size_in_bytes));
 
+Get the remote endpoint of the socket.
 
 
+ endpoint_type remote_endpoint() const;
 
 
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+This function is used to obtain the remote endpoint of the socket.
 
 
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket.
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:overload19 buffer (19 of 22 overloads)]
 
+[heading Example]
+
 
-Create a new non-modifiable buffer that represents the given POD vector.
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 buffer(
- const std::vector< PodType, Allocator > & data);
 
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- const_buffers_1(
- data.size() ? &data[0] : 0,
- data.size() * sizeof(PodType));
 
 
+[endsect]
 
 
 
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+[section:overload2 basic_socket_streambuf::remote_endpoint (2 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
 
-[endsect]
+Get the remote endpoint of the socket.
 
 
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
 
-[section:overload20 buffer (20 of 22 overloads)]
 
+This function is used to obtain the remote endpoint of the socket.
 
-Create a new non-modifiable buffer that represents the given POD vector.
 
+[heading Parameters]
+
 
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 buffer(
- const std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
 [heading Return Value]
       
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
- const_buffers_1(
- data.size() ? &data[0] : 0,
- min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+[heading Example]
+
 
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
 
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
 
 
 
@@ -31620,426 +33577,334 @@
 [endsect]
 
 
+[endsect]
 
-[section:overload21 buffer (21 of 22 overloads)]
 
+[section:reuse_address basic_socket_streambuf::reuse_address]
 
-Create a new non-modifiable buffer that represents the given string.
 
+['Inherited from socket_base.]
 
- const_buffers_1 buffer(
- const std::string & data);
+[indexterm2 reuse_address..basic_socket_streambuf]
+Socket option to allow the socket to be bound to an address that is already in use.
 
 
+ typedef implementation_defined reuse_address;
 
-[heading Return Value]
-
-`const_buffers_1(data.data(), data.size())`.
 
 
-[heading Remarks]
-
-The buffer is invalidated by any non-const operation called on the given string object.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
 
-[endsect]
 
 
 
-[section:overload22 buffer (22 of 22 overloads)]
-
-
-Create a new non-modifiable buffer that represents the given string.
 
+Getting the current option value:
 
- const_buffers_1 buffer(
- const std::string & data,
- std::size_t max_size_in_bytes);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
 
 
-[heading Return Value]
-
-A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- const_buffers_1(
- data.data(),
- min(data.size(), max_size_in_bytes));
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[heading Remarks]
-
-The buffer is invalidated by any non-const operation called on the given string object.
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
 
-[endsect]
 
+[section:send_buffer_size basic_socket_streambuf::send_buffer_size]
 
-[endsect]
 
-[section:buffered_read_stream buffered_read_stream]
+['Inherited from socket_base.]
 
+[indexterm2 send_buffer_size..basic_socket_streambuf]
+Socket option for the send buffer size of a socket.
 
-Adds buffering to the read-related operations of a stream.
 
+ typedef implementation_defined send_buffer_size;
 
- template<
- typename Stream>
- class buffered_read_stream :
- noncopyable
 
 
-[heading Types]
-[table
- [[Name][Description]]
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
- [
 
- [[link boost_asio.reference.buffered_read_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
+[heading Examples]
   
- ]
+Setting the option:
 
- [
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
 
- [[link boost_asio.reference.buffered_read_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.buffered_read_stream.async_fill [*async_fill]]]
- [Start an asynchronous fill. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.async_read_some [*async_read_some]]]
- [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.async_write_some [*async_write_some]]]
- [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.buffered_read_stream [*buffered_read_stream]]]
- [Construct, passing the specified argument to initialise the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.close [*close]]]
- [Close the stream. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.fill [*fill]]]
- [Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
- Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+Getting the current option value:
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.peek [*peek]]]
- [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
- Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.read_some [*read_some]]]
- [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
- Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_read_stream.write_some [*write_some]]]
- [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
- Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.buffered_read_stream.default_buffer_size [*default_buffer_size]]]
- [The default buffer size. ]
- ]
 
-]
 
-The [link boost_asio.reference.buffered_read_stream `buffered_read_stream`] class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[*Convenience header: ][^boost/asio.hpp]
 
-[*Shared] [*objects:] Unsafe.
 
+[endsect]
 
 
 
-[heading Requirements]
+[section:send_low_watermark basic_socket_streambuf::send_low_watermark]
 
-[*Header: ][^boost/asio/buffered_read_stream.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+['Inherited from socket_base.]
 
+[indexterm2 send_low_watermark..basic_socket_streambuf]
+Socket option for the send low watermark.
 
-[section:async_fill buffered_read_stream::async_fill]
 
-[indexterm2 async_fill..buffered_read_stream]
-Start an asynchronous fill.
+ typedef implementation_defined send_low_watermark;
 
 
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
 
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
 
-[endsect]
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
 
 
-[section:async_read_some buffered_read_stream::async_read_some]
 
-[indexterm2 async_read_some..buffered_read_stream]
-Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-[endsect]
 
 
 
-[section:async_write_some buffered_read_stream::async_write_some]
 
-[indexterm2 async_write_some..buffered_read_stream]
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
 
+[heading Requirements]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:buffered_read_stream buffered_read_stream::buffered_read_stream]
-
-[indexterm2 buffered_read_stream..buffered_read_stream]
-Construct, passing the specified argument to initialise the next layer.
 
+[section:service basic_socket_streambuf::service]
 
- template<
- typename Arg>
- explicit ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
- Arg & a);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 more...]]``
 
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
- Arg & a,
- std::size_t buffer_size);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 more...]]``
+['Inherited from basic_io_object.]
 
+[indexterm2 service..basic_socket_streambuf]
+The service associated with the I/O object.
 
-[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
 
+ service_type & service;
 
-Construct, passing the specified argument to initialise the next layer.
 
 
- template<
- typename Arg>
- buffered_read_stream(
- Arg & a);
+[endsect]
 
 
 
-[endsect]
+[section:service_type basic_socket_streambuf::service_type]
 
 
+['Inherited from basic_io_object.]
 
-[section:overload2 buffered_read_stream::buffered_read_stream (2 of 2 overloads)]
+[indexterm2 service_type..basic_socket_streambuf]
+The type of the service that will be used to provide I/O operations.
 
 
-Construct, passing the specified argument to initialise the next layer.
+ typedef StreamSocketService service_type;
 
 
- template<
- typename Arg>
- buffered_read_stream(
- Arg & a,
- std::size_t buffer_size);
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-[section:close buffered_read_stream::close]
 
-[indexterm2 close..buffered_read_stream]
-Close the stream.
+[section:set_option basic_socket_streambuf::set_option]
 
+[indexterm2 set_option..basic_socket_streambuf]
+Set an option on the socket.
 
- void ``[link boost_asio.reference.buffered_read_stream.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.buffered_read_stream.close.overload2 close]``(
+ void ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.set_option.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.close.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.set_option.overload2 more...]]``
 
 
-[section:overload1 buffered_read_stream::close (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::set_option (1 of 2 overloads)]
 
 
-Close the stream.
+['Inherited from basic_socket.]
 
 
- void close();
+Set an option on the socket.
 
 
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
 
-[endsect]
 
+This function is used to set an option on the socket.
 
 
-[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
 
-Close the stream.
+]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[endsect]
 
 
-[endsect]
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
 
-[section:default_buffer_size buffered_read_stream::default_buffer_size]
 
-[indexterm2 default_buffer_size..buffered_read_stream]
-The default buffer size.
 
 
- static const std::size_t default_buffer_size = implementation_defined;
 
 
 
 [endsect]
 
 
-[section:fill buffered_read_stream::fill]
 
-[indexterm2 fill..buffered_read_stream]
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
+[section:overload2 basic_socket_streambuf::set_option (2 of 2 overloads)]
 
 
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.fill.overload1 more...]]``
+['Inherited from basic_socket.]
 
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
+Set an option on the socket.
 
 
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.fill.overload2 more...]]``
 
 
-[section:overload1 buffered_read_stream::fill (1 of 2 overloads)]
-
+This function is used to set an option on the socket.
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
+[heading Parameters]
+
 
- std::size_t fill();
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-[endsect]
 
 
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
-[section:overload2 buffered_read_stream::fill (2 of 2 overloads)]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ boost::system::error_code ec;
+ socket.set_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
 
 
- std::size_t fill(
- boost::system::error_code & ec);
 
 
 
@@ -32049,152 +33914,189 @@
 [endsect]
 
 
-[section:get_io_service buffered_read_stream::get_io_service]
-
-[indexterm2 get_io_service..buffered_read_stream]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[section:setbuf basic_socket_streambuf::setbuf]
 
+[indexterm2 setbuf..basic_socket_streambuf]
 
- boost::asio::io_service & get_io_service();
+ std::streambuf * setbuf(
+ char_type * s,
+ std::streamsize n);
 
 
 
 [endsect]
 
 
-[section:in_avail buffered_read_stream::in_avail]
+[section:shutdown basic_socket_streambuf::shutdown]
 
-[indexterm2 in_avail..buffered_read_stream]
-Determine the amount of data that may be read without blocking.
+[indexterm2 shutdown..basic_socket_streambuf]
+Disable sends or receives on the socket.
 
 
- std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload1 in_avail]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.in_avail.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 shutdown]``(
+ shutdown_type what,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.in_avail.overload2 more...]]``
-
+ `` [''''&raquo;''' [link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 more...]]``
 
-[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
 
+[section:overload1 basic_socket_streambuf::shutdown (1 of 2 overloads)]
 
-Determine the amount of data that may be read without blocking.
 
+['Inherited from basic_socket.]
 
- std::size_t in_avail();
 
+Disable sends or receives on the socket.
 
 
-[endsect]
+ void shutdown(
+ shutdown_type what);
 
 
+This function is used to disable send operations, receive operations, or both.
 
-[section:overload2 buffered_read_stream::in_avail (2 of 2 overloads)]
 
+[heading Parameters]
+
 
-Determine the amount of data that may be read without blocking.
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
 
+]
 
- std::size_t in_avail(
- boost::system::error_code & ec);
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
-[endsect]
+[heading Example]
+
+Shutting down the send side of the socket:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
 
-[section:io_service buffered_read_stream::io_service]
 
-[indexterm2 io_service..buffered_read_stream]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
- boost::asio::io_service & io_service();
 
 
 
 [endsect]
 
 
-[section:lowest_layer buffered_read_stream::lowest_layer]
 
-[indexterm2 lowest_layer..buffered_read_stream]
-Get a reference to the lowest layer.
+[section:overload2 basic_socket_streambuf::shutdown (2 of 2 overloads)]
 
 
- lowest_layer_type & ``[link boost_asio.reference.buffered_read_stream.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.lowest_layer.overload1 more...]]``
+['Inherited from basic_socket.]
 
 
-Get a const reference to the lowest layer.
+Disable sends or receives on the socket.
 
 
- const lowest_layer_type & ``[link boost_asio.reference.buffered_read_stream.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.lowest_layer.overload2 more...]]``
+ boost::system::error_code shutdown(
+ shutdown_type what,
+ boost::system::error_code & ec);
 
 
-[section:overload1 buffered_read_stream::lowest_layer (1 of 2 overloads)]
+This function is used to disable send operations, receive operations, or both.
 
 
-Get a reference to the lowest layer.
+[heading Parameters]
+
 
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
 
- lowest_layer_type & lowest_layer();
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[endsect]
+[heading Example]
+
+Shutting down the send side of the socket:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
-[section:overload2 buffered_read_stream::lowest_layer (2 of 2 overloads)]
 
 
-Get a const reference to the lowest layer.
 
 
- const lowest_layer_type & lowest_layer() const;
 
+[endsect]
 
 
 [endsect]
 
 
-[endsect]
+[section:shutdown_type basic_socket_streambuf::shutdown_type]
 
 
-[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
+['Inherited from socket_base.]
 
-[indexterm2 lowest_layer_type..buffered_read_stream]
-The type of the lowest layer.
+[indexterm2 shutdown_type..basic_socket_streambuf]
+Different ways a socket may be shutdown.
 
 
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+ enum shutdown_type
 
+[indexterm2 shutdown_receive..basic_socket_streambuf]
+[indexterm2 shutdown_send..basic_socket_streambuf]
+[indexterm2 shutdown_both..basic_socket_streambuf]
 
+[heading Values]
+[variablelist
 
-[heading Requirements]
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
 
-[*Header: ][^boost/asio/buffered_read_stream.hpp]
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
 
+]
 
-[endsect]
 
 
+[endsect]
 
-[section:next_layer buffered_read_stream::next_layer]
 
-[indexterm2 next_layer..buffered_read_stream]
-Get a reference to the next layer.
 
+[section:sync basic_socket_streambuf::sync]
 
- next_layer_type & next_layer();
+[indexterm2 sync..basic_socket_streambuf]
+
+ int sync();
 
 
 
@@ -32202,19 +34104,19 @@
 
 
 
-[section:next_layer_type buffered_read_stream::next_layer_type]
+[section:time_type basic_socket_streambuf::time_type]
 
-[indexterm2 next_layer_type..buffered_read_stream]
-The type of the next layer.
+[indexterm2 time_type..basic_socket_streambuf]
+The time type.
 
 
- typedef boost::remove_reference< Stream >::type next_layer_type;
+ typedef TimeTraits::time_type time_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffered_read_stream.hpp]
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -32222,216 +34124,221 @@
 [endsect]
 
 
-[section:peek buffered_read_stream::peek]
 
-[indexterm2 peek..buffered_read_stream]
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+[section:timer_handler basic_socket_streambuf::timer_handler]
 
+[indexterm2 timer_handler..basic_socket_streambuf]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.peek.overload1 more...]]``
-
-
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
-
-
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload2 peek]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.peek.overload2 more...]]``
-
-
-[section:overload1 buffered_read_stream::peek (1 of 2 overloads)]
-
+ friend struct timer_handler();
 
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
+[heading Requirements]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+[*Header: ][^boost/asio/basic_socket_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 buffered_read_stream::peek (2 of 2 overloads)]
-
-
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
-
-
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:underflow basic_socket_streambuf::underflow]
 
+[indexterm2 underflow..basic_socket_streambuf]
 
+ int_type underflow();
 
-[endsect]
 
 
 [endsect]
 
-[section:read_some buffered_read_stream::read_some]
-
-[indexterm2 read_some..buffered_read_stream]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
-
-
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.read_some.overload1 more...]]``
-
-
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.read_some.overload2 more...]]``
+[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
 
+[indexterm2 ~basic_socket_streambuf..basic_socket_streambuf]
+Destructor flushes buffered data.
 
-[section:overload1 buffered_read_stream::read_some (1 of 2 overloads)]
 
+ virtual ~basic_socket_streambuf();
 
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+[endsect]
 
 
 
 [endsect]
 
+[section:basic_stream_socket basic_stream_socket]
 
 
-[section:overload2 buffered_read_stream::read_some (2 of 2 overloads)]
-
-
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
+Provides stream-oriented socket functionality.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
-
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
+ class basic_stream_socket :
+ public basic_socket< Protocol, StreamSocketService >
 
 
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
 
-[section:write_some buffered_read_stream::write_some]
+ [
 
-[indexterm2 write_some..buffered_read_stream]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
 
+ [
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.write_some.overload1 more...]]``
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
 
+ [
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
 
+ [
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.write_some.overload2 more...]]``
+ [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
 
+ [
 
-[section:overload1 buffered_read_stream::write_some (1 of 2 overloads)]
+ [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
+ [
 
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
+ [
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
 
+ [
 
-[section:overload2 buffered_read_stream::write_some (2 of 2 overloads)]
+ [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
 
+ [
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
+ [[link boost_asio.reference.basic_stream_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
 
+ [
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+ [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
 
-[endsect]
+ [
 
-[section:buffered_stream buffered_stream]
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
 
+ [
 
-Adds buffering to the read- and write-related operations of a stream.
+ [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
 
+ [
 
- template<
- typename Stream>
- class buffered_stream :
- noncopyable
+ [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
 
+ [
 
-[heading Types]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
 
   [
 
- [[link boost_asio.reference.buffered_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
+ [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.buffered_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
+ [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
   
   ]
 
@@ -32442,164 +34349,271 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.buffered_stream.async_fill [*async_fill]]]
- [Start an asynchronous fill. ]
+ [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.async_flush [*async_flush]]]
- [Start an asynchronous flush. ]
+ [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.async_read_some [*async_read_some]]]
- [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
+ [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.async_write_some [*async_write_some]]]
- [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
+ [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.buffered_stream [*buffered_stream]]]
- [Construct, passing the specified argument to initialise the next layer. ]
+ [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
+ [Start an asynchronous send. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.close [*close]]]
- [Close the stream. ]
+ [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.fill [*fill]]]
- [Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
-
- Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred. ]
+ [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.flush [*flush]]]
- [Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
+ [Construct a basic_stream_socket without opening it.
 
- Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred. ]
+ Construct and open a basic_stream_socket.
+
+ Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_stream_socket on an existing native socket. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
+ [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
      Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[link boost_asio.reference.basic_stream_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.peek [*peek]]]
- [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
- Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
+ Sets the non-blocking mode of the native socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.read_some [*read_some]]]
- [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
- Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
+ Sets the non-blocking mode of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.buffered_stream.write_some [*write_some]]]
- [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+ [[link boost_asio.reference.basic_stream_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
+ [Read some data from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
+ [Receive some data on the socket.
 
- Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred. ]
+ Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.send [*send]]]
+ [Send some data on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
+ [Write some data to the socket. ]
   ]
   
 ]
 
-The [link boost_asio.reference.buffered_stream `buffered_stream`] class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
 
-[*Shared] [*objects:] Unsafe.
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
 
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
 
+]
 
-[heading Requirements]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
 
-[*Header: ][^boost/asio/buffered_stream.hpp]
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
+ [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
 
+]
 
-[section:async_fill buffered_stream::async_fill]
+The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
 
-[indexterm2 async_fill..buffered_stream]
-Start an asynchronous fill.
 
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
 
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
 
 
 
-[endsect]
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:async_flush buffered_stream::async_flush]
+[section:assign basic_stream_socket::assign]
 
-[indexterm2 async_flush..buffered_stream]
-Start an asynchronous flush.
+[indexterm2 assign..basic_stream_socket]
+Assign an existing native socket to the socket.
 
 
- template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
+ void ``[link boost_asio.reference.basic_stream_socket.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.assign.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.assign.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 basic_stream_socket::assign (1 of 2 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[section:async_read_some buffered_stream::async_read_some]
 
-[indexterm2 async_read_some..buffered_stream]
-Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
+Assign an existing native socket to the socket.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+ void assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
 
@@ -32607,448 +34621,573 @@
 
 
 
-[section:async_write_some buffered_stream::async_write_some]
+[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
 
-[indexterm2 async_write_some..buffered_stream]
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
 
+['Inherited from basic_socket.]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
 
+Assign an existing native socket to the socket.
 
 
-[endsect]
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
 
 
-[section:buffered_stream buffered_stream::buffered_stream]
 
-[indexterm2 buffered_stream..buffered_stream]
-Construct, passing the specified argument to initialise the next layer.
+[endsect]
 
 
- template<
- typename Arg>
- explicit ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
- Arg & a);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.buffered_stream.overload1 more...]]``
+[endsect]
 
- template<
- typename Arg>
- explicit ``[link boost_asio.reference.buffered_stream.buffered_stream.overload2 buffered_stream]``(
- Arg & a,
- std::size_t read_buffer_size,
- std::size_t write_buffer_size);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.buffered_stream.overload2 more...]]``
 
+[section:async_connect basic_stream_socket::async_connect]
 
-[section:overload1 buffered_stream::buffered_stream (1 of 2 overloads)]
 
+['Inherited from basic_socket.]
 
-Construct, passing the specified argument to initialise the next layer.
+[indexterm2 async_connect..basic_stream_socket]
+Start an asynchronous connect.
 
 
   template<
- typename Arg>
- buffered_stream(
- Arg & a);
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
 
 
+This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
 
-[endsect]
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
 
+[heading Parameters]
+
 
-[section:overload2 buffered_stream::buffered_stream (2 of 2 overloads)]
+[variablelist
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
 
+[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
-Construct, passing the specified argument to initialise the next layer.
+]
 
 
- template<
- typename Arg>
- buffered_stream(
- Arg & a,
- std::size_t read_buffer_size,
- std::size_t write_buffer_size);
+[heading Example]
+
 
 
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
 
-[endsect]
+ ...
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_connect(endpoint, connect_handler);
 
-[endsect]
 
-[section:close buffered_stream::close]
 
-[indexterm2 close..buffered_stream]
-Close the stream.
 
 
- void ``[link boost_asio.reference.buffered_stream.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.close.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.buffered_stream.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.close.overload2 more...]]``
 
+[endsect]
 
-[section:overload1 buffered_stream::close (1 of 2 overloads)]
 
 
-Close the stream.
+[section:async_read_some basic_stream_socket::async_read_some]
 
+[indexterm2 async_read_some..basic_stream_socket]
+Start an asynchronous read.
 
- void close();
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
 
-[endsect]
+This function is used to asynchronously read data from the stream socket. The function call always returns immediately.
 
 
+[heading Parameters]
+
 
-[section:overload2 buffered_stream::close (2 of 2 overloads)]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
+[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes read.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
-Close the stream.
+]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+[heading Remarks]
+
+The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
 
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[endsect]
+ socket.async_read_some(boost::asio::buffer(data, size), handler);
 
 
-[endsect]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[section:fill buffered_stream::fill]
 
-[indexterm2 fill..buffered_stream]
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
 
- std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload1 fill]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.fill.overload1 more...]]``
+[endsect]
 
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
+[section:async_receive basic_stream_socket::async_receive]
 
+[indexterm2 async_receive..basic_stream_socket]
+Start an asynchronous receive.
 
- std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload2 fill]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.fill.overload2 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_stream_socket.async_receive.overload1 async_receive]``(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_receive.overload1 more...]]``
 
-[section:overload1 buffered_stream::fill (1 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_stream_socket.async_receive.overload2 async_receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ ReadHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_receive.overload2 more...]]``
 
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
+[section:overload1 basic_stream_socket::async_receive (1 of 2 overloads)]
 
 
- std::size_t fill();
+Start an asynchronous receive.
 
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
-[endsect]
 
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
 
 
-[section:overload2 buffered_stream::fill (2 of 2 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
+[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes received.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
- std::size_t fill(
- boost::system::error_code & ec);
 
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is received before the asynchronous operation completes.
 
 
-[endsect]
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.async_receive(boost::asio::buffer(data, size), handler);
 
-[endsect]
 
-[section:flush buffered_stream::flush]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[indexterm2 flush..buffered_stream]
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
 
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload1 flush]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.flush.overload1 more...]]``
 
+[endsect]
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
 
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload2 flush]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.flush.overload2 more...]]``
+[section:overload2 basic_stream_socket::async_receive (2 of 2 overloads)]
 
 
-[section:overload1 buffered_stream::flush (1 of 2 overloads)]
+Start an asynchronous receive.
 
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ ReadHandler handler);
 
 
- std::size_t flush();
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
+[[flags][Flags specifying how the receive call is to be made.]]
 
+[[handler][The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes received.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
-[section:overload2 buffered_stream::flush (2 of 2 overloads)]
+]
 
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is received before the asynchronous operation completes.
 
 
- std::size_t flush(
- boost::system::error_code & ec);
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.async_receive(boost::asio::buffer(data, size), 0, handler);
 
 
-[endsect]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
-[endsect]
 
 
-[section:get_io_service buffered_stream::get_io_service]
+[endsect]
 
-[indexterm2 get_io_service..buffered_stream]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
+[endsect]
 
- boost::asio::io_service & get_io_service();
+[section:async_send basic_stream_socket::async_send]
 
+[indexterm2 async_send..basic_stream_socket]
+Start an asynchronous send.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_stream_socket.async_send.overload1 async_send]``(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_send.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_stream_socket.async_send.overload2 async_send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.async_send.overload2 more...]]``
 
-[section:in_avail buffered_stream::in_avail]
 
-[indexterm2 in_avail..buffered_stream]
-Determine the amount of data that may be read without blocking.
+[section:overload1 basic_stream_socket::async_send (1 of 2 overloads)]
 
 
- std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload1 in_avail]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.in_avail.overload1 more...]]``
+Start an asynchronous send.
 
- std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.in_avail.overload2 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
-[section:overload1 buffered_stream::in_avail (1 of 2 overloads)]
 
+This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
 
-Determine the amount of data that may be read without blocking.
 
+[heading Parameters]
+
 
- std::size_t in_avail();
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
+[[handler][The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes sent.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
-[endsect]
 
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
-[section:overload2 buffered_stream::in_avail (2 of 2 overloads)]
+[heading Example]
+
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.async_send(boost::asio::buffer(data, size), handler);
 
-Determine the amount of data that may be read without blocking.
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- std::size_t in_avail(
- boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
-[endsect]
 
+[section:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
 
-[section:io_service buffered_stream::io_service]
 
-[indexterm2 io_service..buffered_stream]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+Start an asynchronous send.
 
 
- boost::asio::io_service & io_service();
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
 
+This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
 
-[endsect]
 
+[heading Parameters]
+
 
-[section:lowest_layer buffered_stream::lowest_layer]
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[indexterm2 lowest_layer..buffered_stream]
-Get a reference to the lowest layer.
+[[flags][Flags specifying how the send call is to be made.]]
 
+[[handler][The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes sent.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
- lowest_layer_type & ``[link boost_asio.reference.buffered_stream.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.lowest_layer.overload1 more...]]``
+]
 
 
-Get a const reference to the lowest layer.
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
- const lowest_layer_type & ``[link boost_asio.reference.buffered_stream.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.lowest_layer.overload2 more...]]``
+[heading Example]
+
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.async_send(boost::asio::buffer(data, size), 0, handler);
 
-[section:overload1 buffered_stream::lowest_layer (1 of 2 overloads)]
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-Get a reference to the lowest layer.
 
 
- lowest_layer_type & lowest_layer();
 
+[endsect]
 
 
 [endsect]
 
 
+[section:async_write_some basic_stream_socket::async_write_some]
 
-[section:overload2 buffered_stream::lowest_layer (2 of 2 overloads)]
-
+[indexterm2 async_write_some..basic_stream_socket]
+Start an asynchronous write.
 
-Get a const reference to the lowest layer.
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
- const lowest_layer_type & lowest_layer() const;
 
+This function is used to asynchronously write data to the stream socket. The function call always returns immediately.
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more data buffers to be written to the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
-[endsect]
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes written.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
-[section:lowest_layer_type buffered_stream::lowest_layer_type]
 
-[indexterm2 lowest_layer_type..buffered_stream]
-The type of the lowest layer.
+[heading Remarks]
+
+The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.async_write_some(boost::asio::buffer(data, size), handler);
 
 
-[heading Requirements]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[*Header: ][^boost/asio/buffered_stream.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:at_mark basic_stream_socket::at_mark]
 
-[section:next_layer buffered_stream::next_layer]
-
-[indexterm2 next_layer..buffered_stream]
-Get a reference to the next layer.
-
-
- next_layer_type & next_layer();
+[indexterm2 at_mark..basic_stream_socket]
+Determine whether the socket is at the out-of-band data mark.
 
 
+ bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload1 at_mark]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.at_mark.overload1 more...]]``
 
-[endsect]
+ bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.at_mark.overload2 more...]]``
 
 
+[section:overload1 basic_stream_socket::at_mark (1 of 2 overloads)]
 
-[section:next_layer_type buffered_stream::next_layer_type]
 
-[indexterm2 next_layer_type..buffered_stream]
-The type of the next layer.
+['Inherited from basic_socket.]
 
 
- typedef boost::remove_reference< Stream >::type next_layer_type;
+Determine whether the socket is at the out-of-band data mark.
 
 
+ bool at_mark() const;
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffered_stream.hpp]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
-[endsect]
 
+[heading Exceptions]
+
 
-[section:peek buffered_stream::peek]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-[indexterm2 peek..buffered_stream]
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+]
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.peek.overload1 more...]]``
 
 
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.peek.overload2 peek]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.peek.overload2 more...]]``
 
+[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
 
-[section:overload1 buffered_stream::peek (1 of 2 overloads)]
 
+['Inherited from basic_socket.]
 
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
+Determine whether the socket is at the out-of-band data mark.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
 
+ bool at_mark(
+ boost::system::error_code & ec) const;
 
 
-[endsect]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
 
 
+[heading Parameters]
+
 
-[section:overload2 buffered_stream::peek (2 of 2 overloads)]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
 
 
 
@@ -33057,287 +35196,197 @@
 
 [endsect]
 
-[section:read_some buffered_stream::read_some]
+[section:available basic_stream_socket::available]
 
-[indexterm2 read_some..buffered_stream]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+[indexterm2 available..basic_stream_socket]
+Determine the number of bytes available for reading.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.read_some.overload1 more...]]``
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload1 available]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.available.overload1 more...]]``
 
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.available.overload2 more...]]``
 
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
+[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.read_some.overload2 more...]]``
 
+['Inherited from basic_socket.]
 
-[section:overload1 buffered_stream::read_some (1 of 2 overloads)]
 
+Determine the number of bytes available for reading.
 
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
+ std::size_t available() const;
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
 
+This function is used to determine the number of bytes that may be read without blocking.
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
 
+[heading Exceptions]
+
 
-[section:overload2 buffered_stream::read_some (2 of 2 overloads)]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
 
+[endsect]
 
 
-[endsect]
 
+[section:overload2 basic_stream_socket::available (2 of 2 overloads)]
 
-[endsect]
 
-[section:write_some buffered_stream::write_some]
+['Inherited from basic_socket.]
 
-[indexterm2 write_some..buffered_stream]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
+Determine the number of bytes available for reading.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.write_some.overload1 more...]]``
 
+ std::size_t available(
+ boost::system::error_code & ec) const;
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
 
+This function is used to determine the number of bytes that may be read without blocking.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.write_some.overload2 more...]]``
 
+[heading Parameters]
+
 
-[section:overload1 buffered_stream::write_some (1 of 2 overloads)]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 buffered_stream::write_some (2 of 2 overloads)]
+[section:basic_stream_socket basic_stream_socket::basic_stream_socket]
 
+[indexterm2 basic_stream_socket..basic_stream_socket]
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] without opening it.
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
 
+ explicit ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 basic_stream_socket]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
 
+Construct and open a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`].
 
 
-[endsect]
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 more...]]``
 
 
-[endsect]
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`], opening it and binding it to the given local endpoint.
 
 
-[endsect]
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 more...]]``
 
-[section:buffered_write_stream buffered_write_stream]
 
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] on an existing native socket.
 
-Adds buffering to the write-related operations of a stream.
 
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload4 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload4 more...]]``
 
- template<
- typename Stream>
- class buffered_write_stream :
- noncopyable
 
+[section:overload1 basic_stream_socket::basic_stream_socket (1 of 4 overloads)]
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] without opening it.
 
- [[link boost_asio.reference.buffered_write_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
-
- ]
 
- [
+ basic_stream_socket(
+ boost::asio::io_service & io_service);
 
- [[link boost_asio.reference.buffered_write_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
-
- ]
 
-]
+This constructor creates a stream socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.buffered_write_stream.async_flush [*async_flush]]]
- [Start an asynchronous flush. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.async_read_some [*async_read_some]]]
- [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.async_write_some [*async_write_some]]]
- [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.buffered_write_stream [*buffered_write_stream]]]
- [Construct, passing the specified argument to initialise the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.close [*close]]]
- [Close the stream. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.flush [*flush]]]
- [Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+[heading Parameters]
+
 
- Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
+[variablelist
   
- [
- [[link boost_asio.reference.buffered_write_stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.peek [*peek]]]
- [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+]
 
- Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.read_some [*read_some]]]
- [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
- Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_write_stream.write_some [*write_some]]]
- [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
- Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link boost_asio.reference.buffered_write_stream.default_buffer_size [*default_buffer_size]]]
- [The default buffer size. ]
- ]
 
-]
 
-The [link boost_asio.reference.buffered_write_stream `buffered_write_stream`] class template can be used to add buffering to the synchronous and asynchronous write operations of a stream.
+[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+Construct and open a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`].
 
-[*Shared] [*objects:] Unsafe.
 
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
 
 
+This constructor creates and opens a stream socket. The socket needs to be connected or accepted before data can be sent or received on it.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffered_write_stream.hpp]
+[heading Parameters]
+
 
-[*Convenience header: ][^boost/asio.hpp]
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
+[[protocol][An object specifying protocol parameters to be used.]]
 
-[section:async_flush buffered_write_stream::async_flush]
+]
 
-[indexterm2 async_flush..buffered_write_stream]
-Start an asynchronous flush.
 
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
 
- template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
 
 
 
@@ -33345,91 +35394,86 @@
 
 
 
-[section:async_read_some buffered_write_stream::async_read_some]
+[section:overload3 basic_stream_socket::basic_stream_socket (3 of 4 overloads)]
 
-[indexterm2 async_read_some..buffered_write_stream]
-Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
 
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`], opening it and binding it to the given local endpoint.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
 
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
 
 
-[endsect]
+This constructor creates a stream socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
 
 
+[heading Parameters]
+
 
-[section:async_write_some buffered_write_stream::async_write_some]
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
 
-[indexterm2 async_write_some..buffered_write_stream]
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
+[[endpoint][An endpoint on the local machine to which the stream socket will be bound.]]
 
+]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
 
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
-[endsect]
 
 
-[section:buffered_write_stream buffered_write_stream::buffered_write_stream]
 
-[indexterm2 buffered_write_stream..buffered_write_stream]
-Construct, passing the specified argument to initialise the next layer.
+[endsect]
 
 
- template<
- typename Arg>
- explicit ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 buffered_write_stream]``(
- Arg & a);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 more...]]``
 
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 buffered_write_stream]``(
- Arg & a,
- std::size_t buffer_size);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 more...]]``
+[section:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
 
 
-[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
+Construct a [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] on an existing native socket.
 
 
-Construct, passing the specified argument to initialise the next layer.
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket);
 
 
- template<
- typename Arg>
- buffered_write_stream(
- Arg & a);
+This constructor creates a stream socket object to hold an existing native socket.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+
+[[protocol][An object specifying protocol parameters to be used.]]
 
+[[native_socket][The new underlying socket implementation.]]
 
+]
 
-[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
 
+[heading Exceptions]
+
 
-Construct, passing the specified argument to initialise the next layer.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
- template<
- typename Arg>
- buffered_write_stream(
- Arg & a,
- std::size_t buffer_size);
 
 
 
@@ -33438,104 +35482,123 @@
 
 [endsect]
 
-[section:close buffered_write_stream::close]
+[section:bind basic_stream_socket::bind]
 
-[indexterm2 close..buffered_write_stream]
-Close the stream.
+[indexterm2 bind..basic_stream_socket]
+Bind the socket to the given local endpoint.
 
 
- void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.close.overload1 more...]]``
+ void ``[link boost_asio.reference.basic_stream_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.bind.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.buffered_write_stream.close.overload2 close]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.close.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.bind.overload2 more...]]``
 
 
-[section:overload1 buffered_write_stream::close (1 of 2 overloads)]
+[section:overload1 basic_stream_socket::bind (1 of 2 overloads)]
 
 
-Close the stream.
+['Inherited from basic_socket.]
 
 
- void close();
+Bind the socket to the given local endpoint.
 
 
+ void bind(
+ const endpoint_type & endpoint);
 
-[endsect]
 
+This function binds the socket to the specified endpoint on the local machine.
 
 
-[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
-Close the stream.
+]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[endsect]
 
+[heading Example]
+
 
-[endsect]
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
 
-[section:default_buffer_size buffered_write_stream::default_buffer_size]
 
-[indexterm2 default_buffer_size..buffered_write_stream]
-The default buffer size.
 
 
- static const std::size_t default_buffer_size = implementation_defined;
 
 
 
 [endsect]
 
 
-[section:flush buffered_write_stream::flush]
 
-[indexterm2 flush..buffered_write_stream]
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
 
 
- std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload1 flush]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.flush.overload1 more...]]``
+['Inherited from basic_socket.]
 
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
+Bind the socket to the given local endpoint.
 
 
- std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload2 flush]``(
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.flush.overload2 more...]]``
 
 
-[section:overload1 buffered_write_stream::flush (1 of 2 overloads)]
-
+This function binds the socket to the specified endpoint on the local machine.
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
+[heading Parameters]
+
 
- std::size_t flush();
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-[endsect]
 
+[heading Example]
+
 
 
-[section:overload2 buffered_write_stream::flush (2 of 2 overloads)]
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ boost::system::error_code ec;
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
 
- std::size_t flush(
- boost::system::error_code & ec);
 
 
 
@@ -33545,273 +35608,261 @@
 [endsect]
 
 
-[section:get_io_service buffered_write_stream::get_io_service]
-
-[indexterm2 get_io_service..buffered_write_stream]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & get_io_service();
-
-
+[section:broadcast basic_stream_socket::broadcast]
 
-[endsect]
 
+['Inherited from socket_base.]
 
-[section:in_avail buffered_write_stream::in_avail]
+[indexterm2 broadcast..basic_stream_socket]
+Socket option to permit sending of broadcast messages.
 
-[indexterm2 in_avail..buffered_write_stream]
-Determine the amount of data that may be read without blocking.
 
+ typedef implementation_defined broadcast;
 
- std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload1 in_avail]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.in_avail.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.in_avail.overload2 more...]]``
 
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
 
-[section:overload1 buffered_write_stream::in_avail (1 of 2 overloads)]
 
+[heading Examples]
+
+Setting the option:
 
-Determine the amount of data that may be read without blocking.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
 
 
- std::size_t in_avail();
 
 
 
-[endsect]
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[section:overload2 buffered_write_stream::in_avail (2 of 2 overloads)]
 
 
-Determine the amount of data that may be read without blocking.
 
 
- std::size_t in_avail(
- boost::system::error_code & ec);
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:io_service buffered_write_stream::io_service]
 
-[indexterm2 io_service..buffered_write_stream]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[section:bytes_readable basic_stream_socket::bytes_readable]
 
 
- boost::asio::io_service & io_service();
+['Inherited from socket_base.]
 
+[indexterm2 bytes_readable..basic_stream_socket]
+IO control command to get the amount of data that can be read without blocking.
 
 
-[endsect]
+ typedef implementation_defined bytes_readable;
 
 
-[section:lowest_layer buffered_write_stream::lowest_layer]
 
-[indexterm2 lowest_layer..buffered_write_stream]
-Get a reference to the lowest layer.
+Implements the FIONREAD IO control command.
 
 
- lowest_layer_type & ``[link boost_asio.reference.buffered_write_stream.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.lowest_layer.overload1 more...]]``
+[heading Example]
+
 
 
-Get a const reference to the lowest layer.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
- const lowest_layer_type & ``[link boost_asio.reference.buffered_write_stream.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.lowest_layer.overload2 more...]]``
 
 
-[section:overload1 buffered_write_stream::lowest_layer (1 of 2 overloads)]
 
 
-Get a reference to the lowest layer.
 
+[heading Requirements]
 
- lowest_layer_type & lowest_layer();
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:cancel basic_stream_socket::cancel]
 
-[section:overload2 buffered_write_stream::lowest_layer (2 of 2 overloads)]
+[indexterm2 cancel..basic_stream_socket]
+Cancel all asynchronous operations associated with the socket.
 
 
-Get a const reference to the lowest layer.
+ void ``[link boost_asio.reference.basic_stream_socket.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.cancel.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.cancel.overload2 more...]]``
 
- const lowest_layer_type & lowest_layer() const;
 
+[section:overload1 basic_stream_socket::cancel (1 of 2 overloads)]
 
 
-[endsect]
+['Inherited from basic_socket.]
 
 
-[endsect]
+Cancel all asynchronous operations associated with the socket.
 
 
-[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
+ void cancel();
 
-[indexterm2 lowest_layer_type..buffered_write_stream]
-The type of the lowest layer.
 
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/buffered_write_stream.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
-[endsect]
 
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
 
-[section:next_layer buffered_write_stream::next_layer]
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
-[indexterm2 next_layer..buffered_write_stream]
-Get a reference to the next layer.
+For portable cancellation, consider using one of the following alternatives:
 
 
- next_layer_type & next_layer();
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
 
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
-[endsect]
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
+[endsect]
 
-[section:next_layer_type buffered_write_stream::next_layer_type]
 
-[indexterm2 next_layer_type..buffered_write_stream]
-The type of the next layer.
 
+[section:overload2 basic_stream_socket::cancel (2 of 2 overloads)]
 
- typedef boost::remove_reference< Stream >::type next_layer_type;
 
+['Inherited from basic_socket.]
 
 
-[heading Requirements]
+Cancel all asynchronous operations associated with the socket.
 
-[*Header: ][^boost/asio/buffered_write_stream.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
 
 
-[endsect]
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[section:peek buffered_write_stream::peek]
+[heading Parameters]
+
 
-[indexterm2 peek..buffered_write_stream]
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.peek.overload1 more...]]``
 
+[heading Remarks]
+
+Calls to `cancel()` will always fail with `boost::asio::error::operation_not_supported` when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
 
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
+* It will only cancel asynchronous operations that were initiated in the current thread.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.peek.overload2 peek]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.peek.overload2 more...]]``
 
+* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
 
-[section:overload1 buffered_write_stream::peek (1 of 2 overloads)]
+For portable cancellation, consider using one of the following alternatives:
 
 
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+* Disable asio's I/O completion port backend by defining BOOST\_ASIO\_DISABLE\_IOCP.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+* Use the `close()` function to simultaneously cancel the outstanding operations and close the socket.
 
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 buffered_write_stream::peek (2 of 2 overloads)]
+[section:close basic_stream_socket::close]
 
+[indexterm2 close..basic_stream_socket]
+Close the socket.
 
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
+ void ``[link boost_asio.reference.basic_stream_socket.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.close.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.close.overload2 close]``(
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.close.overload2 more...]]``
 
 
+[section:overload1 basic_stream_socket::close (1 of 2 overloads)]
 
-[endsect]
-
-
-[endsect]
 
-[section:read_some buffered_write_stream::read_some]
+['Inherited from basic_socket.]
 
-[indexterm2 read_some..buffered_write_stream]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
+Close the socket.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.read_some.overload1 more...]]``
 
+ void close();
 
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.read_some.overload2 more...]]``
 
+[heading Exceptions]
+
 
-[section:overload1 buffered_write_stream::read_some (1 of 2 overloads)]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
 
 
 
@@ -33819,331 +35870,237 @@
 
 
 
-[section:overload2 buffered_write_stream::read_some (2 of 2 overloads)]
-
+[section:overload2 basic_stream_socket::close (2 of 2 overloads)]
 
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
+['Inherited from basic_socket.]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
 
+Close the socket.
 
 
-[endsect]
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
 
-[endsect]
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
-[section:write_some buffered_write_stream::write_some]
 
-[indexterm2 write_some..buffered_write_stream]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+[heading Parameters]
+
 
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.write_some.overload1 more...]]``
+]
 
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw.
+[heading Example]
+
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.write_some.overload2 more...]]``
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
-[section:overload1 buffered_write_stream::write_some (1 of 2 overloads)]
 
 
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call `shutdown()` before closing the socket.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
+[section:connect basic_stream_socket::connect]
 
+[indexterm2 connect..basic_stream_socket]
+Connect the socket to the specified endpoint.
 
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw.
 
+ void ``[link boost_asio.reference.basic_stream_socket.connect.overload1 connect]``(
+ const endpoint_type & peer_endpoint);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.connect.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.connect.overload2 more...]]``
 
 
+[section:overload1 basic_stream_socket::connect (1 of 2 overloads)]
 
-[endsect]
 
+['Inherited from basic_socket.]
 
-[endsect]
 
+Connect the socket to the specified endpoint.
 
-[endsect]
 
+ void connect(
+ const endpoint_type & peer_endpoint);
 
-[section:buffers_begin buffers_begin]
 
-[indexterm1 buffers_begin]
-Construct an iterator representing the beginning of the buffers' data.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
 
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
- template<
- typename BufferSequence>
- buffers_iterator< BufferSequence > buffers_begin(
- const BufferSequence & buffers);
 
+[heading Parameters]
+
 
-[heading Requirements]
+[variablelist
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Exceptions]
+
 
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-[section:buffers_end buffers_end]
+[heading Example]
+
 
-[indexterm1 buffers_end]
-Construct an iterator representing the end of the buffers' data.
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.connect(endpoint);
 
- template<
- typename BufferSequence>
- buffers_iterator< BufferSequence > buffers_end(
- const BufferSequence & buffers);
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:buffers_iterator buffers_iterator]
-
-
-A random access iterator over the bytes in a buffer sequence.
-
 
- template<
- typename BufferSequence,
- typename ByteType = char>
- class buffers_iterator
+[section:overload2 basic_stream_socket::connect (2 of 2 overloads)]
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+['Inherited from basic_socket.]
 
- [
- [[link boost_asio.reference.buffers_iterator.begin [*begin]]]
- [Construct an iterator representing the beginning of the buffers' data. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.buffers_iterator [*buffers_iterator]]]
- [Default constructor. Creates an iterator in an undefined state. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.end [*end]]]
- [Construct an iterator representing the end of the buffers' data. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
 
- Increment operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_plus__eq_ [*operator+=]]]
- [Addition operator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_minus__minus_ [*operator--]]]
- [Decrement operator (prefix).
+Connect the socket to the specified endpoint.
 
- Decrement operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_minus__eq_ [*operator-=]]]
- [Subtraction operator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_lb__rb_ [*operator\[\]]]]
- [Access an individual element. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
 
- [
- [[link boost_asio.reference.buffers_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_plus_ [*operator+]]]
- [Addition operator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_minus_ [*operator-]]]
- [Subtraction operator. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_lt_ [*operator<]]]
- [Compare two iterators. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_lt__eq_ [*operator<=]]]
- [Compare two iterators. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_gt_ [*operator>]]]
- [Compare two iterators. ]
- ]
-
- [
- [[link boost_asio.reference.buffers_iterator.operator_gt__eq_ [*operator>=]]]
- [Compare two iterators. ]
- ]
-
-]
 
-[heading Requirements]
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is not returned to the closed state.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[section:begin buffers_iterator::begin]
+[variablelist
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
 
-[indexterm2 begin..buffers_iterator]
-Construct an iterator representing the beginning of the buffers' data.
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
- static buffers_iterator begin(
- const BufferSequence & buffers);
 
+[heading Example]
+
 
 
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ boost::system::error_code ec;
+ socket.connect(endpoint, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
 
-[section:buffers_iterator buffers_iterator::buffers_iterator]
 
-[indexterm2 buffers_iterator..buffers_iterator]
-Default constructor. Creates an iterator in an undefined state.
 
 
- buffers_iterator();
 
+[endsect]
 
 
 [endsect]
 
 
+[section:debug basic_stream_socket::debug]
 
-[section:end buffers_iterator::end]
 
-[indexterm2 end..buffers_iterator]
-Construct an iterator representing the end of the buffers' data.
+['Inherited from socket_base.]
 
+[indexterm2 debug..basic_stream_socket]
+Socket option to enable socket-level debugging.
 
- static buffers_iterator end(
- const BufferSequence & buffers);
 
+ typedef implementation_defined debug;
 
 
-[endsect]
 
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
 
 
-[section:operator__star_ buffers_iterator::operator *]
+[heading Examples]
+
+Setting the option:
 
-[indexterm2 operator *..buffers_iterator]
-Dereference an iterator.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
 
 
- byte_type & operator *() const;
 
 
 
-[endsect]
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
-[section:operator_not__eq_ buffers_iterator::operator!=]
 
-[indexterm2 operator!=..buffers_iterator]
-Test two iterators for inequality.
 
 
- friend bool operator!=(
- const buffers_iterator & a,
- const buffers_iterator & b);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -34151,59 +36108,53 @@
 [endsect]
 
 
-[section:operator_plus_ buffers_iterator::operator+]
 
-[indexterm2 operator+..buffers_iterator]
-Addition operator.
+[section:do_not_route basic_stream_socket::do_not_route]
 
 
- friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload1 operator+]``(
- const buffers_iterator & iter,
- std::ptrdiff_t difference);
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload1 more...]]``
+['Inherited from socket_base.]
 
- friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload2 operator+]``(
- std::ptrdiff_t difference,
- const buffers_iterator & iter);
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload2 more...]]``
+[indexterm2 do_not_route..basic_stream_socket]
+Socket option to prevent routing, use local interfaces only.
 
 
-[section:overload1 buffers_iterator::operator+ (1 of 2 overloads)]
+ typedef implementation_defined do_not_route;
 
 
-Addition operator.
 
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
 
- friend buffers_iterator operator+(
- const buffers_iterator & iter,
- std::ptrdiff_t difference);
 
+[heading Examples]
+
+Setting the option:
 
-[heading Requirements]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
 
+Getting the current option value:
 
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
-[section:overload2 buffers_iterator::operator+ (2 of 2 overloads)]
 
 
-Addition operator.
 
 
- friend buffers_iterator operator+(
- std::ptrdiff_t difference,
- const buffers_iterator & iter);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -34211,247 +36162,274 @@
 [endsect]
 
 
-[endsect]
 
-[section:operator_plus__plus_ buffers_iterator::operator++]
+[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
 
-[indexterm2 operator++..buffers_iterator]
-Increment operator (prefix).
 
+['Inherited from socket_base.]
 
- buffers_iterator & ``[link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload1 operator++]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload1 more...]]``
+[indexterm2 enable_connection_aborted..basic_stream_socket]
+Socket option to report aborted connections on accept.
 
 
-Increment operator (postfix).
+ typedef implementation_defined enable_connection_aborted;
 
 
- buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload2 operator++]``(
- int );
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload2 more...]]``
 
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with `boost::asio::error::connection_aborted`. By default the option is false.
 
-[section:overload1 buffers_iterator::operator++ (1 of 2 overloads)]
 
+[heading Examples]
+
+Setting the option:
 
-Increment operator (prefix).
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
 
 
- buffers_iterator & operator++();
 
 
 
-[endsect]
+Getting the current option value:
 
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
 
-[section:overload2 buffers_iterator::operator++ (2 of 2 overloads)]
 
 
-Increment operator (postfix).
 
 
- buffers_iterator operator++(
- int );
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:operator_plus__eq_ buffers_iterator::operator+=]
 
-[indexterm2 operator+=..buffers_iterator]
-Addition operator.
+[section:endpoint_type basic_stream_socket::endpoint_type]
 
+[indexterm2 endpoint_type..basic_stream_socket]
+The endpoint type.
 
- buffers_iterator & operator+=(
- std::ptrdiff_t difference);
 
+ typedef Protocol::endpoint endpoint_type;
 
 
-[endsect]
 
+[heading Requirements]
 
-[section:operator_minus_ buffers_iterator::operator-]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[indexterm2 operator-..buffers_iterator]
-Subtraction operator.
+[*Convenience header: ][^boost/asio.hpp]
 
 
- friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_minus_.overload1 operator-]``(
- const buffers_iterator & iter,
- std::ptrdiff_t difference);
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus_.overload1 more...]]``
+[endsect]
 
- friend std::ptrdiff_t ``[link boost_asio.reference.buffers_iterator.operator_minus_.overload2 operator-]``(
- const buffers_iterator & a,
- const buffers_iterator & b);
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus_.overload2 more...]]``
 
 
-[section:overload1 buffers_iterator::operator- (1 of 2 overloads)]
+[section:get_io_service basic_stream_socket::get_io_service]
 
 
-Subtraction operator.
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..basic_stream_socket]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
- friend buffers_iterator operator-(
- const buffers_iterator & iter,
- std::ptrdiff_t difference);
+ boost::asio::io_service & get_io_service();
 
 
-[heading Requirements]
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:get_option basic_stream_socket::get_option]
 
-[section:overload2 buffers_iterator::operator- (2 of 2 overloads)]
+[indexterm2 get_option..basic_stream_socket]
+Get an option from the socket.
 
 
-Subtraction operator.
+ void ``[link boost_asio.reference.basic_stream_socket.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.get_option.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.get_option.overload2 more...]]``
 
- friend std::ptrdiff_t operator-(
- const buffers_iterator & a,
- const buffers_iterator & b);
 
+[section:overload1 basic_stream_socket::get_option (1 of 2 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+['Inherited from basic_socket.]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Get an option from the socket.
 
-[endsect]
 
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option) const;
 
-[endsect]
 
-[section:operator_minus__minus_ buffers_iterator::operator--]
+This function is used to get the current value of an option on the socket.
 
-[indexterm2 operator--..buffers_iterator]
-Decrement operator (prefix).
 
+[heading Parameters]
+
 
- buffers_iterator & ``[link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload1 operator--]``();
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload1 more...]]``
+[variablelist
+
+[[option][The option value to be obtained from the socket.]]
 
+]
 
-Decrement operator (postfix).
 
+[heading Exceptions]
+
 
- buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload2 operator--]``(
- int );
- `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload2 more...]]``
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:overload1 buffers_iterator::operator-- (1 of 2 overloads)]
 
 
-Decrement operator (prefix).
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
 
- buffers_iterator & operator--();
 
 
 
-[endsect]
 
 
 
-[section:overload2 buffers_iterator::operator-- (2 of 2 overloads)]
+[endsect]
 
 
-Decrement operator (postfix).
 
+[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
 
- buffers_iterator operator--(
- int );
 
+['Inherited from basic_socket.]
 
 
-[endsect]
+Get an option from the socket.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
-[section:operator_minus__eq_ buffers_iterator::operator-=]
+This function is used to get the current value of an option on the socket.
 
-[indexterm2 operator-=..buffers_iterator]
-Subtraction operator.
 
+[heading Parameters]
+
 
- buffers_iterator & operator-=(
- std::ptrdiff_t difference);
+[variablelist
+
+[[option][The option value to be obtained from the socket.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-[endsect]
 
 
+[heading Example]
+
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ boost::system::error_code ec;
+ socket.get_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ bool is_set = option.get();
 
-[section:operator_arrow_ buffers_iterator::operator->]
 
-[indexterm2 operator->..buffers_iterator]
-Dereference an iterator.
 
 
- byte_type * operator->() const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:operator_lt_ buffers_iterator::operator<]
 
-[indexterm2 operator<..buffers_iterator]
-Compare two iterators.
+[section:implementation basic_stream_socket::implementation]
 
 
- friend bool operator<(
- const buffers_iterator & a,
- const buffers_iterator & b);
+['Inherited from basic_io_object.]
 
+[indexterm2 implementation..basic_stream_socket]
+The underlying implementation of the I/O object.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+ implementation_type implementation;
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_lt__eq_ buffers_iterator::operator<=]
+[section:implementation_type basic_stream_socket::implementation_type]
 
-[indexterm2 operator<=..buffers_iterator]
-Compare two iterators.
 
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation_type..basic_stream_socket]
+The underlying implementation type of I/O object.
+
+
+ typedef service_type::implementation_type implementation_type;
 
- friend bool operator<=(
- const buffers_iterator & a,
- const buffers_iterator & b);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -34459,154 +36437,150 @@
 [endsect]
 
 
+[section:io_control basic_stream_socket::io_control]
 
-[section:operator_eq__eq_ buffers_iterator::operator==]
-
-[indexterm2 operator==..buffers_iterator]
-Test two iterators for equality.
+[indexterm2 io_control..basic_stream_socket]
+Perform an IO control command on the socket.
 
 
- friend bool operator==(
- const buffers_iterator & a,
- const buffers_iterator & b);
+ void ``[link boost_asio.reference.basic_stream_socket.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.io_control.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.io_control.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+['Inherited from basic_socket.]
 
-[endsect]
 
+Perform an IO control command on the socket.
 
 
-[section:operator_gt_ buffers_iterator::operator>]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
-[indexterm2 operator>..buffers_iterator]
-Compare two iterators.
 
+This function is used to execute an IO control command on the socket.
 
- friend bool operator>(
- const buffers_iterator & a,
- const buffers_iterator & b);
 
+[heading Parameters]
+
 
-[heading Requirements]
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
+]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Exceptions]
+
 
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-[section:operator_gt__eq_ buffers_iterator::operator>=]
 
-[indexterm2 operator>=..buffers_iterator]
-Compare two iterators.
+[heading Example]
+
+Getting the number of bytes ready to read:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
 
- friend bool operator>=(
- const buffers_iterator & a,
- const buffers_iterator & b);
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffers_iterator.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_lb__rb_ buffers_iterator::operator\[\]]
+[section:overload2 basic_stream_socket::io_control (2 of 2 overloads)]
 
-[indexterm2 operator\[\]..buffers_iterator]
-Access an individual element.
 
+['Inherited from basic_socket.]
 
- byte_type & operator[](
- std::ptrdiff_t difference) const;
 
+Perform an IO control command on the socket.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
 
+This function is used to execute an IO control command on the socket.
 
-[endsect]
 
-[section:const_buffer const_buffer]
+[heading Parameters]
+
 
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
 
-Holds a buffer that cannot be modified.
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
- class const_buffer
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Example]
+
+Getting the number of bytes ready to read:
 
- [
- [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ boost::system::error_code ec;
+ socket.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
 
- Construct a buffer to represent a given memory range.
 
- Construct a non-modifiable buffer from a modifiable one. ]
- ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.const_buffer.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
- [Create a new non-modifiable buffer that is offset from the start of another. ]
- ]
-
-]
 
-The [link boost_asio.reference.const_buffer `const_buffer`] class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[endsect]
 
-[section:buffer_cast const_buffer::buffer_cast]
 
-[indexterm2 buffer_cast..const_buffer]
-Cast a non-modifiable buffer to a specified pointer to POD type.
+[section:is_open basic_stream_socket::is_open]
 
 
- template<
- typename PointerToPodType>
- PointerToPodType buffer_cast(
- const const_buffer & b);
+['Inherited from basic_socket.]
+
+[indexterm2 is_open..basic_stream_socket]
+Determine whether the socket is open.
+
+
+ bool is_open() const;
 
 
 
@@ -34614,307 +36588,267 @@
 
 
 
-[section:buffer_size const_buffer::buffer_size]
+[section:keep_alive basic_stream_socket::keep_alive]
 
-[indexterm2 buffer_size..const_buffer]
-Get the number of bytes in a non-modifiable buffer.
 
+['Inherited from socket_base.]
 
- std::size_t buffer_size(
- const const_buffer & b);
+[indexterm2 keep_alive..basic_stream_socket]
+Socket option to send keep-alives.
 
 
+ typedef implementation_defined keep_alive;
 
-[endsect]
 
 
-[section:const_buffer const_buffer::const_buffer]
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
 
-[indexterm2 const_buffer..const_buffer]
-Construct an empty buffer.
 
+[heading Examples]
+
+Setting the option:
 
- ``[link boost_asio.reference.const_buffer.const_buffer.overload1 const_buffer]``();
- `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload1 more...]]``
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
 
 
-Construct a buffer to represent a given memory range.
 
 
- ``[link boost_asio.reference.const_buffer.const_buffer.overload2 const_buffer]``(
- const void * data,
- std::size_t size);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload2 more...]]``
 
+Getting the current option value:
 
-Construct a non-modifiable buffer from a modifiable one.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
 
 
- ``[link boost_asio.reference.const_buffer.const_buffer.overload3 const_buffer]``(
- const mutable_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload3 more...]]``
 
 
-[section:overload1 const_buffer::const_buffer (1 of 3 overloads)]
 
 
-Construct an empty buffer.
 
+[heading Requirements]
 
- const_buffer();
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 const_buffer::const_buffer (2 of 3 overloads)]
+[section:linger basic_stream_socket::linger]
 
 
-Construct a buffer to represent a given memory range.
+['Inherited from socket_base.]
 
+[indexterm2 linger..basic_stream_socket]
+Socket option to specify whether the socket lingers on close if unsent data is present.
 
- const_buffer(
- const void * data,
- std::size_t size);
 
+ typedef implementation_defined linger;
 
 
-[endsect]
 
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
 
 
-[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
 
 
-Construct a non-modifiable buffer from a modifiable one.
 
 
- const_buffer(
- const mutable_buffer & b);
 
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option;
+ socket.get_option(option);
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
 
 
-[endsect]
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-[section:operator_plus_ const_buffer::operator+]
 
-[indexterm2 operator+..const_buffer]
-Create a new non-modifiable buffer that is offset from the start of another.
+[section:local_endpoint basic_stream_socket::local_endpoint]
 
+[indexterm2 local_endpoint..basic_stream_socket]
+Get the local endpoint of the socket.
 
- const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload1 operator+]``(
- const const_buffer & b,
- std::size_t start);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffer.operator_plus_.overload1 more...]]``
 
- const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const const_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffer.operator_plus_.overload2 more...]]``
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 more...]]``
 
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 more...]]``
 
-[section:overload1 const_buffer::operator+ (1 of 2 overloads)]
 
+[section:overload1 basic_stream_socket::local_endpoint (1 of 2 overloads)]
 
-Create a new non-modifiable buffer that is offset from the start of another.
 
+['Inherited from basic_socket.]
 
- const_buffer operator+(
- const const_buffer & b,
- std::size_t start);
 
+Get the local endpoint of the socket.
 
 
-[endsect]
+ endpoint_type local_endpoint() const;
 
 
+This function is used to obtain the locally bound endpoint of the socket.
 
-[section:overload2 const_buffer::operator+ (2 of 2 overloads)]
 
+[heading Return Value]
+
+An object that represents the local endpoint of the socket.
 
-Create a new non-modifiable buffer that is offset from the start of another.
 
+[heading Exceptions]
+
 
- const_buffer operator+(
- std::size_t start,
- const const_buffer & b);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
 
 
 
-[endsect]
 
 
-[endsect]
 
 
 [endsect]
 
-[section:const_buffers_1 const_buffers_1]
 
 
-Adapts a single non-modifiable buffer so that it meets the requirements of the ConstBufferSequence concept.
+[section:overload2 basic_stream_socket::local_endpoint (2 of 2 overloads)]
 
 
- class const_buffers_1 :
- public const_buffer
+['Inherited from basic_socket.]
 
 
-[heading Types]
-[table
- [[Name][Description]]
+Get the local endpoint of the socket.
 
- [
 
- [[link boost_asio.reference.const_buffers_1.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
-
- ]
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
 
- [
 
- [[link boost_asio.reference.const_buffers_1.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+This function is used to obtain the locally bound endpoint of the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.const_buffers_1.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffers_1.const_buffers_1 [*const_buffers_1]]]
- [Construct to represent a given memory range.
 
- Construct to represent a single non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffers_1.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
- ]
-
-]
+[heading Return Value]
+
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.const_buffers_1.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffers_1.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffers_1.operator_plus_ [*operator+]]]
- [Create a new non-modifiable buffer that is offset from the start of another. ]
- ]
+[heading Example]
   
-]
-
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-[section:begin const_buffers_1::begin]
 
-[indexterm2 begin..const_buffers_1]
-Get a random-access iterator to the first element.
 
 
- const_iterator begin() const;
 
 
 
 [endsect]
 
 
-
-[section:buffer_cast const_buffers_1::buffer_cast]
-
-
-['Inherited from const_buffer.]
-
-[indexterm2 buffer_cast..const_buffers_1]
-Cast a non-modifiable buffer to a specified pointer to POD type.
-
-
- template<
- typename PointerToPodType>
- PointerToPodType buffer_cast(
- const const_buffer & b);
-
-
-
 [endsect]
 
+[section:lowest_layer basic_stream_socket::lowest_layer]
 
+[indexterm2 lowest_layer..basic_stream_socket]
+Get a reference to the lowest layer.
 
-[section:buffer_size const_buffers_1::buffer_size]
-
-
-['Inherited from const_buffer.]
-
-[indexterm2 buffer_size..const_buffers_1]
-Get the number of bytes in a non-modifiable buffer.
-
-
- std::size_t buffer_size(
- const const_buffer & b);
 
+ lowest_layer_type & ``[link boost_asio.reference.basic_stream_socket.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.lowest_layer.overload1 more...]]``
 
 
-[endsect]
+Get a const reference to the lowest layer.
 
 
-[section:const_buffers_1 const_buffers_1::const_buffers_1]
+ const lowest_layer_type & ``[link boost_asio.reference.basic_stream_socket.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.lowest_layer.overload2 more...]]``
 
-[indexterm2 const_buffers_1..const_buffers_1]
-Construct to represent a given memory range.
 
+[section:overload1 basic_stream_socket::lowest_layer (1 of 2 overloads)]
 
- ``[link boost_asio.reference.const_buffers_1.const_buffers_1.overload1 const_buffers_1]``(
- const void * data,
- std::size_t size);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.const_buffers_1.overload1 more...]]``
 
+['Inherited from basic_socket.]
 
-Construct to represent a single non-modifiable buffer.
 
+Get a reference to the lowest layer.
 
- explicit ``[link boost_asio.reference.const_buffers_1.const_buffers_1.overload2 const_buffers_1]``(
- const const_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.const_buffers_1.overload2 more...]]``
 
+ lowest_layer_type & lowest_layer();
 
-[section:overload1 const_buffers_1::const_buffers_1 (1 of 2 overloads)]
 
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
-Construct to represent a given memory range.
 
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
- const_buffers_1(
- const void * data,
- std::size_t size);
 
 
 
@@ -34922,216 +36856,201 @@
 
 
 
-[section:overload2 const_buffers_1::const_buffers_1 (2 of 2 overloads)]
-
-
-Construct to represent a single non-modifiable buffer.
-
-
- const_buffers_1(
- const const_buffer & b);
-
-
-
-[endsect]
+[section:overload2 basic_stream_socket::lowest_layer (2 of 2 overloads)]
 
 
-[endsect]
+['Inherited from basic_socket.]
 
 
-[section:const_iterator const_buffers_1::const_iterator]
+Get a const reference to the lowest layer.
 
-[indexterm2 const_iterator..const_buffers_1]
-A random-access iterator type that may be used to read elements.
 
+ const lowest_layer_type & lowest_layer() const;
 
- typedef const const_buffer * const_iterator;
 
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.basic_socket `basic_socket`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Requirements]
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
-[*Header: ][^boost/asio/buffer.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-
-[section:end const_buffers_1::end]
-
-[indexterm2 end..const_buffers_1]
-Get a random-access iterator for one past the last element.
-
-
- const_iterator end() const;
-
-
-
 [endsect]
 
 
-[section:operator_plus_ const_buffers_1::operator+]
-
-[indexterm2 operator+..const_buffers_1]
-Create a new non-modifiable buffer that is offset from the start of another.
-
-
- const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload1 operator+]``(
- const const_buffer & b,
- std::size_t start);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.operator_plus_.overload1 more...]]``
-
- const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const const_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.operator_plus_.overload2 more...]]``
-
-
-[section:overload1 const_buffers_1::operator+ (1 of 2 overloads)]
-
-
-['Inherited from const_buffer.]
-
-
-Create a new non-modifiable buffer that is offset from the start of another.
-
-
- const_buffer operator+(
- const const_buffer & b,
- std::size_t start);
-
-
-
-[endsect]
+[section:lowest_layer_type basic_stream_socket::lowest_layer_type]
 
 
+['Inherited from basic_socket.]
 
-[section:overload2 const_buffers_1::operator+ (2 of 2 overloads)]
+[indexterm2 lowest_layer_type..basic_stream_socket]
+A [link boost_asio.reference.basic_socket `basic_socket`] is always the lowest layer.
 
 
-['Inherited from const_buffer.]
+ typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
 
 
-Create a new non-modifiable buffer that is offset from the start of another.
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
- const_buffer operator+(
- std::size_t start,
- const const_buffer & b);
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
 
-[endsect]
+ [
 
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
 
-[section:value_type const_buffers_1::value_type]
+ [
 
-[indexterm2 value_type..const_buffers_1]
-The type for each element in the list of buffers.
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
 
+ [
 
- typedef const_buffer value_type;
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
 
+ [
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
   [
- [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer.
 
- Construct a buffer to represent a given memory range.
-
- Construct a non-modifiable buffer from a modifiable one. ]
- ]
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
   
-]
-
-[heading Related Functions]
-[table
- [[Name][Description]]
+ ]
 
   [
- [[link boost_asio.reference.const_buffer.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
+
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
   
- [
- [[link boost_asio.reference.const_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
   ]
-
+
   [
- [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
- [Create a new non-modifiable buffer that is offset from the start of another. ]
- ]
-
-]
 
-The [link boost_asio.reference.const_buffer `const_buffer`] class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
 
+ [
 
-[heading Requirements]
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
 
-[*Header: ][^boost/asio/buffer.hpp]
+ [
 
-[*Convenience header: ][^boost/asio.hpp]
+ [[link boost_asio.reference.basic_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
 
-[endsect]
+ [
 
-[section:datagram_socket_service datagram_socket_service]
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
 
+ [
 
-Default service implementation for a datagram socket.
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
 
+ [
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class datagram_socket_service :
- public io_service::service
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
 
+ [
 
-[heading Types]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
 
   [
 
- [[link boost_asio.reference.datagram_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.datagram_socket_service.implementation_type [*implementation_type]]]
- [The type of a datagram socket. ]
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.datagram_socket_service.native_type [*native_type]]]
- [The native socket type. ]
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.datagram_socket_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
   
   ]
 
@@ -35142,210 +37061,225 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.datagram_socket_service.assign [*assign]]]
- [Assign an existing native socket to a datagram socket. ]
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.async_connect [*async_connect]]]
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
     [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.datagram_socket_service.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive that will get the endpoint of the sender. ]
- ]
-
- [
- [[link boost_asio.reference.datagram_socket_service.async_send [*async_send]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.basic_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it.
+
+ Construct and open a basic_socket.
+
+ Construct a basic_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_socket on an existing native socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.bind [*bind]]]
- []
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.basic_socket.close [*close]]]
+ [Close the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.close [*close]]]
- [Close a datagram socket implementation. ]
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.connect [*connect]]]
- [Connect the datagram socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.construct [*construct]]]
- [Construct a new datagram socket implementation. ]
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.datagram_socket_service [*datagram_socket_service]]]
- [Construct a new datagram socket service for the specified io_service. ]
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.destroy [*destroy]]]
- [Destroy a datagram socket implementation. ]
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.get_option [*get_option]]]
- [Get a socket option. ]
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.basic_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
+ [[link boost_asio.reference.basic_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.basic_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[link boost_asio.reference.basic_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.native [*native]]]
- [Get the native socket implementation. ]
+ [[link boost_asio.reference.basic_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.open [*open]]]
- []
+ [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.datagram_socket_service.receive_from [*receive_from]]]
- [Receive a datagram with the endpoint of the sender. ]
+ [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
   ]
   
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
   ]
   
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.datagram_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
   ]
-
+
   [
- [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
   ]
-
+
   [
- [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[link boost_asio.reference.basic_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
   ]
-
+
   [
- [[link boost_asio.reference.datagram_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
   ]
-
+
   [
- [[link boost_asio.reference.datagram_socket_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
   ]
-
+
 ]
 
-[heading Data Members]
+[heading Protected Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.datagram_socket_service.id [*id]]]
- [The unique service identifier. ]
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket.service [*service]]]
+ [The service associated with the I/O object. ]
   ]
 
 ]
 
-[heading Requirements]
+The [link boost_asio.reference.basic_socket `basic_socket`] class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
 
-[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
+[*Shared] [*objects:] Unsafe.
 
-[section:assign datagram_socket_service::assign]
 
-[indexterm2 assign..datagram_socket_service]
-Assign an existing native socket to a datagram socket.
 
 
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:async_connect datagram_socket_service::async_connect]
+[section:max_connections basic_stream_socket::max_connections]
 
-[indexterm2 async_connect..datagram_socket_service]
-Start an asynchronous connect.
 
+['Inherited from socket_base.]
 
- template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
+[indexterm2 max_connections..basic_stream_socket]
+The maximum length of the queue of pending incoming connections.
+
+
+ static const int max_connections = implementation_defined;
 
 
 
@@ -35353,101 +37287,74 @@
 
 
 
-[section:async_receive datagram_socket_service::async_receive]
+[section:message_do_not_route basic_stream_socket::message_do_not_route]
 
-[indexterm2 async_receive..datagram_socket_service]
-Start an asynchronous receive.
 
+['Inherited from socket_base.]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- ReadHandler handler);
+[indexterm2 message_do_not_route..basic_stream_socket]
+Specify that the data should not be subject to routing.
 
 
+ static const int message_do_not_route = implementation_defined;
 
-[endsect]
 
 
+[endsect]
 
-[section:async_receive_from datagram_socket_service::async_receive_from]
 
-[indexterm2 async_receive_from..datagram_socket_service]
-Start an asynchronous receive that will get the endpoint of the sender.
 
+[section:message_end_of_record basic_stream_socket::message_end_of_record]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive_from(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
- ReadHandler handler);
 
+['Inherited from socket_base.]
 
+[indexterm2 message_end_of_record..basic_stream_socket]
+Specifies that the data marks the end of a record.
 
-[endsect]
 
+ static const int message_end_of_record = implementation_defined;
 
 
-[section:async_send datagram_socket_service::async_send]
 
-[indexterm2 async_send..datagram_socket_service]
-Start an asynchronous send.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- WriteHandler handler);
+
+[section:message_flags basic_stream_socket::message_flags]
 
 
+['Inherited from socket_base.]
 
-[endsect]
+[indexterm2 message_flags..basic_stream_socket]
+Bitmask type for flags that can be passed to send and receive operations.
 
 
+ typedef int message_flags;
 
-[section:async_send_to datagram_socket_service::async_send_to]
 
-[indexterm2 async_send_to..datagram_socket_service]
-Start an asynchronous send.
 
+[heading Requirements]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send_to(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- const endpoint_type & destination,
- socket_base::message_flags flags,
- WriteHandler handler);
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:at_mark datagram_socket_service::at_mark]
+[section:message_out_of_band basic_stream_socket::message_out_of_band]
 
-[indexterm2 at_mark..datagram_socket_service]
-Determine whether the socket is at the out-of-band data mark.
 
+['Inherited from socket_base.]
+
+[indexterm2 message_out_of_band..basic_stream_socket]
+Process out-of-band data.
 
- bool at_mark(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+
+ static const int message_out_of_band = implementation_defined;
 
 
 
@@ -35455,195 +37362,316 @@
 
 
 
-[section:available datagram_socket_service::available]
+[section:message_peek basic_stream_socket::message_peek]
 
-[indexterm2 available..datagram_socket_service]
-Determine the number of bytes available for reading.
 
+['Inherited from socket_base.]
 
- std::size_t available(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+[indexterm2 message_peek..basic_stream_socket]
+Peek at incoming data without removing it from the input queue.
 
 
+ static const int message_peek = implementation_defined;
 
-[endsect]
 
 
+[endsect]
 
-[section:bind datagram_socket_service::bind]
 
-[indexterm2 bind..datagram_socket_service]
 
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+[section:native basic_stream_socket::native]
 
 
+['Inherited from basic_socket.]
 
-[endsect]
+[indexterm2 native..basic_stream_socket]
+(Deprecated: Use `native_handle()`.) Get the native socket representation.
 
 
+ native_type native();
 
-[section:cancel datagram_socket_service::cancel]
 
-[indexterm2 cancel..datagram_socket_service]
-Cancel all asynchronous operations associated with the socket.
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+[endsect]
 
 
 
-[endsect]
+[section:native_handle basic_stream_socket::native_handle]
 
 
+['Inherited from basic_socket.]
 
-[section:close datagram_socket_service::close]
+[indexterm2 native_handle..basic_stream_socket]
+Get the native socket representation.
 
-[indexterm2 close..datagram_socket_service]
-Close a datagram socket implementation.
 
+ native_handle_type native_handle();
 
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
 
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
 
 
 [endsect]
 
 
 
-[section:connect datagram_socket_service::connect]
+[section:native_handle_type basic_stream_socket::native_handle_type]
 
-[indexterm2 connect..datagram_socket_service]
-Connect the datagram socket to the specified endpoint.
+[indexterm2 native_handle_type..basic_stream_socket]
+The native representation of a socket.
 
 
- boost::system::error_code connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+ typedef StreamSocketService::native_handle_type native_handle_type;
 
 
 
-[endsect]
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:construct datagram_socket_service::construct]
 
-[indexterm2 construct..datagram_socket_service]
-Construct a new datagram socket implementation.
+[endsect]
 
 
- void construct(
- implementation_type & impl);
+[section:native_non_blocking basic_stream_socket::native_non_blocking]
 
+[indexterm2 native_non_blocking..basic_stream_socket]
+Gets the non-blocking mode of the native socket implementation.
 
 
-[endsect]
+ bool ``[link boost_asio.reference.basic_stream_socket.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.native_non_blocking.overload1 more...]]``
 
 
+Sets the non-blocking mode of the native socket implementation.
 
-[section:datagram_socket_service datagram_socket_service::datagram_socket_service]
 
-[indexterm2 datagram_socket_service..datagram_socket_service]
-Construct a new datagram socket service for the specified [link boost_asio.reference.io_service `io_service`].
+ void ``[link boost_asio.reference.basic_stream_socket.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.native_non_blocking.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.native_non_blocking.overload3 more...]]``
 
- datagram_socket_service(
- boost::asio::io_service & io_service);
 
+[section:overload1 basic_stream_socket::native_non_blocking (1 of 3 overloads)]
 
 
-[endsect]
+['Inherited from basic_socket.]
 
 
+Gets the non-blocking mode of the native socket implementation.
 
-[section:destroy datagram_socket_service::destroy]
 
-[indexterm2 destroy..datagram_socket_service]
-Destroy a datagram socket implementation.
+ bool native_non_blocking() const;
 
 
- void destroy(
- implementation_type & impl);
+This function is used to retrieve the non-blocking mode of the underlying native socket. This mode has no effect on the behaviour of the socket object's synchronous operations.
 
 
+[heading Return Value]
+
+`true` if the underlying socket is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
 
-[endsect]
 
+[heading Remarks]
+
+The current non-blocking mode is cached by the socket object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native socket.
 
 
-[section:endpoint_type datagram_socket_service::endpoint_type]
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
-[indexterm2 endpoint_type..datagram_socket_service]
-The endpoint type.
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
- typedef Protocol::endpoint endpoint_type;
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:get_io_service datagram_socket_service::get_io_service]
+[section:overload2 basic_stream_socket::native_non_blocking (2 of 3 overloads)]
 
 
-['Inherited from io_service.]
+['Inherited from basic_socket.]
 
-[indexterm2 get_io_service..datagram_socket_service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
+Sets the non-blocking mode of the native socket implementation.
 
- boost::asio::io_service & get_io_service();
 
+ void native_non_blocking(
+ bool mode);
 
 
-[endsect]
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
+[heading Parameters]
+
 
-[section:get_option datagram_socket_service::get_option]
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
-[indexterm2 get_option..datagram_socket_service]
-Get a socket option.
+]
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- const implementation_type & impl,
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
+]
 
-[endsect]
 
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
+
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
+
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
-[section:id datagram_socket_service::id]
 
-[indexterm2 id..datagram_socket_service]
-The unique service identifier.
 
 
- static boost::asio::io_service::id id;
 
 
 
@@ -35651,742 +37679,668 @@
 
 
 
-[section:implementation_type datagram_socket_service::implementation_type]
+[section:overload3 basic_stream_socket::native_non_blocking (3 of 3 overloads)]
 
-[indexterm2 implementation_type..datagram_socket_service]
-The type of a datagram socket.
 
+['Inherited from basic_socket.]
 
- typedef implementation_defined implementation_type;
 
+Sets the non-blocking mode of the native socket implementation.
 
 
-[heading Requirements]
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
-[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+This function is used to modify the non-blocking mode of the underlying native socket. It has no effect on the behaviour of the socket object's synchronous operations.
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the underlying socket is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense.]]
 
-[section:io_control datagram_socket_service::io_control]
+]
 
-[indexterm2 io_control..datagram_socket_service]
-Perform an IO control command on the socket.
 
+[heading Example]
+
+This function is intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The following example illustrates how Linux's `sendfile` system call might be encapsulated:
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
+ template <typename Handler>
+ struct sendfile_op
+ {
+ tcp::socket& sock_;
+ int fd_;
+ Handler handler_;
+ off_t offset_;
+ std::size_t total_bytes_transferred_;
+
+ // Function call operator meeting WriteHandler requirements.
+ // Used as the handler for the async_write_some operation.
+ void operator()(boost::system::error_code ec, std::size_t)
+ {
+ // Put the underlying socket into non-blocking mode.
+ if (!ec)
+ if (!sock_.native_non_blocking())
+ sock_.native_non_blocking(true, ec);
+
+ if (!ec)
+ {
+ for (;;)
+ {
+ // Try the system call.
+ errno = 0;
+ int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
+ ec = boost::system::error_code(n < 0 ? errno : 0,
+ boost::asio::error::get_system_category());
+ total_bytes_transferred_ += ec ? 0 : n;
+
+ // Retry operation immediately if interrupted by signal.
+ if (ec == boost::asio::error::interrupted)
+ continue;
+
+ // Check if we need to run the operation again.
+ if (ec == boost::asio::error::would_block
+ || ec == boost::asio::error::try_again)
+ {
+ // We have to wait for the socket to become ready again.
+ sock_.async_write_some(boost::asio::null_buffers(), *this);
+ return;
+ }
+
+ if (ec || n == 0)
+ {
+ // An error occurred, or we have reached the end of the file.
+ // Either way we must exit the loop so we can call the handler.
+ break;
+ }
+
+ // Loop around to try calling sendfile again.
+ }
+ }
 
+ // Pass result back to user's handler.
+ handler_(ec, total_bytes_transferred_);
+ }
+ };
 
+ template <typename Handler>
+ void async_sendfile(tcp::socket& sock, int fd, Handler h)
+ {
+ sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
+ sock.async_write_some(boost::asio::null_buffers(), op);
+ }
 
-[endsect]
 
 
 
-[section:io_service datagram_socket_service::io_service]
 
 
-['Inherited from io_service.]
 
-[indexterm2 io_service..datagram_socket_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[endsect]
 
 
- boost::asio::io_service & io_service();
+[endsect]
 
 
+[section:native_type basic_stream_socket::native_type]
 
-[endsect]
+[indexterm2 native_type..basic_stream_socket]
+(Deprecated: Use native\_handle\_type.) The native representation of a socket.
 
 
+ typedef StreamSocketService::native_handle_type native_type;
 
-[section:is_open datagram_socket_service::is_open]
 
-[indexterm2 is_open..datagram_socket_service]
-Determine whether the socket is open.
 
+[heading Requirements]
 
- bool is_open(
- const implementation_type & impl) const;
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:non_blocking basic_stream_socket::non_blocking]
 
-[section:local_endpoint datagram_socket_service::local_endpoint]
-
-[indexterm2 local_endpoint..datagram_socket_service]
-Get the local endpoint.
+[indexterm2 non_blocking..basic_stream_socket]
+Gets the non-blocking mode of the socket.
 
 
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ bool ``[link boost_asio.reference.basic_stream_socket.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.non_blocking.overload1 more...]]``
 
 
+Sets the non-blocking mode of the socket.
 
-[endsect]
 
+ void ``[link boost_asio.reference.basic_stream_socket.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.non_blocking.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.non_blocking.overload3 more...]]``
 
-[section:native datagram_socket_service::native]
 
-[indexterm2 native..datagram_socket_service]
-Get the native socket implementation.
+[section:overload1 basic_stream_socket::non_blocking (1 of 3 overloads)]
 
 
- native_type native(
- implementation_type & impl);
+['Inherited from basic_socket.]
 
 
+Gets the non-blocking mode of the socket.
 
-[endsect]
 
+ bool non_blocking() const;
 
 
-[section:native_type datagram_socket_service::native_type]
 
-[indexterm2 native_type..datagram_socket_service]
-The native socket type.
+[heading Return Value]
+
+`true` if the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
 
- typedef implementation_defined native_type;
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/datagram_socket_service.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload2 basic_stream_socket::non_blocking (2 of 3 overloads)]
 
 
+['Inherited from basic_socket.]
 
-[section:open datagram_socket_service::open]
 
-[indexterm2 open..datagram_socket_service]
+Sets the non-blocking mode of the socket.
 
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
 
+ void non_blocking(
+ bool mode);
 
 
-[endsect]
 
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
-[section:protocol_type datagram_socket_service::protocol_type]
+]
 
-[indexterm2 protocol_type..datagram_socket_service]
-The protocol type.
 
+[heading Exceptions]
+
 
- typedef Protocol protocol_type;
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
 
-[heading Requirements]
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
-[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:receive datagram_socket_service::receive]
+[section:overload3 basic_stream_socket::non_blocking (3 of 3 overloads)]
 
-[indexterm2 receive..datagram_socket_service]
-Receive some data from the peer.
 
+['Inherited from basic_socket.]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
+
+Sets the non-blocking mode of the socket.
+
+
+ boost::system::error_code non_blocking(
+ bool mode,
       boost::system::error_code & ec);
 
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the socket's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
-[section:receive_from datagram_socket_service::receive_from]
+]
 
-[indexterm2 receive_from..datagram_socket_service]
-Receive a datagram with the endpoint of the sender.
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive_from(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:remote_endpoint datagram_socket_service::remote_endpoint]
 
-[indexterm2 remote_endpoint..datagram_socket_service]
-Get the remote endpoint.
+[section:non_blocking_io basic_stream_socket::non_blocking_io]
 
 
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+['Inherited from socket_base.]
 
+[indexterm2 non_blocking_io..basic_stream_socket]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
 
-[endsect]
+ typedef implementation_defined non_blocking_io;
 
 
 
-[section:send datagram_socket_service::send]
+Implements the FIONBIO IO control command.
 
-[indexterm2 send..datagram_socket_service]
-Send the given data to the peer.
 
+[heading Example]
+
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
 
 
-[endsect]
 
 
 
-[section:send_to datagram_socket_service::send_to]
 
-[indexterm2 send_to..datagram_socket_service]
-Send a datagram to the specified endpoint.
 
+[heading Requirements]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send_to(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- const endpoint_type & destination,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:open basic_stream_socket::open]
 
-[section:set_option datagram_socket_service::set_option]
+[indexterm2 open..basic_stream_socket]
+Open the socket using the specified protocol.
 
-[indexterm2 set_option..datagram_socket_service]
-Set a socket option.
 
+ void ``[link boost_asio.reference.basic_stream_socket.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.open.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- implementation_type & impl,
- const SettableSocketOption & option,
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.open.overload2 open]``(
+ const protocol_type & protocol,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.open.overload2 more...]]``
 
 
+[section:overload1 basic_stream_socket::open (1 of 2 overloads)]
 
-[endsect]
 
+['Inherited from basic_socket.]
 
 
-[section:shutdown datagram_socket_service::shutdown]
+Open the socket using the specified protocol.
 
-[indexterm2 shutdown..datagram_socket_service]
-Disable sends or receives on the socket.
 
+ void open(
+ const protocol_type & protocol = protocol_type());
 
- boost::system::error_code shutdown(
- implementation_type & impl,
- socket_base::shutdown_type what,
- boost::system::error_code & ec);
 
+This function opens the socket so that it will use the specified protocol.
 
 
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
 
+]
 
 
-[section:shutdown_service datagram_socket_service::shutdown_service]
+[heading Exceptions]
+
 
-[indexterm2 shutdown_service..datagram_socket_service]
-Destroy all user-defined handler objects owned by the service.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
- virtual void shutdown_service();
 
+[heading Example]
+
 
 
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
 
 
 
-[endsect]
 
 
-[section:deadline_timer deadline_timer]
 
-[indexterm1 deadline_timer]
-Typedef for the typical usage of timer. Uses a UTC clock.
 
+[endsect]
 
- typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[section:overload2 basic_stream_socket::open (2 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.basic_deadline_timer.duration_type [*duration_type]]]
- [The duration type. ]
-
- ]
+['Inherited from basic_socket.]
 
- [
 
- [[link boost_asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+Open the socket using the specified protocol.
 
- [
 
- [[link boost_asio.reference.basic_deadline_timer.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
 
- [
 
- [[link boost_asio.reference.basic_deadline_timer.time_type [*time_type]]]
- [The time type. ]
-
- ]
+This function opens the socket so that it will use the specified protocol.
 
- [
 
- [[link boost_asio.reference.basic_deadline_timer.traits_type [*traits_type]]]
- [The time traits type. ]
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[protocol][An object specifying which protocol is to be used.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.async_wait [*async_wait]]]
- [Start an asynchronous wait on the timer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.basic_deadline_timer [*basic_deadline_timer]]]
- [Constructor.
-
- Constructor to set a particular expiry time as an absolute time.
-
- Constructor to set a particular expiry time relative to now. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the timer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.expires_at [*expires_at]]]
- [Get the timer's expiry time as an absolute time.
 
- Set the timer's expiry time as an absolute time. ]
- ]
+[heading Example]
   
- [
- [[link boost_asio.reference.basic_deadline_timer.expires_from_now [*expires_from_now]]]
- [Get the timer's expiry time relative to now.
 
- Set the timer's expiry time relative to now. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.wait [*wait]]]
- [Perform a blocking wait on the timer. ]
- ]
-
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::system::error_code ec;
+ socket.open(boost::asio::ip::tcp::v4(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
- [
- [[link boost_asio.reference.basic_deadline_timer.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_deadline_timer.service [*service]]]
- [The service associated with the I/O object. ]
- ]
 
-]
 
-The [link boost_asio.reference.basic_deadline_timer `basic_deadline_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
 
-A deadline timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately.
 
-Most applications will use the `boost::asio::deadline_timer` typedef.
 
+[endsect]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[endsect]
 
 
-[heading Examples]
-
-Performing a blocking wait:
+[section:protocol_type basic_stream_socket::protocol_type]
 
- // Construct a timer without setting an expiry time.
- boost::asio::deadline_timer timer(io_service);
+[indexterm2 protocol_type..basic_stream_socket]
+The protocol type.
 
- // Set an expiry time relative to now.
- timer.expires_from_now(boost::posix_time::seconds(5));
 
- // Wait for the timer to expire.
- timer.wait();
+ typedef Protocol protocol_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-Performing an asynchronous wait:
+[*Convenience header: ][^boost/asio.hpp]
 
- void handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Timer expired.
- }
- }
 
- ...
+[endsect]
 
- // Construct a timer with an absolute expiry time.
- boost::asio::deadline_timer timer(io_service,
- boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
 
- // Start an asynchronous wait.
- timer.async_wait(handler);
+[section:read_some basic_stream_socket::read_some]
 
+[indexterm2 read_some..basic_stream_socket]
+Read some data from the socket.
 
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.read_some.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.read_some.overload2 more...]]``
 
-[heading Changing an active deadline_timer's expiry time]
-
 
+[section:overload1 basic_stream_socket::read_some (1 of 2 overloads)]
 
-Changing the expiry time of a timer while there are pending asynchronous waits causes those wait operations to be cancelled. To ensure that the action associated with the timer is performed only once, use something like this: used:
 
+Read some data from the socket.
 
 
- void on_some_event()
- {
- if (my_timer.expires_from_now(seconds(5)) > 0)
- {
- // We managed to cancel the timer. Start new asynchronous wait.
- my_timer.async_wait(on_timeout);
- }
- else
- {
- // Too late, timer has already expired!
- }
- }
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
- void on_timeout(const boost::system::error_code& e)
- {
- if (e != boost::asio::error::operation_aborted)
- {
- // Timer was not cancelled, take necessary action.
- }
- }
 
+This function is used to read data from the stream socket. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
 
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
 
-* The `boost::asio::basic_deadline_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled.
+]
 
 
-* If a wait handler is cancelled, the boost::system::error\_code passed to it contains the value `boost::asio::error::operation_aborted`.
+[heading Return Value]
+
+The number of bytes read.
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/deadline_timer.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
-[endsect]
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.read_some(boost::asio::buffer(data, size));
 
-[section:deadline_timer_service deadline_timer_service]
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-Default service implementation for a timer.
 
 
- template<
- typename TimeType,
- typename ``[link boost_asio.reference.TimeTraits TimeTraits]`` = boost::asio::time_traits<TimeType>>
- class deadline_timer_service :
- public io_service::service
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
- [The duration type. ]
-
- ]
+[section:overload2 basic_stream_socket::read_some (2 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.deadline_timer_service.implementation_type [*implementation_type]]]
- [The implementation type of the deadline timer. ]
-
- ]
+Read some data from the socket.
 
- [
 
- [[link boost_asio.reference.deadline_timer_service.time_type [*time_type]]]
- [The time type. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
- [
 
- [[link boost_asio.reference.deadline_timer_service.traits_type [*traits_type]]]
- [The time traits type. ]
-
- ]
+This function is used to read data from the stream socket. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
 
- [
- [[link boost_asio.reference.deadline_timer_service.async_wait [*async_wait]]]
- []
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.cancel [*cancel]]]
- [Cancel any asynchronous wait operations associated with the timer. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.construct [*construct]]]
- [Construct a new timer implementation. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.deadline_timer_service [*deadline_timer_service]]]
- [Construct a new timer service for the specified io_service. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.destroy [*destroy]]]
- [Destroy a timer implementation. ]
- ]
+[variablelist
   
- [
- [[link boost_asio.reference.deadline_timer_service.expires_at [*expires_at]]]
- [Get the expiry time for the timer as an absolute time.
+[[buffers][One or more buffers into which the data will be read.]]
 
- Set the expiry time for the timer as an absolute time. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.expires_from_now [*expires_from_now]]]
- [Get the expiry time for the timer relative to now.
+[[ec][Set to indicate what error occurred, if any.]]
 
- Set the expiry time for the timer relative to now. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
- ]
-
- [
- [[link boost_asio.reference.deadline_timer_service.wait [*wait]]]
- []
- ]
-
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.deadline_timer_service.id [*id]]]
- [The unique service identifier. ]
- ]
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
 
-]
 
-[heading Requirements]
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
-[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:async_wait deadline_timer_service::async_wait]
+[endsect]
 
-[indexterm2 async_wait..deadline_timer_service]
 
- template<
- typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
- void async_wait(
- implementation_type & impl,
- WaitHandler handler);
+[endsect]
 
+[section:receive basic_stream_socket::receive]
 
+[indexterm2 receive..basic_stream_socket]
+Receive some data on the socket.
 
-[endsect]
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload1 receive]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload2 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload2 more...]]``
 
-[section:cancel deadline_timer_service::cancel]
 
-[indexterm2 cancel..deadline_timer_service]
-Cancel any asynchronous wait operations associated with the timer.
+Receive some data on a connected socket.
 
 
- std::size_t cancel(
- implementation_type & impl,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload3 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.receive.overload3 more...]]``
 
 
-
-[endsect]
+[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
 
 
+Receive some data on the socket.
 
-[section:construct deadline_timer_service::construct]
 
-[indexterm2 construct..deadline_timer_service]
-Construct a new timer implementation.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers);
 
 
- void construct(
- implementation_type & impl);
+This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
 
+]
 
 
-[section:deadline_timer_service deadline_timer_service::deadline_timer_service]
+[heading Return Value]
+
+The number of bytes received.
 
-[indexterm2 deadline_timer_service..deadline_timer_service]
-Construct a new timer service for the specified [link boost_asio.reference.io_service `io_service`].
 
+[heading Exceptions]
+
 
- deadline_timer_service(
- boost::asio::io_service & io_service);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
+]
 
 
-[endsect]
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[section:destroy deadline_timer_service::destroy]
+ socket.receive(boost::asio::buffer(data, size));
 
-[indexterm2 destroy..deadline_timer_service]
-Destroy a timer implementation.
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- void destroy(
- implementation_type & impl);
 
 
 
@@ -36394,55 +38348,63 @@
 
 
 
-[section:duration_type deadline_timer_service::duration_type]
+[section:overload2 basic_stream_socket::receive (2 of 3 overloads)]
 
-[indexterm2 duration_type..deadline_timer_service]
-The duration type.
 
+Receive some data on the socket.
 
- typedef traits_type::duration_type duration_type;
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags);
 
 
-[heading Requirements]
+This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
 
-[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
 
-[endsect]
+[[flags][Flags specifying how the receive call is to be made.]]
 
+]
 
-[section:expires_at deadline_timer_service::expires_at]
 
-[indexterm2 expires_at..deadline_timer_service]
-Get the expiry time for the timer as an absolute time.
+[heading Return Value]
+
+The number of bytes received.
 
 
- time_type ``[link boost_asio.reference.deadline_timer_service.expires_at.overload1 expires_at]``(
- const implementation_type & impl) const;
- `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_at.overload1 more...]]``
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-Set the expiry time for the timer as an absolute time.
+]
 
 
- std::size_t ``[link boost_asio.reference.deadline_timer_service.expires_at.overload2 expires_at]``(
- implementation_type & impl,
- const time_type & expiry_time,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_at.overload2 more...]]``
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
-[section:overload1 deadline_timer_service::expires_at (1 of 2 overloads)]
+[heading Example]
+
+To receive into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ socket.receive(boost::asio::buffer(data, size), 0);
 
-Get the expiry time for the timer as an absolute time.
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- time_type expires_at(
- const implementation_type & impl) const;
 
 
 
@@ -36450,742 +38412,635 @@
 
 
 
-[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
+[section:overload3 basic_stream_socket::receive (3 of 3 overloads)]
 
 
-Set the expiry time for the timer as an absolute time.
+Receive some data on a connected socket.
 
 
- std::size_t expires_at(
- implementation_type & impl,
- const time_type & expiry_time,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
       boost::system::error_code & ec);
 
 
-
-[endsect]
+This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
 
 
-[endsect]
+[heading Parameters]
+
 
-[section:expires_from_now deadline_timer_service::expires_from_now]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
 
-[indexterm2 expires_from_now..deadline_timer_service]
-Get the expiry time for the timer relative to now.
+[[flags][Flags specifying how the receive call is to be made.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
- duration_type ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 expires_from_now]``(
- const implementation_type & impl) const;
- `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 more...]]``
+]
 
 
-Set the expiry time for the timer relative to now.
+[heading Return Value]
+
+The number of bytes received. Returns 0 if an error occurred.
 
 
- std::size_t ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload2 expires_from_now]``(
- implementation_type & impl,
- const duration_type & expiry_time,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_from_now.overload2 more...]]``
+[heading Remarks]
+
+The receive operation may not receive all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
-[section:overload1 deadline_timer_service::expires_from_now (1 of 2 overloads)]
 
 
-Get the expiry time for the timer relative to now.
+[endsect]
 
 
- duration_type expires_from_now(
- const implementation_type & impl) const;
+[endsect]
 
 
+[section:receive_buffer_size basic_stream_socket::receive_buffer_size]
 
-[endsect]
 
+['Inherited from socket_base.]
 
+[indexterm2 receive_buffer_size..basic_stream_socket]
+Socket option for the receive buffer size of a socket.
 
-[section:overload2 deadline_timer_service::expires_from_now (2 of 2 overloads)]
 
+ typedef implementation_defined receive_buffer_size;
 
-Set the expiry time for the timer relative to now.
 
 
- std::size_t expires_from_now(
- implementation_type & impl,
- const duration_type & expiry_time,
- boost::system::error_code & ec);
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
 
 
+[heading Examples]
+
+Setting the option:
 
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
 
 
-[endsect]
 
 
-[section:get_io_service deadline_timer_service::get_io_service]
 
+Getting the current option value:
 
-['Inherited from io_service.]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
-[indexterm2 get_io_service..deadline_timer_service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
 
- boost::asio::io_service & get_io_service();
 
 
 
-[endsect]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
-[section:id deadline_timer_service::id]
+[*Convenience header: ][^boost/asio.hpp]
 
-[indexterm2 id..deadline_timer_service]
-The unique service identifier.
 
+[endsect]
 
- static boost::asio::io_service::id id;
 
 
+[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
 
-[endsect]
 
+['Inherited from socket_base.]
 
+[indexterm2 receive_low_watermark..basic_stream_socket]
+Socket option for the receive low watermark.
 
-[section:implementation_type deadline_timer_service::implementation_type]
 
-[indexterm2 implementation_type..deadline_timer_service]
-The implementation type of the deadline timer.
+ typedef implementation_defined receive_low_watermark;
 
 
- typedef implementation_defined implementation_type;
 
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
 
 
-[heading Requirements]
+[heading Examples]
+
+Setting the option:
 
-[*Header: ][^boost/asio/deadline_timer_service.hpp]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
 
 
+Getting the current option value:
 
-[section:io_service deadline_timer_service::io_service]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-['Inherited from io_service.]
 
-[indexterm2 io_service..deadline_timer_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
 
- boost::asio::io_service & io_service();
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:shutdown_service deadline_timer_service::shutdown_service]
+[endsect]
 
-[indexterm2 shutdown_service..deadline_timer_service]
-Destroy all user-defined handler objects owned by the service.
 
+[section:remote_endpoint basic_stream_socket::remote_endpoint]
 
- virtual void shutdown_service();
+[indexterm2 remote_endpoint..basic_stream_socket]
+Get the remote endpoint of the socket.
 
 
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 more...]]``
 
-[endsect]
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 more...]]``
 
 
+[section:overload1 basic_stream_socket::remote_endpoint (1 of 2 overloads)]
 
-[section:time_type deadline_timer_service::time_type]
 
-[indexterm2 time_type..deadline_timer_service]
-The time type.
+['Inherited from basic_socket.]
 
 
- typedef traits_type::time_type time_type;
+Get the remote endpoint of the socket.
 
 
+ endpoint_type remote_endpoint() const;
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/deadline_timer_service.hpp]
+This function is used to obtain the remote endpoint of the socket.
 
-[*Convenience header: ][^boost/asio.hpp]
+
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket.
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:traits_type deadline_timer_service::traits_type]
 
-[indexterm2 traits_type..deadline_timer_service]
-The time traits type.
+[heading Example]
+
 
 
- typedef TimeTraits traits_type;
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:wait deadline_timer_service::wait]
+[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 overloads)]
 
-[indexterm2 wait..deadline_timer_service]
 
- void wait(
- implementation_type & impl,
- boost::system::error_code & ec);
+['Inherited from basic_socket.]
 
 
+Get the remote endpoint of the socket.
 
-[endsect]
 
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
 
 
-[endsect]
+This function is used to obtain the remote endpoint of the socket.
 
 
-[section:error__addrinfo_category error::addrinfo_category]
+[heading Parameters]
+
 
-[indexterm1 error::addrinfo_category]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
 
- static const boost::system::error_category & addrinfo_category = boost::asio::error::get_addrinfo_category();
+]
 
 
-[heading Requirements]
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Example]
+
 
 
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
 
 
-[section:error__addrinfo_errors error::addrinfo_errors]
 
-[indexterm1 error::addrinfo_errors]
 
- enum addrinfo_errors
 
-[indexterm2 service_not_found..error::addrinfo_errors]
-[indexterm2 socket_type_not_supported..error::addrinfo_errors]
 
-[heading Values]
-[variablelist
+[endsect]
 
- [
- [service_not_found]
- [The service is not supported for the given socket type. ]
- ]
 
- [
- [socket_type_not_supported]
- [The socket type is not supported. ]
- ]
+[endsect]
 
-]
 
+[section:reuse_address basic_stream_socket::reuse_address]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+['Inherited from socket_base.]
 
-[*Convenience header: ][^boost/asio.hpp]
+[indexterm2 reuse_address..basic_stream_socket]
+Socket option to allow the socket to be bound to an address that is already in use.
 
 
-[endsect]
+ typedef implementation_defined reuse_address;
 
 
 
-[section:error__basic_errors error::basic_errors]
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
 
-[indexterm1 error::basic_errors]
 
- enum basic_errors
+[heading Examples]
+
+Setting the option:
 
-[indexterm2 access_denied..error::basic_errors]
-[indexterm2 address_family_not_supported..error::basic_errors]
-[indexterm2 address_in_use..error::basic_errors]
-[indexterm2 already_connected..error::basic_errors]
-[indexterm2 already_started..error::basic_errors]
-[indexterm2 broken_pipe..error::basic_errors]
-[indexterm2 connection_aborted..error::basic_errors]
-[indexterm2 connection_refused..error::basic_errors]
-[indexterm2 connection_reset..error::basic_errors]
-[indexterm2 bad_descriptor..error::basic_errors]
-[indexterm2 fault..error::basic_errors]
-[indexterm2 host_unreachable..error::basic_errors]
-[indexterm2 in_progress..error::basic_errors]
-[indexterm2 interrupted..error::basic_errors]
-[indexterm2 invalid_argument..error::basic_errors]
-[indexterm2 message_size..error::basic_errors]
-[indexterm2 name_too_long..error::basic_errors]
-[indexterm2 network_down..error::basic_errors]
-[indexterm2 network_reset..error::basic_errors]
-[indexterm2 network_unreachable..error::basic_errors]
-[indexterm2 no_descriptors..error::basic_errors]
-[indexterm2 no_buffer_space..error::basic_errors]
-[indexterm2 no_memory..error::basic_errors]
-[indexterm2 no_permission..error::basic_errors]
-[indexterm2 no_protocol_option..error::basic_errors]
-[indexterm2 not_connected..error::basic_errors]
-[indexterm2 not_socket..error::basic_errors]
-[indexterm2 operation_aborted..error::basic_errors]
-[indexterm2 operation_not_supported..error::basic_errors]
-[indexterm2 shut_down..error::basic_errors]
-[indexterm2 timed_out..error::basic_errors]
-[indexterm2 try_again..error::basic_errors]
-[indexterm2 would_block..error::basic_errors]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
 
-[heading Values]
-[variablelist
 
- [
- [access_denied]
- [Permission denied. ]
- ]
 
- [
- [address_family_not_supported]
- [Address family not supported by protocol. ]
- ]
 
- [
- [address_in_use]
- [Address already in use. ]
- ]
 
- [
- [already_connected]
- [Transport endpoint is already connected. ]
- ]
+Getting the current option value:
 
- [
- [already_started]
- [Operation already in progress. ]
- ]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
 
- [
- [broken_pipe]
- [Broken pipe. ]
- ]
 
- [
- [connection_aborted]
- [A connection has been aborted. ]
- ]
 
- [
- [connection_refused]
- [Connection refused. ]
- ]
 
- [
- [connection_reset]
- [Connection reset by peer. ]
- ]
 
- [
- [bad_descriptor]
- [Bad file descriptor. ]
- ]
 
- [
- [fault]
- [Bad address. ]
- ]
 
- [
- [host_unreachable]
- [No route to host. ]
- ]
+[heading Requirements]
 
- [
- [in_progress]
- [Operation now in progress. ]
- ]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
- [
- [interrupted]
- [Interrupted system call. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [invalid_argument]
- [Invalid argument. ]
- ]
 
- [
- [message_size]
- [Message too long. ]
- ]
+[endsect]
 
- [
- [name_too_long]
- [The name was too long. ]
- ]
 
- [
- [network_down]
- [Network is down. ]
- ]
+[section:send basic_stream_socket::send]
 
- [
- [network_reset]
- [Network dropped connection on reset. ]
- ]
+[indexterm2 send..basic_stream_socket]
+Send some data on the socket.
 
- [
- [network_unreachable]
- [Network is unreachable. ]
- ]
 
- [
- [no_descriptors]
- [Too many open files. ]
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload1 send]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload1 more...]]``
 
- [
- [no_buffer_space]
- [No buffer space available. ]
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload2 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload2 more...]]``
 
- [
- [no_memory]
- [Cannot allocate memory. ]
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload3 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.send.overload3 more...]]``
 
- [
- [no_permission]
- [Operation not permitted. ]
- ]
 
- [
- [no_protocol_option]
- [Protocol not available. ]
- ]
+[section:overload1 basic_stream_socket::send (1 of 3 overloads)]
 
- [
- [not_connected]
- [Transport endpoint is not connected. ]
- ]
 
- [
- [not_socket]
- [Socket operation on non-socket. ]
- ]
+Send some data on the socket.
 
- [
- [operation_aborted]
- [Operation cancelled. ]
- ]
 
- [
- [operation_not_supported]
- [Operation not supported. ]
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers);
 
- [
- [shut_down]
- [Cannot send after transport endpoint shutdown. ]
- ]
 
- [
- [timed_out]
- [Connection timed out. ]
- ]
+This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
 
- [
- [try_again]
- [Resource temporarily unavailable. ]
- ]
 
- [
- [would_block]
- [The socket is marked non-blocking and the requested operation would block. ]
- ]
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket.]]
 
 ]
 
 
-[heading Requirements]
+[heading Return Value]
+
+The number of bytes sent.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
-[section:error__get_addrinfo_category error::get_addrinfo_category]
 
-[indexterm1 error::get_addrinfo_category]
+[heading Example]
+
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- const boost::system::error_category & get_addrinfo_category();
+ socket.send(boost::asio::buffer(data, size));
 
 
-[heading Requirements]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:error__get_misc_category error::get_misc_category]
-
-[indexterm1 error::get_misc_category]
-
- const boost::system::error_category & get_misc_category();
+[section:overload2 basic_stream_socket::send (2 of 3 overloads)]
 
 
-[heading Requirements]
+Send some data on the socket.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
 
 
-[endsect]
+This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
 
 
+[heading Parameters]
+
 
-[section:error__get_netdb_category error::get_netdb_category]
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket.]]
 
-[indexterm1 error::get_netdb_category]
+[[flags][Flags specifying how the send call is to be made.]]
 
- const boost::system::error_category & get_netdb_category();
+]
 
 
-[heading Requirements]
+[heading Return Value]
+
+The number of bytes sent.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
-[section:error__get_ssl_category error::get_ssl_category]
 
-[indexterm1 error::get_ssl_category]
+[heading Example]
+
+To send a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- const boost::system::error_category & get_ssl_category();
+ socket.send(boost::asio::buffer(data, size), 0);
 
 
-[heading Requirements]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:error__get_system_category error::get_system_category]
+[section:overload3 basic_stream_socket::send (3 of 3 overloads)]
 
-[indexterm1 error::get_system_category]
 
- const boost::system::error_category & get_system_category();
+Send some data on the socket.
 
 
-[heading Requirements]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket.]]
 
-[section:error__make_error_code error::make_error_code]
+[[flags][Flags specifying how the send call is to be made.]]
 
-[indexterm1 error::make_error_code]
-
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
- basic_errors e);
- `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload1 more...]]``
+[[ec][Set to indicate what error occurred, if any.]]
 
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
- netdb_errors e);
- `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload2 more...]]``
+]
 
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload3 make_error_code]``(
- addrinfo_errors e);
- `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload3 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload4 make_error_code]``(
- misc_errors e);
- `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload4 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload5 make_error_code]``(
- ssl_errors e);
- `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload5 more...]]``
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/error.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-
-[section:overload1 error::make_error_code (1 of 5 overloads)]
+[heading Return Value]
+
+The number of bytes sent. Returns 0 if an error occurred.
 
 
+[heading Remarks]
+
+The send operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
- boost::system::error_code make_error_code(
- basic_errors e);
 
 
 
 [endsect]
 
 
-
-[section:overload2 error::make_error_code (2 of 5 overloads)]
-
-
-
- boost::system::error_code make_error_code(
- netdb_errors e);
+[endsect]
 
 
+[section:send_buffer_size basic_stream_socket::send_buffer_size]
 
-[endsect]
 
+['Inherited from socket_base.]
 
+[indexterm2 send_buffer_size..basic_stream_socket]
+Socket option for the send buffer size of a socket.
 
-[section:overload3 error::make_error_code (3 of 5 overloads)]
 
+ typedef implementation_defined send_buffer_size;
 
 
- boost::system::error_code make_error_code(
- addrinfo_errors e);
 
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
 
 
-[endsect]
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
 
 
-[section:overload4 error::make_error_code (4 of 5 overloads)]
 
 
 
- boost::system::error_code make_error_code(
- misc_errors e);
+Getting the current option value:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
 
 
-[endsect]
 
 
 
-[section:overload5 error::make_error_code (5 of 5 overloads)]
 
 
+[heading Requirements]
 
- boost::system::error_code make_error_code(
- ssl_errors e);
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
 
+[section:send_low_watermark basic_stream_socket::send_low_watermark]
 
-[section:error__misc_category error::misc_category]
 
-[indexterm1 error::misc_category]
+['Inherited from socket_base.]
 
- static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
+[indexterm2 send_low_watermark..basic_stream_socket]
+Socket option for the send low watermark.
 
 
-[heading Requirements]
+ typedef implementation_defined send_low_watermark;
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
 
-[endsect]
 
+[heading Examples]
+
+Setting the option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
 
-[section:error__misc_errors error::misc_errors]
 
-[indexterm1 error::misc_errors]
 
- enum misc_errors
 
-[indexterm2 already_open..error::misc_errors]
-[indexterm2 eof..error::misc_errors]
-[indexterm2 not_found..error::misc_errors]
-[indexterm2 fd_set_failure..error::misc_errors]
 
-[heading Values]
-[variablelist
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
 
- [
- [already_open]
- [Already open. ]
- ]
 
- [
- [eof]
- [End of file or stream. ]
- ]
 
- [
- [not_found]
- [Element not found. ]
- ]
 
- [
- [fd_set_failure]
- [The descriptor cannot fit into the select system call's fd_set. ]
- ]
 
-]
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -37194,64 +39049,39 @@
 
 
 
-[section:error__netdb_category error::netdb_category]
+[section:service basic_stream_socket::service]
 
-[indexterm1 error::netdb_category]
 
- static const boost::system::error_category & netdb_category = boost::asio::error::get_netdb_category();
+['Inherited from basic_io_object.]
 
+[indexterm2 service..basic_stream_socket]
+The service associated with the I/O object.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+ service_type & service;
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:error__netdb_errors error::netdb_errors]
-
-[indexterm1 error::netdb_errors]
-
- enum netdb_errors
-
-[indexterm2 host_not_found..error::netdb_errors]
-[indexterm2 host_not_found_try_again..error::netdb_errors]
-[indexterm2 no_data..error::netdb_errors]
-[indexterm2 no_recovery..error::netdb_errors]
+[section:service_type basic_stream_socket::service_type]
 
-[heading Values]
-[variablelist
 
- [
- [host_not_found]
- [Host not found (authoritative). ]
- ]
+['Inherited from basic_io_object.]
 
- [
- [host_not_found_try_again]
- [Host not found (non-authoritative). ]
- ]
+[indexterm2 service_type..basic_stream_socket]
+The type of the service that will be used to provide I/O operations.
 
- [
- [no_data]
- [The query is valid but does not have associated address data. ]
- ]
 
- [
- [no_recovery]
- [A non-recoverable error occurred. ]
- ]
+ typedef StreamSocketService service_type;
 
-]
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+[*Header: ][^boost/asio/basic_stream_socket.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -37259,72 +39089,97 @@
 [endsect]
 
 
+[section:set_option basic_stream_socket::set_option]
 
-[section:error__ssl_category error::ssl_category]
+[indexterm2 set_option..basic_stream_socket]
+Set an option on the socket.
 
-[indexterm1 error::ssl_category]
 
- static const boost::system::error_category & ssl_category = boost::asio::error::get_ssl_category();
+ void ``[link boost_asio.reference.basic_stream_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.set_option.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.set_option.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+['Inherited from basic_socket.]
 
-[endsect]
 
+Set an option on the socket.
 
 
-[section:error__ssl_errors error::ssl_errors]
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
 
-[indexterm1 error::ssl_errors]
 
- enum ssl_errors
+This function is used to set an option on the socket.
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/error.hpp]
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+]
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:error__system_category error::system_category]
 
-[indexterm1 error::system_category]
 
- static const boost::system::error_category & system_category = boost::asio::error::get_system_category();
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
+
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:has_service has_service]
+[section:overload2 basic_stream_socket::set_option (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+
+Set an option on the socket.
 
-[indexterm1 has_service]
 
   template<
- typename ``[link boost_asio.reference.Service Service]``>
- bool has_service(
- io_service & ios);
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
 
-This function is used to determine whether the [link boost_asio.reference.io_service `io_service`] contains a service object corresponding to the given service type.
+This function is used to set an option on the socket.
 
 
 [heading Parameters]
@@ -37332,324 +39187,236 @@
 
 [variablelist
   
-[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
+[[option][The new option value to be set on the socket.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Return Value]
-
-A boolean indicating whether the [link boost_asio.reference.io_service `io_service`] contains the service.
 
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ boost::system::error_code ec;
+ socket.set_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
 
 
-[section:invalid_service_owner invalid_service_owner]
+[endsect]
 
 
-Exception thrown when trying to add a service object to an [link boost_asio.reference.io_service `io_service`] where the service has a different owner.
+[endsect]
 
+[section:shutdown basic_stream_socket::shutdown]
 
- class invalid_service_owner
+[indexterm2 shutdown..basic_stream_socket]
+Disable sends or receives on the socket.
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.shutdown.overload1 more...]]``
 
- [
- [[link boost_asio.reference.invalid_service_owner.invalid_service_owner [*invalid_service_owner]]]
- []
- ]
-
-]
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.shutdown.overload2 shutdown]``(
+ shutdown_type what,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.shutdown.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
+[section:overload1 basic_stream_socket::shutdown (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+['Inherited from basic_socket.]
 
-[section:invalid_service_owner invalid_service_owner::invalid_service_owner]
 
-[indexterm2 invalid_service_owner..invalid_service_owner]
+Disable sends or receives on the socket.
 
- invalid_service_owner();
 
+ void shutdown(
+ shutdown_type what);
 
 
-[endsect]
+This function is used to disable send operations, receive operations, or both.
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
 
-[section:io_service io_service]
+]
 
 
-Provides core I/O functionality.
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
- class io_service :
- noncopyable
+]
 
 
-[heading Types]
-[table
- [[Name][Description]]
+[heading Example]
+
+Shutting down the send side of the socket:
 
- [
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
 
- [[link boost_asio.reference.io_service__id [*id]]]
- [Class used to uniquely identify a service. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.io_service__service [*service]]]
- [Base class for all io_service services. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.io_service__strand [*strand]]]
- [Provides serialised handler execution. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.io_service__work [*work]]]
- [Class to inform the io_service when it has work to do. ]
-
- ]
+[endsect]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.io_service.dispatch [*dispatch]]]
- [Request the io_service to invoke the given handler. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.io_service [*io_service]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.poll [*poll]]]
- [Run the io_service object's event processing loop to execute ready handlers. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.poll_one [*poll_one]]]
- [Run the io_service object's event processing loop to execute one ready handler. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.post [*post]]]
- [Request the io_service to invoke the given handler and return immediately. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.reset [*reset]]]
- [Reset the io_service in preparation for a subsequent run() invocation. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.run [*run]]]
- [Run the io_service object's event processing loop. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.run_one [*run_one]]]
- [Run the io_service object's event processing loop to execute at most one handler. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.stop [*stop]]]
- [Stop the io_service object's event processing loop. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.wrap [*wrap]]]
- [Create a new handler that automatically dispatches the wrapped handler on the io_service. ]
- ]
-
- [
- [[link boost_asio.reference.io_service._io_service [*~io_service]]]
- [Destructor. ]
- ]
-
-]
+[section:overload2 basic_stream_socket::shutdown (2 of 2 overloads)]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.io_service.add_service [*add_service]]]
- [Add a service object to the io_service. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.has_service [*has_service]]]
- [Determine if an io_service contains a specified service type. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.use_service [*use_service]]]
- [Obtain the service object corresponding to the given type. ]
- ]
-
-]
+['Inherited from basic_socket.]
 
-The [link boost_asio.reference.io_service `io_service`] class provides the core I/O functionality for users of the asynchronous I/O objects, including:
 
+Disable sends or receives on the socket.
 
-* `boost::asio::ip::tcp::socket`
 
-* `boost::asio::ip::tcp::acceptor`
+ boost::system::error_code shutdown(
+ shutdown_type what,
+ boost::system::error_code & ec);
 
-* `boost::asio::ip::udp::socket`
 
-* `boost::asio::deadline_timer`.
+This function is used to disable send operations, receive operations, or both.
 
-The [link boost_asio.reference.io_service `io_service`] class also includes facilities intended for developers of custom asynchronous services.
 
+[heading Parameters]
+
 
-[heading Thread Safety]
+[variablelist
   
-[*Distinct] [*objects:] Safe.
+[[what][Determines what types of operation will no longer be allowed.]]
 
-[*Shared] [*objects:] Safe, with the exception that calling `reset()` while there are unfinished `run()`, `run_one()`, `poll()` or `poll_one()` calls results in undefined behaviour.
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[heading Synchronous and asynchronous operations]
+[heading Example]
   
+Shutting down the send side of the socket:
 
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-Synchronous operations on I/O objects implicitly run the [link boost_asio.reference.io_service `io_service`] object for an individual operation. The [link boost_asio.reference.io_service `io_service`] functions `run()`, `run_one()`, `poll()` or `poll_one()` must be called for the [link boost_asio.reference.io_service `io_service`] to perform asynchronous operations on behalf of a C++ program. Notification that an asynchronous operation has completed is delivered by invocation of the associated handler. Handlers are invoked only by a thread that is currently calling any overload of `run()`, `run_one()`, `poll()` or `poll_one()` for the [link boost_asio.reference.io_service `io_service`].
 
 
-[heading Effect of exceptions thrown from handlers]
-
 
 
-If an exception is thrown from a handler, the exception is allowed to propagate through the throwing thread's invocation of `run()`, `run_one()`, `poll()` or `poll_one()`. No other threads that are calling any of these functions are affected. It is then the responsibility of the application to catch the exception.
 
-After the exception has been caught, the `run()`, `run_one()`, `poll()` or `poll_one()` call may be restarted [*without] the need for an intervening call to `reset()`. This allows the thread to rejoin the [link boost_asio.reference.io_service `io_service`] object's thread pool without impacting any other threads in the pool.
 
-For example:
+[endsect]
 
 
+[endsect]
 
- boost::asio::io_service io_service;
- ...
- for (;;)
- {
- try
- {
- io_service.run();
- break; // run() exited normally
- }
- catch (my_exception& e)
- {
- // Deal with exception as appropriate.
- }
- }
 
+[section:shutdown_type basic_stream_socket::shutdown_type]
 
 
+['Inherited from socket_base.]
 
+[indexterm2 shutdown_type..basic_stream_socket]
+Different ways a socket may be shutdown.
 
-[heading Stopping the io_service from running out of work]
-
 
+ enum shutdown_type
 
-Some applications may need to prevent an [link boost_asio.reference.io_service `io_service`] object's `run()` call from returning when there is no more work to do. For example, the [link boost_asio.reference.io_service `io_service`] may be being run in a background thread that is launched prior to the application's asynchronous operations. The `run()` call may be kept running by creating an object of type [link boost_asio.reference.io_service__work `io_service::work`]:
+[indexterm2 shutdown_receive..basic_stream_socket]
+[indexterm2 shutdown_send..basic_stream_socket]
+[indexterm2 shutdown_both..basic_stream_socket]
 
+[heading Values]
+[variablelist
 
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
 
- boost::asio::io_service io_service;
- boost::asio::io_service::work work(io_service);
- ...
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
 
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
 
+]
 
 
-To effect a shutdown, the application will then need to call the [link boost_asio.reference.io_service `io_service`] object's `stop()` member function. This will cause the [link boost_asio.reference.io_service `io_service`] `run()` call to return as soon as possible, abandoning unfinished operations and without permitting ready handlers to be dispatched.
 
-Alternatively, if the application requires that all operations and handlers be allowed to finish normally, the work object may be explicitly destroyed.
+[endsect]
 
 
+[section:write_some basic_stream_socket::write_some]
 
- boost::asio::io_service io_service;
- auto_ptr<boost::asio::io_service::work> work(
- new boost::asio::io_service::work(io_service));
- ...
- work.reset(); // Allow run() to exit.
-
-
-
-
-
-[heading The io_service class and I/O services]
-
-
-
-Class [link boost_asio.reference.io_service `io_service`] implements an extensible, type-safe, polymorphic set of I/O services, indexed by service type. An object of class [link boost_asio.reference.io_service `io_service`] must be initialised before I/O objects such as sockets, resolvers and timers can be used. These I/O objects are distinguished by having constructors that accept an `io_service&` parameter.
-
-I/O services exist to manage the logical interface to the operating system on behalf of the I/O objects. In particular, there are resources that are shared across a class of I/O objects. For example, timers may be implemented in terms of a single timer queue. The I/O services manage these shared resources.
-
-Access to the services of an [link boost_asio.reference.io_service `io_service`] is via three function templates, `use_service()`, `add_service()` and `has_service()`.
-
-In a call to `use_service<Service>()`, the type argument chooses a service, making available all members of the named type. If `Service` is not present in an [link boost_asio.reference.io_service `io_service`], an object of type `Service` is created and added to the [link boost_asio.reference.io_service `io_service`]. A C++ program can check if an [link boost_asio.reference.io_service `io_service`] implements a particular service with the function template `has_service<Service>()`.
-
-Service objects may be explicitly added to an [link boost_asio.reference.io_service `io_service`] using the function template `add_service<Service>()`. If the `Service` is already present, the [link boost_asio.reference.service_already_exists `service_already_exists`] exception is thrown. If the owner of the service is not the same object as the [link boost_asio.reference.io_service `io_service`] parameter, the [link boost_asio.reference.invalid_service_owner `invalid_service_owner`] exception is thrown.
-
-Once a service reference is obtained from an [link boost_asio.reference.io_service `io_service`] object by calling `use_service()`, that reference remains usable as long as the owning [link boost_asio.reference.io_service `io_service`] object exists.
+[indexterm2 write_some..basic_stream_socket]
+Write some data to the socket.
 
-All I/O service implementations have [link boost_asio.reference.io_service__service `io_service::service`] as a public base class. Custom I/O services may be implemented by deriving from this class and then added to an [link boost_asio.reference.io_service `io_service`] using the facilities described above.
 
-[heading Requirements]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.write_some.overload1 more...]]``
 
-[*Header: ][^boost/asio/io_service.hpp]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.basic_stream_socket.write_some.overload2 more...]]``
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
 
-[section:add_service io_service::add_service]
 
-[indexterm2 add_service..io_service]
-Add a service object to the [link boost_asio.reference.io_service `io_service`].
+Write some data to the socket.
 
 
   template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend void add_service(
- io_service & ios,
- Service * svc);
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
 
-This function is used to add a service to the [link boost_asio.reference.io_service `io_service`].
+This function is used to write data to the stream socket. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -37657,56 +39424,61 @@
 
 [variablelist
   
-[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
-
-[[svc][The service object. On success, ownership of the service object is transferred to the [link boost_asio.reference.io_service `io_service`]. When the [link boost_asio.reference.io_service `io_service`] object is destroyed, it will destroy the service object by performing:
-``
- delete static_cast<io_service::service*>(svc)
-``
-]]
+[[buffers][One or more data buffers to be written to the socket.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes written.
+
+
 [heading Exceptions]
     
 
 [variablelist
   
-[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the [link boost_asio.reference.io_service `io_service`].]]
-
-[[boost::asio::invalid_service_owner][Thrown if the service's owning [link boost_asio.reference.io_service `io_service`] is not the [link boost_asio.reference.io_service `io_service`] object specified by the ios parameter. ]]
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
 ]
 
 
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+
+ socket.write_some(boost::asio::buffer(data, size));
+
+
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:dispatch io_service::dispatch]
+[section:overload2 basic_stream_socket::write_some (2 of 2 overloads)]
 
-[indexterm2 dispatch..io_service]
-Request the [link boost_asio.reference.io_service `io_service`] to invoke the given handler.
 
+Write some data to the socket.
 
- template<
- typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
- void dispatch(
- CompletionHandler handler);
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
 
-This function is used to ask the [link boost_asio.reference.io_service `io_service`] to execute the given handler.
 
-The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. The handler may be executed inside this function if the guarantee can be met.
+This function is used to write data to the stream socket. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -37714,160 +39486,223 @@
 
 [variablelist
   
-[[handler][The handler to be called. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
-``
-]]
+[[buffers][One or more data buffers to be written to the socket.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-[heading Remarks]
+[heading Return Value]
       
-This function throws an exception only if:
+The number of bytes written. Returns 0 if an error occurred.
 
 
-* the handler's `asio_handler_allocate` function; or
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
-* the handler's copy constructor
 
-throws an exception.
+
+[endsect]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:has_service io_service::has_service]
+[section:basic_streambuf basic_streambuf]
 
-[indexterm2 has_service..io_service]
-Determine if an [link boost_asio.reference.io_service `io_service`] contains a specified service type.
 
+Automatically resizable buffer class based on std::streambuf.
 
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend bool has_service(
- io_service & ios);
 
+ template<
+ typename Allocator = std::allocator<char>>
+ class basic_streambuf :
+ noncopyable
 
-This function is used to determine whether the [link boost_asio.reference.io_service `io_service`] contains a service object corresponding to the given service type.
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[heading Parameters]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
+ [The type used to represent the input sequence as a list of buffers. ]
   
-[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
-
-]
+ ]
 
+ [
 
-[heading Return Value]
-
-A boolean indicating whether the [link boost_asio.reference.io_service `io_service`] contains the service.
+ [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
+ [The type used to represent the output sequence as a list of buffers. ]
+
+ ]
 
+]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[heading Requirements]
+ [
+ [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
+ [Construct a basic_streambuf object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
+ [Move characters from the output sequence to the input sequence. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
+ [Remove characters from the input sequence. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.data [*data]]]
+ [Get a list of buffers that represents the input sequence. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
+ [Get the maximum size of the basic_streambuf. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
+ [Get a list of buffers that represents the output sequence, with the given size. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.size [*size]]]
+ [Get the size of the input sequence. ]
+ ]
+
+]
 
-[*Header: ][^boost/asio/io_service.hpp]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
 
-[*Convenience header: ][^boost/asio.hpp]
+ [
+ [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
+ [Override std::streambuf behaviour. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
+ [Override std::streambuf behaviour. ]
+ ]
+
+]
 
+The `basic_streambuf` class is derived from `std::streambuf` to associate the streambuf's input and output sequences with one or more character arrays. These character arrays are internal to the `basic_streambuf` object, but direct access to the array elements is provided to permit them to be used efficiently with I/O operations. Characters written to the output sequence of a `basic_streambuf` object are appended to the input sequence of the same object.
 
-[endsect]
+The `basic_streambuf` class's public interface is intended to permit the following implementation strategies:
 
 
-[section:io_service io_service::io_service]
+* A single contiguous character array, which is reallocated as necessary to accommodate changes in the size of the character sequence. This is the implementation approach currently used in Asio.
 
-[indexterm2 io_service..io_service]
-Constructor.
 
+* A sequence of one or more character arrays, where each array is of the same size. Additional character array objects are appended to the sequence to accommodate changes in the size of the character sequence.
 
- ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
- `` [''''&raquo;''' [link boost_asio.reference.io_service.io_service.overload1 more...]]``
 
- explicit ``[link boost_asio.reference.io_service.io_service.overload2 io_service]``(
- std::size_t concurrency_hint);
- `` [''''&raquo;''' [link boost_asio.reference.io_service.io_service.overload2 more...]]``
+* A sequence of one or more character arrays of varying sizes. Additional character array objects are appended to the sequence to accommodate changes in the size of the character sequence.
 
+The constructor for [link boost_asio.reference.basic_streambuf `basic_streambuf`] accepts a `size_t` argument specifying the maximum of the sum of the sizes of the input sequence and output sequence. During the lifetime of the `basic_streambuf` object, the following invariant holds:
 
-[section:overload1 io_service::io_service (1 of 2 overloads)]
+ size() <= max_size()
 
 
-Constructor.
+Any member function that would, if successful, cause the invariant to be violated shall throw an exception of class `std::length_error`.
 
+The constructor for `basic_streambuf` takes an Allocator argument. A copy of this argument is used for any memory allocation performed, by the constructor and by all member functions, during the lifetime of each `basic_streambuf` object.
 
- io_service();
 
+[heading Examples]
+
+Writing directly from an streambuf to a socket:
 
+ boost::asio::streambuf b;
+ std::ostream os(&b);
+ os << "Hello, World!\n";
 
-[endsect]
+ // try sending some data in input sequence
+ size_t n = sock.send(b.data());
 
+ b.consume(n); // sent data is removed from input sequence
 
 
-[section:overload2 io_service::io_service (2 of 2 overloads)]
 
 
-Constructor.
+Reading from a socket directly into a streambuf:
 
+ boost::asio::streambuf b;
 
- io_service(
- std::size_t concurrency_hint);
+ // reserve 512 bytes in output sequence
+ boost::asio::streambuf::mutable_buffers_type bufs = b.prepare(512);
 
+ size_t n = sock.receive(bufs);
 
-Construct with a hint about the required level of concurrency.
+ // received data is "committed" from output sequence to input sequence
+ b.commit(n);
 
+ std::istream is(&b);
+ std::string s;
+ is >> s;
 
-[heading Parameters]
-
 
-[variablelist
-
-[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
 
-]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_streambuf.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[endsect]
 
+[section:basic_streambuf basic_streambuf::basic_streambuf]
 
-[endsect]
+[indexterm2 basic_streambuf..basic_streambuf]
+Construct a [link boost_asio.reference.basic_streambuf `basic_streambuf`] object.
 
-[section:poll io_service::poll]
 
-[indexterm2 poll..io_service]
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
+ basic_streambuf(
+ std::size_t maximum_size = (std::numeric_limits< std::size_t >::max)(),
+ const Allocator & allocator = Allocator());
 
 
- std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
- `` [''''&raquo;''' [link boost_asio.reference.io_service.poll.overload1 more...]]``
+Constructs a streambuf with the specified maximum size. The initial size of the streambuf's input sequence is 0.
 
- std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.io_service.poll.overload2 more...]]``
 
+[endsect]
 
-[section:overload1 io_service::poll (1 of 2 overloads)]
 
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
+[section:commit basic_streambuf::commit]
 
+[indexterm2 commit..basic_streambuf]
+Move characters from the output sequence to the input sequence.
 
- std::size_t poll();
 
+ void commit(
+ std::size_t n);
 
-The `poll()` function runs handlers that are ready to run, without blocking, until the [link boost_asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers.
 
+Appends `n` characters from the start of the output sequence to the input sequence. The beginning of the output sequence is advanced by `n` characters.
 
-[heading Return Value]
-
-The number of handlers that were executed.
+Requires a preceding call `prepare(x)` where `x >= n`, and no intervening operations that modify the input or output sequence.
 
 
 [heading Exceptions]
@@ -37875,7 +39710,7 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[std::length_error][If `n` is greater than the size of the output sequence. ]]
 
 ]
 
@@ -37886,70 +39721,38 @@
 
 
 
-[section:overload2 io_service::poll (2 of 2 overloads)]
-
-
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
-
-
- std::size_t poll(
- boost::system::error_code & ec);
-
-
-The `poll()` function runs handlers that are ready to run, without blocking, until the [link boost_asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers.
-
-
-[heading Parameters]
-
+[section:const_buffers_type basic_streambuf::const_buffers_type]
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+[indexterm2 const_buffers_type..basic_streambuf]
+The type used to represent the input sequence as a list of buffers.
 
-]
 
+ typedef implementation_defined const_buffers_type;
 
-[heading Return Value]
-
-The number of handlers that were executed.
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/basic_streambuf.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-[section:poll_one io_service::poll_one]
-
-[indexterm2 poll_one..io_service]
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
-
-
- std::size_t ``[link boost_asio.reference.io_service.poll_one.overload1 poll_one]``();
- `` [''''&raquo;''' [link boost_asio.reference.io_service.poll_one.overload1 more...]]``
-
- std::size_t ``[link boost_asio.reference.io_service.poll_one.overload2 poll_one]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.io_service.poll_one.overload2 more...]]``
-
-
-[section:overload1 io_service::poll_one (1 of 2 overloads)]
-
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
 
+[section:consume basic_streambuf::consume]
 
- std::size_t poll_one();
+[indexterm2 consume..basic_streambuf]
+Remove characters from the input sequence.
 
 
-The `poll_one()` function runs at most one handler that is ready to run, without blocking.
+ void consume(
+ std::size_t n);
 
 
-[heading Return Value]
-
-The number of handlers that were executed.
+Removes `n` characters from the beginning of the input sequence.
 
 
 [heading Exceptions]
@@ -37957,7 +39760,7 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[std::length_error][If `n > size()`. ]]
 
 ]
 
@@ -37968,140 +39771,107 @@
 
 
 
-[section:overload2 io_service::poll_one (2 of 2 overloads)]
-
-
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
-
-
- std::size_t poll_one(
- boost::system::error_code & ec);
-
-
-The `poll_one()` function runs at most one handler that is ready to run, without blocking.
+[section:data basic_streambuf::data]
 
+[indexterm2 data..basic_streambuf]
+Get a list of buffers that represents the input sequence.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+ const_buffers_type data() const;
 
-]
 
 
 [heading Return Value]
       
-The number of handlers that were executed.
+An object of type `const_buffers_type` that satisfies ConstBufferSequence requirements, representing all character arrays in the input sequence.
 
 
+[heading Remarks]
+
+The returned object is invalidated by any `basic_streambuf` member function that modifies the input sequence or output sequence.
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:post io_service::post]
-
-[indexterm2 post..io_service]
-Request the [link boost_asio.reference.io_service `io_service`] to invoke the given handler and return immediately.
-
-
- template<
- typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
- void post(
- CompletionHandler handler);
-
-
-This function is used to ask the [link boost_asio.reference.io_service `io_service`] to execute the given handler, but without allowing the [link boost_asio.reference.io_service `io_service`] to call the handler from inside this function.
 
-The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked.
+[section:max_size basic_streambuf::max_size]
 
+[indexterm2 max_size..basic_streambuf]
+Get the maximum size of the [link boost_asio.reference.basic_streambuf `basic_streambuf`].
 
-[heading Parameters]
-
 
-[variablelist
-
-[[handler][The handler to be called. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
-``
-]]
+ std::size_t max_size() const;
 
-]
 
 
-[heading Remarks]
+[heading Return Value]
       
-This function throws an exception only if:
-
+The allowed maximum of the sum of the sizes of the input sequence and output sequence.
 
-* the handler's `asio_handler_allocate` function; or
 
 
-* the handler's copy constructor
 
-throws an exception.
+[endsect]
 
 
-[endsect]
 
+[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
 
+[indexterm2 mutable_buffers_type..basic_streambuf]
+The type used to represent the output sequence as a list of buffers.
 
-[section:reset io_service::reset]
 
-[indexterm2 reset..io_service]
-Reset the [link boost_asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation.
+ typedef implementation_defined mutable_buffers_type;
 
 
- void reset();
 
+[heading Requirements]
 
-This function must be called prior to any second or later set of invocations of the `run()`, `run_one()`, `poll()` or `poll_one()` functions when a previous invocation of these functions returned due to the [link boost_asio.reference.io_service `io_service`] being stopped or running out of work. This function allows the [link boost_asio.reference.io_service `io_service`] to reset any internal state, such as a "stopped" flag.
+[*Header: ][^boost/asio/basic_streambuf.hpp]
 
-This function must not be called while there are any unfinished calls to the `run()`, `run_one()`, `poll()` or `poll_one()` functions.
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:run io_service::run]
 
-[indexterm2 run..io_service]
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
+[section:overflow basic_streambuf::overflow]
 
+[indexterm2 overflow..basic_streambuf]
+Override std::streambuf behaviour.
 
- std::size_t ``[link boost_asio.reference.io_service.run.overload1 run]``();
- `` [''''&raquo;''' [link boost_asio.reference.io_service.run.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.io_service.run.overload2 run]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.io_service.run.overload2 more...]]``
+ int_type overflow(
+ int_type c);
 
 
-[section:overload1 io_service::run (1 of 2 overloads)]
+Behaves according to the specification of `std::streambuf::overflow()`, with the specialisation that `std::length_error` is thrown if appending the character to the input sequence would require the condition `size() > max_size()` to be true.
 
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
+[endsect]
 
 
- std::size_t run();
 
+[section:prepare basic_streambuf::prepare]
 
-The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
+[indexterm2 prepare..basic_streambuf]
+Get a list of buffers that represents the output sequence, with the given size.
 
-Multiple threads may call the `run()` function to set up a pool of threads from which the [link boost_asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link boost_asio.reference.io_service `io_service`] may choose any one of them to invoke a handler.
 
-The `run()` function may be safely called again once it has completed only after a call to `reset()`.
+ mutable_buffers_type prepare(
+ std::size_t n);
+
+
+Ensures that the output sequence can accommodate `n` characters, reallocating character array objects as necessary.
 
 
 [heading Return Value]
       
-The number of handlers that were executed.
+An object of type `mutable_buffers_type` that satisfies MutableBufferSequence requirements, representing character array objects at the start of the output sequence such that the sum of the buffer sizes is `n`.
 
 
 [heading Exceptions]
@@ -38109,407 +39879,464 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[std::length_error][If `size() + n > max_size()`.]]
 
 ]
 
 
 [heading Remarks]
       
-The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link boost_asio.reference.io_service `io_service`] object.
+The returned object is invalidated by any `basic_streambuf` member function that modifies the input sequence or output sequence.
+
 
-The `poll()` function may also be used to dispatch ready handlers, but without blocking.
 
 
 [endsect]
 
 
 
-[section:overload2 io_service::run (2 of 2 overloads)]
+[section:reserve basic_streambuf::reserve]
 
+[indexterm2 reserve..basic_streambuf]
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
+ void reserve(
+ std::size_t n);
 
 
- std::size_t run(
- boost::system::error_code & ec);
 
+[endsect]
 
-The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
 
-Multiple threads may call the `run()` function to set up a pool of threads from which the [link boost_asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link boost_asio.reference.io_service `io_service`] may choose any one of them to invoke a handler.
 
-The `run()` function may be safely called again once it has completed only after a call to `reset()`.
+[section:size basic_streambuf::size]
 
+[indexterm2 size..basic_streambuf]
+Get the size of the input sequence.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+ std::size_t size() const;
 
-]
 
 
 [heading Return Value]
       
-The number of handlers that were executed.
-
+The size of the input sequence. The value is equal to that calculated for `s` in the following code:
+
+ size_t s = 0;
+ const_buffers_type bufs = data();
+ const_buffers_type::const_iterator i = bufs.begin();
+ while (i != bufs.end())
+ {
+ const_buffer buf(*i++);
+ s += buffer_size(buf);
+ }
+
 
-[heading Remarks]
-
-The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link boost_asio.reference.io_service `io_service`] object.
 
-The `poll()` function may also be used to dispatch ready handlers, but without blocking.
 
 
-[endsect]
 
 
 [endsect]
 
-[section:run_one io_service::run_one]
 
-[indexterm2 run_one..io_service]
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
 
+[section:underflow basic_streambuf::underflow]
+
+[indexterm2 underflow..basic_streambuf]
+Override std::streambuf behaviour.
 
- std::size_t ``[link boost_asio.reference.io_service.run_one.overload1 run_one]``();
- `` [''''&raquo;''' [link boost_asio.reference.io_service.run_one.overload1 more...]]``
 
- std::size_t ``[link boost_asio.reference.io_service.run_one.overload2 run_one]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.io_service.run_one.overload2 more...]]``
+ int_type underflow();
 
 
-[section:overload1 io_service::run_one (1 of 2 overloads)]
+Behaves according to the specification of `std::streambuf::underflow()`.
 
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
+[endsect]
 
 
- std::size_t run_one();
 
+[endsect]
 
-The `run_one()` function blocks until one handler has been dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
+[section:buffer buffer]
 
+[indexterm1 buffer]
+The `boost::asio::buffer` function is used to create a buffer object to represent raw memory, an array of POD elements, a vector of POD elements, or a std::string.
 
-[heading Return Value]
       
-The number of handlers that were executed.
-
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload1 buffer]``(
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload1 more...]]``
 
-[heading Exceptions]
-
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload2 buffer]``(
+ const mutable_buffer & b,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload2 more...]]``
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload3 buffer]``(
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload3 more...]]``
 
-]
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload4 buffer]``(
+ const const_buffer & b,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload4 more...]]``
 
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload5 buffer]``(
+ void * data,
+ std::size_t size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload5 more...]]``
 
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload6 buffer]``(
+ const void * data,
+ std::size_t size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload6 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload7 buffer]``(
+ PodType (&data)[N]);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload7 more...]]``
 
-[endsect]
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload8 buffer]``(
+ PodType (&data)[N],
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload8 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
+ const PodType (&data)[N]);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload9 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload10 buffer]``(
+ const PodType (&data)[N],
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload10 more...]]``
 
-[section:overload2 io_service::run_one (2 of 2 overloads)]
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
+ boost::array< PodType, N > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload11 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload12 buffer]``(
+ boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload12 more...]]``
 
-Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload13 buffer]``(
+ boost::array< const PodType, N > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload13 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload14 buffer]``(
+ boost::array< const PodType, N > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload14 more...]]``
 
- std::size_t run_one(
- boost::system::error_code & ec);
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload15 buffer]``(
+ const boost::array< PodType, N > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload15 more...]]``
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload16 buffer]``(
+ const boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload16 more...]]``
 
-The `run_one()` function blocks until one handler has been dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload17 buffer]``(
+ std::vector< PodType, Allocator > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload17 more...]]``
 
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload18 buffer]``(
+ std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload18 more...]]``
 
-[heading Parameters]
-
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload19 buffer]``(
+ const std::vector< PodType, Allocator > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload19 more...]]``
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload20 buffer]``(
+ const std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload20 more...]]``
 
-]
+ template<
+ typename Elem,
+ typename Traits,
+ typename Allocator>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload21 buffer]``(
+ const std::basic_string< Elem, Traits, Allocator > & data);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload21 more...]]``
 
+ template<
+ typename Elem,
+ typename Traits,
+ typename Allocator>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
+ const std::basic_string< Elem, Traits, Allocator > & data,
+ std::size_t max_size_in_bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer.overload22 more...]]``
 
-[heading Return Value]
-
-The number of handlers that were executed.
+A buffer object represents a contiguous region of memory as a 2-tuple consisting of a pointer and size in bytes. A tuple of the form `{void*, size_t}` specifies a mutable (modifiable) region of memory. Similarly, a tuple of the form `{const void*, size_t}` specifies a const (non-modifiable) region of memory. These two forms correspond to the classes [link boost_asio.reference.mutable_buffer `mutable_buffer`] and [link boost_asio.reference.const_buffer `const_buffer`], respectively. To mirror C++'s conversion rules, a [link boost_asio.reference.mutable_buffer `mutable_buffer`] is implicitly convertible to a [link boost_asio.reference.const_buffer `const_buffer`], and the opposite conversion is not permitted.
 
+The simplest use case involves reading or writing a single buffer of a specified size:
 
 
 
-[endsect]
+ sock.send(boost::asio::buffer(data, size));
 
 
-[endsect]
 
 
-[section:stop io_service::stop]
+In the above example, the return value of `boost::asio::buffer` meets the requirements of the ConstBufferSequence concept so that it may be directly passed to the socket's write function. A buffer created for modifiable memory also meets the requirements of the MutableBufferSequence concept.
 
-[indexterm2 stop..io_service]
-Stop the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
+An individual buffer may be created from a builtin array, std::vector or boost::array of POD elements. This helps prevent buffer overruns by automatically determining the size of the buffer:
 
 
- void stop();
 
+ char d1[128];
+ size_t bytes_transferred = sock.receive(boost::asio::buffer(d1));
 
-This function does not block, but instead simply signals the [link boost_asio.reference.io_service `io_service`] to stop. All invocations of its `run()` or `run_one()` member functions should return as soon as possible. Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately until `reset()` is called.
+ std::vector<char> d2(128);
+ bytes_transferred = sock.receive(boost::asio::buffer(d2));
 
+ boost::array<char, 128> d3;
+ bytes_transferred = sock.receive(boost::asio::buffer(d3));
 
-[endsect]
 
 
 
-[section:use_service io_service::use_service]
+In all three cases above, the buffers created are exactly 128 bytes long. Note that a vector is [*never] automatically resized when creating or using a buffer. The buffer size is determined using the vector's `size()` member function, and not its capacity.
 
-[indexterm2 use_service..io_service]
-Obtain the service object corresponding to the given type.
 
+[heading Accessing Buffer Contents]
+
 
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend Service & use_service(
- io_service & ios);
 
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
 
-This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link boost_asio.reference.io_service `io_service`] will create a new instance of the service.
 
 
-[heading Parameters]
-
+ boost::asio::mutable_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
 
-[variablelist
-
-[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
+ boost::asio::const_buffer b2 = ...;
+ std::size_t s2 = boost::asio::buffer_size(b2);
+ const void* p2 = boost::asio::buffer_cast<const void*>(b2);
 
-]
 
 
-[heading Return Value]
-
-The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
 
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
 
 
-[heading Requirements]
+[heading Buffer Invalidation]
+
 
-[*Header: ][^boost/asio/io_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+A buffer object does not have any ownership of the memory it refers to. It is the responsibility of the application to ensure the memory region remains valid until it is no longer required for an I/O operation. When the memory is no longer available, the buffer is said to have been invalidated.
 
+For the `boost::asio::buffer` overloads that accept an argument of type std::vector, the buffer objects returned are invalidated by any vector operation that also invalidates all references, pointers and iterators referring to the elements in the sequence (C++ Std, 23.2.4)
 
-[endsect]
+For the `boost::asio::buffer` overloads that accept an argument of type std::basic\_string, the buffer objects returned are invalidated according to the rules defined for invalidation of references, pointers and iterators referring to elements of the sequence (C++ Std, 21.3).
 
 
+[heading Buffer Arithmetic]
+
 
-[section:wrap io_service::wrap]
 
-[indexterm2 wrap..io_service]
-Create a new handler that automatically dispatches the wrapped handler on the [link boost_asio.reference.io_service `io_service`].
+Buffer objects may be manipulated using simple arithmetic in a safe way which helps prevent buffer overruns. Consider an array initialised as follows:
 
 
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- unspecified wrap(
- Handler handler);
 
+ boost::array<char, 6> a = { 'a', 'b', 'c', 'd', 'e' };
 
-This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the [link boost_asio.reference.io_service `io_service`] object's dispatch function.
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[handler][The handler to be wrapped. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler(A1 a1, ... An an);
-``
-]]
+A buffer object `b1` created using:
 
-]
 
 
-[heading Return Value]
-
-A function object that, when invoked, passes the wrapped handler to the [link boost_asio.reference.io_service `io_service`] object's dispatch function. Given a function object with the signature:
+ b1 = boost::asio::buffer(a);
 
- R f(A1 a1, ... An an);
 
 
-If this function object is passed to the wrap function like so:
 
- io_service.wrap(f);
+represents the entire array, `{ 'a', 'b', 'c', 'd', 'e' }`. An optional second argument to the `boost::asio::buffer` function may be used to limit the size, in bytes, of the buffer:
 
 
-then the return value is a function object with the signature
 
- void g(A1 a1, ... An an);
+ b2 = boost::asio::buffer(a, 3);
 
 
-that, when invoked, executes code equivalent to:
 
- io_service.dispatch(boost::bind(f, a1, ... an));
 
+such that `b2` represents the data `{ 'a', 'b', 'c' }`. Even if the size argument exceeds the actual size of the array, the size of the buffer object created will be limited to the array size.
 
+An offset may be applied to an existing buffer to create a new one:
 
 
 
+ b3 = b1 + 2;
 
 
-[endsect]
 
 
+where `b3` will set to represent `{ 'c', 'd', 'e' }`. If the offset exceeds the size of the existing buffer, the newly created buffer will be empty.
 
-[section:_io_service io_service::~io_service]
+Both an offset and size may be specified to create a buffer that corresponds to a specific range of bytes within an existing buffer:
 
-[indexterm2 ~io_service..io_service]
-Destructor.
 
 
- ~io_service();
+ b4 = boost::asio::buffer(b1 + 1, 3);
 
 
-On destruction, the [link boost_asio.reference.io_service `io_service`] performs the following sequence of operations:
 
 
-* For each service object `svc` in the [link boost_asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`.
+so that `b4` will refer to the bytes `{ 'b', 'c', 'd' }`.
 
 
-* Uninvoked handler objects that were scheduled for deferred invocation on the [link boost_asio.reference.io_service `io_service`], or any associated strand, are destroyed.
+[heading Buffers and Scatter-Gather I/O]
+
 
 
-* For each service object `svc` in the [link boost_asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `delete static_cast<io_service::service*>(svc)`.
+To read or write using multiple buffers (i.e. scatter-gather I/O), multiple buffer objects may be assigned into a container that supports the MutableBufferSequence (for read) or ConstBufferSequence (for write) concepts:
 
 
-[heading Remarks]
-
-The destruction sequence described above permits programs to simplify their resource management by using `shared_ptr<>`. Where an object's lifetime is tied to the lifetime of a connection (or some other sequence of asynchronous operations), a `shared_ptr` to the object would be bound into the handlers for all asynchronous operations associated with it. This works as follows:
 
+ char d1[128];
+ std::vector<char> d2(128);
+ boost::array<char, 128> d3;
 
-* When a single connection ends, all associated asynchronous operations complete. The corresponding handler objects are destroyed, and all `shared_ptr` references to the objects are destroyed.
+ boost::array<mutable_buffer, 3> bufs1 = {
+ boost::asio::buffer(d1),
+ boost::asio::buffer(d2),
+ boost::asio::buffer(d3) };
+ bytes_transferred = sock.receive(bufs1);
 
+ std::vector<const_buffer> bufs2;
+ bufs2.push_back(boost::asio::buffer(d1));
+ bufs2.push_back(boost::asio::buffer(d2));
+ bufs2.push_back(boost::asio::buffer(d3));
+ bytes_transferred = sock.send(bufs2);
 
-* To shut down the whole program, the [link boost_asio.reference.io_service `io_service`] function `stop()` is called to terminate any `run()` calls as soon as possible. The [link boost_asio.reference.io_service `io_service`] destructor defined above destroys all handlers, causing all `shared_ptr` references to all connection objects to be destroyed.
 
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/buffer.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload1 buffer (1 of 22 overloads)]
 
-[section:io_service__id io_service::id]
 
+Create a new modifiable buffer from an existing buffer.
 
-Class used to uniquely identify a service.
 
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b);
 
- class id :
- noncopyable
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+`mutable_buffers_1(b)`.
 
- [
- [[link boost_asio.reference.io_service__id.id [*id]]]
- [Constructor. ]
- ]
-
-]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[section:id io_service::id::id]
 
-[indexterm2 id..io_service::id]
-Constructor.
+[section:overload2 buffer (2 of 22 overloads)]
 
 
- id();
+Create a new modifiable buffer from an existing buffer.
 
 
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b,
+ std::size_t max_size_in_bytes);
 
-[endsect]
 
 
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
-[endsect]
+ mutable_buffers_1(
+ buffer_cast<void*>(b),
+ min(buffer_size(b), max_size_in_bytes));
 
-[section:io_service__service io_service::service]
 
 
-Base class for all [link boost_asio.reference.io_service `io_service`] services.
 
 
- class service :
- noncopyable
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link boost_asio.reference.io_service__service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.io_service__service.service [*service]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__service._service [*~service]]]
- [Destructor. ]
- ]
-
-]
+[section:overload3 buffer (3 of 22 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
+Create a new non-modifiable buffer from an existing buffer.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ const_buffers_1 buffer(
+ const const_buffer & b);
 
-[section:get_io_service io_service::service::get_io_service]
 
-[indexterm2 get_io_service..io_service::service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
+[heading Return Value]
+
+`const_buffers_1(b)`.
 
- boost::asio::io_service & get_io_service();
 
 
 
@@ -38517,54 +40344,52 @@
 
 
 
-[section:io_service io_service::service::io_service]
-
-[indexterm2 io_service..io_service::service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[section:overload4 buffer (4 of 22 overloads)]
 
 
- boost::asio::io_service & io_service();
+Create a new non-modifiable buffer from an existing buffer.
 
 
+ const_buffers_1 buffer(
+ const const_buffer & b,
+ std::size_t max_size_in_bytes);
 
-[endsect]
 
 
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
-[section:service io_service::service::service]
+ const_buffers_1(
+ buffer_cast<const void*>(b),
+ min(buffer_size(b), max_size_in_bytes));
 
-[indexterm2 service..io_service::service]
-Constructor.
 
 
- service(
- boost::asio::io_service & owner);
 
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[owner][The [link boost_asio.reference.io_service `io_service`] object that owns the service. ]]
+[endsect]
 
-]
 
 
+[section:overload5 buffer (5 of 22 overloads)]
 
 
-[endsect]
+Create a new modifiable buffer that represents the given memory range.
 
 
+ mutable_buffers_1 buffer(
+ void * data,
+ std::size_t size_in_bytes);
 
-[section:_service io_service::service::~service]
 
-[indexterm2 ~service..io_service::service]
-Destructor.
 
+[heading Return Value]
+
+`mutable_buffers_1(data, size_in_bytes)`.
 
- virtual ~service();
 
 
 
@@ -38572,152 +40397,118 @@
 
 
 
-[endsect]
+[section:overload6 buffer (6 of 22 overloads)]
 
-[section:io_service__strand io_service::strand]
 
+Create a new non-modifiable buffer that represents the given memory range.
 
-Provides serialised handler execution.
 
+ const_buffers_1 buffer(
+ const void * data,
+ std::size_t size_in_bytes);
 
- class strand
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+`const_buffers_1(data, size_in_bytes)`.
 
- [
- [[link boost_asio.reference.io_service__strand.dispatch [*dispatch]]]
- [Request the strand to invoke the given handler. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand.get_io_service [*get_io_service]]]
- [Get the io_service associated with the strand. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the strand. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand.post [*post]]]
- [Request the strand to invoke the given handler and return immediately. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand.strand [*strand]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand.wrap [*wrap]]]
- [Create a new handler that automatically dispatches the wrapped handler on the strand. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__strand._strand [*~strand]]]
- [Destructor. ]
- ]
-
-]
 
-The [link boost_asio.reference.io_service__strand `io_service::strand`] class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently.
 
 
-[heading Order of handler invocation]
-
-Given:
+[endsect]
 
 
-* a strand object `s`
 
+[section:overload7 buffer (7 of 22 overloads)]
 
-* an object `a` meeting completion handler requirements
 
+Create a new modifiable buffer that represents the given POD array.
 
-* an object `a1` which is an arbitrary copy of `a` made by the implementation
 
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ PodType (&data)[N]);
 
-* an object `b` meeting completion handler requirements
 
 
-* an object `b1` which is an arbitrary copy of `b` made by the implementation
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
-if any of the following conditions are true:
+ mutable_buffers_1(
+ static_cast<void*>(data),
+ N * sizeof(PodType));
 
 
-* `s.post(a)` happens-before `s.post(b)`
 
 
-* `s.post(a)` happens-before `s.dispatch(b)`, where the latter is performed outside the strand
 
 
-* `s.dispatch(a)` happens-before `s.post(b)`, where the former is performed outside the strand
 
+[endsect]
 
-* `s.dispatch(a)` happens-before `s.dispatch(b)`, where both are performed outside the strand
 
-then `asio_handler_invoke(a1, &a1)` happens-before `asio_handler_invoke(b1, &b1)`.
 
-Note that in the following case:
+[section:overload8 buffer (8 of 22 overloads)]
 
- async_op_1(..., s.wrap(a));
- async_op_2(..., s.wrap(b));
 
+Create a new modifiable buffer that represents the given POD array.
 
-the completion of the first async operation will perform `s.dispatch(a)`, and the second will perform `s.dispatch(b)`, but the order in which those are performed is unspecified. That is, you cannot state whether one happens-before the other. Therefore none of the above conditions are met and no ordering guarantee is made.
 
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ PodType (&data)[N],
+ std::size_t max_size_in_bytes);
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Safe.
 
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
+ mutable_buffers_1(
+ static_cast<void*>(data),
+ min(N * sizeof(PodType), max_size_in_bytes));
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/strand.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:dispatch io_service::strand::dispatch]
 
-[indexterm2 dispatch..io_service::strand]
-Request the strand to invoke the given handler.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void dispatch(
- Handler handler);
 
+[section:overload9 buffer (9 of 22 overloads)]
 
-This function is used to ask the strand to execute the given handler.
 
-The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The handler may be executed inside this function if the guarantee can be met. If this function is called from within a handler that was posted or dispatched through the same strand, then the new handler will be executed immediately.
+Create a new non-modifiable buffer that represents the given POD array.
 
-The strand's guarantee is in addition to the guarantee provided by the underlying [link boost_asio.reference.io_service `io_service`]. The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType (&data)[N]);
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[handler][The handler to be called. The strand will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
-``
-]]
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+
+ const_buffers_1(
+ static_cast<const void*>(data),
+ N * sizeof(PodType));
+
+
 
-]
 
 
 
@@ -38726,21 +40517,31 @@
 
 
 
-[section:get_io_service io_service::strand::get_io_service]
+[section:overload10 buffer (10 of 22 overloads)]
 
-[indexterm2 get_io_service..io_service::strand]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the strand.
 
+Create a new non-modifiable buffer that represents the given POD array.
 
- boost::asio::io_service & get_io_service();
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType (&data)[N],
+ std::size_t max_size_in_bytes);
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the strand uses to dispatch handlers for asynchronous operations.
 
 
 [heading Return Value]
       
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+
+ const_buffers_1(
+ static_cast<const void*>(data),
+ min(N * sizeof(PodType), max_size_in_bytes));
+
+
+
 
 
 
@@ -38749,21 +40550,30 @@
 
 
 
-[section:io_service io_service::strand::io_service]
+[section:overload11 buffer (11 of 22 overloads)]
 
-[indexterm2 io_service..io_service::strand]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the strand.
 
+Create a new modifiable buffer that represents the given POD array.
 
- boost::asio::io_service & io_service();
 
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ boost::array< PodType, N > & data);
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the strand uses to dispatch handlers for asynchronous operations.
 
 
 [heading Return Value]
       
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
+
+ mutable_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
+
+
+
 
 
 
@@ -38772,35 +40582,31 @@
 
 
 
-[section:post io_service::strand::post]
+[section:overload12 buffer (12 of 22 overloads)]
 
-[indexterm2 post..io_service::strand]
-Request the strand to invoke the given handler and return immediately.
+
+Create a new modifiable buffer that represents the given POD array.
 
 
   template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void post(
- Handler handler);
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
 
 
-This function is used to ask the strand to execute the given handler, but without allowing the strand to call the handler from inside this function.
 
-The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The strand's guarantee is in addition to the guarantee provided by the underlying [link boost_asio.reference.io_service `io_service`]. The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked.
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
+ mutable_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
 
-[heading Parameters]
-
 
-[variablelist
-
-[[handler][The handler to be called. The strand will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
-``
-]]
 
-]
 
 
 
@@ -38809,596 +40615,708 @@
 
 
 
-[section:strand io_service::strand::strand]
-
-[indexterm2 strand..io_service::strand]
-Constructor.
-
+[section:overload13 buffer (13 of 22 overloads)]
 
- strand(
- boost::asio::io_service & io_service);
 
+Create a new non-modifiable buffer that represents the given POD array.
 
-Constructs the strand.
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ boost::array< const PodType, N > & data);
 
-[heading Parameters]
-
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers that are ready to be run. ]]
 
-]
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
+ const_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
 
 
 
-[endsect]
 
 
 
-[section:wrap io_service::strand::wrap]
 
-[indexterm2 wrap..io_service::strand]
-Create a new handler that automatically dispatches the wrapped handler on the strand.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- unspecified wrap(
- Handler handler);
 
+[section:overload14 buffer (14 of 22 overloads)]
 
-This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the strand's dispatch function.
 
+Create a new non-modifiable buffer that represents the given POD array.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[handler][The handler to be wrapped. The strand will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler(A1 a1, ... An an);
-``
-]]
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ boost::array< const PodType, N > & data,
+ std::size_t max_size_in_bytes);
 
-]
 
 
 [heading Return Value]
       
-A function object that, when invoked, passes the wrapped handler to the strand's dispatch function. Given a function object with the signature:
-
- R f(A1 a1, ... An an);
-
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
-If this function object is passed to the wrap function like so:
+ const_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
 
- strand.wrap(f);
 
 
-then the return value is a function object with the signature
 
- void g(A1 a1, ... An an);
 
 
-that, when invoked, executes code equivalent to:
 
- strand.dispatch(boost::bind(f, a1, ... an));
+[endsect]
 
 
 
+[section:overload15 buffer (15 of 22 overloads)]
 
 
+Create a new non-modifiable buffer that represents the given POD array.
 
 
-[endsect]
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const boost::array< PodType, N > & data);
 
 
 
-[section:_strand io_service::strand::~strand]
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
-[indexterm2 ~strand..io_service::strand]
-Destructor.
+ const_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
 
 
- ~strand();
 
 
-Destroys a strand.
 
-Handlers posted through the strand that have not yet been invoked will still be dispatched in a way that meets the guarantee of non-concurrency.
 
 
 [endsect]
 
 
 
-[endsect]
+[section:overload16 buffer (16 of 22 overloads)]
 
-[section:io_service__work io_service::work]
 
+Create a new non-modifiable buffer that represents the given POD array.
 
-Class to inform the [link boost_asio.reference.io_service `io_service`] when it has work to do.
 
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
 
- class work
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- [
- [[link boost_asio.reference.io_service__work.get_io_service [*get_io_service]]]
- [Get the io_service associated with the work. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__work.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the work. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__work.work [*work]]]
- [Constructor notifies the io_service that work is starting.
+ const_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
 
- Copy constructor notifies the io_service that work is starting. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__work._work [*~work]]]
- [Destructor notifies the io_service that the work is complete. ]
- ]
-
-]
 
-The work class is used to inform the [link boost_asio.reference.io_service `io_service`] when work starts and finishes. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while work is underway, and that it does exit when there is no unfinished work remaining.
 
-The work class is copy-constructible so that it may be used as a data member in a handler class. It is not assignable.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/io_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[endsect]
 
-[section:get_io_service io_service::work::get_io_service]
 
-[indexterm2 get_io_service..io_service::work]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the work.
 
+[section:overload17 buffer (17 of 22 overloads)]
 
- boost::asio::io_service & get_io_service();
 
+Create a new modifiable buffer that represents the given POD vector.
 
 
-[endsect]
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data);
 
 
 
-[section:io_service io_service::work::io_service]
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
-[indexterm2 io_service..io_service::work]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the work.
+ mutable_buffers_1(
+ data.size() ? &data[0] : 0,
+ data.size() * sizeof(PodType));
 
 
- boost::asio::io_service & io_service();
 
 
 
-[endsect]
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
 
 
-[section:work io_service::work::work]
 
-[indexterm2 work..io_service::work]
-Constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
+[endsect]
 
- explicit ``[link boost_asio.reference.io_service__work.work.overload1 work]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.io_service__work.work.overload1 more...]]``
 
 
-Copy constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
+[section:overload18 buffer (18 of 22 overloads)]
 
 
- ``[link boost_asio.reference.io_service__work.work.overload2 work]``(
- const work & other);
- `` [''''&raquo;''' [link boost_asio.reference.io_service__work.work.overload2 more...]]``
+Create a new modifiable buffer that represents the given POD vector.
 
 
-[section:overload1 io_service::work::work (1 of 2 overloads)]
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
 
 
-Constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
+[heading Return Value]
+
+A [link boost_asio.reference.mutable_buffers_1 `mutable_buffers_1`] value equivalent to:
 
- work(
- boost::asio::io_service & io_service);
+ mutable_buffers_1(
+ data.size() ? &data[0] : 0,
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
 
 
-The constructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway.
 
 
-[endsect]
 
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
 
 
-[section:overload2 io_service::work::work (2 of 2 overloads)]
 
 
-Copy constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
+[endsect]
 
 
- work(
- const work & other);
 
+[section:overload19 buffer (19 of 22 overloads)]
 
-The constructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway.
 
+Create a new non-modifiable buffer that represents the given POD vector.
 
-[endsect]
 
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::vector< PodType, Allocator > & data);
 
-[endsect]
 
 
-[section:_work io_service::work::~work]
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
-[indexterm2 ~work..io_service::work]
-Destructor notifies the [link boost_asio.reference.io_service `io_service`] that the work is complete.
+ const_buffers_1(
+ data.size() ? &data[0] : 0,
+ data.size() * sizeof(PodType));
 
 
- ~work();
 
 
-The destructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has finished. Once the count of unfinished work reaches zero, the [link boost_asio.reference.io_service `io_service`] object's `run()` function is permitted to exit.
 
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
 
-[endsect]
 
 
 
 [endsect]
 
-[section:ip__address ip::address]
 
 
-Implements version-independent IP addresses.
+[section:overload20 buffer (20 of 22 overloads)]
 
 
- class address
+Create a new non-modifiable buffer that represents the given POD vector.
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
 
- [
- [[link boost_asio.reference.ip__address.address [*address]]]
- [Default constructor.
 
- Construct an address from an IPv4 address.
 
- Construct an address from an IPv6 address.
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.from_string [*from_string]]]
- [Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.is_v4 [*is_v4]]]
- [Get whether the address is an IP version 4 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.is_v6 [*is_v6]]]
- [Get whether the address is an IP version 6 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_eq_ [*operator=]]]
- [Assign from another address.
+ const_buffers_1(
+ data.size() ? &data[0] : 0,
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
 
- Assign from an IPv4 address.
 
- Assign from an IPv6 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.to_string [*to_string]]]
- [Get the address as a string in dotted decimal format. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.to_v4 [*to_v4]]]
- [Get the address as an IP version 4 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.to_v6 [*to_v6]]]
- [Get the address as an IP version 6 address. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address.operator_not__eq_ [*operator!=]]]
- [Compare two addresses for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_lt__eq_ [*operator<=]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_gt_ [*operator>]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address.operator_gt__eq_ [*operator>=]]]
- [Compare addresses for ordering. ]
- ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
 
- [
- [[link boost_asio.reference.ip__address.operator_lt__lt_ [*operator<<]]]
- [Output an address as a string. ]
- ]
-
-]
 
-The [link boost_asio.reference.ip__address `ip::address`] class provides the ability to use either IP version 4 or version 6 addresses.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
 
-[*Shared] [*objects:] Unsafe.
 
 
+[section:overload21 buffer (21 of 22 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address.hpp]
+Create a new non-modifiable buffer that represents the given string.
 
-[*Convenience header: ][^boost/asio.hpp]
 
-[section:address ip::address::address]
+ template<
+ typename Elem,
+ typename Traits,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::basic_string< Elem, Traits, Allocator > & data);
 
-[indexterm2 address..ip::address]
-Default constructor.
 
 
- ``[link boost_asio.reference.ip__address.address.overload1 address]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload1 more...]]``
+[heading Return Value]
+
+`const_buffers_1(data.data(), data.size() * sizeof(Elem))`.
 
 
-Construct an address from an IPv4 address.
+[heading Remarks]
+
+The buffer is invalidated by any non-const operation called on the given string object.
 
 
- ``[link boost_asio.reference.ip__address.address.overload2 address]``(
- const boost::asio::ip::address_v4 & ipv4_address);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload2 more...]]``
 
 
-Construct an address from an IPv6 address.
+[endsect]
 
 
- ``[link boost_asio.reference.ip__address.address.overload3 address]``(
- const boost::asio::ip::address_v6 & ipv6_address);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload3 more...]]``
 
+[section:overload22 buffer (22 of 22 overloads)]
 
-Copy constructor.
 
+Create a new non-modifiable buffer that represents the given string.
 
- ``[link boost_asio.reference.ip__address.address.overload4 address]``(
- const address & other);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload4 more...]]``
 
+ template<
+ typename Elem,
+ typename Traits,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::basic_string< Elem, Traits, Allocator > & data,
+ std::size_t max_size_in_bytes);
 
-[section:overload1 ip::address::address (1 of 4 overloads)]
 
 
-Default constructor.
+[heading Return Value]
+
+A [link boost_asio.reference.const_buffers_1 `const_buffers_1`] value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(Elem), max_size_in_bytes));
 
 
- address();
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any non-const operation called on the given string object.
+
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 ip::address::address (2 of 4 overloads)]
+[section:buffer_cast buffer_cast]
 
+[indexterm1 buffer_cast]
+The `boost::asio::buffer_cast` function is used to obtain a pointer to the underlying memory region associated with a buffer.
 
-Construct an address from an IPv4 address.
+
+ template<
+ typename PointerToPodType>
+ PointerToPodType ``[link boost_asio.reference.buffer_cast.overload1 buffer_cast]``(
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_cast.overload1 more...]]``
 
+ template<
+ typename PointerToPodType>
+ PointerToPodType ``[link boost_asio.reference.buffer_cast.overload2 buffer_cast]``(
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_cast.overload2 more...]]``
 
- address(
- const boost::asio::ip::address_v4 & ipv4_address);
 
+[heading Examples:]
+
 
 
-[endsect]
+To access the memory of a non-modifiable buffer, use:
 
+ boost::asio::const_buffer b1 = ...;
+ const unsigned char* p1 = boost::asio::buffer_cast<const unsigned char*>(b1);
 
 
-[section:overload3 ip::address::address (3 of 4 overloads)]
 
 
-Construct an address from an IPv6 address.
+To access the memory of a modifiable buffer, use:
 
+ boost::asio::mutable_buffer b2 = ...;
+ unsigned char* p2 = boost::asio::buffer_cast<unsigned char*>(b2);
 
- address(
- const boost::asio::ip::address_v6 & ipv6_address);
 
 
 
-[endsect]
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/buffer.hpp]
 
-[section:overload4 ip::address::address (4 of 4 overloads)]
+[*Convenience header: ][^boost/asio.hpp]
 
 
-Copy constructor.
+[section:overload1 buffer_cast (1 of 2 overloads)]
 
 
- address(
- const address & other);
+Cast a non-modifiable buffer to a specified pointer to POD type.
 
 
+ template<
+ typename PointerToPodType>
+ PointerToPodType buffer_cast(
+ const mutable_buffer & b);
 
-[endsect]
 
 
 [endsect]
 
-[section:from_string ip::address::from_string]
 
-[indexterm2 from_string..ip::address]
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
+[section:overload2 buffer_cast (2 of 2 overloads)]
 
- static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
- const char * str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload1 more...]]``
 
- static address ``[link boost_asio.reference.ip__address.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload2 more...]]``
+Cast a non-modifiable buffer to a specified pointer to POD type.
 
- static address ``[link boost_asio.reference.ip__address.from_string.overload3 from_string]``(
- const std::string & str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload3 more...]]``
 
- static address ``[link boost_asio.reference.ip__address.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload4 more...]]``
+ template<
+ typename PointerToPodType>
+ PointerToPodType buffer_cast(
+ const const_buffer & b);
 
 
-[section:overload1 ip::address::from_string (1 of 4 overloads)]
 
+[endsect]
 
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
+[endsect]
 
- static address from_string(
- const char * str);
+[section:buffer_copy buffer_copy]
 
+[indexterm1 buffer_copy]
+The `boost::asio::buffer_copy` function is used to copy bytes from a source buffer (or buffer sequence) to a target buffer (or buffer sequence).
 
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload1 buffer_copy]``(
+ const mutable_buffer & target,
+ const const_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload1 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload2 buffer_copy]``(
+ const mutable_buffer & target,
+ const const_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload2 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload3 buffer_copy]``(
+ const mutable_buffer & target,
+ const mutable_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload3 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload4 buffer_copy]``(
+ const mutable_buffer & target,
+ const mutable_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload4 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload5 buffer_copy]``(
+ const mutable_buffer & target,
+ const ConstBufferSequence & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload5 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload6 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const const_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload6 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload7 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const const_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload7 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload8 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const mutable_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload8 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload9 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const mutable_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload9 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload10 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const ConstBufferSequence & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload10 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload11 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const const_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload11 more...]]``
 
-[section:overload2 ip::address::from_string (2 of 4 overloads)]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload12 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const const_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload12 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload13 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const mutable_buffer & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload13 more...]]``
 
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload14 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const mutable_buffers_1 & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload14 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload15 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const ConstBufferSequence & source);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload15 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload16 buffer_copy]``(
+ const mutable_buffer & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload16 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload17 buffer_copy]``(
+ const mutable_buffer & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload17 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload18 buffer_copy]``(
+ const mutable_buffer & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload18 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload19 buffer_copy]``(
+ const mutable_buffer & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload19 more...]]``
 
- static address from_string(
- const char * str,
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload20 buffer_copy]``(
+ const mutable_buffer & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload20 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload21 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload21 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload22 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload22 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload23 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload23 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload24 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload24 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload25 buffer_copy]``(
+ const mutable_buffers_1 & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload25 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload26 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload26 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload27 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload27 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload28 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload28 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload29 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload29 more...]]``
 
-[section:overload3 ip::address::from_string (3 of 4 overloads)]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffer_copy.overload30 buffer_copy]``(
+ const MutableBufferSequence & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_copy.overload30 more...]]``
 
+The `buffer_copy` function is available in two forms:
 
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
+* A 2-argument form: `buffer_copy(target, source)`
 
- static address from_string(
- const std::string & str);
 
+* A 3-argument form: `buffer_copy(target, source, max_bytes_to_copy)`
 
+Both forms return the number of bytes actually copied. The number of bytes copied is the lesser of:
 
-[endsect]
 
+* `buffer_size(target)`
 
 
-[section:overload4 ip::address::from_string (4 of 4 overloads)]
+* `buffer_size(source)`
 
 
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+* `If` specified, `max_bytes_to_copy`.
 
+This prevents buffer overflow, regardless of the buffer sizes used in the copy operation.
 
- static address from_string(
- const std::string & str,
- boost::system::error_code & ec);
+[heading Requirements]
 
+[*Header: ][^boost/asio/buffer.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[endsect]
 
+[section:overload1 buffer_copy (1 of 30 overloads)]
 
-[endsect]
 
+Copies bytes from a source buffer to a target buffer.
 
-[section:is_v4 ip::address::is_v4]
 
-[indexterm2 is_v4..ip::address]
-Get whether the address is an IP version 4 address.
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const const_buffer & source);
 
 
- bool is_v4() const;
 
+[heading Parameters]
+
+
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
+
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+]
 
-[endsect]
 
+[heading Return Value]
+
+The number of bytes copied.
 
 
-[section:is_v6 ip::address::is_v6]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-[indexterm2 is_v6..ip::address]
-Get whether the address is an IP version 6 address.
 
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
 
- bool is_v6() const;
 
 
 
@@ -39406,65 +41324,62 @@
 
 
 
-[section:operator_not__eq_ ip::address::operator!=]
+[section:overload2 buffer_copy (2 of 30 overloads)]
 
-[indexterm2 operator!=..ip::address]
-Compare two addresses for inequality.
 
+Copies bytes from a source buffer to a target buffer.
 
- friend bool operator!=(
- const address & a1,
- const address & a2);
 
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const const_buffers_1 & source);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+]
 
 
-[section:operator_lt_ ip::address::operator<]
+[heading Return Value]
+
+The number of bytes copied.
 
-[indexterm2 operator<..ip::address]
-Compare addresses for ordering.
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
- friend bool operator<(
- const address & a1,
- const address & a2);
 
+* `buffer_size(target)`
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address.hpp]
+* `buffer_size(source)`
+
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_lt__lt_ ip::address::operator<<]
+[section:overload3 buffer_copy (3 of 30 overloads)]
 
-[indexterm2 operator<<..ip::address]
-Output an address as a string.
 
+Copies bytes from a source buffer to a target buffer.
 
- template<
- typename Elem,
- typename Traits>
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const address & addr);
 
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const mutable_buffer & source);
 
-Used to output a human-readable string for a specified address.
 
 
 [heading Parameters]
@@ -39472,205 +41387,214 @@
 
 [variablelist
   
-[[os][The output stream to which the string will be written.]]
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[[addr][The address to be written.]]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
 ]
 
 
 [heading Return Value]
       
-The output stream.
+The number of bytes copied.
 
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[endsect]
+* `buffer_size(target)`
 
 
+* `buffer_size(source)`
 
-[section:operator_lt__eq_ ip::address::operator<=]
 
-[indexterm2 operator<=..ip::address]
-Compare addresses for ordering.
 
 
- friend bool operator<=(
- const address & a1,
- const address & a2);
+[endsect]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address.hpp]
+[section:overload4 buffer_copy (4 of 30 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Copies bytes from a source buffer to a target buffer.
 
-[endsect]
 
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const mutable_buffers_1 & source);
 
-[section:operator_eq_ ip::address::operator=]
 
-[indexterm2 operator=..ip::address]
-Assign from another address.
 
+[heading Parameters]
+
 
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload1 operator=]``(
- const address & other);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload1 more...]]``
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
-Assign from an IPv4 address.
+]
 
 
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload2 operator=]``(
- const boost::asio::ip::address_v4 & ipv4_address);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload2 more...]]``
+[heading Return Value]
+
+The number of bytes copied.
 
 
-Assign from an IPv6 address.
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload3 operator=]``(
- const boost::asio::ip::address_v6 & ipv6_address);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload3 more...]]``
+* `buffer_size(target)`
 
 
-[section:overload1 ip::address::operator= (1 of 3 overloads)]
+* `buffer_size(source)`
 
 
-Assign from another address.
 
 
- address & operator=(
- const address & other);
+[endsect]
 
 
 
-[endsect]
+[section:overload5 buffer_copy (5 of 30 overloads)]
 
 
+Copies bytes from a source buffer sequence to a target buffer.
 
-[section:overload2 ip::address::operator= (2 of 3 overloads)]
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const ConstBufferSequence & source);
 
-Assign from an IPv4 address.
 
 
- address & operator=(
- const boost::asio::ip::address_v4 & ipv4_address);
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
 
-[endsect]
+]
 
 
+[heading Return Value]
+
+The number of bytes copied.
 
-[section:overload3 ip::address::operator= (3 of 3 overloads)]
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-Assign from an IPv6 address.
 
+* `buffer_size(target)`
 
- address & operator=(
- const boost::asio::ip::address_v6 & ipv6_address);
 
+* `buffer_size(source)`
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:operator_eq__eq_ ip::address::operator==]
 
-[indexterm2 operator==..ip::address]
-Compare two addresses for equality.
+[section:overload6 buffer_copy (6 of 30 overloads)]
 
 
- friend bool operator==(
- const address & a1,
- const address & a2);
+Copies bytes from a source buffer to a target buffer.
 
 
-[heading Requirements]
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const const_buffer & source);
 
-[*Header: ][^boost/asio/ip/address.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+]
 
-[section:operator_gt_ ip::address::operator>]
 
-[indexterm2 operator>..ip::address]
-Compare addresses for ordering.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- friend bool operator>(
- const address & a1,
- const address & a2);
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[heading Requirements]
+* `buffer_size(target)`
 
-[*Header: ][^boost/asio/ip/address.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+* `buffer_size(source)`
 
 
-[endsect]
 
 
+[endsect]
 
-[section:operator_gt__eq_ ip::address::operator>=]
 
-[indexterm2 operator>=..ip::address]
-Compare addresses for ordering.
 
+[section:overload7 buffer_copy (7 of 30 overloads)]
 
- friend bool operator>=(
- const address & a1,
- const address & a2);
 
+Copies bytes from a source buffer to a target buffer.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address.hpp]
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const const_buffers_1 & source);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[section:to_string ip::address::to_string]
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
-[indexterm2 to_string..ip::address]
-Get the address as a string in dotted decimal format.
+]
 
 
- std::string ``[link boost_asio.reference.ip__address.to_string.overload1 to_string]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.to_string.overload1 more...]]``
+[heading Return Value]
+
+The number of bytes copied.
 
- std::string ``[link boost_asio.reference.ip__address.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address.to_string.overload2 more...]]``
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-[section:overload1 ip::address::to_string (1 of 2 overloads)]
 
+* `buffer_size(target)`
 
-Get the address as a string in dotted decimal format.
 
+* `buffer_size(source)`
 
- std::string to_string() const;
 
 
 
@@ -39678,279 +41602,187 @@
 
 
 
-[section:overload2 ip::address::to_string (2 of 2 overloads)]
+[section:overload8 buffer_copy (8 of 30 overloads)]
 
 
-Get the address as a string in dotted decimal format.
+Copies bytes from a source buffer to a target buffer.
 
 
- std::string to_string(
- boost::system::error_code & ec) const;
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const mutable_buffer & source);
 
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+]
 
-[section:to_v4 ip::address::to_v4]
 
-[indexterm2 to_v4..ip::address]
-Get the address as an IP version 4 address.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- boost::asio::ip::address_v4 to_v4() const;
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
+* `buffer_size(target)`
 
-[endsect]
 
+* `buffer_size(source)`
 
 
-[section:to_v6 ip::address::to_v6]
 
-[indexterm2 to_v6..ip::address]
-Get the address as an IP version 6 address.
 
+[endsect]
 
- boost::asio::ip::address_v6 to_v6() const;
 
 
+[section:overload9 buffer_copy (9 of 30 overloads)]
 
-[endsect]
 
+Copies bytes from a source buffer to a target buffer.
 
 
-[endsect]
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const mutable_buffers_1 & source);
 
-[section:ip__address_v4 ip::address_v4]
 
 
-Implements IP version 4 style addresses.
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
- class address_v4
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+]
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[heading Return Value]
+
+The number of bytes copied.
 
- [[link boost_asio.reference.ip__address_v4.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
-
- ]
 
-]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v4.address_v4 [*address_v4]]]
- [Default constructor.
+* `buffer_size(target)`
 
- Construct an address from raw bytes.
 
- Construct an address from a unsigned long in host byte order.
+* `buffer_size(source)`
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.any [*any]]]
- [Obtain an address object that represents any address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.broadcast [*broadcast]]]
- [Obtain an address object that represents the broadcast address.
 
- Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.from_string [*from_string]]]
- [Create an address from an IP address string in dotted decimal form. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.is_class_a [*is_class_a]]]
- [Determine whether the address is a class A address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.is_class_b [*is_class_b]]]
- [Determine whether the address is a class B address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.is_class_c [*is_class_c]]]
- [Determine whether the address is a class C address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.is_multicast [*is_multicast]]]
- [Determine whether the address is a multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.loopback [*loopback]]]
- [Obtain an address object that represents the loopback address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.netmask [*netmask]]]
- [Obtain the netmask that corresponds to the address, based on its address class. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_eq_ [*operator=]]]
- [Assign from another address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.to_bytes [*to_bytes]]]
- [Get the address in bytes, in network byte order. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.to_string [*to_string]]]
- [Get the address as a string in dotted decimal format. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.to_ulong [*to_ulong]]]
- [Get the address as an unsigned long in host byte order. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]]
- [Compare two addresses for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_gt_ [*operator>]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]]
- [Compare addresses for ordering. ]
- ]
-
-]
+[endsect]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]]
- [Output an address as a string. ]
- ]
-
-]
 
-The [link boost_asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses.
+[section:overload10 buffer_copy (10 of 30 overloads)]
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+Copies bytes from a source buffer sequence to a target buffer.
 
-[*Shared] [*objects:] Unsafe.
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const ConstBufferSequence & source);
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
+[heading Parameters]
+
 
-[*Convenience header: ][^boost/asio.hpp]
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[section:address_v4 ip::address_v4::address_v4]
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
 
-[indexterm2 address_v4..ip::address_v4]
-Default constructor.
+]
 
 
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload1 address_v4]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload1 more...]]``
+[heading Return Value]
+
+The number of bytes copied.
 
 
-Construct an address from raw bytes.
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
- explicit ``[link boost_asio.reference.ip__address_v4.address_v4.overload2 address_v4]``(
- const bytes_type & bytes);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload2 more...]]``
+* `buffer_size(target)`
 
 
-Construct an address from a unsigned long in host byte order.
+* `buffer_size(source)`
 
 
- explicit ``[link boost_asio.reference.ip__address_v4.address_v4.overload3 address_v4]``(
- unsigned long addr);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload3 more...]]``
 
 
-Copy constructor.
+[endsect]
 
 
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
- const address_v4 & other);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload4 more...]]``
 
+[section:overload11 buffer_copy (11 of 30 overloads)]
 
-[section:overload1 ip::address_v4::address_v4 (1 of 4 overloads)]
 
+Copies bytes from a source buffer to a target buffer sequence.
 
-Default constructor.
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const const_buffer & source);
 
- address_v4();
 
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
+
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+]
 
 
-[section:overload2 ip::address_v4::address_v4 (2 of 4 overloads)]
+[heading Return Value]
+
+The number of bytes copied.
 
 
-Construct an address from raw bytes.
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
- address_v4(
- const bytes_type & bytes);
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
 
 
 
@@ -39958,77 +41790,143 @@
 
 
 
-[section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)]
+[section:overload12 buffer_copy (12 of 30 overloads)]
 
 
-Construct an address from a unsigned long in host byte order.
+Copies bytes from a source buffer to a target buffer sequence.
 
 
- address_v4(
- unsigned long addr);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const const_buffers_1 & source);
 
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
-[section:overload4 ip::address_v4::address_v4 (4 of 4 overloads)]
+]
 
 
-Copy constructor.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- address_v4(
- const address_v4 & other);
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
 
-[endsect]
 
 
 [endsect]
 
 
-[section:any ip::address_v4::any]
 
-[indexterm2 any..ip::address_v4]
-Obtain an address object that represents any address.
+[section:overload13 buffer_copy (13 of 30 overloads)]
 
 
- static address_v4 any();
+Copies bytes from a source buffer to a target buffer sequence.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const mutable_buffer & source);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
+
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes copied.
+
+
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
 
 
 
 [endsect]
 
 
-[section:broadcast ip::address_v4::broadcast]
 
-[indexterm2 broadcast..ip::address_v4]
-Obtain an address object that represents the broadcast address.
+[section:overload14 buffer_copy (14 of 30 overloads)]
 
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload1 broadcast]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.broadcast.overload1 more...]]``
+Copies bytes from a source buffer to a target buffer sequence.
 
 
-Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const mutable_buffers_1 & source);
 
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload2 broadcast]``(
- const address_v4 & addr,
- const address_v4 & mask);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.broadcast.overload2 more...]]``
 
+[heading Parameters]
+
+
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
-[section:overload1 ip::address_v4::broadcast (1 of 2 overloads)]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+]
 
-Obtain an address object that represents the broadcast address.
+
+[heading Return Value]
+
+The number of bytes copied.
 
 
- static address_v4 broadcast();
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
 
 
 
@@ -40036,93 +41934,100 @@
 
 
 
-[section:overload2 ip::address_v4::broadcast (2 of 2 overloads)]
+[section:overload15 buffer_copy (15 of 30 overloads)]
 
 
-Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
+Copies bytes from a source buffer sequence to a target buffer sequence.
 
 
- static address_v4 broadcast(
- const address_v4 & addr,
- const address_v4 & mask);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const ConstBufferSequence & source);
 
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
-[endsect]
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
+
+]
 
 
-[section:bytes_type ip::address_v4::bytes_type]
+[heading Return Value]
+
+The number of bytes copied.
 
-[indexterm2 bytes_type..ip::address_v4]
-The type used to represent an address as an array of bytes.
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
- typedef boost::array< unsigned char, 4 > bytes_type;
 
+* `buffer_size(target)`
 
 
-[heading Requirements]
+* `buffer_size(source)`
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:from_string ip::address_v4::from_string]
 
-[indexterm2 from_string..ip::address_v4]
-Create an address from an IP address string in dotted decimal form.
+[section:overload16 buffer_copy (16 of 30 overloads)]
 
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload1 from_string]``(
- const char * str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload1 more...]]``
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload2 more...]]``
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload3 from_string]``(
- const std::string & str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload3 more...]]``
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
 
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload4 more...]]``
 
 
-[section:overload1 ip::address_v4::from_string (1 of 4 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-Create an address from an IP address string in dotted decimal form.
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
- static address_v4 from_string(
- const char * str);
+]
 
 
+[heading Return Value]
+
+The number of bytes copied.
 
-[endsect]
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[section:overload2 ip::address_v4::from_string (2 of 4 overloads)]
+* `buffer_size(target)`
 
 
-Create an address from an IP address string in dotted decimal form.
+* `buffer_size(source)`
 
 
- static address_v4 from_string(
- const char * str,
- boost::system::error_code & ec);
+* `max_bytes_to_copy`
+
 
 
 
@@ -40130,74 +42035,103 @@
 
 
 
-[section:overload3 ip::address_v4::from_string (3 of 4 overloads)]
+[section:overload17 buffer_copy (17 of 30 overloads)]
 
 
-Create an address from an IP address string in dotted decimal form.
+Copies a limited number of bytes from a source buffer to a target buffer.
 
 
- static address_v4 from_string(
- const std::string & str);
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
-[section:overload4 ip::address_v4::from_string (4 of 4 overloads)]
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-Create an address from an IP address string in dotted decimal form.
 
+[heading Return Value]
+
+The number of bytes copied.
 
- static address_v4 from_string(
- const std::string & str,
- boost::system::error_code & ec);
+
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
+
 
-[endsect]
 
 
 [endsect]
 
 
-[section:is_class_a ip::address_v4::is_class_a]
 
-[indexterm2 is_class_a..ip::address_v4]
-Determine whether the address is a class A address.
+[section:overload18 buffer_copy (18 of 30 overloads)]
 
 
- bool is_class_a() const;
+Copies a limited number of bytes from a source buffer to a target buffer.
 
 
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
 
-[endsect]
 
 
+[heading Parameters]
+
 
-[section:is_class_b ip::address_v4::is_class_b]
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[indexterm2 is_class_b..ip::address_v4]
-Determine whether the address is a class B address.
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
- bool is_class_b() const;
+]
 
 
+[heading Return Value]
+
+The number of bytes copied.
 
-[endsect]
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[section:is_class_c ip::address_v4::is_class_c]
+* `buffer_size(target)`
 
-[indexterm2 is_class_c..ip::address_v4]
-Determine whether the address is a class C address.
 
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
 
- bool is_class_c() const;
 
 
 
@@ -40205,42 +42139,51 @@
 
 
 
-[section:is_multicast ip::address_v4::is_multicast]
+[section:overload19 buffer_copy (19 of 30 overloads)]
 
-[indexterm2 is_multicast..ip::address_v4]
-Determine whether the address is a multicast address.
 
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- bool is_multicast() const;
 
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
 
-[endsect]
 
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[section:loopback ip::address_v4::loopback]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
-[indexterm2 loopback..ip::address_v4]
-Obtain an address object that represents the loopback address.
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
- static address_v4 loopback();
 
+[heading Return Value]
+
+The number of bytes copied.
 
 
-[endsect]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
+* `buffer_size(target)`
 
-[section:netmask ip::address_v4::netmask]
 
-[indexterm2 netmask..ip::address_v4]
-Obtain the netmask that corresponds to the address, based on its address class.
+* `buffer_size(source)`
 
 
- static address_v4 netmask(
- const address_v4 & addr);
+* `max_bytes_to_copy`
+
 
 
 
@@ -40248,65 +42191,71 @@
 
 
 
-[section:operator_not__eq_ ip::address_v4::operator!=]
+[section:overload20 buffer_copy (20 of 30 overloads)]
 
-[indexterm2 operator!=..ip::address_v4]
-Compare two addresses for inequality.
 
+Copies a limited number of bytes from a source buffer sequence to a target buffer.
 
- friend bool operator!=(
- const address_v4 & a1,
- const address_v4 & a2);
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const mutable_buffer & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-[section:operator_lt_ ip::address_v4::operator<]
 
-[indexterm2 operator<..ip::address_v4]
-Compare addresses for ordering.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- friend bool operator<(
- const address_v4 & a1,
- const address_v4 & a2);
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[heading Requirements]
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_lt__lt_ ip::address_v4::operator<<]
+[section:overload21 buffer_copy (21 of 30 overloads)]
 
-[indexterm2 operator<<..ip::address_v4]
-Output an address as a string.
 
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- template<
- typename Elem,
- typename Traits>
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const address_v4 & addr);
 
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
 
-Used to output a human-readable string for a specified address.
 
 
 [heading Parameters]
@@ -40314,16 +42263,32 @@
 
 [variablelist
   
-[[os][The output stream to which the string will be written.]]
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[[addr][The address to be written.]]
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
+
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
 ]
 
 
 [heading Return Value]
       
-The output stream.
+The number of bytes copied.
+
+
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
 
 
 
@@ -40332,36 +42297,51 @@
 
 
 
-[section:operator_lt__eq_ ip::address_v4::operator<=]
+[section:overload22 buffer_copy (22 of 30 overloads)]
 
-[indexterm2 operator<=..ip::address_v4]
-Compare addresses for ordering.
 
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- friend bool operator<=(
- const address_v4 & a1,
- const address_v4 & a2);
 
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-[section:operator_eq_ ip::address_v4::operator=]
 
-[indexterm2 operator=..ip::address_v4]
-Assign from another address.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- address_v4 & operator=(
- const address_v4 & other);
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
+
 
 
 
@@ -40369,529 +42349,479 @@
 
 
 
-[section:operator_eq__eq_ ip::address_v4::operator==]
+[section:overload23 buffer_copy (23 of 30 overloads)]
 
-[indexterm2 operator==..ip::address_v4]
-Compare two addresses for equality.
 
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- friend bool operator==(
- const address_v4 & a1,
- const address_v4 & a2);
 
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-[section:operator_gt_ ip::address_v4::operator>]
 
-[indexterm2 operator>..ip::address_v4]
-Compare addresses for ordering.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- friend bool operator>(
- const address_v4 & a1,
- const address_v4 & a2);
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[heading Requirements]
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_gt__eq_ ip::address_v4::operator>=]
+[section:overload24 buffer_copy (24 of 30 overloads)]
 
-[indexterm2 operator>=..ip::address_v4]
-Compare addresses for ordering.
 
+Copies a limited number of bytes from a source buffer to a target buffer.
 
- friend bool operator>=(
- const address_v4 & a1,
- const address_v4 & a2);
 
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v4.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
-[endsect]
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-[section:to_bytes ip::address_v4::to_bytes]
 
-[indexterm2 to_bytes..ip::address_v4]
-Get the address in bytes, in network byte order.
+[heading Return Value]
+
+The number of bytes copied.
 
 
- bytes_type to_bytes() const;
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
+
 
 
 
 [endsect]
 
 
-[section:to_string ip::address_v4::to_string]
 
-[indexterm2 to_string..ip::address_v4]
-Get the address as a string in dotted decimal format.
+[section:overload25 buffer_copy (25 of 30 overloads)]
 
 
- std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload1 to_string]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.to_string.overload1 more...]]``
+Copies a limited number of bytes from a source buffer sequence to a target buffer.
 
- std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.to_string.overload2 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const mutable_buffers_1 & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
 
-[section:overload1 ip::address_v4::to_string (1 of 2 overloads)]
 
 
-Get the address as a string in dotted decimal format.
+[heading Parameters]
+
 
+[variablelist
+
+[[target][A modifiable buffer representing the memory region to which the bytes will be copied.]]
 
- std::string to_string() const;
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
 
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
-[endsect]
 
+[heading Return Value]
+
+The number of bytes copied.
 
 
-[section:overload2 ip::address_v4::to_string (2 of 2 overloads)]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-Get the address as a string in dotted decimal format.
+* `buffer_size(target)`
 
 
- std::string to_string(
- boost::system::error_code & ec) const;
+* `buffer_size(source)`
 
 
+* `max_bytes_to_copy`
+
 
-[endsect]
 
 
 [endsect]
 
 
-[section:to_ulong ip::address_v4::to_ulong]
 
-[indexterm2 to_ulong..ip::address_v4]
-Get the address as an unsigned long in host byte order.
+[section:overload26 buffer_copy (26 of 30 overloads)]
 
 
- unsigned long to_ulong() const;
+Copies a limited number of bytes from a source buffer to a target buffer sequence.
 
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const const_buffer & source,
+ std::size_t max_bytes_to_copy);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
+
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
+
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes copied.
+
+
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
+
+
+* `buffer_size(target)`
+
+
+* `buffer_size(source)`
+
+
+* `max_bytes_to_copy`
 
-[endsect]
 
 
 
 [endsect]
 
-[section:ip__address_v6 ip::address_v6]
 
 
-Implements IP version 6 style addresses.
+[section:overload27 buffer_copy (27 of 30 overloads)]
 
 
- class address_v6
+Copies a limited number of bytes from a source buffer to a target buffer sequence.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const const_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
- [
 
- [[link boost_asio.reference.ip__address_v6.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
+
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
+
+[[source][A non-modifiable buffer representing the memory region from which the bytes will be copied.]]
+
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v6.address_v6 [*address_v6]]]
- [Default constructor.
+[heading Return Value]
+
+The number of bytes copied.
 
- Construct an address from raw bytes and scope ID.
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.any [*any]]]
- [Obtain an address object that represents any address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.from_string [*from_string]]]
- [Create an address from an IP address string. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_link_local [*is_link_local]]]
- [Determine whether the address is link local. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_loopback [*is_loopback]]]
- [Determine whether the address is a loopback address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast [*is_multicast]]]
- [Determine whether the address is a multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]]
- [Determine whether the address is a global multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]]
- [Determine whether the address is a link-local multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]]
- [Determine whether the address is a node-local multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]]
- [Determine whether the address is a org-local multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]]
- [Determine whether the address is a site-local multicast address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_site_local [*is_site_local]]]
- [Determine whether the address is site local. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]]
- [Determine whether the address is unspecified. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]]
- [Determine whether the address is an IPv4-compatible address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]]
- [Determine whether the address is a mapped IPv4 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.loopback [*loopback]]]
- [Obtain an address object that represents the loopback address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_eq_ [*operator=]]]
- [Assign from another address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.scope_id [*scope_id]]]
- [The scope ID of the address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.to_bytes [*to_bytes]]]
- [Get the address in bytes, in network byte order. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.to_string [*to_string]]]
- [Get the address as a string. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.to_v4 [*to_v4]]]
- [Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.v4_compatible [*v4_compatible]]]
- [Create an IPv4-compatible IPv6 address. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]]
- [Create an IPv4-mapped IPv6 address. ]
- ]
-
-]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]]
- [Compare two addresses for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_gt_ [*operator>]]]
- [Compare addresses for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]]
- [Compare addresses for ordering. ]
- ]
-
-]
+* `buffer_size(target)`
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]]
- [Output an address as a string. ]
- ]
-
-]
+* `buffer_size(source)`
 
-The [link boost_asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses.
 
+* `max_bytes_to_copy`
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
 
 
+[endsect]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:overload28 buffer_copy (28 of 30 overloads)]
 
-[section:address_v6 ip::address_v6::address_v6]
 
-[indexterm2 address_v6..ip::address_v6]
-Default constructor.
+Copies a limited number of bytes from a source buffer to a target buffer sequence.
 
 
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload1 address_v6]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const mutable_buffer & source,
+ std::size_t max_bytes_to_copy);
 
 
-Construct an address from raw bytes and scope ID.
 
+[heading Parameters]
+
 
- explicit ``[link boost_asio.reference.ip__address_v6.address_v6.overload2 address_v6]``(
- const bytes_type & bytes,
- unsigned long scope_id = 0);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload2 more...]]``
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
-Copy constructor.
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload3 address_v6]``(
- const address_v6 & other);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload3 more...]]``
 
+[heading Return Value]
+
+The number of bytes copied.
 
-[section:overload1 ip::address_v6::address_v6 (1 of 3 overloads)]
 
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
-Default constructor.
 
+* `buffer_size(target)`
 
- address_v6();
 
+* `buffer_size(source)`
 
 
-[endsect]
+* `max_bytes_to_copy`
 
 
 
-[section:overload2 ip::address_v6::address_v6 (2 of 3 overloads)]
 
+[endsect]
 
-Construct an address from raw bytes and scope ID.
 
 
- address_v6(
- const bytes_type & bytes,
- unsigned long scope_id = 0);
+[section:overload29 buffer_copy (29 of 30 overloads)]
 
 
+Copies a limited number of bytes from a source buffer to a target buffer sequence.
 
-[endsect]
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const mutable_buffers_1 & source,
+ std::size_t max_bytes_to_copy);
 
 
-[section:overload3 ip::address_v6::address_v6 (3 of 3 overloads)]
 
+[heading Parameters]
+
 
-Copy constructor.
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
+[[source][A modifiable buffer representing the memory region from which the bytes will be copied. The contents of the source buffer will not be modified.]]
 
- address_v6(
- const address_v6 & other);
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes copied.
 
 
-[endsect]
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
 
-[section:any ip::address_v6::any]
+* `buffer_size(target)`
 
-[indexterm2 any..ip::address_v6]
-Obtain an address object that represents any address.
 
+* `buffer_size(source)`
 
- static address_v6 any();
 
+* `max_bytes_to_copy`
 
 
-[endsect]
 
 
+[endsect]
 
-[section:bytes_type ip::address_v6::bytes_type]
 
-[indexterm2 bytes_type..ip::address_v6]
-The type used to represent an address as an array of bytes.
 
+[section:overload30 buffer_copy (30 of 30 overloads)]
 
- typedef boost::array< unsigned char, 16 > bytes_type;
 
+Copies a limited number of bytes from a source buffer sequence to a target buffer sequence.
 
 
-[heading Requirements]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t buffer_copy(
+ const MutableBufferSequence & target,
+ const ConstBufferSequence & source,
+ std::size_t max_bytes_to_copy);
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[target][A modifiable buffer sequence representing the memory regions to which the bytes will be copied.]]
 
+[[source][A non-modifiable buffer sequence representing the memory regions from which the bytes will be copied.]]
 
-[section:from_string ip::address_v6::from_string]
+[[max_bytes_to_copy][The maximum number of bytes to be copied.]]
 
-[indexterm2 from_string..ip::address_v6]
-Create an address from an IP address string.
+]
 
 
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload1 from_string]``(
- const char * str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload1 more...]]``
+[heading Return Value]
+
+The number of bytes copied.
 
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload2 more...]]``
 
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload3 from_string]``(
- const std::string & str);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload3 more...]]``
+[heading Remarks]
+
+The number of bytes copied is the lesser of:
 
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload4 more...]]``
 
+* `buffer_size(target)`
 
-[section:overload1 ip::address_v6::from_string (1 of 4 overloads)]
 
+* `buffer_size(source)`
 
-Create an address from an IP address string.
 
+* `max_bytes_to_copy`
 
- static address_v6 from_string(
- const char * str);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 ip::address_v6::from_string (2 of 4 overloads)]
+[section:buffer_size buffer_size]
 
+[indexterm1 buffer_size]
+The `boost::asio::buffer_size` function determines the total number of bytes in a buffer or buffer sequence.
 
-Create an address from an IP address string.
+
+ std::size_t ``[link boost_asio.reference.buffer_size.overload1 buffer_size]``(
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_size.overload1 more...]]``
 
+ std::size_t ``[link boost_asio.reference.buffer_size.overload2 buffer_size]``(
+ const mutable_buffers_1 & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_size.overload2 more...]]``
 
- static address_v6 from_string(
- const char * str,
- boost::system::error_code & ec);
+ std::size_t ``[link boost_asio.reference.buffer_size.overload3 buffer_size]``(
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_size.overload3 more...]]``
+
+ std::size_t ``[link boost_asio.reference.buffer_size.overload4 buffer_size]``(
+ const const_buffers_1 & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_size.overload4 more...]]``
 
+ template<
+ typename BufferSequence>
+ std::size_t ``[link boost_asio.reference.buffer_size.overload5 buffer_size]``(
+ const BufferSequence & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffer_size.overload5 more...]]``
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/buffer.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload3 ip::address_v6::from_string (3 of 4 overloads)]
+[section:overload1 buffer_size (1 of 5 overloads)]
 
 
-Create an address from an IP address string.
+Get the number of bytes in a modifiable buffer.
 
 
- static address_v6 from_string(
- const std::string & str);
+ std::size_t buffer_size(
+ const mutable_buffer & b);
 
 
 
@@ -40899,31 +42829,29 @@
 
 
 
-[section:overload4 ip::address_v6::from_string (4 of 4 overloads)]
+[section:overload2 buffer_size (2 of 5 overloads)]
 
 
-Create an address from an IP address string.
+Get the number of bytes in a modifiable buffer.
 
 
- static address_v6 from_string(
- const std::string & str,
- boost::system::error_code & ec);
+ std::size_t buffer_size(
+ const mutable_buffers_1 & b);
 
 
 
 [endsect]
 
 
-[endsect]
 
+[section:overload3 buffer_size (3 of 5 overloads)]
 
-[section:is_link_local ip::address_v6::is_link_local]
 
-[indexterm2 is_link_local..ip::address_v6]
-Determine whether the address is link local.
+Get the number of bytes in a non-modifiable buffer.
 
 
- bool is_link_local() const;
+ std::size_t buffer_size(
+ const const_buffer & b);
 
 
 
@@ -40931,13 +42859,14 @@
 
 
 
-[section:is_loopback ip::address_v6::is_loopback]
+[section:overload4 buffer_size (4 of 5 overloads)]
 
-[indexterm2 is_loopback..ip::address_v6]
-Determine whether the address is a loopback address.
+
+Get the number of bytes in a non-modifiable buffer.
 
 
- bool is_loopback() const;
+ std::size_t buffer_size(
+ const const_buffers_1 & b);
 
 
 
@@ -40945,83 +42874,179 @@
 
 
 
-[section:is_multicast ip::address_v6::is_multicast]
-
-[indexterm2 is_multicast..ip::address_v6]
-Determine whether the address is a multicast address.
+[section:overload5 buffer_size (5 of 5 overloads)]
 
 
- bool is_multicast() const;
+Get the total number of bytes in a buffer sequence.
 
 
+ template<
+ typename BufferSequence>
+ std::size_t buffer_size(
+ const BufferSequence & b);
 
-[endsect]
 
+The `BufferSequence` template parameter may meet either of the `ConstBufferSequence` or `MutableBufferSequence` type requirements.
 
 
-[section:is_multicast_global ip::address_v6::is_multicast_global]
+[endsect]
 
-[indexterm2 is_multicast_global..ip::address_v6]
-Determine whether the address is a global multicast address.
 
+[endsect]
 
- bool is_multicast_global() const;
+[section:buffered_read_stream buffered_read_stream]
 
 
+Adds buffering to the read-related operations of a stream.
 
-[endsect]
 
+ template<
+ typename Stream>
+ class buffered_read_stream :
+ noncopyable
 
 
-[section:is_multicast_link_local ip::address_v6::is_multicast_link_local]
+[heading Types]
+[table
+ [[Name][Description]]
 
-[indexterm2 is_multicast_link_local..ip::address_v6]
-Determine whether the address is a link-local multicast address.
+ [
 
+ [[link boost_asio.reference.buffered_read_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
 
- bool is_multicast_link_local() const;
+ [
 
+ [[link boost_asio.reference.buffered_read_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
+
+ ]
 
+]
 
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.buffered_read_stream.async_fill [*async_fill]]]
+ [Start an asynchronous fill. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.buffered_read_stream [*buffered_read_stream]]]
+ [Construct, passing the specified argument to initialise the next layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.close [*close]]]
+ [Close the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.fill [*fill]]]
+ [Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
+ Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
 
-[section:is_multicast_node_local ip::address_v6::is_multicast_node_local]
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.next_layer [*next_layer]]]
+ [Get a reference to the next layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.peek [*peek]]]
+ [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
-[indexterm2 is_multicast_node_local..ip::address_v6]
-Determine whether the address is a node-local multicast address.
+ Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.read_some [*read_some]]]
+ [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
+ Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.write_some [*write_some]]]
+ [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
- bool is_multicast_node_local() const;
+ Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred. ]
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.buffered_read_stream.default_buffer_size [*default_buffer_size]]]
+ [The default buffer size. ]
+ ]
 
-[endsect]
+]
 
+The [link boost_asio.reference.buffered_read_stream `buffered_read_stream`] class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.
 
 
-[section:is_multicast_org_local ip::address_v6::is_multicast_org_local]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
-[indexterm2 is_multicast_org_local..ip::address_v6]
-Determine whether the address is a org-local multicast address.
+[*Shared] [*objects:] Unsafe.
 
 
- bool is_multicast_org_local() const;
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/buffered_read_stream.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:is_multicast_site_local ip::address_v6::is_multicast_site_local]
+[section:async_fill buffered_read_stream::async_fill]
 
-[indexterm2 is_multicast_site_local..ip::address_v6]
-Determine whether the address is a site-local multicast address.
+[indexterm2 async_fill..buffered_read_stream]
+Start an asynchronous fill.
 
 
- bool is_multicast_site_local() const;
+ template<
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
 
 
 
@@ -41029,13 +43054,18 @@
 
 
 
-[section:is_site_local ip::address_v6::is_site_local]
+[section:async_read_some buffered_read_stream::async_read_some]
 
-[indexterm2 is_site_local..ip::address_v6]
-Determine whether the address is site local.
+[indexterm2 async_read_some..buffered_read_stream]
+Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
 
 
- bool is_site_local() const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
 
 
@@ -41043,55 +43073,101 @@
 
 
 
-[section:is_unspecified ip::address_v6::is_unspecified]
+[section:async_write_some buffered_read_stream::async_write_some]
 
-[indexterm2 is_unspecified..ip::address_v6]
-Determine whether the address is unspecified.
+[indexterm2 async_write_some..buffered_read_stream]
+Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
 
 
- bool is_unspecified() const;
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
 
 
 [endsect]
 
 
+[section:buffered_read_stream buffered_read_stream::buffered_read_stream]
 
-[section:is_v4_compatible ip::address_v6::is_v4_compatible]
-
-[indexterm2 is_v4_compatible..ip::address_v6]
-Determine whether the address is an IPv4-compatible address.
+[indexterm2 buffered_read_stream..buffered_read_stream]
+Construct, passing the specified argument to initialise the next layer.
 
 
- bool is_v4_compatible() const;
+ template<
+ typename Arg>
+ explicit ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
+ Arg & a);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 more...]]``
 
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
+ Arg & a,
+ std::size_t buffer_size);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
 
 
+Construct, passing the specified argument to initialise the next layer.
 
-[section:is_v4_mapped ip::address_v6::is_v4_mapped]
 
-[indexterm2 is_v4_mapped..ip::address_v6]
-Determine whether the address is a mapped IPv4 address.
+ template<
+ typename Arg>
+ buffered_read_stream(
+ Arg & a);
 
 
- bool is_v4_mapped() const;
+
+[endsect]
+
+
+
+[section:overload2 buffered_read_stream::buffered_read_stream (2 of 2 overloads)]
+
+
+Construct, passing the specified argument to initialise the next layer.
+
+
+ template<
+ typename Arg>
+ buffered_read_stream(
+ Arg & a,
+ std::size_t buffer_size);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:loopback ip::address_v6::loopback]
+[section:close buffered_read_stream::close]
 
-[indexterm2 loopback..ip::address_v6]
-Obtain an address object that represents the loopback address.
+[indexterm2 close..buffered_read_stream]
+Close the stream.
 
 
- static address_v6 loopback();
+ void ``[link boost_asio.reference.buffered_read_stream.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.close.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.buffered_read_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.close.overload2 more...]]``
+
+
+[section:overload1 buffered_read_stream::close (1 of 2 overloads)]
+
+
+Close the stream.
+
+
+ void close();
 
 
 
@@ -41099,185 +43175,202 @@
 
 
 
-[section:operator_not__eq_ ip::address_v6::operator!=]
+[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
 
-[indexterm2 operator!=..ip::address_v6]
-Compare two addresses for inequality.
 
+Close the stream.
 
- friend bool operator!=(
- const address_v6 & a1,
- const address_v6 & a2);
 
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
+[section:default_buffer_size buffered_read_stream::default_buffer_size]
 
-[section:operator_lt_ ip::address_v6::operator<]
+[indexterm2 default_buffer_size..buffered_read_stream]
+The default buffer size.
 
-[indexterm2 operator<..ip::address_v6]
-Compare addresses for ordering.
 
+ static const std::size_t default_buffer_size = implementation_defined;
 
- friend bool operator<(
- const address_v6 & a1,
- const address_v6 & a2);
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:fill buffered_read_stream::fill]
+
+[indexterm2 fill..buffered_read_stream]
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
+
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.fill.overload1 more...]]``
+
+
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
+
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.fill.overload2 more...]]``
+
+
+[section:overload1 buffered_read_stream::fill (1 of 2 overloads)]
+
+
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
+
+
+ std::size_t fill();
+
 
 
 [endsect]
 
 
 
-[section:operator_lt__lt_ ip::address_v6::operator<<]
+[section:overload2 buffered_read_stream::fill (2 of 2 overloads)]
 
-[indexterm2 operator<<..ip::address_v6]
-Output an address as a string.
 
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
 
- template<
- typename Elem,
- typename Traits>
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const address_v6 & addr);
 
+ std::size_t fill(
+ boost::system::error_code & ec);
 
-Used to output a human-readable string for a specified address.
 
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[os][The output stream to which the string will be written.]]
 
-[[addr][The address to be written.]]
+[endsect]
 
-]
 
+[section:get_io_service buffered_read_stream::get_io_service]
+
+[indexterm2 get_io_service..buffered_read_stream]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
-[heading Return Value]
-
-The output stream.
 
+ boost::asio::io_service & get_io_service();
 
 
 
 [endsect]
 
 
+[section:in_avail buffered_read_stream::in_avail]
 
-[section:operator_lt__eq_ ip::address_v6::operator<=]
+[indexterm2 in_avail..buffered_read_stream]
+Determine the amount of data that may be read without blocking.
 
-[indexterm2 operator<=..ip::address_v6]
-Compare addresses for ordering.
 
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload1 in_avail]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.in_avail.overload1 more...]]``
 
- friend bool operator<=(
- const address_v6 & a1,
- const address_v6 & a2);
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.in_avail.overload2 more...]]``
 
 
-[heading Requirements]
+[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+Determine the amount of data that may be read without blocking.
+
+
+ std::size_t in_avail();
+
 
 
 [endsect]
 
 
 
-[section:operator_eq_ ip::address_v6::operator=]
+[section:overload2 buffered_read_stream::in_avail (2 of 2 overloads)]
 
-[indexterm2 operator=..ip::address_v6]
-Assign from another address.
 
+Determine the amount of data that may be read without blocking.
 
- address_v6 & operator=(
- const address_v6 & other);
+
+ std::size_t in_avail(
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:operator_eq__eq_ ip::address_v6::operator==]
+[section:lowest_layer buffered_read_stream::lowest_layer]
 
-[indexterm2 operator==..ip::address_v6]
-Compare two addresses for equality.
+[indexterm2 lowest_layer..buffered_read_stream]
+Get a reference to the lowest layer.
 
 
- friend bool operator==(
- const address_v6 & a1,
- const address_v6 & a2);
+ lowest_layer_type & ``[link boost_asio.reference.buffered_read_stream.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.lowest_layer.overload1 more...]]``
 
 
-[heading Requirements]
+Get a const reference to the lowest layer.
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ const lowest_layer_type & ``[link boost_asio.reference.buffered_read_stream.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.lowest_layer.overload2 more...]]``
+
+
+[section:overload1 buffered_read_stream::lowest_layer (1 of 2 overloads)]
+
+
+Get a reference to the lowest layer.
+
+
+ lowest_layer_type & lowest_layer();
+
 
 
 [endsect]
 
 
 
-[section:operator_gt_ ip::address_v6::operator>]
+[section:overload2 buffered_read_stream::lowest_layer (2 of 2 overloads)]
 
-[indexterm2 operator>..ip::address_v6]
-Compare addresses for ordering.
 
+Get a const reference to the lowest layer.
 
- friend bool operator>(
- const address_v6 & a1,
- const address_v6 & a2);
 
+ const lowest_layer_type & lowest_layer() const;
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
+[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
 
-[section:operator_gt__eq_ ip::address_v6::operator>=]
+[indexterm2 lowest_layer_type..buffered_read_stream]
+The type of the lowest layer.
 
-[indexterm2 operator>=..ip::address_v6]
-Compare addresses for ordering.
 
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
 
- friend bool operator>=(
- const address_v6 & a1,
- const address_v6 & a2);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/address_v6.hpp]
+[*Header: ][^boost/asio/buffered_read_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -41285,89 +43378,135 @@
 [endsect]
 
 
-[section:scope_id ip::address_v6::scope_id]
 
-[indexterm2 scope_id..ip::address_v6]
-The scope ID of the address.
+[section:next_layer buffered_read_stream::next_layer]
 
+[indexterm2 next_layer..buffered_read_stream]
+Get a reference to the next layer.
 
- unsigned long ``[link boost_asio.reference.ip__address_v6.scope_id.overload1 scope_id]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.scope_id.overload1 more...]]``
 
- void ``[link boost_asio.reference.ip__address_v6.scope_id.overload2 scope_id]``(
- unsigned long id);
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.scope_id.overload2 more...]]``
+ next_layer_type & next_layer();
 
 
-[section:overload1 ip::address_v6::scope_id (1 of 2 overloads)]
 
+[endsect]
 
-The scope ID of the address.
 
 
- unsigned long scope_id() const;
+[section:next_layer_type buffered_read_stream::next_layer_type]
 
+[indexterm2 next_layer_type..buffered_read_stream]
+The type of the next layer.
 
-Returns the scope ID associated with the IPv6 address.
+
+ typedef boost::remove_reference< Stream >::type next_layer_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffered_read_stream.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:peek buffered_read_stream::peek]
 
-[section:overload2 ip::address_v6::scope_id (2 of 2 overloads)]
+[indexterm2 peek..buffered_read_stream]
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
-The scope ID of the address.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.peek.overload1 more...]]``
 
 
- void scope_id(
- unsigned long id);
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
 
-Modifies the scope ID associated with the IPv6 address.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload2 peek]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.peek.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 buffered_read_stream::peek (1 of 2 overloads)]
+
+
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
+
 
 
 [endsect]
 
 
-[section:to_bytes ip::address_v6::to_bytes]
 
-[indexterm2 to_bytes..ip::address_v6]
-Get the address in bytes, in network byte order.
+[section:overload2 buffered_read_stream::peek (2 of 2 overloads)]
 
 
- bytes_type to_bytes() const;
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
-[section:to_string ip::address_v6::to_string]
+[endsect]
 
-[indexterm2 to_string..ip::address_v6]
-Get the address as a string.
+[section:read_some buffered_read_stream::read_some]
 
+[indexterm2 read_some..buffered_read_stream]
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
- std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload1 to_string]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.to_string.overload1 more...]]``
 
- std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.to_string.overload2 more...]]``
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.read_some.overload1 more...]]``
 
 
-[section:overload1 ip::address_v6::to_string (1 of 2 overloads)]
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
-Get the address as a string.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.read_some.overload2 more...]]``
 
 
- std::string to_string() const;
+[section:overload1 buffered_read_stream::read_some (1 of 2 overloads)]
+
+
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
 
 
@@ -41375,14 +43514,17 @@
 
 
 
-[section:overload2 ip::address_v6::to_string (2 of 2 overloads)]
+[section:overload2 buffered_read_stream::read_some (2 of 2 overloads)]
 
 
-Get the address as a string.
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
- std::string to_string(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
 
@@ -41391,29 +43533,40 @@
 
 [endsect]
 
+[section:write_some buffered_read_stream::write_some]
 
-[section:to_v4 ip::address_v6::to_v4]
+[indexterm2 write_some..buffered_read_stream]
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
-[indexterm2 to_v4..ip::address_v6]
-Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.write_some.overload1 more...]]``
 
- address_v4 to_v4() const;
 
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_read_stream.write_some.overload2 more...]]``
 
 
+[section:overload1 buffered_read_stream::write_some (1 of 2 overloads)]
 
-[section:v4_compatible ip::address_v6::v4_compatible]
 
-[indexterm2 v4_compatible..ip::address_v6]
-Create an IPv4-compatible IPv6 address.
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
 
- static address_v6 v4_compatible(
- const address_v4 & addr);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
 
 
@@ -41421,32 +43574,38 @@
 
 
 
-[section:v4_mapped ip::address_v6::v4_mapped]
+[section:overload2 buffered_read_stream::write_some (2 of 2 overloads)]
 
-[indexterm2 v4_mapped..ip::address_v6]
-Create an IPv4-mapped IPv6 address.
 
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
 
- static address_v6 v4_mapped(
- const address_v4 & addr);
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
+
 
 [endsect]
 
-[section:ip__basic_endpoint ip::basic_endpoint]
+[section:buffered_stream buffered_stream]
 
 
-Describes an endpoint for a version-independent IP socket.
+Adds buffering to the read- and write-related operations of a stream.
 
 
   template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_endpoint
+ typename Stream>
+ class buffered_stream :
+ noncopyable
 
 
 [heading Types]
@@ -41455,15 +43614,15 @@
 
   [
 
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+ [[link boost_asio.reference.buffered_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
+ [[link boost_asio.reference.buffered_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
   
   ]
 
@@ -41474,110 +43633,95 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint.
-
- Set the IP address associated with the endpoint. ]
+ [[link boost_asio.reference.buffered_stream.async_fill [*async_fill]]]
+ [Start an asynchronous fill. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
-
- Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
-
- Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
-
- Copy constructor. ]
+ [[link boost_asio.reference.buffered_stream.async_flush [*async_flush]]]
+ [Start an asynchronous flush. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
+ [[link boost_asio.reference.buffered_stream.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
+ [[link boost_asio.reference.buffered_stream.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [[link boost_asio.reference.buffered_stream.buffered_stream [*buffered_stream]]]
+ [Construct, passing the specified argument to initialise the next layer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
- [Get the port associated with the endpoint. The port number is always in the host's byte order.
-
- Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ [[link boost_asio.reference.buffered_stream.close [*close]]]
+ [Close the stream. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [[link boost_asio.reference.buffered_stream.fill [*fill]]]
+ [Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
+
+ Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.buffered_stream.flush [*flush]]]
+ [Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+
+ Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.buffered_stream.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
-]
-
-[heading Friends]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
+ [[link boost_asio.reference.buffered_stream.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
+ [[link boost_asio.reference.buffered_stream.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
+ [[link boost_asio.reference.buffered_stream.next_layer [*next_layer]]]
+ [Get a reference to the next layer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
+ [[link boost_asio.reference.buffered_stream.peek [*peek]]]
+ [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+
+ Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
+ [[link boost_asio.reference.buffered_stream.read_some [*read_some]]]
+ [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+
+ Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
- ]
-
-]
-
-[heading Related Functions]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.buffered_stream.write_some [*write_some]]]
+ [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
+ Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred. ]
   ]
   
 ]
 
-The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+The [link boost_asio.reference.buffered_stream `buffered_stream`] class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
 
 
 [heading Thread Safety]
@@ -41591,35 +43735,38 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+[*Header: ][^boost/asio/buffered_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:address ip::basic_endpoint::address]
-
-[indexterm2 address..ip::basic_endpoint]
-Get the IP address associated with the endpoint.
 
+[section:async_fill buffered_stream::async_fill]
 
- boost::asio::ip::address ``[link boost_asio.reference.ip__basic_endpoint.address.overload1 address]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.address.overload1 more...]]``
+[indexterm2 async_fill..buffered_stream]
+Start an asynchronous fill.
 
 
-Set the IP address associated with the endpoint.
+ template<
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
 
 
- void ``[link boost_asio.reference.ip__basic_endpoint.address.overload2 address]``(
- const boost::asio::ip::address & addr);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.address.overload2 more...]]``
+
+[endsect]
 
 
-[section:overload1 ip::basic_endpoint::address (1 of 2 overloads)]
 
+[section:async_flush buffered_stream::async_flush]
 
-Get the IP address associated with the endpoint.
+[indexterm2 async_flush..buffered_stream]
+Start an asynchronous flush.
 
 
- boost::asio::ip::address address() const;
+ template<
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
 
 
 
@@ -41627,98 +43774,122 @@
 
 
 
-[section:overload2 ip::basic_endpoint::address (2 of 2 overloads)]
-
+[section:async_read_some buffered_stream::async_read_some]
 
-Set the IP address associated with the endpoint.
+[indexterm2 async_read_some..buffered_stream]
+Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
 
 
- void address(
- const boost::asio::ip::address & addr);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
 
 
 [endsect]
 
 
-[endsect]
 
-[section:basic_endpoint ip::basic_endpoint::basic_endpoint]
+[section:async_write_some buffered_stream::async_write_some]
 
-[indexterm2 basic_endpoint..ip::basic_endpoint]
-Default constructor.
+[indexterm2 async_write_some..buffered_stream]
+Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
 
 
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
 
-Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR\_ANY or in6addr\_any). This constructor would typically be used for accepting new connections.
 
+[endsect]
 
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
- const InternetProtocol & protocol,
- unsigned short port_num);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 more...]]``
 
+[section:buffered_stream buffered_stream::buffered_stream]
 
-Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+[indexterm2 buffered_stream..buffered_stream]
+Construct, passing the specified argument to initialise the next layer.
 
 
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
- const boost::asio::ip::address & addr,
- unsigned short port_num);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 more...]]``
+ template<
+ typename Arg>
+ explicit ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
+ Arg & a);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.buffered_stream.overload1 more...]]``
 
+ template<
+ typename Arg>
+ explicit ``[link boost_asio.reference.buffered_stream.buffered_stream.overload2 buffered_stream]``(
+ Arg & a,
+ std::size_t read_buffer_size,
+ std::size_t write_buffer_size);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.buffered_stream.overload2 more...]]``
 
-Copy constructor.
 
+[section:overload1 buffered_stream::buffered_stream (1 of 2 overloads)]
 
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
- const basic_endpoint & other);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 more...]]``
 
+Construct, passing the specified argument to initialise the next layer.
 
-[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)]
 
+ template<
+ typename Arg>
+ buffered_stream(
+ Arg & a);
 
-Default constructor.
 
 
- basic_endpoint();
+[endsect]
 
 
 
-[endsect]
+[section:overload2 buffered_stream::buffered_stream (2 of 2 overloads)]
+
 
+Construct, passing the specified argument to initialise the next layer.
 
 
-[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+ template<
+ typename Arg>
+ buffered_stream(
+ Arg & a,
+ std::size_t read_buffer_size,
+ std::size_t write_buffer_size);
 
 
-Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR\_ANY or in6addr\_any). This constructor would typically be used for accepting new connections.
+
+[endsect]
 
 
- basic_endpoint(
- const InternetProtocol & protocol,
- unsigned short port_num);
+[endsect]
 
+[section:close buffered_stream::close]
 
+[indexterm2 close..buffered_stream]
+Close the stream.
 
-[heading Examples]
-
-To initialise an IPv4 TCP endpoint for port 1234, use:
 
- boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), 1234);
+ void ``[link boost_asio.reference.buffered_stream.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.close.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.buffered_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.close.overload2 more...]]``
 
 
+[section:overload1 buffered_stream::close (1 of 2 overloads)]
 
-To specify an IPv6 UDP endpoint for port 9876, use:
 
- boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
+Close the stream.
 
 
+ void close();
 
 
 
@@ -41726,248 +43897,236 @@
 
 
 
-[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)]
+[section:overload2 buffered_stream::close (2 of 2 overloads)]
 
 
-Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+Close the stream.
 
 
- basic_endpoint(
- const boost::asio::ip::address & addr,
- unsigned short port_num);
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)]
-
+[section:fill buffered_stream::fill]
 
-Copy constructor.
+[indexterm2 fill..buffered_stream]
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
 
- basic_endpoint(
- const basic_endpoint & other);
+ std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload1 fill]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.fill.overload1 more...]]``
 
 
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
 
-[endsect]
 
+ std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload2 fill]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.fill.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 buffered_stream::fill (1 of 2 overloads)]
 
-[section:capacity ip::basic_endpoint::capacity]
 
-[indexterm2 capacity..ip::basic_endpoint]
-Get the capacity of the endpoint in the native type.
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
 
 
- std::size_t capacity() const;
+ std::size_t fill();
 
 
 
 [endsect]
 
 
-[section:data ip::basic_endpoint::data]
 
-[indexterm2 data..ip::basic_endpoint]
-Get the underlying endpoint in the native type.
+[section:overload2 buffered_stream::fill (2 of 2 overloads)]
 
 
- data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload1 data]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.data.overload1 more...]]``
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
 
- const data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload2 data]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.data.overload2 more...]]``
 
+ std::size_t fill(
+ boost::system::error_code & ec);
 
-[section:overload1 ip::basic_endpoint::data (1 of 2 overloads)]
 
 
-Get the underlying endpoint in the native type.
+[endsect]
 
 
- data_type * data();
+[endsect]
 
+[section:flush buffered_stream::flush]
 
+[indexterm2 flush..buffered_stream]
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
-[endsect]
 
+ std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload1 flush]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.flush.overload1 more...]]``
 
 
-[section:overload2 ip::basic_endpoint::data (2 of 2 overloads)]
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
 
-Get the underlying endpoint in the native type.
+ std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload2 flush]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.flush.overload2 more...]]``
 
 
- const data_type * data() const;
+[section:overload1 buffered_stream::flush (1 of 2 overloads)]
 
 
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
-[endsect]
 
+ std::size_t flush();
 
-[endsect]
 
 
-[section:data_type ip::basic_endpoint::data_type]
+[endsect]
 
-[indexterm2 data_type..ip::basic_endpoint]
-The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
 
 
- typedef implementation_defined data_type;
+[section:overload2 buffered_stream::flush (2 of 2 overloads)]
 
 
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+ std::size_t flush(
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:operator_not__eq_ ip::basic_endpoint::operator!=]
 
-[indexterm2 operator!=..ip::basic_endpoint]
-Compare two endpoints for inequality.
+[section:get_io_service buffered_stream::get_io_service]
 
+[indexterm2 get_io_service..buffered_stream]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
- friend bool operator!=(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
 
+ boost::asio::io_service & get_io_service();
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[endsect]
+[section:in_avail buffered_stream::in_avail]
 
+[indexterm2 in_avail..buffered_stream]
+Determine the amount of data that may be read without blocking.
 
 
-[section:operator_lt_ ip::basic_endpoint::operator<]
+ std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload1 in_avail]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.in_avail.overload1 more...]]``
 
-[indexterm2 operator<..ip::basic_endpoint]
-Compare endpoints for ordering.
+ std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.in_avail.overload2 more...]]``
 
 
- friend bool operator<(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+[section:overload1 buffered_stream::in_avail (1 of 2 overloads)]
 
 
-[heading Requirements]
+Determine the amount of data that may be read without blocking.
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ std::size_t in_avail();
+
 
 
 [endsect]
 
 
 
-[section:operator_lt__lt_ ip::basic_endpoint::operator<<]
+[section:overload2 buffered_stream::in_avail (2 of 2 overloads)]
 
-[indexterm2 operator<<..ip::basic_endpoint]
-Output an endpoint as a string.
 
+Determine the amount of data that may be read without blocking.
 
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const basic_endpoint< InternetProtocol > & endpoint);
 
+ std::size_t in_avail(
+ boost::system::error_code & ec);
 
-Used to output a human-readable string for a specified endpoint.
 
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[os][The output stream to which the string will be written.]]
 
-[[endpoint][The endpoint to be written.]]
+[endsect]
 
-]
+[section:lowest_layer buffered_stream::lowest_layer]
 
+[indexterm2 lowest_layer..buffered_stream]
+Get a reference to the lowest layer.
 
-[heading Return Value]
-
-The output stream.
 
+ lowest_layer_type & ``[link boost_asio.reference.buffered_stream.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.lowest_layer.overload1 more...]]``
 
 
+Get a const reference to the lowest layer.
 
-[endsect]
 
+ const lowest_layer_type & ``[link boost_asio.reference.buffered_stream.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.lowest_layer.overload2 more...]]``
 
 
-[section:operator_lt__eq_ ip::basic_endpoint::operator<=]
+[section:overload1 buffered_stream::lowest_layer (1 of 2 overloads)]
 
-[indexterm2 operator<=..ip::basic_endpoint]
-Compare endpoints for ordering.
 
+Get a reference to the lowest layer.
 
- friend bool operator<=(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
 
+ lowest_layer_type & lowest_layer();
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[endsect]
 
+[section:overload2 buffered_stream::lowest_layer (2 of 2 overloads)]
 
 
-[section:operator_eq_ ip::basic_endpoint::operator=]
+Get a const reference to the lowest layer.
 
-[indexterm2 operator=..ip::basic_endpoint]
-Assign from another endpoint.
+
+ const lowest_layer_type & lowest_layer() const;
 
 
- basic_endpoint & operator=(
- const basic_endpoint & other);
 
+[endsect]
 
 
 [endsect]
 
 
+[section:lowest_layer_type buffered_stream::lowest_layer_type]
 
-[section:operator_eq__eq_ ip::basic_endpoint::operator==]
+[indexterm2 lowest_layer_type..buffered_stream]
+The type of the lowest layer.
 
-[indexterm2 operator==..ip::basic_endpoint]
-Compare two endpoints for equality.
 
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
 
- friend bool operator==(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+[*Header: ][^boost/asio/buffered_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -41976,42 +44135,33 @@
 
 
 
-[section:operator_gt_ ip::basic_endpoint::operator>]
-
-[indexterm2 operator>..ip::basic_endpoint]
-Compare endpoints for ordering.
-
-
- friend bool operator>(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+[section:next_layer buffered_stream::next_layer]
 
+[indexterm2 next_layer..buffered_stream]
+Get a reference to the next layer.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+ next_layer_type & next_layer();
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_gt__eq_ ip::basic_endpoint::operator>=]
+[section:next_layer_type buffered_stream::next_layer_type]
 
-[indexterm2 operator>=..ip::basic_endpoint]
-Compare endpoints for ordering.
+[indexterm2 next_layer_type..buffered_stream]
+The type of the next layer.
 
 
- friend bool operator>=(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+ typedef boost::remove_reference< Stream >::type next_layer_type;
+
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+[*Header: ][^boost/asio/buffered_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -42019,31 +44169,40 @@
 [endsect]
 
 
-[section:port ip::basic_endpoint::port]
+[section:peek buffered_stream::peek]
 
-[indexterm2 port..ip::basic_endpoint]
-Get the port associated with the endpoint. The port number is always in the host's byte order.
+[indexterm2 peek..buffered_stream]
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
- unsigned short ``[link boost_asio.reference.ip__basic_endpoint.port.overload1 port]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.port.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.peek.overload1 more...]]``
 
 
-Set the port associated with the endpoint. The port number is always in the host's byte order.
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
 
- void ``[link boost_asio.reference.ip__basic_endpoint.port.overload2 port]``(
- unsigned short port_num);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.port.overload2 more...]]``
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.peek.overload2 peek]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.peek.overload2 more...]]``
 
 
-[section:overload1 ip::basic_endpoint::port (1 of 2 overloads)]
+[section:overload1 buffered_stream::peek (1 of 2 overloads)]
 
 
-Get the port associated with the endpoint. The port number is always in the host's byte order.
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
- unsigned short port() const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
 
 
 
@@ -42051,14 +44210,17 @@
 
 
 
-[section:overload2 ip::basic_endpoint::port (2 of 2 overloads)]
+[section:overload2 buffered_stream::peek (2 of 2 overloads)]
 
 
-Set the port associated with the endpoint. The port number is always in the host's byte order.
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
 
- void port(
- unsigned short port_num);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
 
@@ -42067,50 +44229,100 @@
 
 [endsect]
 
+[section:read_some buffered_stream::read_some]
 
-[section:protocol ip::basic_endpoint::protocol]
+[indexterm2 read_some..buffered_stream]
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
-[indexterm2 protocol..ip::basic_endpoint]
-The protocol associated with the endpoint.
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.read_some.overload1 more...]]``
 
- protocol_type protocol() const;
 
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.read_some.overload2 more...]]``
 
 
+[section:overload1 buffered_stream::read_some (1 of 2 overloads)]
 
-[section:protocol_type ip::basic_endpoint::protocol_type]
 
-[indexterm2 protocol_type..ip::basic_endpoint]
-The protocol type associated with the endpoint.
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
- typedef InternetProtocol protocol_type;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+
+[section:overload2 buffered_stream::read_some (2 of 2 overloads)]
+
+
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+
 
 
 [endsect]
 
 
+[endsect]
 
-[section:resize ip::basic_endpoint::resize]
+[section:write_some buffered_stream::write_some]
 
-[indexterm2 resize..ip::basic_endpoint]
-Set the underlying size of the endpoint in the native type.
+[indexterm2 write_some..buffered_stream]
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
 
- void resize(
- std::size_t size);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.write_some.overload1 more...]]``
+
+
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
+
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_stream.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_stream.write_some.overload2 more...]]``
+
+
+[section:overload1 buffered_stream::write_some (1 of 2 overloads)]
+
+
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
 
 
@@ -42118,33 +44330,38 @@
 
 
 
-[section:size ip::basic_endpoint::size]
+[section:overload2 buffered_stream::write_some (2 of 2 overloads)]
 
-[indexterm2 size..ip::basic_endpoint]
-Get the underlying size of the endpoint in the native type.
 
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
 
- std::size_t size() const;
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
+
 
 [endsect]
 
-[section:ip__basic_resolver ip::basic_resolver]
+[section:buffered_write_stream buffered_write_stream]
 
 
-Provides endpoint resolution functionality.
+Adds buffering to the write-related operations of a stream.
 
 
   template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``,
- typename ``[link boost_asio.reference.ResolverService ResolverService]`` = resolver_service<InternetProtocol>>
- class basic_resolver :
- public basic_io_object< ResolverService >
+ typename Stream>
+ class buffered_write_stream :
+ noncopyable
 
 
 [heading Types]
@@ -42153,236 +44370,234 @@
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+ [[link boost_asio.reference.buffered_write_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
   
   ]
 
- [
+]
 
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
   [
-
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
+ [[link boost_asio.reference.buffered_write_stream.async_flush [*async_flush]]]
+ [Start an asynchronous flush. ]
   ]
-
+
   [
-
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
+ [[link boost_asio.reference.buffered_write_stream.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. ]
+ ]
   
+ [
+ [[link boost_asio.reference.buffered_write_stream.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. ]
   ]
-
+
   [
-
- [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.buffered_write_stream.buffered_write_stream [*buffered_write_stream]]]
+ [Construct, passing the specified argument to initialise the next layer. ]
+ ]
   
+ [
+ [[link boost_asio.reference.buffered_write_stream.close [*close]]]
+ [Close the stream. ]
   ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously perform forward resolution of a query to a list of entries.
+ [[link boost_asio.reference.buffered_write_stream.flush [*flush]]]
+ [Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
- Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
+ Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
+ [[link boost_asio.reference.buffered_write_stream.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
+ [[link boost_asio.reference.buffered_write_stream.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.buffered_write_stream.next_layer [*next_layer]]]
+ [Get a reference to the next layer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Perform forward resolution of a query to a list of entries.
+ [[link boost_asio.reference.buffered_write_stream.peek [*peek]]]
+ [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
- Perform reverse resolution of an endpoint to a list of entries. ]
+ Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_write_stream.read_some [*read_some]]]
+ [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+
+ Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_write_stream.write_some [*write_some]]]
+ [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+
+ Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw. ]
   ]
   
 ]
 
-[heading Protected Data Members]
+[heading Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
+ [[link boost_asio.reference.buffered_write_stream.default_buffer_size [*default_buffer_size]]]
+ [The default buffer size. ]
   ]
 
 ]
 
-The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+The [link boost_asio.reference.buffered_write_stream `buffered_write_stream`] class template can be used to add buffering to the synchronous and asynchronous write operations of a stream.
 
 
 [heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[*Shared] [*objects:] Unsafe.
+
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+[*Header: ][^boost/asio/buffered_write_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:async_resolve ip::basic_resolver::async_resolve]
 
-[indexterm2 async_resolve..ip::basic_resolver]
-Asynchronously perform forward resolution of a query to a list of entries.
+[section:async_flush buffered_write_stream::async_flush]
 
+[indexterm2 async_flush..buffered_write_stream]
+Start an asynchronous flush.
 
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void ``[link boost_asio.reference.ip__basic_resolver.async_resolve.overload1 async_resolve]``(
- const query & q,
- ResolveHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.async_resolve.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
 
-Asynchronously perform reverse resolution of an endpoint to a list of entries.
 
 
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void ``[link boost_asio.reference.ip__basic_resolver.async_resolve.overload2 async_resolve]``(
- const endpoint_type & e,
- ResolveHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.async_resolve.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)]
 
+[section:async_read_some buffered_write_stream::async_read_some]
 
-Asynchronously perform forward resolution of a query to a list of entries.
+[indexterm2 async_read_some..buffered_write_stream]
+Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
 
 
   template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const query & q,
- ResolveHandler handler);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
 
-This function is used to asynchronously resolve a query into a list of endpoint entries.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
 
-[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- resolver::iterator iterator // Forward-only iterator that can
- // be used to traverse the list
- // of endpoint entries.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[section:async_write_some buffered_write_stream::async_write_some]
 
-]
+[indexterm2 async_write_some..buffered_write_stream]
+Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
 
 
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
-A successful resolve operation is guaranteed to pass at least one entry to the handler.
 
 
 [endsect]
 
 
+[section:buffered_write_stream buffered_write_stream::buffered_write_stream]
 
-[section:overload2 ip::basic_resolver::async_resolve (2 of 2 overloads)]
+[indexterm2 buffered_write_stream..buffered_write_stream]
+Construct, passing the specified argument to initialise the next layer.
 
 
-Asynchronously perform reverse resolution of an endpoint to a list of entries.
+ template<
+ typename Arg>
+ explicit ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 buffered_write_stream]``(
+ Arg & a);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 more...]]``
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 buffered_write_stream]``(
+ Arg & a,
+ std::size_t buffer_size);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 more...]]``
+
+
+[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
+
+
+Construct, passing the specified argument to initialise the next layer.
 
 
   template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const endpoint_type & e,
- ResolveHandler handler);
+ typename Arg>
+ buffered_write_stream(
+ Arg & a);
 
 
-This function is used to asynchronously resolve an endpoint into a list of endpoint entries.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[e][An endpoint object that determines what endpoints will be returned.]]
 
-[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- resolver::iterator iterator // Forward-only iterator that can
- // be used to traverse the list
- // of endpoint entries.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
 
-]
 
+Construct, passing the specified argument to initialise the next layer.
 
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
 
-A successful resolve operation is guaranteed to pass at least one entry to the handler.
+ template<
+ typename Arg>
+ buffered_write_stream(
+ Arg & a,
+ std::size_t buffer_size);
+
 
 
 [endsect]
@@ -42390,29 +44605,27 @@
 
 [endsect]
 
+[section:close buffered_write_stream::close]
 
-[section:basic_resolver ip::basic_resolver::basic_resolver]
-
-[indexterm2 basic_resolver..ip::basic_resolver]
-Constructor.
+[indexterm2 close..buffered_write_stream]
+Close the stream.
 
 
- basic_resolver(
- boost::asio::io_service & io_service);
+ void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.close.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.buffered_write_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.close.overload2 more...]]``
 
-This constructor creates a [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`].
 
+[section:overload1 buffered_write_stream::close (1 of 2 overloads)]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]]
+Close the stream.
 
-]
 
+ void close();
 
 
 
@@ -42420,62 +44633,61 @@
 
 
 
-[section:cancel ip::basic_resolver::cancel]
+[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
 
-[indexterm2 cancel..ip::basic_resolver]
-Cancel any asynchronous operations that are waiting on the resolver.
 
+Close the stream.
 
- void cancel();
 
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
-This function forces the completion of any pending asynchronous operations on the host resolver. The handler for each cancelled operation will be invoked with the `boost::asio::error::operation_aborted` error code.
 
 
 [endsect]
 
 
+[endsect]
 
-[section:endpoint_type ip::basic_resolver::endpoint_type]
-
-[indexterm2 endpoint_type..ip::basic_resolver]
-The endpoint type.
 
+[section:default_buffer_size buffered_write_stream::default_buffer_size]
 
- typedef InternetProtocol::endpoint endpoint_type;
+[indexterm2 default_buffer_size..buffered_write_stream]
+The default buffer size.
 
 
+ static const std::size_t default_buffer_size = implementation_defined;
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[endsect]
+[section:flush buffered_write_stream::flush]
 
+[indexterm2 flush..buffered_write_stream]
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
 
-[section:get_io_service ip::basic_resolver::get_io_service]
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload1 flush]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.flush.overload1 more...]]``
 
 
-['Inherited from basic_io_object.]
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
-[indexterm2 get_io_service..ip::basic_resolver]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload2 flush]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.flush.overload2 more...]]``
 
- boost::asio::io_service & get_io_service();
 
+[section:overload1 buffered_write_stream::flush (1 of 2 overloads)]
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+ std::size_t flush();
 
 
 
@@ -42483,176 +44695,140 @@
 
 
 
-[section:implementation ip::basic_resolver::implementation]
+[section:overload2 buffered_write_stream::flush (2 of 2 overloads)]
 
 
-['Inherited from basic_io_object.]
+Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred.
 
-[indexterm2 implementation..ip::basic_resolver]
-The underlying implementation of the I/O object.
+
+ std::size_t flush(
+ boost::system::error_code & ec);
 
 
- implementation_type implementation;
 
+[endsect]
 
 
 [endsect]
 
 
+[section:get_io_service buffered_write_stream::get_io_service]
 
-[section:implementation_type ip::basic_resolver::implementation_type]
+[indexterm2 get_io_service..buffered_write_stream]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
-['Inherited from basic_io_object.]
+ boost::asio::io_service & get_io_service();
 
-[indexterm2 implementation_type..ip::basic_resolver]
-The underlying implementation type of I/O object.
 
 
- typedef service_type::implementation_type implementation_type;
+[endsect]
 
 
+[section:in_avail buffered_write_stream::in_avail]
 
-[heading Requirements]
+[indexterm2 in_avail..buffered_write_stream]
+Determine the amount of data that may be read without blocking.
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload1 in_avail]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.in_avail.overload1 more...]]``
 
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.in_avail.overload2 more...]]``
 
-[endsect]
 
+[section:overload1 buffered_write_stream::in_avail (1 of 2 overloads)]
 
 
-[section:io_service ip::basic_resolver::io_service]
+Determine the amount of data that may be read without blocking.
 
 
-['Inherited from basic_io_object.]
+ std::size_t in_avail();
 
-[indexterm2 io_service..ip::basic_resolver]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
- boost::asio::io_service & io_service();
+[endsect]
 
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+[section:overload2 buffered_write_stream::in_avail (2 of 2 overloads)]
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+Determine the amount of data that may be read without blocking.
 
 
+ std::size_t in_avail(
+ boost::system::error_code & ec);
 
-[endsect]
 
 
+[endsect]
 
-[section:iterator ip::basic_resolver::iterator]
 
-[indexterm2 iterator..ip::basic_resolver]
-The iterator type.
+[endsect]
 
+[section:lowest_layer buffered_write_stream::lowest_layer]
 
- typedef basic_resolver_iterator< InternetProtocol > iterator;
+[indexterm2 lowest_layer..buffered_write_stream]
+Get a reference to the lowest layer.
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ lowest_layer_type & ``[link boost_asio.reference.buffered_write_stream.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.lowest_layer.overload1 more...]]``
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
 
- Create an iterator from an endpoint, host name and service name. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
+Get a const reference to the lowest layer.
 
- Increment operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
+ const lowest_layer_type & ``[link boost_asio.reference.buffered_write_stream.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.lowest_layer.overload2 more...]]``
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
- ]
-
-]
 
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+[section:overload1 buffered_write_stream::lowest_layer (1 of 2 overloads)]
 
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
 
- const basic_resolver_entry<InternetProtocol>
+Get a reference to the lowest layer.
 
 
+ lowest_layer_type & lowest_layer();
 
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
 
-[*Shared] [*objects:] Unsafe.
 
 
+[section:overload2 buffered_write_stream::lowest_layer (2 of 2 overloads)]
 
 
-[heading Requirements]
+Get a const reference to the lowest layer.
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ const lowest_layer_type & lowest_layer() const;
+
 
 
 [endsect]
 
 
+[endsect]
 
-[section:protocol_type ip::basic_resolver::protocol_type]
 
-[indexterm2 protocol_type..ip::basic_resolver]
-The protocol type.
+[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..buffered_write_stream]
+The type of the lowest layer.
 
 
- typedef InternetProtocol protocol_type;
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+[*Header: ][^boost/asio/buffered_write_stream.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -42661,336 +44837,214 @@
 
 
 
-[section:query ip::basic_resolver::query]
+[section:next_layer buffered_write_stream::next_layer]
 
-[indexterm2 query..ip::basic_resolver]
-The query type.
+[indexterm2 next_layer..buffered_write_stream]
+Get a reference to the next layer.
 
 
- typedef basic_resolver_query< InternetProtocol > query;
+ next_layer_type & next_layer();
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
+[section:next_layer_type buffered_write_stream::next_layer_type]
 
-]
+[indexterm2 next_layer_type..buffered_write_stream]
+The type of the next layer.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
+ typedef boost::remove_reference< Stream >::type next_layer_type;
 
- Construct with specified service name for a given protocol.
 
- Construct with specified host name and service name for any protocol.
 
- Construct with specified host name and service name for a given protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
- ]
-
-]
+[heading Requirements]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[*Header: ][^boost/asio/buffered_write_stream.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
+[section:peek buffered_write_stream::peek]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
+[indexterm2 peek..buffered_write_stream]
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
-
-]
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
-
-
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.peek.overload1 more...]]``
 
-[*Shared] [*objects:] Unsafe.
 
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.peek.overload2 peek]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.peek.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+[section:overload1 buffered_write_stream::peek (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
 
-[endsect]
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
 
-[section:resolve ip::basic_resolver::resolve]
 
-[indexterm2 resolve..ip::basic_resolver]
-Perform forward resolution of a query to a list of entries.
 
+[endsect]
 
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
- const query & q);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload1 more...]]``
 
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload2 resolve]``(
- const query & q,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload2 more...]]``
 
+[section:overload2 buffered_write_stream::peek (2 of 2 overloads)]
 
-Perform reverse resolution of an endpoint to a list of entries.
 
+Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
 
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload3 resolve]``(
- const endpoint_type & e);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload3 more...]]``
 
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload4 resolve]``(
- const endpoint_type & e,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload4 more...]]``
-
 
-[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)]
 
 
-Perform forward resolution of a query to a list of entries.
+[endsect]
 
 
- iterator resolve(
- const query & q);
+[endsect]
 
+[section:read_some buffered_write_stream::read_some]
 
-This function is used to resolve a query into a list of endpoint entries.
+[indexterm2 read_some..buffered_write_stream]
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
-[heading Parameters]
-
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.read_some.overload1 more...]]``
 
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
 
-]
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
-[heading Return Value]
-
-A forward-only iterator that can be used to traverse the list of endpoint entries.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.read_some.overload2 more...]]``
 
 
-[heading Exceptions]
-
+[section:overload1 buffered_write_stream::read_some (1 of 2 overloads)]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
 
 
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
-A successful call to this function is guaranteed to return at least one entry.
 
 
 [endsect]
 
 
 
-[section:overload2 ip::basic_resolver::resolve (2 of 4 overloads)]
+[section:overload2 buffered_write_stream::read_some (2 of 2 overloads)]
 
 
-Perform forward resolution of a query to a list of entries.
+Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
 
 
- iterator resolve(
- const query & q,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
 
 
-This function is used to resolve a query into a list of endpoint entries.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
-
-
-[heading Return Value]
-
-A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
-
-
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
-
-A successful call to this function is guaranteed to return at least one entry.
-
 
 [endsect]
 
 
+[endsect]
 
-[section:overload3 ip::basic_resolver::resolve (3 of 4 overloads)]
-
-
-Perform reverse resolution of an endpoint to a list of entries.
-
-
- iterator resolve(
- const endpoint_type & e);
-
+[section:write_some buffered_write_stream::write_some]
 
-This function is used to resolve an endpoint into a list of endpoint entries.
+[indexterm2 write_some..buffered_write_stream]
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
 
-[heading Parameters]
-
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.write_some.overload1 more...]]``
 
-[variablelist
-
-[[e][An endpoint object that determines what endpoints will be returned.]]
 
-]
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw.
 
 
-[heading Return Value]
-
-A forward-only iterator that can be used to traverse the list of endpoint entries.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.buffered_write_stream.write_some.overload2 more...]]``
 
 
-[heading Exceptions]
-
+[section:overload1 buffered_write_stream::write_some (1 of 2 overloads)]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
 
 
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
-A successful call to this function is guaranteed to return at least one entry.
 
 
 [endsect]
 
 
 
-[section:overload4 ip::basic_resolver::resolve (4 of 4 overloads)]
+[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
 
 
-Perform reverse resolution of an endpoint to a list of entries.
+Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw.
 
 
- iterator resolve(
- const endpoint_type & e,
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
       boost::system::error_code & ec);
 
 
-This function is used to resolve an endpoint into a list of endpoint entries.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[e][An endpoint object that determines what endpoints will be returned.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
-
-
-[heading Return Value]
-
-A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
-
-
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
-
-A successful call to this function is guaranteed to return at least one entry.
-
 
 [endsect]
 
@@ -42998,39 +45052,47 @@
 [endsect]
 
 
-[section:service ip::basic_resolver::service]
+[endsect]
 
 
-['Inherited from basic_io_object.]
+[section:buffers_begin buffers_begin]
 
-[indexterm2 service..ip::basic_resolver]
-The service associated with the I/O object.
+[indexterm1 buffers_begin]
+Construct an iterator representing the beginning of the buffers' data.
 
 
- service_type & service;
+ template<
+ typename BufferSequence>
+ buffers_iterator< BufferSequence > buffers_begin(
+ const BufferSequence & buffers);
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:service_type ip::basic_resolver::service_type]
+[endsect]
 
 
-['Inherited from basic_io_object.]
 
-[indexterm2 service_type..ip::basic_resolver]
-The type of the service that will be used to provide I/O operations.
+[section:buffers_end buffers_end]
 
+[indexterm1 buffers_end]
+Construct an iterator representing the end of the buffers' data.
 
- typedef ResolverService service_type;
 
+ template<
+ typename BufferSequence>
+ buffers_iterator< BufferSequence > buffers_end(
+ const BufferSequence & buffers);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -43038,117 +45100,153 @@
 [endsect]
 
 
-
-[endsect]
-
-[section:ip__basic_resolver_entry ip::basic_resolver_entry]
+[section:buffers_iterator buffers_iterator]
 
 
-An entry produced by a resolver.
+A random access iterator over the bytes in a buffer sequence.
 
 
   template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_entry
+ typename BufferSequence,
+ typename ByteType = char>
+ class buffers_iterator
 
 
-[heading Types]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
-
- [[link boost_asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]]
- [The endpoint type associated with the endpoint entry. ]
+ [[link boost_asio.reference.buffers_iterator.begin [*begin]]]
+ [Construct an iterator representing the beginning of the buffers' data. ]
+ ]
   
+ [
+ [[link boost_asio.reference.buffers_iterator.buffers_iterator [*buffers_iterator]]]
+ [Default constructor. Creates an iterator in an undefined state. ]
   ]
-
+
+ [
+ [[link boost_asio.reference.buffers_iterator.end [*end]]]
+ [Construct an iterator representing the end of the buffers' data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
   [
+ [[link boost_asio.reference.buffers_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
 
- [[link boost_asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint entry. ]
+ Increment operator (postfix). ]
+ ]
   
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_plus__eq_ [*operator+=]]]
+ [Addition operator. ]
   ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_minus__minus_ [*operator--]]]
+ [Decrement operator (prefix).
 
+ Decrement operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_minus__eq_ [*operator-=]]]
+ [Subtraction operator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_lb__rb_ [*operator\[\]]]]
+ [Access an individual element. ]
+ ]
+
 ]
 
-[heading Member Functions]
+[heading Friends]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]]]
- [Default constructor.
-
- Construct with specified endpoint, host name and service name. ]
+ [[link boost_asio.reference.buffers_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]]
- [Get the endpoint associated with the entry. ]
+ [[link boost_asio.reference.buffers_iterator.operator_plus_ [*operator+]]]
+ [Addition operator. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_entry.host_name [*host_name]]]
- [Get the host name associated with the entry. ]
+ [[link boost_asio.reference.buffers_iterator.operator_minus_ [*operator-]]]
+ [Subtraction operator. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]]
- [Convert to the endpoint associated with the entry. ]
+ [[link boost_asio.reference.buffers_iterator.operator_lt_ [*operator<]]]
+ [Compare two iterators. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_entry.service_name [*service_name]]]
- [Get the service name associated with the entry. ]
+ [[link boost_asio.reference.buffers_iterator.operator_lt__eq_ [*operator<=]]]
+ [Compare two iterators. ]
   ]
   
-]
-
-The [link boost_asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver.
-
-
-[heading Thread Safety]
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
   
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_gt_ [*operator>]]]
+ [Compare two iterators. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffers_iterator.operator_gt__eq_ [*operator>=]]]
+ [Compare two iterators. ]
+ ]
+
+]
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:basic_resolver_entry ip::basic_resolver_entry::basic_resolver_entry]
 
-[indexterm2 basic_resolver_entry..ip::basic_resolver_entry]
-Default constructor.
+[section:begin buffers_iterator::begin]
 
+[indexterm2 begin..buffers_iterator]
+Construct an iterator representing the beginning of the buffers' data.
 
- ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 basic_resolver_entry]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 more...]]``
 
+ static buffers_iterator begin(
+ const BufferSequence & buffers);
 
-Construct with specified endpoint, host name and service name.
 
 
- ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload2 basic_resolver_entry]``(
- const endpoint_type & endpoint,
- const std::string & host_name,
- const std::string & service_name);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 ip::basic_resolver_entry::basic_resolver_entry (1 of 2 overloads)]
 
+[section:buffers_iterator buffers_iterator::buffers_iterator]
 
-Default constructor.
+[indexterm2 buffers_iterator..buffers_iterator]
+Default constructor. Creates an iterator in an undefined state.
 
 
- basic_resolver_entry();
+ buffers_iterator();
 
 
 
@@ -43156,32 +45254,28 @@
 
 
 
-[section:overload2 ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads)]
-
+[section:end buffers_iterator::end]
 
-Construct with specified endpoint, host name and service name.
+[indexterm2 end..buffers_iterator]
+Construct an iterator representing the end of the buffers' data.
 
 
- basic_resolver_entry(
- const endpoint_type & endpoint,
- const std::string & host_name,
- const std::string & service_name);
+ static buffers_iterator end(
+ const BufferSequence & buffers);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:endpoint ip::basic_resolver_entry::endpoint]
+[section:operator__star_ buffers_iterator::operator *]
 
-[indexterm2 endpoint..ip::basic_resolver_entry]
-Get the endpoint associated with the entry.
+[indexterm2 operator *..buffers_iterator]
+Dereference an iterator.
 
 
- endpoint_type endpoint() const;
+ byte_type & operator *() const;
 
 
 
@@ -43189,19 +45283,20 @@
 
 
 
-[section:endpoint_type ip::basic_resolver_entry::endpoint_type]
-
-[indexterm2 endpoint_type..ip::basic_resolver_entry]
-The endpoint type associated with the endpoint entry.
+[section:operator_not__eq_ buffers_iterator::operator!=]
 
+[indexterm2 operator!=..buffers_iterator]
+Test two iterators for inequality.
 
- typedef InternetProtocol::endpoint endpoint_type;
 
+ friend bool operator!=(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -43209,48 +45304,59 @@
 [endsect]
 
 
+[section:operator_plus_ buffers_iterator::operator+]
 
-[section:host_name ip::basic_resolver_entry::host_name]
+[indexterm2 operator+..buffers_iterator]
+Addition operator.
 
-[indexterm2 host_name..ip::basic_resolver_entry]
-Get the host name associated with the entry.
 
+ friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload1 operator+]``(
+ const buffers_iterator & iter,
+ std::ptrdiff_t difference);
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload1 more...]]``
 
- std::string host_name() const;
+ friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus_.overload2 operator+]``(
+ std::ptrdiff_t difference,
+ const buffers_iterator & iter);
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus_.overload2 more...]]``
 
 
+[section:overload1 buffers_iterator::operator+ (1 of 2 overloads)]
 
-[endsect]
 
+Addition operator.
 
 
-[section:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type]
+ friend buffers_iterator operator+(
+ const buffers_iterator & iter,
+ std::ptrdiff_t difference);
 
-[indexterm2 operator endpoint_type..ip::basic_resolver_entry]
-Convert to the endpoint associated with the entry.
 
+[heading Requirements]
 
- operator endpoint_type() const;
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:protocol_type ip::basic_resolver_entry::protocol_type]
+[section:overload2 buffers_iterator::operator+ (2 of 2 overloads)]
 
-[indexterm2 protocol_type..ip::basic_resolver_entry]
-The protocol type associated with the endpoint entry.
 
+Addition operator.
 
- typedef InternetProtocol protocol_type;
 
+ friend buffers_iterator operator+(
+ std::ptrdiff_t difference,
+ const buffers_iterator & iter);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -43258,273 +45364,204 @@
 [endsect]
 
 
+[endsect]
 
-[section:service_name ip::basic_resolver_entry::service_name]
+[section:operator_plus__plus_ buffers_iterator::operator++]
 
-[indexterm2 service_name..ip::basic_resolver_entry]
-Get the service name associated with the entry.
+[indexterm2 operator++..buffers_iterator]
+Increment operator (prefix).
 
 
- std::string service_name() const;
+ buffers_iterator & ``[link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload1 operator++]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload1 more...]]``
 
 
+Increment operator (postfix).
 
-[endsect]
 
+ buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload2 operator++]``(
+ int );
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_plus__plus_.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 buffers_iterator::operator++ (1 of 2 overloads)]
 
-[section:ip__basic_resolver_iterator ip::basic_resolver_iterator]
 
+Increment operator (prefix).
 
-An iterator over the entries produced by a resolver.
 
+ buffers_iterator & operator++();
 
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_iterator
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
-
- Create an iterator from an endpoint, host name and service name. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
-
- Increment operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
- ]
-
-]
-
-[heading Friends]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
- ]
-
-]
-
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
-
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
-
- const basic_resolver_entry<InternetProtocol>
 
 
+[section:overload2 buffers_iterator::operator++ (2 of 2 overloads)]
 
 
+Increment operator (postfix).
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+ buffers_iterator operator++(
+ int );
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator]
+[section:operator_plus__eq_ buffers_iterator::operator+=]
 
-[indexterm2 basic_resolver_iterator..ip::basic_resolver_iterator]
-Default constructor creates an end iterator.
+[indexterm2 operator+=..buffers_iterator]
+Addition operator.
 
 
- basic_resolver_iterator();
+ buffers_iterator & operator+=(
+ std::ptrdiff_t difference);
 
 
 
 [endsect]
 
 
-[section:create ip::basic_resolver_iterator::create]
+[section:operator_minus_ buffers_iterator::operator-]
 
-[indexterm2 create..ip::basic_resolver_iterator]
-Create an iterator from an addrinfo list returned by getaddrinfo.
+[indexterm2 operator-..buffers_iterator]
+Subtraction operator.
 
 
- static basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.create.overload1 create]``(
- boost::asio::detail::addrinfo_type * address_info,
- const std::string & host_name,
- const std::string & service_name);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.create.overload1 more...]]``
+ friend buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_minus_.overload1 operator-]``(
+ const buffers_iterator & iter,
+ std::ptrdiff_t difference);
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus_.overload1 more...]]``
 
+ friend std::ptrdiff_t ``[link boost_asio.reference.buffers_iterator.operator_minus_.overload2 operator-]``(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus_.overload2 more...]]``
 
-Create an iterator from an endpoint, host name and service name.
 
+[section:overload1 buffers_iterator::operator- (1 of 2 overloads)]
 
- static basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.create.overload2 create]``(
- const typename InternetProtocol::endpoint & endpoint,
- const std::string & host_name,
- const std::string & service_name);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.create.overload2 more...]]``
 
+Subtraction operator.
 
-[section:overload1 ip::basic_resolver_iterator::create (1 of 2 overloads)]
 
+ friend buffers_iterator operator-(
+ const buffers_iterator & iter,
+ std::ptrdiff_t difference);
 
-Create an iterator from an addrinfo list returned by getaddrinfo.
 
+[heading Requirements]
 
- static basic_resolver_iterator create(
- boost::asio::detail::addrinfo_type * address_info,
- const std::string & host_name,
- const std::string & service_name);
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 ip::basic_resolver_iterator::create (2 of 2 overloads)]
+[section:overload2 buffers_iterator::operator- (2 of 2 overloads)]
 
 
-Create an iterator from an endpoint, host name and service name.
+Subtraction operator.
 
 
- static basic_resolver_iterator create(
- const typename InternetProtocol::endpoint & endpoint,
- const std::string & host_name,
- const std::string & service_name);
+ friend std::ptrdiff_t operator-(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:operator__star_ ip::basic_resolver_iterator::operator *]
-
-[indexterm2 operator *..ip::basic_resolver_iterator]
-Dereference an iterator.
+[endsect]
 
+[section:operator_minus__minus_ buffers_iterator::operator--]
 
- const basic_resolver_entry< InternetProtocol > & operator *() const;
+[indexterm2 operator--..buffers_iterator]
+Decrement operator (prefix).
 
 
+ buffers_iterator & ``[link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload1 operator--]``();
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload1 more...]]``
 
-[endsect]
 
+Decrement operator (postfix).
 
 
-[section:operator_not__eq_ ip::basic_resolver_iterator::operator!=]
+ buffers_iterator ``[link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload2 operator--]``(
+ int );
+ `` [''''&raquo;''' [link boost_asio.reference.buffers_iterator.operator_minus__minus_.overload2 more...]]``
 
-[indexterm2 operator!=..ip::basic_resolver_iterator]
-Test two iterators for inequality.
 
+[section:overload1 buffers_iterator::operator-- (1 of 2 overloads)]
 
- friend bool operator!=(
- const basic_resolver_iterator & a,
- const basic_resolver_iterator & b);
 
+Decrement operator (prefix).
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
+ buffers_iterator & operator--();
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:operator_plus__plus_ ip::basic_resolver_iterator::operator++]
-
-[indexterm2 operator++..ip::basic_resolver_iterator]
-Increment operator (prefix).
-
 
- basic_resolver_iterator & ``[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload1 operator++]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload1 more...]]``
+[section:overload2 buffers_iterator::operator-- (2 of 2 overloads)]
 
 
-Increment operator (postfix).
+Decrement operator (postfix).
 
 
- basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload2 operator++]``(
+ buffers_iterator operator--(
       int );
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload2 more...]]``
-
-
-[section:overload1 ip::basic_resolver_iterator::operator++ (1 of 2 overloads)]
-
-
-Increment operator (prefix).
-
-
- basic_resolver_iterator & operator++();
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:overload2 ip::basic_resolver_iterator::operator++ (2 of 2 overloads)]
 
+[section:operator_minus__eq_ buffers_iterator::operator-=]
 
-Increment operator (postfix).
+[indexterm2 operator-=..buffers_iterator]
+Subtraction operator.
 
 
- basic_resolver_iterator operator++(
- int );
+ buffers_iterator & operator-=(
+ std::ptrdiff_t difference);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:operator_arrow_ ip::basic_resolver_iterator::operator->]
+[section:operator_arrow_ buffers_iterator::operator->]
 
-[indexterm2 operator->..ip::basic_resolver_iterator]
+[indexterm2 operator->..buffers_iterator]
 Dereference an iterator.
 
 
- const basic_resolver_entry< InternetProtocol > * operator->() const;
+ byte_type * operator->() const;
 
 
 
@@ -43532,20 +45569,20 @@
 
 
 
-[section:operator_eq__eq_ ip::basic_resolver_iterator::operator==]
+[section:operator_lt_ buffers_iterator::operator<]
 
-[indexterm2 operator==..ip::basic_resolver_iterator]
-Test two iterators for equality.
+[indexterm2 operator<..buffers_iterator]
+Compare two iterators.
 
 
- friend bool operator==(
- const basic_resolver_iterator & a,
- const basic_resolver_iterator & b);
+ friend bool operator<(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -43554,219 +45591,228 @@
 
 
 
-[endsect]
+[section:operator_lt__eq_ buffers_iterator::operator<=]
 
-[section:ip__basic_resolver_query ip::basic_resolver_query]
+[indexterm2 operator<=..buffers_iterator]
+Compare two iterators.
 
 
-An query to be passed to a resolver.
+ friend bool operator<=(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
 
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_query :
- public ip::resolver_query_base
+[heading Requirements]
 
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
-[heading Types]
-[table
- [[Name][Description]]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
 
-]
+[section:operator_eq__eq_ buffers_iterator::operator==]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 operator==..buffers_iterator]
+Test two iterators for equality.
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
 
- Construct with specified service name for a given protocol.
+ friend bool operator==(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
- Construct with specified host name and service name for any protocol.
 
- Construct with specified host name and service name for a given protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
- ]
-
-]
+[heading Requirements]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
+[section:operator_gt_ buffers_iterator::operator>]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
+[indexterm2 operator>..buffers_iterator]
+Compare two iterators.
 
-]
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+ friend bool operator>(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[heading Requirements]
 
-[*Shared] [*objects:] Unsafe.
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:operator_gt__eq_ buffers_iterator::operator>=]
 
-[section:address_configured ip::basic_resolver_query::address_configured]
+[indexterm2 operator>=..buffers_iterator]
+Compare two iterators.
 
 
-['Inherited from ip::resolver_query_base.]
+ friend bool operator>=(
+ const buffers_iterator & a,
+ const buffers_iterator & b);
 
-[indexterm2 address_configured..ip::basic_resolver_query]
-Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
 
+[heading Requirements]
 
- static const flags address_configured = implementation_defined;
+[*Header: ][^boost/asio/buffers_iterator.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:all_matching ip::basic_resolver_query::all_matching]
-
-
-['Inherited from ip::resolver_query_base.]
+[section:operator_lb__rb_ buffers_iterator::operator\[\]]
 
-[indexterm2 all_matching..ip::basic_resolver_query]
-If used with v4\_mapped, return all matching IPv6 and IPv4 addresses.
+[indexterm2 operator\[\]..buffers_iterator]
+Access an individual element.
 
 
- static const flags all_matching = implementation_defined;
+ byte_type & operator[](
+ std::ptrdiff_t difference) const;
 
 
 
 [endsect]
 
 
-[section:basic_resolver_query ip::basic_resolver_query::basic_resolver_query]
-
-[indexterm2 basic_resolver_query..ip::basic_resolver_query]
-Construct with specified service name for any protocol.
 
+[endsect]
 
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload1 basic_resolver_query]``(
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = passive|address_configured);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload1 more...]]``
+[section:connect connect]
 
+[indexterm1 connect]
+Establishes a socket connection by trying each endpoint in a sequence.
 
-Construct with specified service name for a given protocol.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator ``[link boost_asio.reference.connect.overload1 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator ``[link boost_asio.reference.connect.overload2 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload2 more...]]``
 
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 basic_resolver_query]``(
- const protocol_type & protocol,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = passive|address_configured);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 more...]]``
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator ``[link boost_asio.reference.connect.overload3 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload3 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator ``[link boost_asio.reference.connect.overload4 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload4 more...]]``
 
-Construct with specified host name and service name for any protocol.
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator ``[link boost_asio.reference.connect.overload5 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload5 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator ``[link boost_asio.reference.connect.overload6 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload6 more...]]``
 
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload3 basic_resolver_query]``(
- const std::string & host_name,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = address_configured);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload3 more...]]``
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator ``[link boost_asio.reference.connect.overload7 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload7 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator ``[link boost_asio.reference.connect.overload8 connect]``(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.connect.overload8 more...]]``
 
-Construct with specified host name and service name for a given protocol.
+[heading Requirements]
 
+[*Header: ][^boost/asio/connect.hpp]
 
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload4 basic_resolver_query]``(
- const protocol_type & protocol,
- const std::string & host_name,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = address_configured);
- `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload4 more...]]``
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload1 ip::basic_resolver_query::basic_resolver_query (1 of 4 overloads)]
+[section:overload1 connect (1 of 8 overloads)]
 
 
-Construct with specified service name for any protocol.
+Establishes a socket connection by trying each endpoint in a sequence.
 
 
- basic_resolver_query(
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = passive|address_configured);
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin);
 
 
-This constructor is typically used to perform name resolution for local service binding.
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
 
 [heading Parameters]
@@ -43774,56 +45820,44 @@
 
 [variablelist
   
-[[service_name][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.]]
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.]]
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
 ]
 
 
-[heading Remarks]
+[heading Return Value]
       
-On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
-
-
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
 
-[endsect]
-
-
-
-[section:overload2 ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads)]
-
-
-Construct with specified service name for a given protocol.
-
+[heading Exceptions]
+
 
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = passive|address_configured);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
+]
 
-This constructor is typically used to perform name resolution for local service binding with a specific protocol version.
 
+[heading Remarks]
+
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
 
-[heading Parameters]
-
 
-[variablelist
+[heading Example]
   
-[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]]
 
-[[service_name][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.]]
 
-[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.]]
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+ boost::asio::connect(s, r.resolve(q));
 
-]
 
 
-[heading Remarks]
-
-On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
 
 
 
@@ -43832,19 +45866,23 @@
 
 
 
-[section:overload3 ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads)]
+[section:overload2 connect (2 of 8 overloads)]
 
 
-Construct with specified host name and service name for any protocol.
+Establishes a socket connection by trying each endpoint in a sequence.
 
 
- basic_resolver_query(
- const std::string & host_name,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = address_configured);
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ boost::system::error_code & ec);
 
 
-This constructor is typically used to perform name resolution for communication with remote hosts.
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
 
 [heading Parameters]
@@ -43852,40 +45890,66 @@
 
 [variablelist
   
-[[host_name][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]]
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-[[service_name][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]]
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
-[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]]
+[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
 ]
 
 
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
+
+
 [heading Remarks]
       
-On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows).
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
+
+
+[heading Example]
+
+
+
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+ boost::system::error_code ec;
+ boost::asio::connect(s, r.resolve(q), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
 
-On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
 
 
 [endsect]
 
 
 
-[section:overload4 ip::basic_resolver_query::basic_resolver_query (4 of 4 overloads)]
+[section:overload3 connect (3 of 8 overloads)]
 
 
-Construct with specified host name and service name for a given protocol.
+Establishes a socket connection by trying each endpoint in a sequence.
 
 
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & host_name,
- const std::string & service_name,
- resolver_query_base::flags resolve_flags = address_configured);
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end);
 
 
-This constructor is typically used to perform name resolution for communication with remote hosts.
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
 
 [heading Parameters]
@@ -43893,40 +45957,43 @@
 
 [variablelist
   
-[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]]
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-[[host_name][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]]
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
-[[service_name][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]]
-
-[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]]
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
 
 ]
 
 
-[heading Remarks]
+[heading Return Value]
       
-On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows).
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
-On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
 
+[heading Exceptions]
+
 
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
+]
 
-[endsect]
 
+[heading Example]
+
 
-[section:canonical_name ip::basic_resolver_query::canonical_name]
 
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::resolver::iterator i = r.resolve(q), end;
+ tcp::socket s(io_service);
+ boost::asio::connect(s, i, end);
 
-['Inherited from ip::resolver_query_base.]
 
-[indexterm2 canonical_name..ip::basic_resolver_query]
-Determine the canonical name of the host specified in the query.
 
 
- static const flags canonical_name = implementation_defined;
 
 
 
@@ -43934,102 +46001,162 @@
 
 
 
-[section:flags ip::basic_resolver_query::flags]
+[section:overload4 connect (4 of 8 overloads)]
 
 
-['Inherited from ip::resolver_query_base.]
+Establishes a socket connection by trying each endpoint in a sequence.
 
-[indexterm2 flags..ip::basic_resolver_query]
-A bitmask type (C++ Std [lib.bitmask.types]).
 
-
- typedef unspecified flags;
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ boost::system::error_code & ec);
 
 
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
+[heading Parameters]
+
 
-[*Convenience header: ][^boost/asio.hpp]
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
-[endsect]
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
 
+[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
+]
 
-[section:hints ip::basic_resolver_query::hints]
 
-[indexterm2 hints..ip::basic_resolver_query]
-Get the hints associated with the query.
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
 
- const boost::asio::detail::addrinfo_type & hints() const;
+[heading Example]
+
 
 
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::resolver::iterator i = r.resolve(q), end;
+ tcp::socket s(io_service);
+ boost::system::error_code ec;
+ boost::asio::connect(s, i, end, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
 
-[endsect]
 
 
 
-[section:host_name ip::basic_resolver_query::host_name]
 
-[indexterm2 host_name..ip::basic_resolver_query]
-Get the host name associated with the query.
 
 
- std::string host_name() const;
+[endsect]
 
 
 
-[endsect]
+[section:overload5 connect (5 of 8 overloads)]
 
 
+Establishes a socket connection by trying each endpoint in a sequence.
 
-[section:numeric_host ip::basic_resolver_query::numeric_host]
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition);
 
-['Inherited from ip::resolver_query_base.]
 
-[indexterm2 numeric_host..ip::basic_resolver_query]
-Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
 
- static const flags numeric_host = implementation_defined;
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
-[endsect]
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
 
+]
 
 
-[section:numeric_service ip::basic_resolver_query::numeric_service]
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
 
-['Inherited from ip::resolver_query_base.]
+[heading Exceptions]
+
 
-[indexterm2 numeric_service..ip::basic_resolver_query]
-Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
+]
 
- static const flags numeric_service = implementation_defined;
 
+[heading Remarks]
+
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
 
 
-[endsect]
+[heading Example]
+
+The following connect condition function object can be used to output information about the individual connection attempts:
 
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
 
 
-[section:passive ip::basic_resolver_query::passive]
+It would be used with the `boost::asio::connect` function as follows:
 
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+ tcp::resolver::iterator i = boost::asio::connect(
+ s, r.resolve(q), my_connect_condition());
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
 
-['Inherited from ip::resolver_query_base.]
 
-[indexterm2 passive..ip::basic_resolver_query]
-Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
 
 
- static const flags passive = implementation_defined;
 
 
 
@@ -44037,51 +46164,97 @@
 
 
 
-[section:protocol_type ip::basic_resolver_query::protocol_type]
+[section:overload6 connect (6 of 8 overloads)]
 
-[indexterm2 protocol_type..ip::basic_resolver_query]
-The protocol type associated with the endpoint query.
 
+Establishes a socket connection by trying each endpoint in a sequence.
 
- typedef InternetProtocol protocol_type;
 
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ ConnectCondition connect_condition,
+ boost::system::error_code & ec);
 
 
-[heading Requirements]
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
-[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-[endsect]
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
 
+[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
-[section:service_name ip::basic_resolver_query::service_name]
+]
 
-[indexterm2 service_name..ip::basic_resolver_query]
-Get the service name associated with the query.
 
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
- std::string service_name() const;
 
+[heading Remarks]
+
+This overload assumes that a default constructed object of type `Iterator` represents the end of the sequence. This is a valid assumption for iterator types such as `boost::asio::ip::tcp::resolver::iterator`.
 
 
-[endsect]
+[heading Example]
+
+The following connect condition function object can be used to output information about the individual connection attempts:
 
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
 
 
-[section:v4_mapped ip::basic_resolver_query::v4_mapped]
+It would be used with the `boost::asio::connect` function as follows:
 
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::socket s(io_service);
+ boost::system::error_code ec;
+ tcp::resolver::iterator i = boost::asio::connect(
+ s, r.resolve(q), my_connect_condition(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
+ }
 
-['Inherited from ip::resolver_query_base.]
 
-[indexterm2 v4_mapped..ip::basic_resolver_query]
-If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
 
 
- static const flags v4_mapped = implementation_defined;
 
 
 
@@ -44089,342 +46262,309 @@
 
 
 
-[endsect]
-
-[section:ip__host_name ip::host_name]
+[section:overload7 connect (7 of 8 overloads)]
 
-[indexterm1 ip::host_name]
-Get the current host name.
 
-
- std::string ``[link boost_asio.reference.ip__host_name.overload1 host_name]``();
- `` [''''&raquo;''' [link boost_asio.reference.ip__host_name.overload1 more...]]``
+Establishes a socket connection by trying each endpoint in a sequence.
 
- std::string ``[link boost_asio.reference.ip__host_name.overload2 host_name]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__host_name.overload2 more...]]``
 
-[heading Requirements]
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition);
 
-[*Header: ][^boost/asio/ip/host_name.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
 
-[section:overload1 ip::host_name (1 of 2 overloads)]
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-Get the current host name.
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
 
- std::string host_name();
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
 
+]
 
 
-[endsect]
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
 
+[heading Exceptions]
+
 
-[section:overload2 ip::host_name (2 of 2 overloads)]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. If the sequence is empty, the associated `error_code` is `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
+]
 
-Get the current host name.
 
+[heading Example]
+
+The following connect condition function object can be used to output information about the individual connection attempts:
 
- std::string host_name(
- boost::system::error_code & ec);
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
 
 
+It would be used with the `boost::asio::connect` function as follows:
 
-[endsect]
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::resolver::iterator i = r.resolve(q), end;
+ tcp::socket s(io_service);
+ i = boost::asio::connect(s, i, end, my_connect_condition());
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
 
 
-[endsect]
 
-[section:ip__icmp ip::icmp]
 
 
-Encapsulates the flags needed for ICMP.
 
 
- class icmp
+[endsect]
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:overload8 connect (8 of 8 overloads)]
 
- [[link boost_asio.reference.ip__icmp.endpoint [*endpoint]]]
- [The type of a ICMP endpoint. ]
-
- ]
 
- [
+Establishes a socket connection by trying each endpoint in a sequence.
 
- [[link boost_asio.reference.ip__icmp.resolver [*resolver]]]
- [The ICMP resolver type. ]
-
- ]
 
- [
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename Iterator,
+ typename ConnectCondition>
+ Iterator connect(
+ basic_socket< Protocol, SocketService > & s,
+ Iterator begin,
+ Iterator end,
+ ConnectCondition connect_condition,
+ boost::system::error_code & ec);
 
- [[link boost_asio.reference.ip__icmp.resolver_iterator [*resolver_iterator]]]
- [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
-
- ]
 
- [
+This function attempts to connect a socket to one of a sequence of endpoints. It does this by repeated calls to the socket's `connect` member function, once for each endpoint in the sequence, until a connection is successfully established.
 
- [[link boost_asio.reference.ip__icmp.resolver_query [*resolver_query]]]
- [(Deprecated: use resolver::query.) The type of a resolver query. ]
-
- ]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.ip__icmp.socket [*socket]]]
- [The ICMP socket type. ]
+[variablelist
   
- ]
+[[s][The socket to be connected. If the socket is already open, it will be closed.]]
 
-]
+[[begin][An iterator pointing to the start of a sequence of endpoints.]]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[[end][An iterator pointing to the end of a sequence of endpoints.]]
 
- [
- [[link boost_asio.reference.ip__icmp.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.ip__icmp.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__icmp.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__icmp.v4 [*v4]]]
- [Construct to represent the IPv4 ICMP protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__icmp.v6 [*v6]]]
- [Construct to represent the IPv6 ICMP protocol. ]
- ]
-
-]
+[[connect_condition][A function object that is called prior to each connection attempt. The signature of the function object must be:
+``
+ Iterator connect_condition(
+ const boost::system::error_code& ec,
+ Iterator next);
+``
+The `ec` parameter contains the result from the most recent connect operation. Before the first connection attempt, `ec` is always set to indicate success. The `next` parameter is an iterator pointing to the next endpoint to be tried. The function object should return the next iterator, but is permitted to return a different iterator so that endpoints may be skipped. The implementation guarantees that the function object will never be called with the end iterator.]]
 
-[heading Friends]
-[table
- [[Name][Description]]
+[[ec][Set to indicate what error occurred, if any. If the sequence is empty, set to `boost::asio::error::not_found`. Otherwise, contains the error from the last connection attempt.]]
 
- [
- [[link boost_asio.reference.ip__icmp.operator_not__eq_ [*operator!=]]]
- [Compare two protocols for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__icmp.operator_eq__eq_ [*operator==]]]
- [Compare two protocols for equality. ]
- ]
-
 ]
 
-The [link boost_asio.reference.ip__icmp `ip::icmp`] class contains flags necessary for ICMP sockets.
 
+[heading Return Value]
+
+On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.
 
-[heading Thread Safety]
+
+[heading Example]
   
-[*Distinct] [*objects:] Safe.
+The following connect condition function object can be used to output information about the individual connection attempts:
 
-[*Shared] [*objects:] Safe.
+ struct my_connect_condition
+ {
+ template <typename Iterator>
+ Iterator operator()(
+ const boost::system::error_code& ec,
+ Iterator next)
+ {
+ if (ec) std::cout << "Error: " << ec.message() << std::endl;
+ std::cout << "Trying: " << next->endpoint() << std::endl;
+ return next;
+ }
+ };
 
 
+It would be used with the `boost::asio::connect` function as follows:
 
+ tcp::resolver r(io_service);
+ tcp::resolver::query q("host", "service");
+ tcp::resolver::iterator i = r.resolve(q), end;
+ tcp::socket s(io_service);
+ boost::system::error_code ec;
+ i = boost::asio::connect(s, i, end, my_connect_condition(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ std::cout << "Connected to: " << i->endpoint() << std::endl;
+ }
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:endpoint ip::icmp::endpoint]
 
-[indexterm2 endpoint..ip::icmp]
-The type of a ICMP endpoint.
 
+[endsect]
 
- typedef basic_endpoint< icmp > endpoint;
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
+[section:const_buffer const_buffer]
 
- [
 
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+Holds a buffer that cannot be modified.
 
- [
 
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+ class const_buffer
 
-]
 
 [heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint.
-
- Set the IP address associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
-
- Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
-
- Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+ [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer.
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
- [Get the port associated with the endpoint. The port number is always in the host's byte order.
+ Construct a buffer to represent a given memory range.
 
- Set the port associated with the endpoint. The port number is always in the host's byte order. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ Construct a non-modifiable buffer from a modifiable one. ]
   ]
   
 ]
 
-[heading Friends]
+[heading Related Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
+ [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
+ [Create a new non-modifiable buffer that is offset from the start of another. ]
   ]
   
 ]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+The [link boost_asio.reference.const_buffer `const_buffer`] class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
 
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
+
+[heading Accessing Buffer Contents]
   
-]
 
-The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
 
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+
+ boost::asio::const_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ const unsigned char* p1 = boost::asio::buffer_cast<const unsigned char*>(b1);
 
 
 
 
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+[*Header: ][^boost/asio/buffer.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
+[section:const_buffer const_buffer::const_buffer]
+
+[indexterm2 const_buffer..const_buffer]
+Construct an empty buffer.
+
+
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload1 const_buffer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload1 more...]]``
+
+
+Construct a buffer to represent a given memory range.
+
+
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload2 const_buffer]``(
+ const void * data,
+ std::size_t size);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload2 more...]]``
+
+
+Construct a non-modifiable buffer from a modifiable one.
+
+
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload3 const_buffer]``(
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffer.const_buffer.overload3 more...]]``
+
+
+[section:overload1 const_buffer::const_buffer (1 of 3 overloads)]
+
+
+Construct an empty buffer.
+
+
+ const_buffer();
+
+
 
 [endsect]
 
 
 
-[section:family ip::icmp::family]
+[section:overload2 const_buffer::const_buffer (2 of 3 overloads)]
 
-[indexterm2 family..ip::icmp]
-Obtain an identifier for the protocol family.
+
+Construct a buffer to represent a given memory range.
 
 
- int family() const;
+ const_buffer(
+ const void * data,
+ std::size_t size);
 
 
 
@@ -44432,71 +46572,83 @@
 
 
 
-[section:operator_not__eq_ ip::icmp::operator!=]
+[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
 
-[indexterm2 operator!=..ip::icmp]
-Compare two protocols for inequality.
 
+Construct a non-modifiable buffer from a modifiable one.
 
- friend bool operator!=(
- const icmp & p1,
- const icmp & p2);
 
+ const_buffer(
+ const mutable_buffer & b);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
+[section:operator_plus_ const_buffer::operator+]
 
+[indexterm2 operator+..const_buffer]
+Create a new non-modifiable buffer that is offset from the start of another.
 
-[section:operator_eq__eq_ ip::icmp::operator==]
 
-[indexterm2 operator==..ip::icmp]
-Compare two protocols for equality.
+ const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload1 operator+]``(
+ const const_buffer & b,
+ std::size_t start);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffer.operator_plus_.overload1 more...]]``
 
+ const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffer.operator_plus_.overload2 more...]]``
 
- friend bool operator==(
- const icmp & p1,
- const icmp & p2);
 
+[section:overload1 const_buffer::operator+ (1 of 2 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+Create a new non-modifiable buffer that is offset from the start of another.
+
+
+ const_buffer operator+(
+ const const_buffer & b,
+ std::size_t start);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:protocol ip::icmp::protocol]
+[section:overload2 const_buffer::operator+ (2 of 2 overloads)]
 
-[indexterm2 protocol..ip::icmp]
-Obtain an identifier for the protocol.
 
+Create a new non-modifiable buffer that is offset from the start of another.
 
- int protocol() const;
+
+ const_buffer operator+(
+ std::size_t start,
+ const const_buffer & b);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:resolver ip::icmp::resolver]
 
-[indexterm2 resolver..ip::icmp]
-The ICMP resolver type.
+[endsect]
+
+[section:const_buffers_1 const_buffers_1]
 
 
- typedef basic_resolver< icmp > resolver;
+Adapts a single non-modifiable buffer so that it meets the requirements of the ConstBufferSequence concept.
+
+
+ class const_buffers_1 :
+ public const_buffer
 
 
 [heading Types]
@@ -44505,43 +46657,15 @@
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.const_buffers_1.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.const_buffers_1.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
   
   ]
 
@@ -44552,162 +46676,121 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously perform forward resolution of a query to a list of entries.
-
- Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.const_buffers_1.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.const_buffers_1.const_buffers_1 [*const_buffers_1]]]
+ [Construct to represent a given memory range.
+
+ Construct to represent a single non-modifiable buffer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Perform forward resolution of a query to a list of entries.
-
- Perform reverse resolution of an endpoint to a list of entries. ]
+ [[link boost_asio.reference.const_buffers_1.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
   ]
   
 ]
 
-[heading Protected Data Members]
+[heading Related Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
+ [[link boost_asio.reference.const_buffers_1.operator_plus_ [*operator+]]]
+ [Create a new non-modifiable buffer that is offset from the start of another. ]
   ]
+
+]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[heading Requirements]
 
-]
+[*Header: ][^boost/asio/buffer.hpp]
 
-The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[section:begin const_buffers_1::begin]
 
-[*Shared] [*objects:] Unsafe.
+[indexterm2 begin..const_buffers_1]
+Get a random-access iterator to the first element.
 
 
+ const_iterator begin() const;
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:const_buffers_1 const_buffers_1::const_buffers_1]
 
-[endsect]
+[indexterm2 const_buffers_1..const_buffers_1]
+Construct to represent a given memory range.
 
 
+ ``[link boost_asio.reference.const_buffers_1.const_buffers_1.overload1 const_buffers_1]``(
+ const void * data,
+ std::size_t size);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.const_buffers_1.overload1 more...]]``
 
-[section:resolver_iterator ip::icmp::resolver_iterator]
 
-[indexterm2 resolver_iterator..ip::icmp]
-(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
+Construct to represent a single non-modifiable buffer.
 
 
- typedef basic_resolver_iterator< icmp > resolver_iterator;
+ explicit ``[link boost_asio.reference.const_buffers_1.const_buffers_1.overload2 const_buffers_1]``(
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.const_buffers_1.overload2 more...]]``
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:overload1 const_buffers_1::const_buffers_1 (1 of 2 overloads)]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
 
- Create an iterator from an endpoint, host name and service name. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
+Construct to represent a given memory range.
 
- Increment operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
+ const_buffers_1(
+ const void * data,
+ std::size_t size);
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
- ]
-
-]
 
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
 
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+[endsect]
 
- const basic_resolver_entry<InternetProtocol>
 
 
+[section:overload2 const_buffers_1::const_buffers_1 (2 of 2 overloads)]
 
 
+Construct to represent a single non-modifiable buffer.
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+ const_buffers_1(
+ const const_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:const_iterator const_buffers_1::const_iterator]
+
+[indexterm2 const_iterator..const_buffers_1]
+A random-access iterator type that may be used to read elements.
 
 
+ typedef const const_buffer * const_iterator;
+
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+[*Header: ][^boost/asio/buffer.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -44716,288 +46799,193 @@
 
 
 
-[section:resolver_query ip::icmp::resolver_query]
-
-[indexterm2 resolver_query..ip::icmp]
-(Deprecated: use `resolver::query`.) The type of a resolver query.
+[section:end const_buffers_1::end]
 
+[indexterm2 end..const_buffers_1]
+Get a random-access iterator for one past the last element.
 
- typedef basic_resolver_query< icmp > resolver_query;
 
+ const_iterator end() const;
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
+[section:operator_plus_ const_buffers_1::operator+]
 
-]
+[indexterm2 operator+..const_buffers_1]
+Create a new non-modifiable buffer that is offset from the start of another.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
+ const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload1 operator+]``(
+ const const_buffer & b,
+ std::size_t start);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.operator_plus_.overload1 more...]]``
 
- Construct with specified service name for a given protocol.
+ const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.const_buffers_1.operator_plus_.overload2 more...]]``
 
- Construct with specified host name and service name for any protocol.
 
- Construct with specified host name and service name for a given protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
- ]
-
-]
+[section:overload1 const_buffers_1::operator+ (1 of 2 overloads)]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+['Inherited from const_buffer.]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+Create a new non-modifiable buffer that is offset from the start of another.
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
+ const_buffer operator+(
+ const const_buffer & b,
+ std::size_t start);
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
 
-]
+[endsect]
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[section:overload2 const_buffers_1::operator+ (2 of 2 overloads)]
 
-[*Shared] [*objects:] Unsafe.
 
+['Inherited from const_buffer.]
 
 
+Create a new non-modifiable buffer that is offset from the start of another.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+ const_buffer operator+(
+ std::size_t start,
+ const const_buffer & b);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
 
-[section:socket ip::icmp::socket]
 
-[indexterm2 socket..ip::icmp]
-The ICMP socket type.
+[section:value_type const_buffers_1::value_type]
+
+[indexterm2 value_type..const_buffers_1]
+The type for each element in the list of buffers.
 
 
- typedef basic_raw_socket< icmp > socket;
+ typedef const_buffer value_type;
 
 
-[heading Types]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
+ [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer.
 
- [[link boost_asio.reference.basic_raw_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
-
- [
+ Construct a buffer to represent a given memory range.
 
- [[link boost_asio.reference.basic_raw_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
+ Construct a non-modifiable buffer from a modifiable one. ]
   ]
+
+]
 
- [
+[heading Related Functions]
+[table
+ [[Name][Description]]
 
- [[link boost_asio.reference.basic_raw_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
+ [
+ [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
+ [Create a new non-modifiable buffer that is offset from the start of another. ]
   ]
+
+]
 
- [
+The [link boost_asio.reference.const_buffer `const_buffer`] class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
 
- [[link boost_asio.reference.basic_raw_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
+
+[heading Accessing Buffer Contents]
   
- ]
 
- [
 
- [[link boost_asio.reference.basic_raw_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
 
- [
 
- [[link boost_asio.reference.basic_raw_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
+ boost::asio::const_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ const unsigned char* p1 = boost::asio::buffer_cast<const unsigned char*>(b1);
 
- [[link boost_asio.reference.basic_raw_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_raw_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
 
- [[link boost_asio.reference.basic_raw_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+[heading Requirements]
 
- [[link boost_asio.reference.basic_raw_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
+[*Header: ][^boost/asio/buffer.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.basic_raw_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+[endsect]
 
- [
+[section:datagram_socket_service datagram_socket_service]
 
- [[link boost_asio.reference.basic_raw_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
+Default service implementation for a datagram socket.
 
- [[link boost_asio.reference.basic_raw_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
 
- [
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class datagram_socket_service :
+ public io_service::service
 
- [[link boost_asio.reference.basic_raw_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
+ [[link boost_asio.reference.datagram_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
+ [[link boost_asio.reference.datagram_socket_service.implementation_type [*implementation_type]]]
+ [The type of a datagram socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.datagram_socket_service.native_handle_type [*native_handle_type]]]
+ [The native socket type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.datagram_socket_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native socket type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_raw_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.datagram_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
   
   ]
 
@@ -45008,232 +46996,224 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_raw_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a datagram socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.async_connect [*async_connect]]]
+ [[link boost_asio.reference.datagram_socket_service.async_connect [*async_connect]]]
     [Start an asynchronous connect. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive on a connected socket. ]
+ [[link boost_asio.reference.datagram_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive. ]
+ [[link boost_asio.reference.datagram_socket_service.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive that will get the endpoint of the sender. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.async_send [*async_send]]]
- [Start an asynchronous send on a connected socket. ]
+ [[link boost_asio.reference.datagram_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.async_send_to [*async_send_to]]]
+ [[link boost_asio.reference.datagram_socket_service.async_send_to [*async_send_to]]]
     [Start an asynchronous send. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.at_mark [*at_mark]]]
+ [[link boost_asio.reference.datagram_socket_service.at_mark [*at_mark]]]
     [Determine whether the socket is at the out-of-band data mark. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.available [*available]]]
+ [[link boost_asio.reference.datagram_socket_service.available [*available]]]
     [Determine the number of bytes available for reading. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.basic_raw_socket [*basic_raw_socket]]]
- [Construct a basic_raw_socket without opening it.
-
- Construct and open a basic_raw_socket.
-
- Construct a basic_raw_socket, opening it and binding it to the given local endpoint.
-
- Construct a basic_raw_socket on an existing native socket. ]
+ [[link boost_asio.reference.datagram_socket_service.bind [*bind]]]
+ []
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.datagram_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.close [*close]]]
+ [Close a datagram socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.connect [*connect]]]
+ [Connect the datagram socket to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.datagram_socket_service.construct [*construct]]]
+ [Construct a new datagram socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.datagram_socket_service.datagram_socket_service [*datagram_socket_service]]]
+ [Construct a new datagram socket service for the specified io_service. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.destroy [*destroy]]]
+ [Destroy a datagram socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.datagram_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.datagram_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
-
- Get a const reference to the lowest layer. ]
+ [[link boost_asio.reference.datagram_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.native [*native]]]
- [Get the native socket representation. ]
+ [[link boost_asio.reference.datagram_socket_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.datagram_socket_service.native_handle [*native_handle]]]
+ [Get the native socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.receive [*receive]]]
- [Receive some data on a connected socket. ]
+ [[link boost_asio.reference.datagram_socket_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.receive_from [*receive_from]]]
- [Receive raw data with the endpoint of the sender. ]
+ [[link boost_asio.reference.datagram_socket_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.open [*open]]]
+ []
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.send [*send]]]
- [Send some data on a connected socket. ]
+ [[link boost_asio.reference.datagram_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.send_to [*send_to]]]
- [Send raw data to the specified endpoint. ]
+ [[link boost_asio.reference.datagram_socket_service.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.basic_raw_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.datagram_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.basic_raw_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
+ [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_raw_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
+ [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_raw_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
+ [[link boost_asio.reference.datagram_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_raw_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
+ [[link boost_asio.reference.datagram_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
   ]
-
+
 ]
 
-[heading Protected Data Members]
+[heading Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_raw_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_raw_socket.service [*service]]]
- [The service associated with the I/O object. ]
+ [[link boost_asio.reference.datagram_socket_service.id [*id]]]
+ [The unique service identifier. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_raw_socket `basic_raw_socket`] class template provides asynchronous and blocking raw-oriented socket functionality.
-
+[heading Requirements]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
-[*Shared] [*objects:] Unsafe.
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[section:assign datagram_socket_service::assign]
 
+[indexterm2 assign..datagram_socket_service]
+Assign an existing native socket to a datagram socket.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/icmp.hpp]
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:type ip::icmp::type]
+[section:async_connect datagram_socket_service::async_connect]
 
-[indexterm2 type..ip::icmp]
-Obtain an identifier for the type of the protocol.
+[indexterm2 async_connect..datagram_socket_service]
+Start an asynchronous connect.
 
 
- int type() const;
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
 
 
 
@@ -45241,13 +47221,20 @@
 
 
 
-[section:v4 ip::icmp::v4]
+[section:async_receive datagram_socket_service::async_receive]
 
-[indexterm2 v4..ip::icmp]
-Construct to represent the IPv4 ICMP protocol.
+[indexterm2 async_receive..datagram_socket_service]
+Start an asynchronous receive.
 
 
- static icmp v4();
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ ReadHandler handler);
 
 
 
@@ -45255,13 +47242,21 @@
 
 
 
-[section:v6 ip::icmp::v6]
+[section:async_receive_from datagram_socket_service::async_receive_from]
 
-[indexterm2 v6..ip::icmp]
-Construct to represent the IPv6 ICMP protocol.
+[indexterm2 async_receive_from..datagram_socket_service]
+Start an asynchronous receive that will get the endpoint of the sender.
 
 
- static icmp v6();
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive_from(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ ReadHandler handler);
 
 
 
@@ -45269,185 +47264,203 @@
 
 
 
-[endsect]
+[section:async_send datagram_socket_service::async_send]
 
+[indexterm2 async_send..datagram_socket_service]
+Start an asynchronous send.
 
-[section:ip__multicast__enable_loopback ip::multicast::enable_loopback]
 
-[indexterm1 ip::multicast::enable_loopback]
-Socket option determining whether outgoing multicast packets will be received on the same socket if it is a member of the multicast group.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
 
- typedef implementation_defined enable_loopback;
 
+[endsect]
 
 
-Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option.
 
+[section:async_send_to datagram_socket_service::async_send_to]
 
-[heading Examples]
-
-Setting the option:
+[indexterm2 async_send_to..datagram_socket_service]
+Start an asynchronous send.
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::enable_loopback option(true);
- socket.set_option(option);
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send_to(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
 
 
+[endsect]
 
-Getting the current option value:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::enable_loopback option;
- socket.get_option(option);
- bool is_set = option.value();
 
+[section:at_mark datagram_socket_service::at_mark]
 
+[indexterm2 at_mark..datagram_socket_service]
+Determine whether the socket is at the out-of-band data mark.
 
 
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/multicast.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:available datagram_socket_service::available]
+
+[indexterm2 available..datagram_socket_service]
+Determine the number of bytes available for reading.
 
-[endsect]
 
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
-[section:ip__multicast__hops ip::multicast::hops]
 
-[indexterm1 ip::multicast::hops]
-Socket option for time-to-live associated with outgoing multicast packets.
+[endsect]
 
 
- typedef implementation_defined hops;
 
+[section:bind datagram_socket_service::bind]
 
+[indexterm2 bind..datagram_socket_service]
 
-Implements the IPPROTO\_IP/IP\_MULTICAST\_TTL socket option.
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
 
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::hops option(4);
- socket.set_option(option);
+[endsect]
 
 
 
+[section:cancel datagram_socket_service::cancel]
 
+[indexterm2 cancel..datagram_socket_service]
+Cancel all asynchronous operations associated with the socket.
 
-Getting the current option value:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
 
 
+[endsect]
 
 
 
+[section:close datagram_socket_service::close]
 
-[heading Requirements]
+[indexterm2 close..datagram_socket_service]
+Close a datagram socket implementation.
 
-[*Header: ][^boost/asio/ip/multicast.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
 
 
 [endsect]
 
 
 
-[section:ip__multicast__join_group ip::multicast::join_group]
+[section:connect datagram_socket_service::connect]
 
-[indexterm1 ip::multicast::join_group]
-Socket option to join a multicast group on a specified interface.
+[indexterm2 connect..datagram_socket_service]
+Connect the datagram socket to the specified endpoint.
 
 
- typedef implementation_defined join_group;
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
 
 
 
-Implements the IPPROTO\_IP/IP\_ADD\_MEMBERSHIP socket option.
+[endsect]
 
 
-[heading Examples]
-
-Setting the option to join a multicast group:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::address multicast_address =
- boost::asio::ip::address::from_string("225.0.0.1");
- boost::asio::ip::multicast::join_group option(multicast_address);
- socket.set_option(option);
+[section:construct datagram_socket_service::construct]
 
+[indexterm2 construct..datagram_socket_service]
+Construct a new datagram socket implementation.
 
 
+ void construct(
+ implementation_type & impl);
 
 
 
+[endsect]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/multicast.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:datagram_socket_service datagram_socket_service::datagram_socket_service]
 
+[indexterm2 datagram_socket_service..datagram_socket_service]
+Construct a new datagram socket service for the specified [link boost_asio.reference.io_service `io_service`].
 
-[endsect]
 
+ datagram_socket_service(
+ boost::asio::io_service & io_service);
 
 
-[section:ip__multicast__leave_group ip::multicast::leave_group]
 
-[indexterm1 ip::multicast::leave_group]
-Socket option to leave a multicast group on a specified interface.
+[endsect]
 
 
- typedef implementation_defined leave_group;
 
+[section:destroy datagram_socket_service::destroy]
 
+[indexterm2 destroy..datagram_socket_service]
+Destroy a datagram socket implementation.
 
-Implements the IPPROTO\_IP/IP\_DROP\_MEMBERSHIP socket option.
 
+ void destroy(
+ implementation_type & impl);
 
-[heading Examples]
-
-Setting the option to leave a multicast group:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::address multicast_address =
- boost::asio::ip::address::from_string("225.0.0.1");
- boost::asio::ip::multicast::leave_group option(multicast_address);
- socket.set_option(option);
 
+[endsect]
+
+
+
+[section:endpoint_type datagram_socket_service::endpoint_type]
 
+[indexterm2 endpoint_type..datagram_socket_service]
+The endpoint type.
 
 
+ typedef Protocol::endpoint endpoint_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/multicast.hpp]
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -45456,134 +47469,104 @@
 
 
 
-[section:ip__multicast__outbound_interface ip::multicast::outbound_interface]
+[section:get_io_service datagram_socket_service::get_io_service]
 
-[indexterm1 ip::multicast::outbound_interface]
-Socket option for local interface to use for outgoing multicast packets.
 
+['Inherited from io_service.]
 
- typedef implementation_defined outbound_interface;
+[indexterm2 get_io_service..datagram_socket_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
 
+ boost::asio::io_service & get_io_service();
 
-Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option.
 
 
-[heading Examples]
-
-Setting the option:
+[endsect]
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::address_v4 local_interface =
- boost::asio::ip::address_v4::from_string("1.2.3.4");
- boost::asio::ip::multicast::outbound_interface option(local_interface);
- socket.set_option(option);
 
 
+[section:get_option datagram_socket_service::get_option]
 
+[indexterm2 get_option..datagram_socket_service]
+Get a socket option.
 
 
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ const implementation_type & impl,
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/multicast.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:id datagram_socket_service::id]
 
+[indexterm2 id..datagram_socket_service]
+The unique service identifier.
 
-[section:ip__resolver_query_base ip::resolver_query_base]
 
+ static boost::asio::io_service::id id;
 
-The [link boost_asio.reference.ip__resolver_query_base `ip::resolver_query_base`] class is used as a base for the [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class templates to provide a common place to define the flag constants.
 
 
- class resolver_query_base
+[endsect]
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:implementation_type datagram_socket_service::implementation_type]
 
- [[link boost_asio.reference.ip__resolver_query_base.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
+[indexterm2 implementation_type..datagram_socket_service]
+The type of a datagram socket.
 
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ typedef implementation_defined implementation_type;
 
- [
- [[link boost_asio.reference.ip__resolver_query_base._resolver_query_base [*~resolver_query_base]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+[heading Requirements]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
 
- [
- [[link boost_asio.reference.ip__resolver_query_base.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
 
-]
+[section:io_control datagram_socket_service::io_control]
 
-[heading Requirements]
+[indexterm2 io_control..datagram_socket_service]
+Perform an IO control command on the socket.
 
-[*Header: ][^boost/asio/ip/resolver_query_base.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
 
-[section:address_configured ip::resolver_query_base::address_configured]
 
-[indexterm2 address_configured..ip::resolver_query_base]
-Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
+[endsect]
 
 
- static const flags address_configured = implementation_defined;
+
+[section:is_open datagram_socket_service::is_open]
+
+[indexterm2 is_open..datagram_socket_service]
+Determine whether the socket is open.
+
+
+ bool is_open(
+ const implementation_type & impl) const;
 
 
 
@@ -45591,13 +47574,15 @@
 
 
 
-[section:all_matching ip::resolver_query_base::all_matching]
+[section:local_endpoint datagram_socket_service::local_endpoint]
 
-[indexterm2 all_matching..ip::resolver_query_base]
-If used with v4\_mapped, return all matching IPv6 and IPv4 addresses.
+[indexterm2 local_endpoint..datagram_socket_service]
+Get the local endpoint.
 
 
- static const flags all_matching = implementation_defined;
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
 
@@ -45605,13 +47590,14 @@
 
 
 
-[section:canonical_name ip::resolver_query_base::canonical_name]
+[section:native datagram_socket_service::native]
 
-[indexterm2 canonical_name..ip::resolver_query_base]
-Determine the canonical name of the host specified in the query.
+[indexterm2 native..datagram_socket_service]
+(Deprecated: Use `native_handle()`.) Get the native socket implementation.
 
 
- static const flags canonical_name = implementation_defined;
+ native_type native(
+ implementation_type & impl);
 
 
 
@@ -45619,62 +47605,70 @@
 
 
 
-[section:flags ip::resolver_query_base::flags]
+[section:native_handle datagram_socket_service::native_handle]
 
-[indexterm2 flags..ip::resolver_query_base]
-A bitmask type (C++ Std [lib.bitmask.types]).
+[indexterm2 native_handle..datagram_socket_service]
+Get the native socket implementation.
 
 
- typedef unspecified flags;
+ native_handle_type native_handle(
+ implementation_type & impl);
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/ip/resolver_query_base.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:native_handle_type datagram_socket_service::native_handle_type]
 
-[endsect]
+[indexterm2 native_handle_type..datagram_socket_service]
+The native socket type.
 
 
+ typedef implementation_defined native_handle_type;
 
-[section:numeric_host ip::resolver_query_base::numeric_host]
 
-[indexterm2 numeric_host..ip::resolver_query_base]
-Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
 
+[heading Requirements]
 
- static const flags numeric_host = implementation_defined;
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:native_non_blocking datagram_socket_service::native_non_blocking]
 
-[section:numeric_service ip::resolver_query_base::numeric_service]
+[indexterm2 native_non_blocking..datagram_socket_service]
+Gets the non-blocking mode of the native socket implementation.
 
-[indexterm2 numeric_service..ip::resolver_query_base]
-Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
 
+ bool ``[link boost_asio.reference.datagram_socket_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.datagram_socket_service.native_non_blocking.overload1 more...]]``
 
- static const flags numeric_service = implementation_defined;
 
+Sets the non-blocking mode of the native socket implementation.
 
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.datagram_socket_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.datagram_socket_service.native_non_blocking.overload2 more...]]``
 
 
+[section:overload1 datagram_socket_service::native_non_blocking (1 of 2 overloads)]
 
-[section:passive ip::resolver_query_base::passive]
 
-[indexterm2 passive..ip::resolver_query_base]
-Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+Gets the non-blocking mode of the native socket implementation.
 
 
- static const flags passive = implementation_defined;
+ bool native_non_blocking(
+ const implementation_type & impl) const;
 
 
 
@@ -45682,236 +47676,170 @@
 
 
 
-[section:v4_mapped ip::resolver_query_base::v4_mapped]
+[section:overload2 datagram_socket_service::native_non_blocking (2 of 2 overloads)]
 
-[indexterm2 v4_mapped..ip::resolver_query_base]
-If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
 
+Sets the non-blocking mode of the native socket implementation.
 
- static const flags v4_mapped = implementation_defined;
+
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:_resolver_query_base ip::resolver_query_base::~resolver_query_base]
 
-[indexterm2 ~resolver_query_base..ip::resolver_query_base]
-Protected destructor to prevent deletion through this type.
+[section:native_type datagram_socket_service::native_type]
+
+[indexterm2 native_type..datagram_socket_service]
+(Deprecated: Use native\_handle\_type.) The native socket type.
 
 
- ~resolver_query_base();
+ typedef implementation_defined native_type;
 
 
 
-[endsect]
+[heading Requirements]
+
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-[section:ip__resolver_service ip::resolver_service]
 
+[section:non_blocking datagram_socket_service::non_blocking]
 
-Default service implementation for a resolver.
+[indexterm2 non_blocking..datagram_socket_service]
+Gets the non-blocking mode of the socket.
 
 
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class resolver_service :
- public io_service::service
+ bool ``[link boost_asio.reference.datagram_socket_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.datagram_socket_service.non_blocking.overload1 more...]]``
 
 
-[heading Types]
-[table
- [[Name][Description]]
+Sets the non-blocking mode of the socket.
 
- [
 
- [[link boost_asio.reference.ip__resolver_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+ boost::system::error_code ``[link boost_asio.reference.datagram_socket_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.datagram_socket_service.non_blocking.overload2 more...]]``
 
- [
 
- [[link boost_asio.reference.ip__resolver_service.implementation_type [*implementation_type]]]
- [The type of a resolver implementation. ]
-
- ]
+[section:overload1 datagram_socket_service::non_blocking (1 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.ip__resolver_service.iterator_type [*iterator_type]]]
- [The iterator type. ]
-
- ]
+Gets the non-blocking mode of the socket.
 
- [
 
- [[link boost_asio.reference.ip__resolver_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+ bool non_blocking(
+ const implementation_type & impl) const;
 
- [
 
- [[link boost_asio.reference.ip__resolver_service.query_type [*query_type]]]
- [The query type. ]
-
- ]
 
-]
+[endsect]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__resolver_service.async_resolve [*async_resolve]]]
- [Asynchronously resolve a query to a list of entries.
 
- Asynchronously resolve an endpoint to a list of entries. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.cancel [*cancel]]]
- [Cancel pending asynchronous operations. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.construct [*construct]]]
- [Construct a new resolver implementation. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.destroy [*destroy]]]
- [Destroy a resolver implementation. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.resolve [*resolve]]]
- [Resolve a query to a list of entries.
+[section:overload2 datagram_socket_service::non_blocking (2 of 2 overloads)]
 
- Resolve an endpoint to a list of entries. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.resolver_service [*resolver_service]]]
- [Construct a new resolver service for the specified io_service. ]
- ]
-
- [
- [[link boost_asio.reference.ip__resolver_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+Sets the non-blocking mode of the socket.
 
- [
- [[link boost_asio.reference.ip__resolver_service.id [*id]]]
- [The unique service identifier. ]
- ]
 
-]
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
-[section:async_resolve ip::resolver_service::async_resolve]
 
-[indexterm2 async_resolve..ip::resolver_service]
-Asynchronously resolve a query to a list of entries.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void ``[link boost_asio.reference.ip__resolver_service.async_resolve.overload1 async_resolve]``(
+[section:open datagram_socket_service::open]
+
+[indexterm2 open..datagram_socket_service]
+
+ boost::system::error_code open(
       implementation_type & impl,
- const query_type & query,
- Handler handler);
- `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.async_resolve.overload1 more...]]``
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
 
 
-Asynchronously resolve an endpoint to a list of entries.
 
+[endsect]
 
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void ``[link boost_asio.reference.ip__resolver_service.async_resolve.overload2 async_resolve]``(
- implementation_type & impl,
- const endpoint_type & endpoint,
- ResolveHandler handler);
- `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.async_resolve.overload2 more...]]``
 
 
-[section:overload1 ip::resolver_service::async_resolve (1 of 2 overloads)]
+[section:protocol_type datagram_socket_service::protocol_type]
 
+[indexterm2 protocol_type..datagram_socket_service]
+The protocol type.
 
-Asynchronously resolve a query to a list of entries.
 
+ typedef Protocol protocol_type;
 
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void async_resolve(
- implementation_type & impl,
- const query_type & query,
- Handler handler);
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/datagram_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload2 ip::resolver_service::async_resolve (2 of 2 overloads)]
+[endsect]
 
 
-Asynchronously resolve an endpoint to a list of entries.
+
+[section:receive datagram_socket_service::receive]
+
+[indexterm2 receive..datagram_socket_service]
+Receive some data from the peer.
 
 
   template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
       implementation_type & impl,
- const endpoint_type & endpoint,
- ResolveHandler handler);
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:cancel ip::resolver_service::cancel]
+[section:receive_from datagram_socket_service::receive_from]
 
-[indexterm2 cancel..ip::resolver_service]
-Cancel pending asynchronous operations.
+[indexterm2 receive_from..datagram_socket_service]
+Receive a datagram with the endpoint of the sender.
 
 
- void cancel(
- implementation_type & impl);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive_from(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
 
 
@@ -45919,14 +47847,15 @@
 
 
 
-[section:construct ip::resolver_service::construct]
+[section:remote_endpoint datagram_socket_service::remote_endpoint]
 
-[indexterm2 construct..ip::resolver_service]
-Construct a new resolver implementation.
+[indexterm2 remote_endpoint..datagram_socket_service]
+Get the remote endpoint.
 
 
- void construct(
- implementation_type & impl);
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
 
@@ -45934,14 +47863,19 @@
 
 
 
-[section:destroy ip::resolver_service::destroy]
+[section:send datagram_socket_service::send]
 
-[indexterm2 destroy..ip::resolver_service]
-Destroy a resolver implementation.
+[indexterm2 send..datagram_socket_service]
+Send the given data to the peer.
 
 
- void destroy(
- implementation_type & impl);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
 
 
@@ -45949,37 +47883,39 @@
 
 
 
-[section:endpoint_type ip::resolver_service::endpoint_type]
-
-[indexterm2 endpoint_type..ip::resolver_service]
-The endpoint type.
-
-
- typedef InternetProtocol::endpoint endpoint_type;
-
+[section:send_to datagram_socket_service::send_to]
 
+[indexterm2 send_to..datagram_socket_service]
+Send a datagram to the specified endpoint.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send_to(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:get_io_service ip::resolver_service::get_io_service]
-
-
-['Inherited from io_service.]
+[section:set_option datagram_socket_service::set_option]
 
-[indexterm2 get_io_service..ip::resolver_service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[indexterm2 set_option..datagram_socket_service]
+Set a socket option.
 
 
- boost::asio::io_service & get_io_service();
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ implementation_type & impl,
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
 
 
@@ -45987,13 +47923,16 @@
 
 
 
-[section:id ip::resolver_service::id]
+[section:shutdown datagram_socket_service::shutdown]
 
-[indexterm2 id..ip::resolver_service]
-The unique service identifier.
+[indexterm2 shutdown..datagram_socket_service]
+Disable sends or receives on the socket.
 
 
- static boost::asio::io_service::id id;
+ boost::system::error_code shutdown(
+ implementation_type & impl,
+ socket_base::shutdown_type what,
+ boost::system::error_code & ec);
 
 
 
@@ -46001,147 +47940,241 @@
 
 
 
-[section:implementation_type ip::resolver_service::implementation_type]
-
-[indexterm2 implementation_type..ip::resolver_service]
-The type of a resolver implementation.
+[section:shutdown_service datagram_socket_service::shutdown_service]
 
+[indexterm2 shutdown_service..datagram_socket_service]
+Destroy all user-defined handler objects owned by the service.
 
- typedef implementation_defined implementation_type;
 
+ virtual void shutdown_service();
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:deadline_timer deadline_timer]
 
-[section:io_service ip::resolver_service::io_service]
+[indexterm1 deadline_timer]
+Typedef for the typical usage of timer. Uses a UTC clock.
 
 
-['Inherited from io_service.]
+ typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
 
-[indexterm2 io_service..ip::resolver_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
+[heading Types]
+[table
+ [[Name][Description]]
 
- boost::asio::io_service & io_service();
+ [
 
+ [[link boost_asio.reference.basic_deadline_timer.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
 
+ [
 
-[endsect]
+ [[link boost_asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
 
+ [
 
+ [[link boost_asio.reference.basic_deadline_timer.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
 
-[section:iterator_type ip::resolver_service::iterator_type]
+ [
 
-[indexterm2 iterator_type..ip::resolver_service]
-The iterator type.
+ [[link boost_asio.reference.basic_deadline_timer.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
 
+ [
 
- typedef basic_resolver_iterator< InternetProtocol > iterator_type;
+ [[link boost_asio.reference.basic_deadline_timer.traits_type [*traits_type]]]
+ [The time traits type. ]
+
+ ]
 
+]
 
 [heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
+ [[link boost_asio.reference.basic_deadline_timer.async_wait [*async_wait]]]
+ [Start an asynchronous wait on the timer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
+ [[link boost_asio.reference.basic_deadline_timer.basic_deadline_timer [*basic_deadline_timer]]]
+ [Constructor.
 
- Create an iterator from an endpoint, host name and service name. ]
+ Constructor to set a particular expiry time as an absolute time.
+
+ Constructor to set a particular expiry time relative to now. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
+ [[link boost_asio.reference.basic_deadline_timer.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the timer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
+ [[link boost_asio.reference.basic_deadline_timer.cancel_one [*cancel_one]]]
+ [Cancels one asynchronous operation that is waiting on the timer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_deadline_timer.expires_at [*expires_at]]]
+ [Get the timer's expiry time as an absolute time.
 
- Increment operator (postfix). ]
+ Set the timer's expiry time as an absolute time. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
+ [[link boost_asio.reference.basic_deadline_timer.expires_from_now [*expires_from_now]]]
+ [Get the timer's expiry time relative to now.
+
+ Set the timer's expiry time relative to now. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_deadline_timer.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_deadline_timer.wait [*wait]]]
+ [Perform a blocking wait on the timer. ]
   ]
   
 ]
 
-[heading Friends]
+[heading Protected Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
+ [[link boost_asio.reference.basic_deadline_timer.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
+ [[link boost_asio.reference.basic_deadline_timer.service [*service]]]
+ [The service associated with the I/O object. ]
   ]
-
+
 ]
 
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+The [link boost_asio.reference.basic_deadline_timer `basic_deadline_timer`] class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
 
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+A deadline timer is always in one of two states: "expired" or "not expired". If the `wait()` or `async_wait()` function is called on an expired timer, the wait operation will complete immediately.
 
- const basic_resolver_entry<InternetProtocol>
+Most applications will use the `boost::asio::deadline_timer` typedef.
 
 
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
+[*Shared] [*objects:] Unsafe.
 
 
-[heading Thread Safety]
+[heading Examples]
   
-[*Distinct] [*objects:] Safe.
+Performing a blocking wait:
 
-[*Shared] [*objects:] Unsafe.
+ // Construct a timer without setting an expiry time.
+ boost::asio::deadline_timer timer(io_service);
 
+ // Set an expiry time relative to now.
+ timer.expires_from_now(boost::posix_time::seconds(5));
 
+ // Wait for the timer to expire.
+ timer.wait();
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Performing an asynchronous wait:
 
-[endsect]
+ void handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Timer expired.
+ }
+ }
 
+ ...
 
+ // Construct a timer with an absolute expiry time.
+ boost::asio::deadline_timer timer(io_service,
+ boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
 
-[section:protocol_type ip::resolver_service::protocol_type]
+ // Start an asynchronous wait.
+ timer.async_wait(handler);
 
-[indexterm2 protocol_type..ip::resolver_service]
-The protocol type.
 
 
- typedef InternetProtocol protocol_type;
+
+
+[heading Changing an active deadline_timer's expiry time]
+
+
+
+Changing the expiry time of a timer while there are pending asynchronous waits causes those wait operations to be cancelled. To ensure that the action associated with the timer is performed only once, use something like this: used:
+
+
+
+ void on_some_event()
+ {
+ if (my_timer.expires_from_now(seconds(5)) > 0)
+ {
+ // We managed to cancel the timer. Start new asynchronous wait.
+ my_timer.async_wait(on_timeout);
+ }
+ else
+ {
+ // Too late, timer has already expired!
+ }
+ }
+
+ void on_timeout(const boost::system::error_code& e)
+ {
+ if (e != boost::asio::error::operation_aborted)
+ {
+ // Timer was not cancelled, take necessary action.
+ }
+ }
+
+
+
+
+
+* The `boost::asio::basic_deadline_timer::expires_from_now()` function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled.
+
+
+* If a wait handler is cancelled, the boost::system::error\_code passed to it contains the value `boost::asio::error::operation_aborted`.
+
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
+[*Header: ][^boost/asio/deadline_timer.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -46149,14 +48182,17 @@
 [endsect]
 
 
+[section:deadline_timer_service deadline_timer_service]
 
-[section:query_type ip::resolver_service::query_type]
 
-[indexterm2 query_type..ip::resolver_service]
-The query type.
+Default service implementation for a timer.
 
 
- typedef basic_resolver_query< InternetProtocol > query_type;
+ template<
+ typename TimeType,
+ typename ``[link boost_asio.reference.TimeTraits TimeTraits]`` = boost::asio::time_traits<TimeType>>
+ class deadline_timer_service :
+ public io_service::service
 
 
 [heading Types]
@@ -46165,15 +48201,29 @@
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+ [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
+ [The duration type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
+ [[link boost_asio.reference.deadline_timer_service.implementation_type [*implementation_type]]]
+ [The implementation type of the deadline timer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.deadline_timer_service.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.deadline_timer_service.traits_type [*traits_type]]]
+ [The time traits type. ]
   
   ]
 
@@ -46184,128 +48234,124 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
-
- Construct with specified service name for a given protocol.
-
- Construct with specified host name and service name for any protocol.
-
- Construct with specified host name and service name for a given protocol. ]
+ [[link boost_asio.reference.deadline_timer_service.async_wait [*async_wait]]]
+ []
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
+ [[link boost_asio.reference.deadline_timer_service.cancel [*cancel]]]
+ [Cancel any asynchronous wait operations associated with the timer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
+ [[link boost_asio.reference.deadline_timer_service.cancel_one [*cancel_one]]]
+ [Cancels one asynchronous wait operation associated with the timer. ]
   ]
   
   [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
+ [[link boost_asio.reference.deadline_timer_service.construct [*construct]]]
+ [Construct a new timer implementation. ]
   ]
   
-]
-
-[heading Data Members]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ [[link boost_asio.reference.deadline_timer_service.deadline_timer_service [*deadline_timer_service]]]
+ [Construct a new timer service for the specified io_service. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ [[link boost_asio.reference.deadline_timer_service.destroy [*destroy]]]
+ [Destroy a timer implementation. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ [[link boost_asio.reference.deadline_timer_service.expires_at [*expires_at]]]
+ [Get the expiry time for the timer as an absolute time.
+
+ Set the expiry time for the timer as an absolute time. ]
   ]
+
+ [
+ [[link boost_asio.reference.deadline_timer_service.expires_from_now [*expires_from_now]]]
+ [Get the expiry time for the timer relative to now.
 
+ Set the expiry time for the timer relative to now. ]
+ ]
+
   [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ [[link boost_asio.reference.deadline_timer_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ [[link boost_asio.reference.deadline_timer_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ [[link boost_asio.reference.deadline_timer_service.wait [*wait]]]
+ []
   ]
-
+
 ]
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.deadline_timer_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
 
+]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[heading Requirements]
 
-[*Shared] [*objects:] Unsafe.
+[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[section:async_wait deadline_timer_service::async_wait]
 
-[heading Requirements]
+[indexterm2 async_wait..deadline_timer_service]
 
-[*Header: ][^boost/asio/ip/resolver_service.hpp]
+ template<
+ typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
+ void async_wait(
+ implementation_type & impl,
+ WaitHandler handler);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:resolve ip::resolver_service::resolve]
 
-[indexterm2 resolve..ip::resolver_service]
-Resolve a query to a list of entries.
+[section:cancel deadline_timer_service::cancel]
+
+[indexterm2 cancel..deadline_timer_service]
+Cancel any asynchronous wait operations associated with the timer.
 
 
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload1 resolve]``(
+ std::size_t cancel(
       implementation_type & impl,
- const query_type & query,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.resolve.overload1 more...]]``
 
 
-Resolve an endpoint to a list of entries.
-
 
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload2 resolve]``(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.resolve.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 ip::resolver_service::resolve (1 of 2 overloads)]
 
+[section:cancel_one deadline_timer_service::cancel_one]
 
-Resolve a query to a list of entries.
+[indexterm2 cancel_one..deadline_timer_service]
+Cancels one asynchronous wait operation associated with the timer.
 
 
- iterator_type resolve(
+ std::size_t cancel_one(
       implementation_type & impl,
- const query_type & query,
       boost::system::error_code & ec);
 
 
@@ -46314,32 +48360,28 @@
 
 
 
-[section:overload2 ip::resolver_service::resolve (2 of 2 overloads)]
-
+[section:construct deadline_timer_service::construct]
 
-Resolve an endpoint to a list of entries.
+[indexterm2 construct..deadline_timer_service]
+Construct a new timer implementation.
 
 
- iterator_type resolve(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ void construct(
+ implementation_type & impl);
 
 
 
 [endsect]
 
 
-[endsect]
-
 
-[section:resolver_service ip::resolver_service::resolver_service]
+[section:deadline_timer_service deadline_timer_service::deadline_timer_service]
 
-[indexterm2 resolver_service..ip::resolver_service]
-Construct a new resolver service for the specified [link boost_asio.reference.io_service `io_service`].
+[indexterm2 deadline_timer_service..deadline_timer_service]
+Construct a new timer service for the specified [link boost_asio.reference.io_service `io_service`].
 
 
- resolver_service(
+ deadline_timer_service(
       boost::asio::io_service & io_service);
 
 
@@ -46348,13 +48390,14 @@
 
 
 
-[section:shutdown_service ip::resolver_service::shutdown_service]
+[section:destroy deadline_timer_service::destroy]
 
-[indexterm2 shutdown_service..ip::resolver_service]
-Destroy all user-defined handler objects owned by the service.
+[indexterm2 destroy..deadline_timer_service]
+Destroy a timer implementation.
 
 
- virtual void shutdown_service();
+ void destroy(
+ implementation_type & impl);
 
 
 
@@ -46362,466 +48405,214 @@
 
 
 
-[endsect]
+[section:duration_type deadline_timer_service::duration_type]
 
-[section:ip__tcp ip::tcp]
+[indexterm2 duration_type..deadline_timer_service]
+The duration type.
 
 
-Encapsulates the flags needed for TCP.
+ typedef traits_type::duration_type duration_type;
 
 
- class tcp
 
+[heading Requirements]
 
-[heading Types]
-[table
- [[Name][Description]]
+[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.ip__tcp.acceptor [*acceptor]]]
- [The TCP acceptor type. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.ip__tcp.endpoint [*endpoint]]]
- [The type of a TCP endpoint. ]
-
- ]
 
- [
+[section:expires_at deadline_timer_service::expires_at]
 
- [[link boost_asio.reference.ip__tcp.iostream [*iostream]]]
- [The TCP iostream type. ]
-
- ]
+[indexterm2 expires_at..deadline_timer_service]
+Get the expiry time for the timer as an absolute time.
 
- [
 
- [[link boost_asio.reference.ip__tcp.no_delay [*no_delay]]]
- [Socket option for disabling the Nagle algorithm. ]
-
- ]
+ time_type ``[link boost_asio.reference.deadline_timer_service.expires_at.overload1 expires_at]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_at.overload1 more...]]``
 
- [
 
- [[link boost_asio.reference.ip__tcp.resolver [*resolver]]]
- [The TCP resolver type. ]
-
- ]
+Set the expiry time for the timer as an absolute time.
 
- [
 
- [[link boost_asio.reference.ip__tcp.resolver_iterator [*resolver_iterator]]]
- [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
-
- ]
+ std::size_t ``[link boost_asio.reference.deadline_timer_service.expires_at.overload2 expires_at]``(
+ implementation_type & impl,
+ const time_type & expiry_time,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_at.overload2 more...]]``
 
- [
 
- [[link boost_asio.reference.ip__tcp.resolver_query [*resolver_query]]]
- [(Deprecated: use resolver::query.) The type of a resolver query. ]
-
- ]
+[section:overload1 deadline_timer_service::expires_at (1 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.ip__tcp.socket [*socket]]]
- [The TCP socket type. ]
-
- ]
+Get the expiry time for the timer as an absolute time.
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ time_type expires_at(
+ const implementation_type & impl) const;
 
- [
- [[link boost_asio.reference.ip__tcp.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.ip__tcp.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__tcp.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__tcp.v4 [*v4]]]
- [Construct to represent the IPv4 TCP protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__tcp.v6 [*v6]]]
- [Construct to represent the IPv6 TCP protocol. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__tcp.operator_not__eq_ [*operator!=]]]
- [Compare two protocols for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__tcp.operator_eq__eq_ [*operator==]]]
- [Compare two protocols for equality. ]
- ]
-
-]
+[endsect]
 
-The [link boost_asio.reference.ip__tcp `ip::tcp`] class contains flags necessary for TCP sockets.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
 
-[*Shared] [*objects:] Safe.
 
+Set the expiry time for the timer as an absolute time.
 
 
+ std::size_t expires_at(
+ implementation_type & impl,
+ const time_type & expiry_time,
+ boost::system::error_code & ec);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
-[section:acceptor ip::tcp::acceptor]
+[endsect]
 
-[indexterm2 acceptor..ip::tcp]
-The TCP acceptor type.
+[section:expires_from_now deadline_timer_service::expires_from_now]
 
+[indexterm2 expires_from_now..deadline_timer_service]
+Get the expiry time for the timer relative to now.
 
- typedef basic_socket_acceptor< tcp > acceptor;
 
+ duration_type ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 expires_from_now]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 more...]]``
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+Set the expiry time for the timer relative to now.
 
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
+ std::size_t ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload2 expires_from_now]``(
+ implementation_type & impl,
+ const duration_type & expiry_time,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.deadline_timer_service.expires_from_now.overload2 more...]]``
 
- [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
+[section:overload1 deadline_timer_service::expires_from_now (1 of 2 overloads)]
 
- [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
 
- [
+Get the expiry time for the timer relative to now.
 
- [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
 
- [
+ duration_type expires_from_now(
+ const implementation_type & impl) const;
 
- [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+[section:overload2 deadline_timer_service::expires_from_now (2 of 2 overloads)]
 
- [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
+Set the expiry time for the timer relative to now.
 
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+ std::size_t expires_from_now(
+ implementation_type & impl,
+ const duration_type & expiry_time,
+ boost::system::error_code & ec);
 
- [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+[section:get_io_service deadline_timer_service::get_io_service]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+['Inherited from io_service.]
 
- [
+[indexterm2 get_io_service..deadline_timer_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
 
- [
+ boost::asio::io_service & get_io_service();
 
- [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
 
- [
+[section:id deadline_timer_service::id]
 
- [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+[indexterm2 id..deadline_timer_service]
+The unique service identifier.
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
+ static boost::asio::io_service::id id;
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
- [Accept a new connection.
+[endsect]
 
- Accept a new connection and obtain the endpoint of the peer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
- [Assigns an existing native acceptor to the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
- [Start an asynchronous accept. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
- [Construct an acceptor without opening it.
 
- Construct an open acceptor.
 
- Construct an acceptor opened on the given endpoint.
+[section:implementation_type deadline_timer_service::implementation_type]
 
- Construct a basic_socket_acceptor on an existing native acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
- [Bind the acceptor to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
- [Close the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
- [Get an option from the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
- [Determine whether the acceptor is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
- [Place the acceptor into the state where it will listen for new connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
- [Get the native acceptor representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
- [Open the acceptor using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
- [Set an option on the acceptor. ]
- ]
-
-]
+[indexterm2 implementation_type..deadline_timer_service]
+The implementation type of the deadline timer.
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+ typedef implementation_defined implementation_type;
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
+[heading Requirements]
 
-]
+[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[endsect]
 
-]
 
-The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
 
+[section:shutdown_service deadline_timer_service::shutdown_service]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[indexterm2 shutdown_service..deadline_timer_service]
+Destroy all user-defined handler objects owned by the service.
 
-[*Shared] [*objects:] Unsafe.
 
+ virtual void shutdown_service();
 
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
- acceptor.open(endpoint.protocol());
- acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen();
 
+[endsect]
+
+
+
+[section:time_type deadline_timer_service::time_type]
 
+[indexterm2 time_type..deadline_timer_service]
+The time type.
 
 
+ typedef traits_type::time_type time_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/deadline_timer_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -46830,159 +48621,312 @@
 
 
 
-[section:endpoint ip::tcp::endpoint]
+[section:traits_type deadline_timer_service::traits_type]
 
-[indexterm2 endpoint..ip::tcp]
-The type of a TCP endpoint.
+[indexterm2 traits_type..deadline_timer_service]
+The time traits type.
 
 
- typedef basic_endpoint< tcp > endpoint;
+ typedef TimeTraits traits_type;
 
 
-[heading Types]
-[table
- [[Name][Description]]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/deadline_timer_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:wait deadline_timer_service::wait]
+
+[indexterm2 wait..deadline_timer_service]
+
+ void wait(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:error__addrinfo_category error::addrinfo_category]
+
+[indexterm1 error::addrinfo_category]
+
+ static const boost::system::error_category & addrinfo_category = boost::asio::error::get_addrinfo_category();
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/error.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:error__addrinfo_errors error::addrinfo_errors]
+
+[indexterm1 error::addrinfo_errors]
+
+ enum addrinfo_errors
+
+[indexterm2 service_not_found..error::addrinfo_errors]
+[indexterm2 socket_type_not_supported..error::addrinfo_errors]
+
+[heading Values]
+[variablelist
 
   [
+ [service_not_found]
+ [The service is not supported for the given socket type. ]
+ ]
 
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
+ [
+ [socket_type_not_supported]
+ [The socket type is not supported. ]
   ]
 
+]
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/error.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:error__basic_errors error::basic_errors]
+
+[indexterm1 error::basic_errors]
+
+ enum basic_errors
+
+[indexterm2 access_denied..error::basic_errors]
+[indexterm2 address_family_not_supported..error::basic_errors]
+[indexterm2 address_in_use..error::basic_errors]
+[indexterm2 already_connected..error::basic_errors]
+[indexterm2 already_started..error::basic_errors]
+[indexterm2 broken_pipe..error::basic_errors]
+[indexterm2 connection_aborted..error::basic_errors]
+[indexterm2 connection_refused..error::basic_errors]
+[indexterm2 connection_reset..error::basic_errors]
+[indexterm2 bad_descriptor..error::basic_errors]
+[indexterm2 fault..error::basic_errors]
+[indexterm2 host_unreachable..error::basic_errors]
+[indexterm2 in_progress..error::basic_errors]
+[indexterm2 interrupted..error::basic_errors]
+[indexterm2 invalid_argument..error::basic_errors]
+[indexterm2 message_size..error::basic_errors]
+[indexterm2 name_too_long..error::basic_errors]
+[indexterm2 network_down..error::basic_errors]
+[indexterm2 network_reset..error::basic_errors]
+[indexterm2 network_unreachable..error::basic_errors]
+[indexterm2 no_descriptors..error::basic_errors]
+[indexterm2 no_buffer_space..error::basic_errors]
+[indexterm2 no_memory..error::basic_errors]
+[indexterm2 no_permission..error::basic_errors]
+[indexterm2 no_protocol_option..error::basic_errors]
+[indexterm2 not_connected..error::basic_errors]
+[indexterm2 not_socket..error::basic_errors]
+[indexterm2 operation_aborted..error::basic_errors]
+[indexterm2 operation_not_supported..error::basic_errors]
+[indexterm2 shut_down..error::basic_errors]
+[indexterm2 timed_out..error::basic_errors]
+[indexterm2 try_again..error::basic_errors]
+[indexterm2 would_block..error::basic_errors]
+
+[heading Values]
+[variablelist
+
   [
+ [access_denied]
+ [Permission denied. ]
+ ]
 
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
+ [
+ [address_family_not_supported]
+ [Address family not supported by protocol. ]
   ]
 
-]
+ [
+ [address_in_use]
+ [Address already in use. ]
+ ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [
+ [already_connected]
+ [Transport endpoint is already connected. ]
+ ]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint.
+ [already_started]
+ [Operation already in progress. ]
+ ]
 
- Set the IP address associated with the endpoint. ]
+ [
+ [broken_pipe]
+ [Broken pipe. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
+ [connection_aborted]
+ [A connection has been aborted. ]
+ ]
 
- Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+ [
+ [connection_refused]
+ [Connection refused. ]
+ ]
 
- Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+ [
+ [connection_reset]
+ [Connection reset by peer. ]
+ ]
 
- Copy constructor. ]
+ [
+ [bad_descriptor]
+ [Bad file descriptor. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
+ [fault]
+ [Bad address. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
+ [host_unreachable]
+ [No route to host. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [in_progress]
+ [Operation now in progress. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
- [Get the port associated with the endpoint. The port number is always in the host's byte order.
+ [interrupted]
+ [Interrupted system call. ]
+ ]
 
- Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ [
+ [invalid_argument]
+ [Invalid argument. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [message_size]
+ [Message too long. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
+ [name_too_long]
+ [The name was too long. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [network_down]
+ [Network is down. ]
   ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
+ [
+ [network_reset]
+ [Network dropped connection on reset. ]
+ ]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
+ [network_unreachable]
+ [Network is unreachable. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
+ [no_descriptors]
+ [Too many open files. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
+ [no_buffer_space]
+ [No buffer space available. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
+ [no_memory]
+ [Cannot allocate memory. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
+ [no_permission]
+ [Operation not permitted. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
+ [no_protocol_option]
+ [Protocol not available. ]
   ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+ [
+ [not_connected]
+ [Transport endpoint is not connected. ]
+ ]
 
   [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
+ [not_socket]
+ [Socket operation on non-socket. ]
   ]
-
-]
 
-The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+ [
+ [operation_aborted]
+ [Operation cancelled. ]
+ ]
 
+ [
+ [operation_not_supported]
+ [Operation not supported. ]
+ ]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ [
+ [shut_down]
+ [Cannot send after transport endpoint shutdown. ]
+ ]
 
-[*Shared] [*objects:] Unsafe.
+ [
+ [timed_out]
+ [Connection timed out. ]
+ ]
 
+ [
+ [try_again]
+ [Resource temporarily unavailable. ]
+ ]
 
+ [
+ [would_block]
+ [The socket is marked non-blocking and the requested operation would block. ]
+ ]
 
+]
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/error.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -46991,61 +48935,34 @@
 
 
 
-[section:family ip::tcp::family]
-
-[indexterm2 family..ip::tcp]
-Obtain an identifier for the protocol family.
-
-
- int family() const;
+[section:error__get_addrinfo_category error::get_addrinfo_category]
 
+[indexterm1 error::get_addrinfo_category]
 
+ const boost::system::error_category & get_addrinfo_category();
 
-[endsect]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/error.hpp]
 
-[section:iostream ip::tcp::iostream]
+[*Convenience header: ][^boost/asio.hpp]
 
-[indexterm2 iostream..ip::tcp]
-The TCP iostream type.
 
+[endsect]
 
- typedef basic_socket_iostream< tcp > iostream;
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:error__get_misc_category error::get_misc_category]
 
- [
- [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
- [Construct a basic_socket_iostream without establishing a connection.
+[indexterm1 error::get_misc_category]
 
- Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
- [Close the connection. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
- [Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
- [Return a pointer to the underlying streambuf. ]
- ]
-
-]
+ const boost::system::error_category & get_misc_category();
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/error.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -47054,49 +48971,52 @@
 
 
 
-[section:no_delay ip::tcp::no_delay]
+[section:error__get_netdb_category error::get_netdb_category]
 
-[indexterm2 no_delay..ip::tcp]
-Socket option for disabling the Nagle algorithm.
+[indexterm1 error::get_netdb_category]
 
+ const boost::system::error_category & get_netdb_category();
 
- typedef implementation_defined no_delay;
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/error.hpp]
 
-Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[heading Examples]
-
-Setting the option:
+[endsect]
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
 
 
+[section:error__get_ssl_category error::get_ssl_category]
 
+[indexterm1 error::get_ssl_category]
 
+ const boost::system::error_category & get_ssl_category();
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option;
- socket.get_option(option);
- bool is_set = option.value();
+[heading Requirements]
+
+[*Header: ][^boost/asio/ssl/error.hpp]
+
+[*Convenience header: ][^boost/asio/ssl.hpp]
+
+
+[endsect]
 
 
 
+[section:error__get_system_category error::get_system_category]
 
+[indexterm1 error::get_system_category]
 
+ const boost::system::error_category & get_system_category();
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/error.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -47104,58 +49024,69 @@
 [endsect]
 
 
+[section:error__make_error_code error::make_error_code]
 
-[section:operator_not__eq_ ip::tcp::operator!=]
+[indexterm1 error::make_error_code]
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
+ basic_errors e);
+ `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload1 more...]]``
 
-[indexterm2 operator!=..ip::tcp]
-Compare two protocols for inequality.
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
+ netdb_errors e);
+ `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload2 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload3 make_error_code]``(
+ addrinfo_errors e);
+ `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload3 more...]]``
 
- friend bool operator!=(
- const tcp & p1,
- const tcp & p2);
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload4 make_error_code]``(
+ misc_errors e);
+ `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload4 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload5 make_error_code]``(
+ ssl_errors e);
+ `` [''''&raquo;''' [link boost_asio.reference.error__make_error_code.overload5 more...]]``
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/error.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload1 error::make_error_code (1 of 5 overloads)]
 
 
 
-[section:operator_eq__eq_ ip::tcp::operator==]
+ boost::system::error_code make_error_code(
+ basic_errors e);
 
-[indexterm2 operator==..ip::tcp]
-Compare two protocols for equality.
 
 
- friend bool operator==(
- const tcp & p1,
- const tcp & p2);
+[endsect]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[section:overload2 error::make_error_code (2 of 5 overloads)]
+
+
+
+ boost::system::error_code make_error_code(
+ netdb_errors e);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:protocol ip::tcp::protocol]
+[section:overload3 error::make_error_code (3 of 5 overloads)]
 
-[indexterm2 protocol..ip::tcp]
-Obtain an identifier for the protocol.
 
 
- int protocol() const;
+ boost::system::error_code make_error_code(
+ addrinfo_errors e);
 
 
 
@@ -47163,134 +49094,110 @@
 
 
 
-[section:resolver ip::tcp::resolver]
+[section:overload4 error::make_error_code (4 of 5 overloads)]
 
-[indexterm2 resolver..ip::tcp]
-The TCP resolver type.
 
 
- typedef basic_resolver< tcp > resolver;
+ boost::system::error_code make_error_code(
+ misc_errors e);
 
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[section:overload5 error::make_error_code (5 of 5 overloads)]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
 
- [
+ boost::system::error_code make_error_code(
+ ssl_errors e);
 
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+[endsect]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:error__misc_category error::misc_category]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously perform forward resolution of a query to a list of entries.
+[indexterm1 error::misc_category]
+
+ static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/error.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:error__misc_errors error::misc_errors]
+
+[indexterm1 error::misc_errors]
+
+ enum misc_errors
+
+[indexterm2 already_open..error::misc_errors]
+[indexterm2 eof..error::misc_errors]
+[indexterm2 not_found..error::misc_errors]
+[indexterm2 fd_set_failure..error::misc_errors]
+
+[heading Values]
+[variablelist
 
- Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
- ]
-
   [
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
+ [already_open]
+ [Already open. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
+ [eof]
+ [End of file or stream. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [not_found]
+ [Element not found. ]
   ]
-
+
   [
- [[link boost_asio.reference.ip__basic_resolver.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [fd_set_failure]
+ [The descriptor cannot fit into the select system call's fd_set. ]
   ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Perform forward resolution of a query to a list of entries.
 
- Perform reverse resolution of an endpoint to a list of entries. ]
- ]
-
 ]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+[heading Requirements]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[*Header: ][^boost/asio/error.hpp]
 
-]
+[*Convenience header: ][^boost/asio.hpp]
 
-The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
 
+[endsect]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
 
+[section:error__netdb_category error::netdb_category]
+
+[indexterm1 error::netdb_category]
 
+ static const boost::system::error_category & netdb_category = boost::asio::error::get_netdb_category();
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/error.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -47299,213 +49206,140 @@
 
 
 
-[section:resolver_iterator ip::tcp::resolver_iterator]
-
-[indexterm2 resolver_iterator..ip::tcp]
-(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
+[section:error__netdb_errors error::netdb_errors]
 
+[indexterm1 error::netdb_errors]
 
- typedef basic_resolver_iterator< tcp > resolver_iterator;
+ enum netdb_errors
 
+[indexterm2 host_not_found..error::netdb_errors]
+[indexterm2 host_not_found_try_again..error::netdb_errors]
+[indexterm2 no_data..error::netdb_errors]
+[indexterm2 no_recovery..error::netdb_errors]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
 
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
+ [host_not_found]
+ [Host not found (authoritative). ]
   ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
 
- Create an iterator from an endpoint, host name and service name. ]
- ]
-
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
+ [host_not_found_try_again]
+ [Host not found (non-authoritative). ]
   ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
 
- Increment operator (postfix). ]
- ]
-
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
+ [no_data]
+ [The query is valid but does not have associated address data. ]
   ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
   [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
+ [no_recovery]
+ [A non-recoverable error occurred. ]
   ]
-
+
 ]
 
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
 
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+[heading Requirements]
 
- const basic_resolver_entry<InternetProtocol>
+[*Header: ][^boost/asio/error.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[endsect]
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[section:error__ssl_category error::ssl_category]
 
+[indexterm1 error::ssl_category]
 
+ static const boost::system::error_category & ssl_category = boost::asio::error::get_ssl_category();
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/ssl/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[*Convenience header: ][^boost/asio/ssl.hpp]
 
 
 [endsect]
 
 
 
-[section:resolver_query ip::tcp::resolver_query]
+[section:error__ssl_errors error::ssl_errors]
 
-[indexterm2 resolver_query..ip::tcp]
-(Deprecated: use `resolver::query`.) The type of a resolver query.
+[indexterm1 error::ssl_errors]
 
+ enum ssl_errors
 
- typedef basic_resolver_query< tcp > resolver_query;
 
+[heading Requirements]
 
-[heading Types]
-[table
- [[Name][Description]]
+[*Header: ][^boost/asio/ssl/error.hpp]
 
- [
+[*Convenience header: ][^boost/asio/ssl.hpp]
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:error__system_category error::system_category]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
+[indexterm1 error::system_category]
 
- Construct with specified service name for a given protocol.
+ static const boost::system::error_category & system_category = boost::asio::error::get_system_category();
 
- Construct with specified host name and service name for any protocol.
 
- Construct with specified host name and service name for a given protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
- ]
-
-]
+[heading Requirements]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[*Header: ][^boost/asio/error.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
+[section:has_service has_service]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
+[indexterm1 has_service]
 
-]
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ bool has_service(
+ io_service & ios);
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+This function is used to determine whether the [link boost_asio.reference.io_service `io_service`] contains a service object corresponding to the given service type.
 
 
-[heading Thread Safety]
+[heading Parameters]
+
+
+[variablelist
   
-[*Distinct] [*objects:] Safe.
+[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
 
-[*Shared] [*objects:] Unsafe.
+]
 
 
+[heading Return Value]
+
+A boolean indicating whether the [link boost_asio.reference.io_service `io_service`] contains the service.
+
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+[*Header: ][^boost/asio/io_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -47513,164 +49347,86 @@
 [endsect]
 
 
+[section:invalid_service_owner invalid_service_owner]
 
-[section:socket ip::tcp::socket]
 
-[indexterm2 socket..ip::tcp]
-The TCP socket type.
+Exception thrown when trying to add a service object to an [link boost_asio.reference.io_service `io_service`] where the service has a different owner.
 
 
- typedef basic_stream_socket< tcp > socket;
+ class invalid_service_owner
 
 
-[heading Types]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
-
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
+ [[link boost_asio.reference.invalid_service_owner.invalid_service_owner [*invalid_service_owner]]]
+ []
   ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
   
- ]
+]
 
- [
+[heading Requirements]
 
- [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[*Header: ][^boost/asio/io_service.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+[section:invalid_service_owner invalid_service_owner::invalid_service_owner]
 
- [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
+[indexterm2 invalid_service_owner..invalid_service_owner]
 
- [
+ invalid_service_owner();
 
- [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+[section:io_service io_service]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+Provides core I/O functionality.
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+ class io_service :
+ noncopyable
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
+ [[link boost_asio.reference.io_service__id [*id]]]
+ [Class used to uniquely identify a service. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.io_service__service [*service]]]
+ [Base class for all io_service services. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.io_service__strand [*strand]]]
+ [Provides serialised handler execution. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.io_service__work [*work]]]
+ [Class to inform the io_service when it has work to do. ]
   
   ]
 
@@ -47681,1379 +49437,844 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
+ [[link boost_asio.reference.io_service.dispatch [*dispatch]]]
+ [Request the io_service to invoke the given handler. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
+ [[link boost_asio.reference.io_service.io_service [*io_service]]]
+ [Constructor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
+ [[link boost_asio.reference.io_service.poll [*poll]]]
+ [Run the io_service object's event processing loop to execute ready handlers. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
+ [[link boost_asio.reference.io_service.poll_one [*poll_one]]]
+ [Run the io_service object's event processing loop to execute one ready handler. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.io_service.post [*post]]]
+ [Request the io_service to invoke the given handler and return immediately. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
+ [[link boost_asio.reference.io_service.reset [*reset]]]
+ [Reset the io_service in preparation for a subsequent run() invocation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
+ [[link boost_asio.reference.io_service.run [*run]]]
+ [Run the io_service object's event processing loop. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.io_service.run_one [*run_one]]]
+ [Run the io_service object's event processing loop to execute at most one handler. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
- [Construct a basic_stream_socket without opening it.
-
- Construct and open a basic_stream_socket.
-
- Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
-
- Construct a basic_stream_socket on an existing native socket. ]
+ [[link boost_asio.reference.io_service.stop [*stop]]]
+ [Stop the io_service object's event processing loop. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.io_service.stopped [*stopped]]]
+ [Determine whether the io_service object has been stopped. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.io_service.wrap [*wrap]]]
+ [Create a new handler that automatically dispatches the wrapped handler on the io_service. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.io_service._io_service [*~io_service]]]
+ [Destructor. ]
   ]
   
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.io_service.add_service [*add_service]]]
+ [Add a service object to the io_service. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.io_service.has_service [*has_service]]]
+ [Determine if an io_service contains a specified service type. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
-
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
- [Read some data from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the socket.
-
- Receive some data on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.send [*send]]]
- [Send some data on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
+ [[link boost_asio.reference.io_service.use_service [*use_service]]]
+ [Obtain the service object corresponding to the given type. ]
   ]
   
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
+The [link boost_asio.reference.io_service `io_service`] class provides the core I/O functionality for users of the asynchronous I/O objects, including:
 
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+* `boost::asio::ip::tcp::socket`
 
- [
- [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+* `boost::asio::ip::tcp::acceptor`
 
- [
- [[link boost_asio.reference.basic_stream_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+* `boost::asio::ip::udp::socket`
 
-]
+* `boost::asio::deadline_timer`.
 
-The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
+The [link boost_asio.reference.io_service `io_service`] class also includes facilities intended for developers of custom asynchronous services.
 
 
 [heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
-
+[*Shared] [*objects:] Safe, with the exception that calling `reset()` while there are unfinished `run()`, `run_one()`, `poll()` or `poll_one()` calls results in undefined behaviour.
 
 
 
+[heading Synchronous and asynchronous operations]
+
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/tcp.hpp]
+Synchronous operations on I/O objects implicitly run the [link boost_asio.reference.io_service `io_service`] object for an individual operation. The [link boost_asio.reference.io_service `io_service`] functions `run()`, `run_one()`, `poll()` or `poll_one()` must be called for the [link boost_asio.reference.io_service `io_service`] to perform asynchronous operations on behalf of a C++ program. Notification that an asynchronous operation has completed is delivered by invocation of the associated handler. Handlers are invoked only by a thread that is currently calling any overload of `run()`, `run_one()`, `poll()` or `poll_one()` for the [link boost_asio.reference.io_service `io_service`].
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Effect of exceptions thrown from handlers]
+
 
-[endsect]
 
+If an exception is thrown from a handler, the exception is allowed to propagate through the throwing thread's invocation of `run()`, `run_one()`, `poll()` or `poll_one()`. No other threads that are calling any of these functions are affected. It is then the responsibility of the application to catch the exception.
 
+After the exception has been caught, the `run()`, `run_one()`, `poll()` or `poll_one()` call may be restarted [*without] the need for an intervening call to `reset()`. This allows the thread to rejoin the [link boost_asio.reference.io_service `io_service`] object's thread pool without impacting any other threads in the pool.
 
-[section:type ip::tcp::type]
+For example:
 
-[indexterm2 type..ip::tcp]
-Obtain an identifier for the type of the protocol.
 
 
- int type() const;
+ boost::asio::io_service io_service;
+ ...
+ for (;;)
+ {
+ try
+ {
+ io_service.run();
+ break; // run() exited normally
+ }
+ catch (my_exception& e)
+ {
+ // Deal with exception as appropriate.
+ }
+ }
 
 
 
-[endsect]
 
 
+[heading Stopping the io_service from running out of work]
+
 
-[section:v4 ip::tcp::v4]
 
-[indexterm2 v4..ip::tcp]
-Construct to represent the IPv4 TCP protocol.
+Some applications may need to prevent an [link boost_asio.reference.io_service `io_service`] object's `run()` call from returning when there is no more work to do. For example, the [link boost_asio.reference.io_service `io_service`] may be being run in a background thread that is launched prior to the application's asynchronous operations. The `run()` call may be kept running by creating an object of type [link boost_asio.reference.io_service__work `io_service::work`]:
 
 
- static tcp v4();
 
+ boost::asio::io_service io_service;
+ boost::asio::io_service::work work(io_service);
+ ...
 
 
-[endsect]
 
 
+To effect a shutdown, the application will then need to call the [link boost_asio.reference.io_service `io_service`] object's `stop()` member function. This will cause the [link boost_asio.reference.io_service `io_service`] `run()` call to return as soon as possible, abandoning unfinished operations and without permitting ready handlers to be dispatched.
 
-[section:v6 ip::tcp::v6]
+Alternatively, if the application requires that all operations and handlers be allowed to finish normally, the work object may be explicitly destroyed.
 
-[indexterm2 v6..ip::tcp]
-Construct to represent the IPv6 TCP protocol.
 
 
- static tcp v6();
+ boost::asio::io_service io_service;
+ auto_ptr<boost::asio::io_service::work> work(
+ new boost::asio::io_service::work(io_service));
+ ...
+ work.reset(); // Allow run() to exit.
 
 
 
-[endsect]
 
 
+[heading The io_service class and I/O services]
+
 
-[endsect]
 
-[section:ip__udp ip::udp]
+Class [link boost_asio.reference.io_service `io_service`] implements an extensible, type-safe, polymorphic set of I/O services, indexed by service type. An object of class [link boost_asio.reference.io_service `io_service`] must be initialised before I/O objects such as sockets, resolvers and timers can be used. These I/O objects are distinguished by having constructors that accept an `io_service&` parameter.
 
+I/O services exist to manage the logical interface to the operating system on behalf of the I/O objects. In particular, there are resources that are shared across a class of I/O objects. For example, timers may be implemented in terms of a single timer queue. The I/O services manage these shared resources.
 
-Encapsulates the flags needed for UDP.
+Access to the services of an [link boost_asio.reference.io_service `io_service`] is via three function templates, `use_service()`, `add_service()` and `has_service()`.
 
+In a call to `use_service<Service>()`, the type argument chooses a service, making available all members of the named type. If `Service` is not present in an [link boost_asio.reference.io_service `io_service`], an object of type `Service` is created and added to the [link boost_asio.reference.io_service `io_service`]. A C++ program can check if an [link boost_asio.reference.io_service `io_service`] implements a particular service with the function template `has_service<Service>()`.
 
- class udp
+Service objects may be explicitly added to an [link boost_asio.reference.io_service `io_service`] using the function template `add_service<Service>()`. If the `Service` is already present, the [link boost_asio.reference.service_already_exists `service_already_exists`] exception is thrown. If the owner of the service is not the same object as the [link boost_asio.reference.io_service `io_service`] parameter, the [link boost_asio.reference.invalid_service_owner `invalid_service_owner`] exception is thrown.
 
+Once a service reference is obtained from an [link boost_asio.reference.io_service `io_service`] object by calling `use_service()`, that reference remains usable as long as the owning [link boost_asio.reference.io_service `io_service`] object exists.
 
-[heading Types]
-[table
- [[Name][Description]]
+All I/O service implementations have [link boost_asio.reference.io_service__service `io_service::service`] as a public base class. Custom I/O services may be implemented by deriving from this class and then added to an [link boost_asio.reference.io_service `io_service`] using the facilities described above.
 
- [
+[heading Requirements]
 
- [[link boost_asio.reference.ip__udp.endpoint [*endpoint]]]
- [The type of a UDP endpoint. ]
-
- ]
+[*Header: ][^boost/asio/io_service.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.ip__udp.resolver [*resolver]]]
- [The UDP resolver type. ]
-
- ]
 
- [
+[section:add_service io_service::add_service]
 
- [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
- [(Deprecated: use resolver::iterator.) The type of a resolver iterator. ]
-
- ]
+[indexterm2 add_service..io_service]
+Add a service object to the [link boost_asio.reference.io_service `io_service`].
 
- [
 
- [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
- [(Deprecated: use resolver::query.) The type of a resolver query. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend void add_service(
+ io_service & ios,
+ Service * svc);
 
- [
 
- [[link boost_asio.reference.ip__udp.socket [*socket]]]
- [The UDP socket type. ]
-
- ]
+This function is used to add a service to the [link boost_asio.reference.io_service `io_service`].
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
 
- [
- [[link boost_asio.reference.ip__udp.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.v4 [*v4]]]
- [Construct to represent the IPv4 UDP protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.v6 [*v6]]]
- [Construct to represent the IPv6 UDP protocol. ]
- ]
+[variablelist
   
-]
+[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
 
-[heading Friends]
-[table
- [[Name][Description]]
+[[svc][The service object. On success, ownership of the service object is transferred to the [link boost_asio.reference.io_service `io_service`]. When the [link boost_asio.reference.io_service `io_service`] object is destroyed, it will destroy the service object by performing:
+``
+ delete static_cast<io_service::service*>(svc)
+``
+]]
 
- [
- [[link boost_asio.reference.ip__udp.operator_not__eq_ [*operator!=]]]
- [Compare two protocols for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.operator_eq__eq_ [*operator==]]]
- [Compare two protocols for equality. ]
- ]
-
 ]
 
-The [link boost_asio.reference.ip__udp `ip::udp`] class contains flags necessary for UDP sockets.
 
+[heading Exceptions]
+
 
-[heading Thread Safety]
+[variablelist
   
-[*Distinct] [*objects:] Safe.
+[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the [link boost_asio.reference.io_service `io_service`].]]
 
-[*Shared] [*objects:] Safe.
+[[boost::asio::invalid_service_owner][Thrown if the service's owning [link boost_asio.reference.io_service `io_service`] is not the [link boost_asio.reference.io_service `io_service`] object specified by the ios parameter. ]]
 
+]
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+[*Header: ][^boost/asio/io_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:endpoint ip::udp::endpoint]
-
-[indexterm2 endpoint..ip::udp]
-The type of a UDP endpoint.
+[endsect]
 
 
- typedef basic_endpoint< udp > endpoint;
 
+[section:dispatch io_service::dispatch]
 
-[heading Types]
-[table
- [[Name][Description]]
+[indexterm2 dispatch..io_service]
+Request the [link boost_asio.reference.io_service `io_service`] to invoke the given handler.
 
- [
 
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void dispatch(
+ CompletionHandler handler);
 
- [
 
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+This function is used to ask the [link boost_asio.reference.io_service `io_service`] to execute the given handler.
 
-]
+The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked. The handler may be executed inside this function if the guarantee can be met.
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint.
+[heading Parameters]
+
 
- Set the IP address associated with the endpoint. ]
- ]
+[variablelist
   
- [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
+[[handler][The handler to be called. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
 
- Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+]
 
- Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
- [Get the port associated with the endpoint. The port number is always in the host's byte order.
+[heading Remarks]
+
+This function throws an exception only if:
 
- Set the port associated with the endpoint. The port number is always in the host's byte order. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
- ]
-
-]
 
-[heading Friends]
-[table
- [[Name][Description]]
+* the handler's `asio_handler_allocate` function; or
 
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
- ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+* the handler's copy constructor
 
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
-
-]
+throws an exception.
 
-The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
 
+[endsect]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
 
+[section:has_service io_service::has_service]
 
+[indexterm2 has_service..io_service]
+Determine if an [link boost_asio.reference.io_service `io_service`] contains a specified service type.
 
 
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend bool has_service(
+ io_service & ios);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+This function is used to determine whether the [link boost_asio.reference.io_service `io_service`] contains a service object corresponding to the given service type.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
 
+]
 
 
-[section:family ip::udp::family]
+[heading Return Value]
+
+A boolean indicating whether the [link boost_asio.reference.io_service `io_service`] contains the service.
 
-[indexterm2 family..ip::udp]
-Obtain an identifier for the protocol family.
 
 
- int family() const;
+[heading Requirements]
 
+[*Header: ][^boost/asio/io_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[endsect]
 
+[endsect]
 
 
-[section:operator_not__eq_ ip::udp::operator!=]
+[section:io_service io_service::io_service]
 
-[indexterm2 operator!=..ip::udp]
-Compare two protocols for inequality.
+[indexterm2 io_service..io_service]
+Constructor.
 
 
- friend bool operator!=(
- const udp & p1,
- const udp & p2);
+ ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.io_service.overload1 more...]]``
 
+ explicit ``[link boost_asio.reference.io_service.io_service.overload2 io_service]``(
+ std::size_t concurrency_hint);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.io_service.overload2 more...]]``
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+[section:overload1 io_service::io_service (1 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Constructor.
 
-[endsect]
 
+ io_service();
 
 
-[section:operator_eq__eq_ ip::udp::operator==]
 
-[indexterm2 operator==..ip::udp]
-Compare two protocols for equality.
+[endsect]
 
 
- friend bool operator==(
- const udp & p1,
- const udp & p2);
 
+[section:overload2 io_service::io_service (2 of 2 overloads)]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+Constructor.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ io_service(
+ std::size_t concurrency_hint);
 
-[endsect]
 
+Construct with a hint about the required level of concurrency.
 
 
-[section:protocol ip::udp::protocol]
+[heading Parameters]
+
 
-[indexterm2 protocol..ip::udp]
-Obtain an identifier for the protocol.
+[variablelist
+
+[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
 
+]
 
- int protocol() const;
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:resolver ip::udp::resolver]
+[section:poll io_service::poll]
 
-[indexterm2 resolver..ip::udp]
-The UDP resolver type.
+[indexterm2 poll..io_service]
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
 
 
- typedef basic_resolver< udp > resolver;
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.poll.overload1 more...]]``
 
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.poll.overload2 more...]]``
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:overload1 io_service::poll (1 of 2 overloads)]
 
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
 
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+ std::size_t poll();
 
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
 
- [
+The `poll()` function runs handlers that are ready to run, without blocking, until the [link boost_asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers.
 
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
+[heading Return Value]
+
+The number of handlers that were executed.
 
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
-
- ]
 
- [
+[heading Exceptions]
+
 
- [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously perform forward resolution of a query to a list of entries.
 
- Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Perform forward resolution of a query to a list of entries.
 
- Perform reverse resolution of an endpoint to a list of entries. ]
- ]
-
-]
+[endsect]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[section:overload2 io_service::poll (2 of 2 overloads)]
 
-]
 
-The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute ready handlers.
 
 
-[heading Thread Safety]
+ std::size_t poll(
+ boost::system::error_code & ec);
+
+
+The `poll()` function runs handlers that are ready to run, without blocking, until the [link boost_asio.reference.io_service `io_service`] has been stopped or there are no more ready handlers.
+
+
+[heading Parameters]
+
+
+[variablelist
   
-[*Distinct] [*objects:] Safe.
+[[ec][Set to indicate what error occurred, if any.]]
 
-[*Shared] [*objects:] Unsafe.
+]
 
 
+[heading Return Value]
+
+The number of handlers that were executed.
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
+[section:poll_one io_service::poll_one]
+
+[indexterm2 poll_one..io_service]
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
+
+
+ std::size_t ``[link boost_asio.reference.io_service.poll_one.overload1 poll_one]``();
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.poll_one.overload1 more...]]``
+
+ std::size_t ``[link boost_asio.reference.io_service.poll_one.overload2 poll_one]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.poll_one.overload2 more...]]``
 
 
-[section:resolver_iterator ip::udp::resolver_iterator]
+[section:overload1 io_service::poll_one (1 of 2 overloads)]
 
-[indexterm2 resolver_iterator..ip::udp]
-(Deprecated: use `resolver::iterator`.) The type of a resolver iterator.
 
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
 
- typedef basic_resolver_iterator< udp > resolver_iterator;
 
+ std::size_t poll_one();
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo.
+The `poll_one()` function runs at most one handler that is ready to run, without blocking.
 
- Create an iterator from an endpoint, host name and service name. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
- [Dereference an iterator. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
- [Increment operator (prefix).
 
- Increment operator (postfix). ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
- [Dereference an iterator. ]
- ]
-
-]
+[heading Return Value]
+
+The number of handlers that were executed.
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
- [Test two iterators for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
- [Test two iterators for equality. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure. ]]
+
 ]
 
-The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
 
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
 
- const basic_resolver_entry<InternetProtocol>
 
+[endsect]
 
 
 
+[section:overload2 io_service::poll_one (2 of 2 overloads)]
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute one ready handler.
+
 
+ std::size_t poll_one(
+ boost::system::error_code & ec);
 
 
+The `poll_one()` function runs at most one handler that is ready to run, without blocking.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
+
 
-[section:resolver_query ip::udp::resolver_query]
+[section:post io_service::post]
 
-[indexterm2 resolver_query..ip::udp]
-(Deprecated: use `resolver::query`.) The type of a resolver query.
+[indexterm2 post..io_service]
+Request the [link boost_asio.reference.io_service `io_service`] to invoke the given handler and return immediately.
 
 
- typedef basic_resolver_query< udp > resolver_query;
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void post(
+ CompletionHandler handler);
 
 
-[heading Types]
-[table
- [[Name][Description]]
+This function is used to ask the [link boost_asio.reference.io_service `io_service`] to execute the given handler, but without allowing the [link boost_asio.reference.io_service `io_service`] to call the handler from inside this function.
 
- [
+The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the `run()`, `run_one()`, `poll()` or `poll_one()` member functions is currently being invoked.
 
- [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
- [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
-
- ]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
+[variablelist
   
- ]
+[[handler][The handler to be called. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol.
+[heading Remarks]
+
+This function throws an exception only if:
 
- Construct with specified service name for a given protocol.
 
- Construct with specified host name and service name for any protocol.
+* the handler's `asio_handler_allocate` function; or
 
- Construct with specified host name and service name for a given protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
+* the handler's copy constructor
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
- [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
- ]
+throws an exception.
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
- [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
- [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
- [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
- ]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
+[section:reset io_service::reset]
 
- [
- [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
- [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
- ]
+[indexterm2 reset..io_service]
+Reset the [link boost_asio.reference.io_service `io_service`] in preparation for a subsequent `run()` invocation.
 
-]
 
-The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+ void reset();
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+This function must be called prior to any second or later set of invocations of the `run()`, `run_one()`, `poll()` or `poll_one()` functions when a previous invocation of these functions returned due to the [link boost_asio.reference.io_service `io_service`] being stopped or running out of work. After a call to `reset()`, the [link boost_asio.reference.io_service `io_service`] object's `stopped()` function will return `false`.
 
-[*Shared] [*objects:] Unsafe.
+This function must not be called while there are any unfinished calls to the `run()`, `run_one()`, `poll()` or `poll_one()` functions.
 
 
+[endsect]
 
 
-[heading Requirements]
+[section:run io_service::run]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
+[indexterm2 run..io_service]
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+ std::size_t ``[link boost_asio.reference.io_service.run.overload1 run]``();
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.run.overload1 more...]]``
 
-[endsect]
+ std::size_t ``[link boost_asio.reference.io_service.run.overload2 run]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.run.overload2 more...]]``
 
 
+[section:overload1 io_service::run (1 of 2 overloads)]
 
-[section:socket ip::udp::socket]
 
-[indexterm2 socket..ip::udp]
-The UDP socket type.
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
 
 
- typedef basic_datagram_socket< udp > socket;
+ std::size_t run();
 
 
-[heading Types]
-[table
- [[Name][Description]]
+The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
 
- [
+Multiple threads may call the `run()` function to set up a pool of threads from which the [link boost_asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link boost_asio.reference.io_service `io_service`] may choose any one of them to invoke a handler.
 
- [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+A normal exit from the `run()` function implies that the [link boost_asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+[heading Return Value]
+
+The number of handlers that were executed.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
+[heading Exceptions]
+
+
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
 
- [
+[heading Remarks]
+
+The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link boost_asio.reference.io_service `io_service`] object.
 
- [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+The `poll()` function may also be used to dispatch ready handlers, but without blocking.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+[section:overload2 io_service::run (2 of 2 overloads)]
 
- [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
 
- [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
+ std::size_t run(
+ boost::system::error_code & ec);
 
- [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
 
- [
+The `run()` function blocks until all work has finished and there are no more handlers to be dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
 
- [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+Multiple threads may call the `run()` function to set up a pool of threads from which the [link boost_asio.reference.io_service `io_service`] may execute handlers. All threads that are waiting in the pool are equivalent and the [link boost_asio.reference.io_service `io_service`] may choose any one of them to invoke a handler.
 
- [
+A normal exit from the `run()` function implies that the [link boost_asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`.
 
- [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+[variablelist
   
- ]
+[[ec][Set to indicate what error occurred, if any.]]
 
- [
+]
 
- [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
+[heading Return Value]
+
+The number of handlers that were executed.
 
- [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
 
- [
+[heading Remarks]
+
+The `run()` function must not be called from a thread that is currently calling one of `run()`, `run_one()`, `poll()` or `poll_one()` on the same [link boost_asio.reference.io_service `io_service`] object.
 
- [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+The `poll()` function may also be used to dispatch ready handlers, but without blocking.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+[endsect]
 
- [
+[section:run_one io_service::run_one]
 
- [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+[indexterm2 run_one..io_service]
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+ std::size_t ``[link boost_asio.reference.io_service.run_one.overload1 run_one]``();
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.run_one.overload1 more...]]``
 
- [
+ std::size_t ``[link boost_asio.reference.io_service.run_one.overload2 run_one]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service.run_one.overload2 more...]]``
 
- [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
 
-]
+[section:overload1 io_service::run_one (1 of 2 overloads)]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
- [Start an asynchronous send on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
- [Construct a basic_datagram_socket without opening it.
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
 
- Construct and open a basic_datagram_socket.
 
- Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
+ std::size_t run_one();
 
- Construct a basic_datagram_socket on an existing native socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.close [*close]]]
- [Close the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]]
- [Receive some data on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
- [Receive a datagram with the endpoint of the sender. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
- [Send some data on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
+The `run_one()` function blocks until one handler has been dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
+
+
+[heading Return Value]
+
+The number of handlers that were executed. A zero return value implies that the [link boost_asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`.
+
+
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure. ]]
+
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
 
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[section:overload2 io_service::run_one (2 of 2 overloads)]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+Run the [link boost_asio.reference.io_service `io_service`] object's event processing loop to execute at most one handler.
 
-]
 
-The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality.
+ std::size_t run_one(
+ boost::system::error_code & ec);
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+The `run_one()` function blocks until one handler has been dispatched, or until the [link boost_asio.reference.io_service `io_service`] has been stopped.
 
-[*Shared] [*objects:] Unsafe.
 
+[heading Return Value]
+
+The number of handlers that were executed. A zero return value implies that the [link boost_asio.reference.io_service `io_service`] object is stopped (the `stopped()` function returns `true`). Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately unless there is a prior call to `reset()`.
 
+The number of handlers that were executed.
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/udp.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
+[section:stop io_service::stop]
 
-[section:type ip::udp::type]
+[indexterm2 stop..io_service]
+Stop the [link boost_asio.reference.io_service `io_service`] object's event processing loop.
 
-[indexterm2 type..ip::udp]
-Obtain an identifier for the type of the protocol.
 
+ void stop();
 
- int type() const;
 
+This function does not block, but instead simply signals the [link boost_asio.reference.io_service `io_service`] to stop. All invocations of its `run()` or `run_one()` member functions should return as soon as possible. Subsequent calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately until `reset()` is called.
 
 
 [endsect]
 
 
 
-[section:v4 ip::udp::v4]
+[section:stopped io_service::stopped]
 
-[indexterm2 v4..ip::udp]
-Construct to represent the IPv4 UDP protocol.
+[indexterm2 stopped..io_service]
+Determine whether the [link boost_asio.reference.io_service `io_service`] object has been stopped.
 
 
- static udp v4();
+ bool stopped() const;
+
+
+This function is used to determine whether an [link boost_asio.reference.io_service `io_service`] object has been stopped, either through an explicit call to `stop()`, or due to running out of work. When an [link boost_asio.reference.io_service `io_service`] object is stopped, calls to `run()`, `run_one()`, `poll()` or `poll_one()` will return immediately without invoking any handlers.
+
+
+[heading Return Value]
+
+`true` if the [link boost_asio.reference.io_service `io_service`] object is stopped, otherwise `false`.
+
 
 
 
@@ -49061,160 +50282,183 @@
 
 
 
-[section:v6 ip::udp::v6]
+[section:use_service io_service::use_service]
 
-[indexterm2 v6..ip::udp]
-Construct to represent the IPv6 UDP protocol.
+[indexterm2 use_service..io_service]
+Obtain the service object corresponding to the given type.
 
 
- static udp v6();
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend Service & use_service(
+ io_service & ios);
+
 
+This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the [link boost_asio.reference.io_service `io_service`] will create a new instance of the service.
 
 
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[ios][The [link boost_asio.reference.io_service `io_service`] object that owns the service.]]
+
+]
+
+
+[heading Return Value]
+
+The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
+
 
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/io_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
 
 [endsect]
 
 
-[section:ip__unicast__hops ip::unicast::hops]
 
-[indexterm1 ip::unicast::hops]
-Socket option for time-to-live associated with outgoing unicast packets.
+[section:wrap io_service::wrap]
+
+[indexterm2 wrap..io_service]
+Create a new handler that automatically dispatches the wrapped handler on the [link boost_asio.reference.io_service `io_service`].
 
 
- typedef implementation_defined hops;
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ unspecified wrap(
+ Handler handler);
 
 
+This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the [link boost_asio.reference.io_service `io_service`] object's dispatch function.
 
-Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
 
+[heading Parameters]
+
 
-[heading Examples]
+[variablelist
   
-Setting the option:
+[[handler][The handler to be wrapped. The [link boost_asio.reference.io_service `io_service`] will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler(A1 a1, ... An an);
+``
+]]
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::unicast::hops option(4);
- socket.set_option(option);
+]
 
 
+[heading Return Value]
+
+A function object that, when invoked, passes the wrapped handler to the [link boost_asio.reference.io_service `io_service`] object's dispatch function. Given a function object with the signature:
 
+ R f(A1 a1, ... An an);
 
 
-Getting the current option value:
+If this function object is passed to the wrap function like so:
 
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::unicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+ io_service.wrap(f);
 
 
+then the return value is a function object with the signature
 
+ void g(A1 a1, ... An an);
 
 
+that, when invoked, executes code equivalent to:
 
+ io_service.dispatch(boost::bind(f, a1, ... an));
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/unicast.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
 
 
+[endsect]
 
-[section:ip__v6_only ip::v6_only]
 
-[indexterm1 ip::v6_only]
-Socket option for determining whether an IPv6 socket supports IPv6 communication only.
 
+[section:_io_service io_service::~io_service]
 
- typedef implementation_defined v6_only;
+[indexterm2 ~io_service..io_service]
+Destructor.
 
 
+ ~io_service();
 
-Implements the IPPROTO\_IPV6/IP\_V6ONLY socket option.
 
+On destruction, the [link boost_asio.reference.io_service `io_service`] performs the following sequence of operations:
 
-[heading Examples]
-
-Setting the option:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::v6_only option(true);
- socket.set_option(option);
+* For each service object `svc` in the [link boost_asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `svc->shutdown_service()`.
 
 
+* Uninvoked handler objects that were scheduled for deferred invocation on the [link boost_asio.reference.io_service `io_service`], or any associated strand, are destroyed.
 
 
+* For each service object `svc` in the [link boost_asio.reference.io_service `io_service`] set, in reverse order of the beginning of service object lifetime, performs `delete static_cast<io_service::service*>(svc)`.
 
-Getting the current option value:
 
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::v6_only option;
- socket.get_option(option);
- bool v6_only = option.value();
+[heading Remarks]
+
+The destruction sequence described above permits programs to simplify their resource management by using `shared_ptr<>`. Where an object's lifetime is tied to the lifetime of a connection (or some other sequence of asynchronous operations), a `shared_ptr` to the object would be bound into the handlers for all asynchronous operations associated with it. This works as follows:
 
 
+* When a single connection ends, all associated asynchronous operations complete. The corresponding handler objects are destroyed, and all `shared_ptr` references to the objects are destroyed.
 
 
+* To shut down the whole program, the [link boost_asio.reference.io_service `io_service`] function `stop()` is called to terminate any `run()` calls as soon as possible. The [link boost_asio.reference.io_service `io_service`] destructor defined above destroys all handlers, causing all `shared_ptr` references to all connection objects to be destroyed.
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/ip/v6_only.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
-
-[section:is_match_condition is_match_condition]
+[section:io_service__id io_service::id]
 
 
-Type trait used to determine whether a type can be used as a match condition function with read\_until and async\_read\_until.
+Class used to uniquely identify a service.
 
 
- template<
- typename T>
- struct is_match_condition
+ class id :
+ noncopyable
 
 
-[heading Data Members]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.is_match_condition.value [*value]]]
- [The value member is true if the type may be used as a match condition. ]
+ [[link boost_asio.reference.io_service__id.id [*id]]]
+ [Constructor. ]
   ]
-
+
 ]
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/read_until.hpp]
+[*Header: ][^boost/asio/io_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:value is_match_condition::value]
+[section:id io_service::id::id]
 
-[indexterm2 value..is_match_condition]
-The value member is true if the type may be used as a match condition.
+[indexterm2 id..io_service::id]
+Constructor.
 
 
- static const bool value;
+ id();
 
 
 
@@ -49224,42 +50468,57 @@
 
 [endsect]
 
-[section:is_read_buffered is_read_buffered]
+[section:io_service__service io_service::service]
 
 
-The [link boost_asio.reference.is_read_buffered `is_read_buffered`] class is a traits class that may be used to determine whether a stream type supports buffering of read data.
+Base class for all [link boost_asio.reference.io_service `io_service`] services.
 
 
- template<
- typename Stream>
- class is_read_buffered
+ class service :
+ noncopyable
 
 
-[heading Data Members]
+[heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.is_read_buffered.value [*value]]]
- [The value member is true only if the Stream type supports buffering of read data. ]
+ [[link boost_asio.reference.io_service__service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
   ]
+
+]
 
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.io_service__service.service [*service]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service__service._service [*~service]]]
+ [Destructor. ]
+ ]
+
 ]
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/is_read_buffered.hpp]
+[*Header: ][^boost/asio/io_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:value is_read_buffered::value]
+[section:get_io_service io_service::service::get_io_service]
 
-[indexterm2 value..is_read_buffered]
-The value member is true only if the Stream type supports buffering of read data.
+[indexterm2 get_io_service..io_service::service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
 
- static const bool value;
+ boost::asio::io_service & get_io_service();
 
 
 
@@ -49267,325 +50526,212 @@
 
 
 
-[endsect]
-
-[section:is_write_buffered is_write_buffered]
+[section:service io_service::service::service]
 
+[indexterm2 service..io_service::service]
+Constructor.
 
-The [link boost_asio.reference.is_write_buffered `is_write_buffered`] class is a traits class that may be used to determine whether a stream type supports buffering of written data.
 
+ service(
+ boost::asio::io_service & owner);
 
- template<
- typename Stream>
- class is_write_buffered
 
 
-[heading Data Members]
-[table
- [[Name][Description]]
+[heading Parameters]
+
 
- [
- [[link boost_asio.reference.is_write_buffered.value [*value]]]
- [The value member is true only if the Stream type supports buffering of written data. ]
- ]
+[variablelist
+
+[[owner][The [link boost_asio.reference.io_service `io_service`] object that owns the service. ]]
 
 ]
 
-[heading Requirements]
-
-[*Header: ][^boost/asio/is_write_buffered.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:value is_write_buffered::value]
+[endsect]
 
-[indexterm2 value..is_write_buffered]
-The value member is true only if the Stream type supports buffering of written data.
 
 
- static const bool value;
+[section:_service io_service::service::~service]
 
+[indexterm2 ~service..io_service::service]
+Destructor.
 
 
-[endsect]
+ virtual ~service();
 
 
 
 [endsect]
 
-[section:local__basic_endpoint local::basic_endpoint]
-
 
-Describes an endpoint for a UNIX socket.
-
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class basic_endpoint
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
+[section:io_service__strand io_service::strand]
 
- [
 
- [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+Provides serialised handler execution.
 
- [
 
- [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+ class strand
 
-]
 
 [heading Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
-
- Construct an endpoint using the specified path name.
-
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
+ [[link boost_asio.reference.io_service__strand.dispatch [*dispatch]]]
+ [Request the strand to invoke the given handler. ]
   ]
   
   [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [[link boost_asio.reference.io_service__strand.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the strand. ]
   ]
   
   [
- [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
- [Get the path associated with the endpoint.
-
- Set the path associated with the endpoint. ]
+ [[link boost_asio.reference.io_service__strand.post [*post]]]
+ [Request the strand to invoke the given handler and return immediately. ]
   ]
   
   [
- [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [[link boost_asio.reference.io_service__strand.strand [*strand]]]
+ [Constructor. ]
   ]
   
   [
- [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.io_service__strand.wrap [*wrap]]]
+ [Create a new handler that automatically dispatches the wrapped handler on the strand. ]
   ]
   
   [
- [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.io_service__strand._strand [*~strand]]]
+ [Destructor. ]
   ]
   
 ]
 
-[heading Friends]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
- ]
-
-]
-
-[heading Related Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
-
-]
-
-The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
+The [link boost_asio.reference.io_service__strand `io_service::strand`] class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently.
 
 
-[heading Thread Safety]
+[heading Order of handler invocation]
   
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
-[section:basic_endpoint local::basic_endpoint::basic_endpoint]
-
-[indexterm2 basic_endpoint..local::basic_endpoint]
-Default constructor.
-
-
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload1 more...]]``
-
-
-Construct an endpoint using the specified path name.
-
-
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
- const char * path);
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload2 more...]]``
-
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
- const std::string & path);
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 more...]]``
-
-
-Copy constructor.
-
+Given:
 
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
- const basic_endpoint & other);
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 more...]]``
 
+* a strand object `s`
 
-[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)]
 
+* an object `a` meeting completion handler requirements
 
-Default constructor.
 
+* an object `a1` which is an arbitrary copy of `a` made by the implementation
 
- basic_endpoint();
 
+* an object `b` meeting completion handler requirements
 
 
-[endsect]
+* an object `b1` which is an arbitrary copy of `b` made by the implementation
 
+if any of the following conditions are true:
 
 
-[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+* `s.post(a)` happens-before `s.post(b)`
 
 
-Construct an endpoint using the specified path name.
+* `s.post(a)` happens-before `s.dispatch(b)`, where the latter is performed outside the strand
 
 
- basic_endpoint(
- const char * path);
+* `s.dispatch(a)` happens-before `s.post(b)`, where the former is performed outside the strand
 
 
+* `s.dispatch(a)` happens-before `s.dispatch(b)`, where both are performed outside the strand
 
-[endsect]
+then `asio_handler_invoke(a1, &a1)` happens-before `asio_handler_invoke(b1, &b1)`.
 
+Note that in the following case:
 
+ async_op_1(..., s.wrap(a));
+ async_op_2(..., s.wrap(b));
 
-[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 overloads)]
 
+the completion of the first async operation will perform `s.dispatch(a)`, and the second will perform `s.dispatch(b)`, but the order in which those are performed is unspecified. That is, you cannot state whether one happens-before the other. Therefore none of the above conditions are met and no ordering guarantee is made.
 
-Construct an endpoint using the specified path name.
 
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
 
- basic_endpoint(
- const std::string & path);
+[*Shared] [*objects:] Safe.
 
 
 
-[endsect]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/strand.hpp]
 
-[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 overloads)]
+[*Convenience header: ][^boost/asio.hpp]
 
 
-Copy constructor.
+[section:dispatch io_service::strand::dispatch]
 
+[indexterm2 dispatch..io_service::strand]
+Request the strand to invoke the given handler.
 
- basic_endpoint(
- const basic_endpoint & other);
 
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void dispatch(
+ CompletionHandler handler);
 
 
-[endsect]
+This function is used to ask the strand to execute the given handler.
 
+The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The handler may be executed inside this function if the guarantee can be met. If this function is called from within a handler that was posted or dispatched through the same strand, then the new handler will be executed immediately.
 
-[endsect]
+The strand's guarantee is in addition to the guarantee provided by the underlying [link boost_asio.reference.io_service `io_service`]. The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked.
 
 
-[section:capacity local::basic_endpoint::capacity]
+[heading Parameters]
+
 
-[indexterm2 capacity..local::basic_endpoint]
-Get the capacity of the endpoint in the native type.
+[variablelist
+
+[[handler][The handler to be called. The strand will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
 
+]
 
- std::size_t capacity() const;
 
 
 
 [endsect]
 
 
-[section:data local::basic_endpoint::data]
-
-[indexterm2 data..local::basic_endpoint]
-Get the underlying endpoint in the native type.
 
+[section:get_io_service io_service::strand::get_io_service]
 
- data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload1 data]``();
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.data.overload1 more...]]``
+[indexterm2 get_io_service..io_service::strand]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the strand.
 
- const data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload2 data]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.data.overload2 more...]]``
 
+ boost::asio::io_service & get_io_service();
 
-[section:overload1 local::basic_endpoint::data (1 of 2 overloads)]
 
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the strand uses to dispatch handlers for asynchronous operations.
 
-Get the underlying endpoint in the native type.
 
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
 
- data_type * data();
 
 
 
@@ -49593,99 +50739,85 @@
 
 
 
-[section:overload2 local::basic_endpoint::data (2 of 2 overloads)]
-
-
-Get the underlying endpoint in the native type.
-
-
- const data_type * data() const;
-
-
-
-[endsect]
+[section:post io_service::strand::post]
 
+[indexterm2 post..io_service::strand]
+Request the strand to invoke the given handler and return immediately.
 
-[endsect]
 
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void post(
+ CompletionHandler handler);
 
-[section:data_type local::basic_endpoint::data_type]
 
-[indexterm2 data_type..local::basic_endpoint]
-The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+This function is used to ask the strand to execute the given handler, but without allowing the strand to call the handler from inside this function.
 
+The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The strand's guarantee is in addition to the guarantee provided by the underlying [link boost_asio.reference.io_service `io_service`]. The [link boost_asio.reference.io_service `io_service`] guarantees that the handler will only be called in a thread in which the io\_service's run member function is currently being invoked.
 
- typedef implementation_defined data_type;
 
+[heading Parameters]
+
 
+[variablelist
+
+[[handler][The handler to be called. The strand will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_not__eq_ local::basic_endpoint::operator!=]
-
-[indexterm2 operator!=..local::basic_endpoint]
-Compare two endpoints for inequality.
-
-
- friend bool operator!=(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
-
-
-[heading Requirements]
-
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
-
-[*Convenience header: ][^boost/asio.hpp]
-
+[section:strand io_service::strand::strand]
 
-[endsect]
+[indexterm2 strand..io_service::strand]
+Constructor.
 
 
+ strand(
+ boost::asio::io_service & io_service);
 
-[section:operator_lt_ local::basic_endpoint::operator<]
 
-[indexterm2 operator<..local::basic_endpoint]
-Compare endpoints for ordering.
+Constructs the strand.
 
 
- friend bool operator<(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the strand will use to dispatch handlers that are ready to be run. ]]
 
-[heading Requirements]
+]
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:operator_lt__lt_ local::basic_endpoint::operator<<]
+[section:wrap io_service::strand::wrap]
 
-[indexterm2 operator<<..local::basic_endpoint]
-Output an endpoint as a string.
+[indexterm2 wrap..io_service::strand]
+Create a new handler that automatically dispatches the wrapped handler on the strand.
 
 
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const basic_endpoint< Protocol > & endpoint);
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ unspecified wrap(
+ Handler handler);
 
 
-Used to output a human-readable string for a specified endpoint.
+This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the strand's dispatch function.
 
 
 [heading Parameters]
@@ -49693,54 +50825,39 @@
 
 [variablelist
   
-[[os][The output stream to which the string will be written.]]
-
-[[endpoint][The endpoint to be written.]]
+[[handler][The handler to be wrapped. The strand will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler(A1 a1, ... An an);
+``
+]]
 
 ]
 
 
 [heading Return Value]
       
-The output stream.
-
-
-
-
-[endsect]
-
-
-
-[section:operator_lt__eq_ local::basic_endpoint::operator<=]
-
-[indexterm2 operator<=..local::basic_endpoint]
-Compare endpoints for ordering.
+A function object that, when invoked, passes the wrapped handler to the strand's dispatch function. Given a function object with the signature:
 
+ R f(A1 a1, ... An an);
 
- friend bool operator<=(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
 
+If this function object is passed to the wrap function like so:
 
-[heading Requirements]
+ strand.wrap(f);
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+then the return value is a function object with the signature
 
+ void g(A1 a1, ... An an);
 
-[endsect]
 
+that, when invoked, executes code equivalent to:
 
+ strand.dispatch(boost::bind(f, a1, ... an));
 
-[section:operator_eq_ local::basic_endpoint::operator=]
 
-[indexterm2 operator=..local::basic_endpoint]
-Assign from another endpoint.
 
 
- basic_endpoint & operator=(
- const basic_endpoint & other);
 
 
 
@@ -49748,507 +50865,457 @@
 
 
 
-[section:operator_eq__eq_ local::basic_endpoint::operator==]
-
-[indexterm2 operator==..local::basic_endpoint]
-Compare two endpoints for equality.
+[section:_strand io_service::strand::~strand]
 
+[indexterm2 ~strand..io_service::strand]
+Destructor.
 
- friend bool operator==(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
 
+ ~strand();
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+Destroys a strand.
 
-[*Convenience header: ][^boost/asio.hpp]
+Handlers posted through the strand that have not yet been invoked will still be dispatched in a way that meets the guarantee of non-concurrency.
 
 
 [endsect]
 
 
 
-[section:operator_gt_ local::basic_endpoint::operator>]
-
-[indexterm2 operator>..local::basic_endpoint]
-Compare endpoints for ordering.
-
-
- friend bool operator>(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
-
-
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+[section:io_service__work io_service::work]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Class to inform the [link boost_asio.reference.io_service `io_service`] when it has work to do.
 
-[endsect]
 
+ class work
 
 
-[section:operator_gt__eq_ local::basic_endpoint::operator>=]
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[indexterm2 operator>=..local::basic_endpoint]
-Compare endpoints for ordering.
+ [
+ [[link boost_asio.reference.io_service__work.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the work. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service__work.work [*work]]]
+ [Constructor notifies the io_service that work is starting.
 
+ Copy constructor notifies the io_service that work is starting. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service__work._work [*~work]]]
+ [Destructor notifies the io_service that the work is complete. ]
+ ]
+
+]
 
- friend bool operator>=(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
+The work class is used to inform the [link boost_asio.reference.io_service `io_service`] when work starts and finishes. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while work is underway, and that it does exit when there is no unfinished work remaining.
 
+The work class is copy-constructible so that it may be used as a data member in a handler class. It is not assignable.
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+[*Header: ][^boost/asio/io_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
-
-
-[section:path local::basic_endpoint::path]
-
-[indexterm2 path..local::basic_endpoint]
-Get the path associated with the endpoint.
-
+[section:get_io_service io_service::work::get_io_service]
 
- std::string ``[link boost_asio.reference.local__basic_endpoint.path.overload1 path]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload1 more...]]``
+[indexterm2 get_io_service..io_service::work]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the work.
 
 
-Set the path associated with the endpoint.
+ boost::asio::io_service & get_io_service();
 
 
- void ``[link boost_asio.reference.local__basic_endpoint.path.overload2 path]``(
- const char * p);
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload2 more...]]``
 
- void ``[link boost_asio.reference.local__basic_endpoint.path.overload3 path]``(
- const std::string & p);
- `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload3 more...]]``
+[endsect]
 
 
-[section:overload1 local::basic_endpoint::path (1 of 3 overloads)]
+[section:work io_service::work::work]
 
+[indexterm2 work..io_service::work]
+Constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
-Get the path associated with the endpoint.
 
+ explicit ``[link boost_asio.reference.io_service__work.work.overload1 work]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service__work.work.overload1 more...]]``
 
- std::string path() const;
 
+Copy constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
 
-[endsect]
+ ``[link boost_asio.reference.io_service__work.work.overload2 work]``(
+ const work & other);
+ `` [''''&raquo;''' [link boost_asio.reference.io_service__work.work.overload2 more...]]``
 
 
+[section:overload1 io_service::work::work (1 of 2 overloads)]
 
-[section:overload2 local::basic_endpoint::path (2 of 3 overloads)]
 
+Constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
-Set the path associated with the endpoint.
 
+ work(
+ boost::asio::io_service & io_service);
 
- void path(
- const char * p);
 
+The constructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway.
 
 
 [endsect]
 
 
 
-[section:overload3 local::basic_endpoint::path (3 of 3 overloads)]
-
+[section:overload2 io_service::work::work (2 of 2 overloads)]
 
-Set the path associated with the endpoint.
 
+Copy constructor notifies the [link boost_asio.reference.io_service `io_service`] that work is starting.
 
- void path(
- const std::string & p);
 
+ work(
+ const work & other);
 
 
-[endsect]
+The constructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has begun. This ensures that the [link boost_asio.reference.io_service `io_service`] object's `run()` function will not exit while the work is underway.
 
 
 [endsect]
 
 
-[section:protocol local::basic_endpoint::protocol]
-
-[indexterm2 protocol..local::basic_endpoint]
-The protocol associated with the endpoint.
-
-
- protocol_type protocol() const;
-
-
-
 [endsect]
 
 
+[section:_work io_service::work::~work]
 
-[section:protocol_type local::basic_endpoint::protocol_type]
-
-[indexterm2 protocol_type..local::basic_endpoint]
-The protocol type associated with the endpoint.
-
-
- typedef Protocol protocol_type;
-
+[indexterm2 ~work..io_service::work]
+Destructor notifies the [link boost_asio.reference.io_service `io_service`] that the work is complete.
 
 
-[heading Requirements]
+ ~work();
 
-[*Header: ][^boost/asio/local/basic_endpoint.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+The destructor is used to inform the [link boost_asio.reference.io_service `io_service`] that some work has finished. Once the count of unfinished work reaches zero, the [link boost_asio.reference.io_service `io_service`] object's `run()` function is permitted to exit.
 
 
 [endsect]
 
 
 
-[section:resize local::basic_endpoint::resize]
-
-[indexterm2 resize..local::basic_endpoint]
-Set the underlying size of the endpoint in the native type.
+[endsect]
 
+[section:ip__address ip::address]
 
- void resize(
- std::size_t size);
 
+Implements version-independent IP addresses.
 
 
-[endsect]
+ class address
 
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[section:size local::basic_endpoint::size]
+ [
+ [[link boost_asio.reference.ip__address.address [*address]]]
+ [Default constructor.
 
-[indexterm2 size..local::basic_endpoint]
-Get the underlying size of the endpoint in the native type.
+ Construct an address from an IPv4 address.
 
+ Construct an address from an IPv6 address.
 
- std::size_t size() const;
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.from_string [*from_string]]]
+ [Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.is_loopback [*is_loopback]]]
+ [Determine whether the address is a loopback address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.is_multicast [*is_multicast]]]
+ [Determine whether the address is a multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.is_unspecified [*is_unspecified]]]
+ [Determine whether the address is unspecified. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.is_v4 [*is_v4]]]
+ [Get whether the address is an IP version 4 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.is_v6 [*is_v6]]]
+ [Get whether the address is an IP version 6 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_eq_ [*operator=]]]
+ [Assign from another address.
 
+ Assign from an IPv4 address.
 
+ Assign from an IPv6 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.to_string [*to_string]]]
+ [Get the address as a string in dotted decimal format. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.to_v4 [*to_v4]]]
+ [Get the address as an IP version 4 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.to_v6 [*to_v6]]]
+ [Get the address as an IP version 6 address. ]
+ ]
+
+]
 
-[endsect]
+[heading Friends]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.ip__address.operator_not__eq_ [*operator!=]]]
+ [Compare two addresses for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_lt_ [*operator<]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_lt__eq_ [*operator<=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_eq__eq_ [*operator==]]]
+ [Compare two addresses for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_gt_ [*operator>]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address.operator_gt__eq_ [*operator>=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+]
 
+[heading Related Functions]
+[table
+ [[Name][Description]]
 
-[endsect]
+ [
+ [[link boost_asio.reference.ip__address.operator_lt__lt_ [*operator<<]]]
+ [Output an address as a string. ]
+ ]
+
+]
 
-[section:local__connect_pair local::connect_pair]
+The [link boost_asio.reference.ip__address `ip::address`] class provides the ability to use either IP version 4 or version 6 addresses.
 
-[indexterm1 local::connect_pair]
-Create a pair of connected sockets.
 
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService SocketService1]``,
- typename ``[link boost_asio.reference.SocketService SocketService2]``>
- void ``[link boost_asio.reference.local__connect_pair.overload1 connect_pair]``(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2);
- `` [''''&raquo;''' [link boost_asio.reference.local__connect_pair.overload1 more...]]``
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService SocketService1]``,
- typename ``[link boost_asio.reference.SocketService SocketService2]``>
- boost::system::error_code ``[link boost_asio.reference.local__connect_pair.overload2 connect_pair]``(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.local__connect_pair.overload2 more...]]``
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/connect_pair.hpp]
+[*Header: ][^boost/asio/ip/address.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
+[section:address ip::address::address]
 
-[section:overload1 local::connect_pair (1 of 2 overloads)]
+[indexterm2 address..ip::address]
+Default constructor.
 
 
-Create a pair of connected sockets.
+ ``[link boost_asio.reference.ip__address.address.overload1 address]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload1 more...]]``
 
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService SocketService1]``,
- typename ``[link boost_asio.reference.SocketService SocketService2]``>
- void connect_pair(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2);
+Construct an address from an IPv4 address.
 
 
+ ``[link boost_asio.reference.ip__address.address.overload2 address]``(
+ const boost::asio::ip::address_v4 & ipv4_address);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload2 more...]]``
 
-[endsect]
 
+Construct an address from an IPv6 address.
 
 
-[section:overload2 local::connect_pair (2 of 2 overloads)]
+ ``[link boost_asio.reference.ip__address.address.overload3 address]``(
+ const boost::asio::ip::address_v6 & ipv6_address);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload3 more...]]``
 
 
-Create a pair of connected sockets.
+Copy constructor.
 
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService SocketService1]``,
- typename ``[link boost_asio.reference.SocketService SocketService2]``>
- boost::system::error_code connect_pair(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2,
- boost::system::error_code & ec);
+ ``[link boost_asio.reference.ip__address.address.overload4 address]``(
+ const address & other);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.address.overload4 more...]]``
+
 
+[section:overload1 ip::address::address (1 of 4 overloads)]
 
 
-[endsect]
+Default constructor.
+
+
+ address();
+
 
 
 [endsect]
 
-[section:local__datagram_protocol local::datagram_protocol]
 
 
-Encapsulates the flags needed for datagram-oriented UNIX sockets.
+[section:overload2 ip::address::address (2 of 4 overloads)]
 
 
- class datagram_protocol
+Construct an address from an IPv4 address.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ address(
+ const boost::asio::ip::address_v4 & ipv4_address);
 
- [
 
- [[link boost_asio.reference.local__datagram_protocol.endpoint [*endpoint]]]
- [The type of a UNIX domain endpoint. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.local__datagram_protocol.socket [*socket]]]
- [The UNIX domain socket type. ]
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:overload3 ip::address::address (3 of 4 overloads)]
 
- [
- [[link boost_asio.reference.local__datagram_protocol.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.local__datagram_protocol.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.local__datagram_protocol.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
-]
 
-The [link boost_asio.reference.local__datagram_protocol `local::datagram_protocol`] class contains flags necessary for datagram-oriented UNIX domain sockets.
+Construct an address from an IPv6 address.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ address(
+ const boost::asio::ip::address_v6 & ipv6_address);
 
-[*Shared] [*objects:] Safe.
 
 
+[endsect]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/local/datagram_protocol.hpp]
+[section:overload4 ip::address::address (4 of 4 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Copy constructor.
 
-[section:endpoint local::datagram_protocol::endpoint]
 
-[indexterm2 endpoint..local::datagram_protocol]
-The type of a UNIX domain endpoint.
+ address(
+ const address & other);
 
 
- typedef basic_endpoint< datagram_protocol > endpoint;
 
+[endsect]
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[endsect]
 
- [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+[section:from_string ip::address::from_string]
 
- [
+[indexterm2 from_string..ip::address]
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
- [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
 
-]
+ static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
+ const char * str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload1 more...]]``
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ static address ``[link boost_asio.reference.ip__address.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload2 more...]]``
 
- [
- [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
+ static address ``[link boost_asio.reference.ip__address.from_string.overload3 from_string]``(
+ const std::string & str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload3 more...]]``
 
- Construct an endpoint using the specified path name.
+ static address ``[link boost_asio.reference.ip__address.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.from_string.overload4 more...]]``
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
- [Get the path associated with the endpoint.
 
- Set the path associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
- ]
-
-]
+[section:overload1 ip::address::from_string (1 of 4 overloads)]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
- ]
-
-]
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
-
-]
+ static address from_string(
+ const char * str);
 
-The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
 
-[*Shared] [*objects:] Unsafe.
 
 
+[section:overload2 ip::address::from_string (2 of 4 overloads)]
 
 
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/local/datagram_protocol.hpp]
+ static address from_string(
+ const char * str,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:family local::datagram_protocol::family]
+[section:overload3 ip::address::from_string (3 of 4 overloads)]
 
-[indexterm2 family..local::datagram_protocol]
-Obtain an identifier for the protocol family.
 
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
- int family() const;
+
+ static address from_string(
+ const std::string & str);
 
 
 
@@ -50256,413 +51323,13213 @@
 
 
 
-[section:protocol local::datagram_protocol::protocol]
+[section:overload4 ip::address::from_string (4 of 4 overloads)]
 
-[indexterm2 protocol..local::datagram_protocol]
-Obtain an identifier for the protocol.
+
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
 
 
- int protocol() const;
+ static address from_string(
+ const std::string & str,
+ boost::system::error_code & ec);
 
 
 
 [endsect]
 
 
+[endsect]
 
-[section:socket local::datagram_protocol::socket]
 
-[indexterm2 socket..local::datagram_protocol]
-The UNIX domain socket type.
+[section:is_loopback ip::address::is_loopback]
 
+[indexterm2 is_loopback..ip::address]
+Determine whether the address is a loopback address.
 
- typedef basic_datagram_socket< datagram_protocol > socket;
 
+ bool is_loopback() const;
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
+[section:is_multicast ip::address::is_multicast]
 
- [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+[indexterm2 is_multicast..ip::address]
+Determine whether the address is a multicast address.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+ bool is_multicast() const;
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[section:is_unspecified ip::address::is_unspecified]
 
- [
+[indexterm2 is_unspecified..ip::address]
+Determine whether the address is unspecified.
 
- [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
+ bool is_unspecified() const;
 
- [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
 
- [
+[section:is_v4 ip::address::is_v4]
 
- [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+[indexterm2 is_v4..ip::address]
+Get whether the address is an IP version 4 address.
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+ bool is_v4() const;
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+[section:is_v6 ip::address::is_v6]
 
- [
+[indexterm2 is_v6..ip::address]
+Get whether the address is an IP version 6 address.
 
- [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
 
- [
+ bool is_v6() const;
 
- [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
 
- [
+[section:operator_not__eq_ ip::address::operator!=]
 
- [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
+[indexterm2 operator!=..ip::address]
+Compare two addresses for inequality.
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ friend bool operator!=(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt_ ip::address::operator<]
+
+[indexterm2 operator<..ip::address]
+Compare addresses for ordering.
+
+
+ friend bool operator<(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ ip::address::operator<<]
+
+[indexterm2 operator<<..ip::address]
+Output an address as a string.
+
+
+ template<
+ typename Elem,
+ typename Traits>
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const address & addr);
+
+
+Used to output a human-readable string for a specified address.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[addr][The address to be written.]]
+
+]
+
+
+[heading Return Value]
+
+The output stream.
+
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__eq_ ip::address::operator<=]
+
+[indexterm2 operator<=..ip::address]
+Compare addresses for ordering.
+
+
+ friend bool operator<=(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:operator_eq_ ip::address::operator=]
+
+[indexterm2 operator=..ip::address]
+Assign from another address.
+
+
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload1 operator=]``(
+ const address & other);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload1 more...]]``
+
+
+Assign from an IPv4 address.
+
+
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload2 operator=]``(
+ const boost::asio::ip::address_v4 & ipv4_address);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload2 more...]]``
+
+
+Assign from an IPv6 address.
+
+
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload3 operator=]``(
+ const boost::asio::ip::address_v6 & ipv6_address);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.operator_eq_.overload3 more...]]``
+
+
+[section:overload1 ip::address::operator= (1 of 3 overloads)]
+
+
+Assign from another address.
+
+
+ address & operator=(
+ const address & other);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address::operator= (2 of 3 overloads)]
+
+
+Assign from an IPv4 address.
+
+
+ address & operator=(
+ const boost::asio::ip::address_v4 & ipv4_address);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address::operator= (3 of 3 overloads)]
+
+
+Assign from an IPv6 address.
+
+
+ address & operator=(
+ const boost::asio::ip::address_v6 & ipv6_address);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:operator_eq__eq_ ip::address::operator==]
+
+[indexterm2 operator==..ip::address]
+Compare two addresses for equality.
+
+
+ friend bool operator==(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt_ ip::address::operator>]
+
+[indexterm2 operator>..ip::address]
+Compare addresses for ordering.
+
+
+ friend bool operator>(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt__eq_ ip::address::operator>=]
+
+[indexterm2 operator>=..ip::address]
+Compare addresses for ordering.
+
+
+ friend bool operator>=(
+ const address & a1,
+ const address & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:to_string ip::address::to_string]
+
+[indexterm2 to_string..ip::address]
+Get the address as a string in dotted decimal format.
+
+
+ std::string ``[link boost_asio.reference.ip__address.to_string.overload1 to_string]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.to_string.overload1 more...]]``
+
+ std::string ``[link boost_asio.reference.ip__address.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address.to_string.overload2 more...]]``
+
+
+[section:overload1 ip::address::to_string (1 of 2 overloads)]
+
+
+Get the address as a string in dotted decimal format.
+
+
+ std::string to_string() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address::to_string (2 of 2 overloads)]
+
+
+Get the address as a string in dotted decimal format.
+
+
+ std::string to_string(
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:to_v4 ip::address::to_v4]
+
+[indexterm2 to_v4..ip::address]
+Get the address as an IP version 4 address.
+
+
+ boost::asio::ip::address_v4 to_v4() const;
+
+
+
+[endsect]
+
+
+
+[section:to_v6 ip::address::to_v6]
+
+[indexterm2 to_v6..ip::address]
+Get the address as an IP version 6 address.
+
+
+ boost::asio::ip::address_v6 to_v6() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__address_v4 ip::address_v4]
+
+
+Implements IP version 4 style addresses.
+
+
+ class address_v4
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__address_v4.bytes_type [*bytes_type]]]
+ [The type used to represent an address as an array of bytes. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.address_v4 [*address_v4]]]
+ [Default constructor.
+
+ Construct an address from raw bytes.
+
+ Construct an address from a unsigned long in host byte order.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.any [*any]]]
+ [Obtain an address object that represents any address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.broadcast [*broadcast]]]
+ [Obtain an address object that represents the broadcast address.
+
+ Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.from_string [*from_string]]]
+ [Create an address from an IP address string in dotted decimal form. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_class_a [*is_class_a]]]
+ [Determine whether the address is a class A address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_class_b [*is_class_b]]]
+ [Determine whether the address is a class B address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_class_c [*is_class_c]]]
+ [Determine whether the address is a class C address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_loopback [*is_loopback]]]
+ [Determine whether the address is a loopback address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_multicast [*is_multicast]]]
+ [Determine whether the address is a multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.is_unspecified [*is_unspecified]]]
+ [Determine whether the address is unspecified. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.loopback [*loopback]]]
+ [Obtain an address object that represents the loopback address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.netmask [*netmask]]]
+ [Obtain the netmask that corresponds to the address, based on its address class. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_eq_ [*operator=]]]
+ [Assign from another address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.to_bytes [*to_bytes]]]
+ [Get the address in bytes, in network byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.to_string [*to_string]]]
+ [Get the address as a string in dotted decimal format. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.to_ulong [*to_ulong]]]
+ [Get the address as an unsigned long in host byte order. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]]
+ [Compare two addresses for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_lt_ [*operator<]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_lt__eq_ [*operator<=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_eq__eq_ [*operator==]]]
+ [Compare two addresses for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_gt_ [*operator>]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]]
+ [Output an address as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__address_v4 `ip::address_v4`] class provides the ability to use and manipulate IP version 4 addresses.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:address_v4 ip::address_v4::address_v4]
+
+[indexterm2 address_v4..ip::address_v4]
+Default constructor.
+
+
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload1 address_v4]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload1 more...]]``
+
+
+Construct an address from raw bytes.
+
+
+ explicit ``[link boost_asio.reference.ip__address_v4.address_v4.overload2 address_v4]``(
+ const bytes_type & bytes);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload2 more...]]``
+
+
+Construct an address from a unsigned long in host byte order.
+
+
+ explicit ``[link boost_asio.reference.ip__address_v4.address_v4.overload3 address_v4]``(
+ unsigned long addr);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload3 more...]]``
+
+
+Copy constructor.
+
+
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
+ const address_v4 & other);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.address_v4.overload4 more...]]``
+
+
+[section:overload1 ip::address_v4::address_v4 (1 of 4 overloads)]
+
+
+Default constructor.
+
+
+ address_v4();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v4::address_v4 (2 of 4 overloads)]
+
+
+Construct an address from raw bytes.
+
+
+ address_v4(
+ const bytes_type & bytes);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)]
+
+
+Construct an address from a unsigned long in host byte order.
+
+
+ address_v4(
+ unsigned long addr);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::address_v4::address_v4 (4 of 4 overloads)]
+
+
+Copy constructor.
+
+
+ address_v4(
+ const address_v4 & other);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:any ip::address_v4::any]
+
+[indexterm2 any..ip::address_v4]
+Obtain an address object that represents any address.
+
+
+ static address_v4 any();
+
+
+
+[endsect]
+
+
+[section:broadcast ip::address_v4::broadcast]
+
+[indexterm2 broadcast..ip::address_v4]
+Obtain an address object that represents the broadcast address.
+
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload1 broadcast]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.broadcast.overload1 more...]]``
+
+
+Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
+
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload2 broadcast]``(
+ const address_v4 & addr,
+ const address_v4 & mask);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.broadcast.overload2 more...]]``
+
+
+[section:overload1 ip::address_v4::broadcast (1 of 2 overloads)]
+
+
+Obtain an address object that represents the broadcast address.
+
+
+ static address_v4 broadcast();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v4::broadcast (2 of 2 overloads)]
+
+
+Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
+
+
+ static address_v4 broadcast(
+ const address_v4 & addr,
+ const address_v4 & mask);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:bytes_type ip::address_v4::bytes_type]
+
+[indexterm2 bytes_type..ip::address_v4]
+The type used to represent an address as an array of bytes.
+
+
+ typedef boost::array< unsigned char, 4 > bytes_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:from_string ip::address_v4::from_string]
+
+[indexterm2 from_string..ip::address_v4]
+Create an address from an IP address string in dotted decimal form.
+
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload1 from_string]``(
+ const char * str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload1 more...]]``
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload2 more...]]``
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload3 from_string]``(
+ const std::string & str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload3 more...]]``
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.from_string.overload4 more...]]``
+
+
+[section:overload1 ip::address_v4::from_string (1 of 4 overloads)]
+
+
+Create an address from an IP address string in dotted decimal form.
+
+
+ static address_v4 from_string(
+ const char * str);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v4::from_string (2 of 4 overloads)]
+
+
+Create an address from an IP address string in dotted decimal form.
+
+
+ static address_v4 from_string(
+ const char * str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address_v4::from_string (3 of 4 overloads)]
+
+
+Create an address from an IP address string in dotted decimal form.
+
+
+ static address_v4 from_string(
+ const std::string & str);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::address_v4::from_string (4 of 4 overloads)]
+
+
+Create an address from an IP address string in dotted decimal form.
+
+
+ static address_v4 from_string(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:is_class_a ip::address_v4::is_class_a]
+
+[indexterm2 is_class_a..ip::address_v4]
+Determine whether the address is a class A address.
+
+
+ bool is_class_a() const;
+
+
+
+[endsect]
+
+
+
+[section:is_class_b ip::address_v4::is_class_b]
+
+[indexterm2 is_class_b..ip::address_v4]
+Determine whether the address is a class B address.
+
+
+ bool is_class_b() const;
+
+
+
+[endsect]
+
+
+
+[section:is_class_c ip::address_v4::is_class_c]
+
+[indexterm2 is_class_c..ip::address_v4]
+Determine whether the address is a class C address.
+
+
+ bool is_class_c() const;
+
+
+
+[endsect]
+
+
+
+[section:is_loopback ip::address_v4::is_loopback]
+
+[indexterm2 is_loopback..ip::address_v4]
+Determine whether the address is a loopback address.
+
+
+ bool is_loopback() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast ip::address_v4::is_multicast]
+
+[indexterm2 is_multicast..ip::address_v4]
+Determine whether the address is a multicast address.
+
+
+ bool is_multicast() const;
+
+
+
+[endsect]
+
+
+
+[section:is_unspecified ip::address_v4::is_unspecified]
+
+[indexterm2 is_unspecified..ip::address_v4]
+Determine whether the address is unspecified.
+
+
+ bool is_unspecified() const;
+
+
+
+[endsect]
+
+
+
+[section:loopback ip::address_v4::loopback]
+
+[indexterm2 loopback..ip::address_v4]
+Obtain an address object that represents the loopback address.
+
+
+ static address_v4 loopback();
+
+
+
+[endsect]
+
+
+
+[section:netmask ip::address_v4::netmask]
+
+[indexterm2 netmask..ip::address_v4]
+Obtain the netmask that corresponds to the address, based on its address class.
+
+
+ static address_v4 netmask(
+ const address_v4 & addr);
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::address_v4::operator!=]
+
+[indexterm2 operator!=..ip::address_v4]
+Compare two addresses for inequality.
+
+
+ friend bool operator!=(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt_ ip::address_v4::operator<]
+
+[indexterm2 operator<..ip::address_v4]
+Compare addresses for ordering.
+
+
+ friend bool operator<(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ ip::address_v4::operator<<]
+
+[indexterm2 operator<<..ip::address_v4]
+Output an address as a string.
+
+
+ template<
+ typename Elem,
+ typename Traits>
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const address_v4 & addr);
+
+
+Used to output a human-readable string for a specified address.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[addr][The address to be written.]]
+
+]
+
+
+[heading Return Value]
+
+The output stream.
+
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__eq_ ip::address_v4::operator<=]
+
+[indexterm2 operator<=..ip::address_v4]
+Compare addresses for ordering.
+
+
+ friend bool operator<=(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq_ ip::address_v4::operator=]
+
+[indexterm2 operator=..ip::address_v4]
+Assign from another address.
+
+
+ address_v4 & operator=(
+ const address_v4 & other);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::address_v4::operator==]
+
+[indexterm2 operator==..ip::address_v4]
+Compare two addresses for equality.
+
+
+ friend bool operator==(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt_ ip::address_v4::operator>]
+
+[indexterm2 operator>..ip::address_v4]
+Compare addresses for ordering.
+
+
+ friend bool operator>(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt__eq_ ip::address_v4::operator>=]
+
+[indexterm2 operator>=..ip::address_v4]
+Compare addresses for ordering.
+
+
+ friend bool operator>=(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v4.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:to_bytes ip::address_v4::to_bytes]
+
+[indexterm2 to_bytes..ip::address_v4]
+Get the address in bytes, in network byte order.
+
+
+ bytes_type to_bytes() const;
+
+
+
+[endsect]
+
+
+[section:to_string ip::address_v4::to_string]
+
+[indexterm2 to_string..ip::address_v4]
+Get the address as a string in dotted decimal format.
+
+
+ std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload1 to_string]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.to_string.overload1 more...]]``
+
+ std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v4.to_string.overload2 more...]]``
+
+
+[section:overload1 ip::address_v4::to_string (1 of 2 overloads)]
+
+
+Get the address as a string in dotted decimal format.
+
+
+ std::string to_string() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v4::to_string (2 of 2 overloads)]
+
+
+Get the address as a string in dotted decimal format.
+
+
+ std::string to_string(
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:to_ulong ip::address_v4::to_ulong]
+
+[indexterm2 to_ulong..ip::address_v4]
+Get the address as an unsigned long in host byte order.
+
+
+ unsigned long to_ulong() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__address_v6 ip::address_v6]
+
+
+Implements IP version 6 style addresses.
+
+
+ class address_v6
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__address_v6.bytes_type [*bytes_type]]]
+ [The type used to represent an address as an array of bytes. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.address_v6 [*address_v6]]]
+ [Default constructor.
+
+ Construct an address from raw bytes and scope ID.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.any [*any]]]
+ [Obtain an address object that represents any address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.from_string [*from_string]]]
+ [Create an address from an IP address string. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_link_local [*is_link_local]]]
+ [Determine whether the address is link local. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_loopback [*is_loopback]]]
+ [Determine whether the address is a loopback address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast [*is_multicast]]]
+ [Determine whether the address is a multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast_global [*is_multicast_global]]]
+ [Determine whether the address is a global multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast_link_local [*is_multicast_link_local]]]
+ [Determine whether the address is a link-local multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast_node_local [*is_multicast_node_local]]]
+ [Determine whether the address is a node-local multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast_org_local [*is_multicast_org_local]]]
+ [Determine whether the address is a org-local multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_multicast_site_local [*is_multicast_site_local]]]
+ [Determine whether the address is a site-local multicast address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_site_local [*is_site_local]]]
+ [Determine whether the address is site local. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]]
+ [Determine whether the address is unspecified. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_v4_compatible [*is_v4_compatible]]]
+ [Determine whether the address is an IPv4-compatible address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.is_v4_mapped [*is_v4_mapped]]]
+ [Determine whether the address is a mapped IPv4 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.loopback [*loopback]]]
+ [Obtain an address object that represents the loopback address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_eq_ [*operator=]]]
+ [Assign from another address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.scope_id [*scope_id]]]
+ [The scope ID of the address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.to_bytes [*to_bytes]]]
+ [Get the address in bytes, in network byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.to_string [*to_string]]]
+ [Get the address as a string. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.to_v4 [*to_v4]]]
+ [Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.v4_compatible [*v4_compatible]]]
+ [Create an IPv4-compatible IPv6 address. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]]
+ [Create an IPv4-mapped IPv6 address. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]]
+ [Compare two addresses for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_lt_ [*operator<]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]]
+ [Compare two addresses for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_gt_ [*operator>]]]
+ [Compare addresses for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]]
+ [Compare addresses for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]]
+ [Output an address as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__address_v6 `ip::address_v6`] class provides the ability to use and manipulate IP version 6 addresses.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:address_v6 ip::address_v6::address_v6]
+
+[indexterm2 address_v6..ip::address_v6]
+Default constructor.
+
+
+ ``[link boost_asio.reference.ip__address_v6.address_v6.overload1 address_v6]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload1 more...]]``
+
+
+Construct an address from raw bytes and scope ID.
+
+
+ explicit ``[link boost_asio.reference.ip__address_v6.address_v6.overload2 address_v6]``(
+ const bytes_type & bytes,
+ unsigned long scope_id = 0);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload2 more...]]``
+
+
+Copy constructor.
+
+
+ ``[link boost_asio.reference.ip__address_v6.address_v6.overload3 address_v6]``(
+ const address_v6 & other);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.address_v6.overload3 more...]]``
+
+
+[section:overload1 ip::address_v6::address_v6 (1 of 3 overloads)]
+
+
+Default constructor.
+
+
+ address_v6();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v6::address_v6 (2 of 3 overloads)]
+
+
+Construct an address from raw bytes and scope ID.
+
+
+ address_v6(
+ const bytes_type & bytes,
+ unsigned long scope_id = 0);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address_v6::address_v6 (3 of 3 overloads)]
+
+
+Copy constructor.
+
+
+ address_v6(
+ const address_v6 & other);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:any ip::address_v6::any]
+
+[indexterm2 any..ip::address_v6]
+Obtain an address object that represents any address.
+
+
+ static address_v6 any();
+
+
+
+[endsect]
+
+
+
+[section:bytes_type ip::address_v6::bytes_type]
+
+[indexterm2 bytes_type..ip::address_v6]
+The type used to represent an address as an array of bytes.
+
+
+ typedef boost::array< unsigned char, 16 > bytes_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:from_string ip::address_v6::from_string]
+
+[indexterm2 from_string..ip::address_v6]
+Create an address from an IP address string.
+
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload1 from_string]``(
+ const char * str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload1 more...]]``
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload2 more...]]``
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload3 from_string]``(
+ const std::string & str);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload3 more...]]``
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.from_string.overload4 more...]]``
+
+
+[section:overload1 ip::address_v6::from_string (1 of 4 overloads)]
+
+
+Create an address from an IP address string.
+
+
+ static address_v6 from_string(
+ const char * str);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v6::from_string (2 of 4 overloads)]
+
+
+Create an address from an IP address string.
+
+
+ static address_v6 from_string(
+ const char * str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address_v6::from_string (3 of 4 overloads)]
+
+
+Create an address from an IP address string.
+
+
+ static address_v6 from_string(
+ const std::string & str);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::address_v6::from_string (4 of 4 overloads)]
+
+
+Create an address from an IP address string.
+
+
+ static address_v6 from_string(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:is_link_local ip::address_v6::is_link_local]
+
+[indexterm2 is_link_local..ip::address_v6]
+Determine whether the address is link local.
+
+
+ bool is_link_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_loopback ip::address_v6::is_loopback]
+
+[indexterm2 is_loopback..ip::address_v6]
+Determine whether the address is a loopback address.
+
+
+ bool is_loopback() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast ip::address_v6::is_multicast]
+
+[indexterm2 is_multicast..ip::address_v6]
+Determine whether the address is a multicast address.
+
+
+ bool is_multicast() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast_global ip::address_v6::is_multicast_global]
+
+[indexterm2 is_multicast_global..ip::address_v6]
+Determine whether the address is a global multicast address.
+
+
+ bool is_multicast_global() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast_link_local ip::address_v6::is_multicast_link_local]
+
+[indexterm2 is_multicast_link_local..ip::address_v6]
+Determine whether the address is a link-local multicast address.
+
+
+ bool is_multicast_link_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast_node_local ip::address_v6::is_multicast_node_local]
+
+[indexterm2 is_multicast_node_local..ip::address_v6]
+Determine whether the address is a node-local multicast address.
+
+
+ bool is_multicast_node_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast_org_local ip::address_v6::is_multicast_org_local]
+
+[indexterm2 is_multicast_org_local..ip::address_v6]
+Determine whether the address is a org-local multicast address.
+
+
+ bool is_multicast_org_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_multicast_site_local ip::address_v6::is_multicast_site_local]
+
+[indexterm2 is_multicast_site_local..ip::address_v6]
+Determine whether the address is a site-local multicast address.
+
+
+ bool is_multicast_site_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_site_local ip::address_v6::is_site_local]
+
+[indexterm2 is_site_local..ip::address_v6]
+Determine whether the address is site local.
+
+
+ bool is_site_local() const;
+
+
+
+[endsect]
+
+
+
+[section:is_unspecified ip::address_v6::is_unspecified]
+
+[indexterm2 is_unspecified..ip::address_v6]
+Determine whether the address is unspecified.
+
+
+ bool is_unspecified() const;
+
+
+
+[endsect]
+
+
+
+[section:is_v4_compatible ip::address_v6::is_v4_compatible]
+
+[indexterm2 is_v4_compatible..ip::address_v6]
+Determine whether the address is an IPv4-compatible address.
+
+
+ bool is_v4_compatible() const;
+
+
+
+[endsect]
+
+
+
+[section:is_v4_mapped ip::address_v6::is_v4_mapped]
+
+[indexterm2 is_v4_mapped..ip::address_v6]
+Determine whether the address is a mapped IPv4 address.
+
+
+ bool is_v4_mapped() const;
+
+
+
+[endsect]
+
+
+
+[section:loopback ip::address_v6::loopback]
+
+[indexterm2 loopback..ip::address_v6]
+Obtain an address object that represents the loopback address.
+
+
+ static address_v6 loopback();
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::address_v6::operator!=]
+
+[indexterm2 operator!=..ip::address_v6]
+Compare two addresses for inequality.
+
+
+ friend bool operator!=(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt_ ip::address_v6::operator<]
+
+[indexterm2 operator<..ip::address_v6]
+Compare addresses for ordering.
+
+
+ friend bool operator<(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ ip::address_v6::operator<<]
+
+[indexterm2 operator<<..ip::address_v6]
+Output an address as a string.
+
+
+ template<
+ typename Elem,
+ typename Traits>
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const address_v6 & addr);
+
+
+Used to output a human-readable string for a specified address.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[addr][The address to be written.]]
+
+]
+
+
+[heading Return Value]
+
+The output stream.
+
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__eq_ ip::address_v6::operator<=]
+
+[indexterm2 operator<=..ip::address_v6]
+Compare addresses for ordering.
+
+
+ friend bool operator<=(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq_ ip::address_v6::operator=]
+
+[indexterm2 operator=..ip::address_v6]
+Assign from another address.
+
+
+ address_v6 & operator=(
+ const address_v6 & other);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::address_v6::operator==]
+
+[indexterm2 operator==..ip::address_v6]
+Compare two addresses for equality.
+
+
+ friend bool operator==(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt_ ip::address_v6::operator>]
+
+[indexterm2 operator>..ip::address_v6]
+Compare addresses for ordering.
+
+
+ friend bool operator>(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt__eq_ ip::address_v6::operator>=]
+
+[indexterm2 operator>=..ip::address_v6]
+Compare addresses for ordering.
+
+
+ friend bool operator>=(
+ const address_v6 & a1,
+ const address_v6 & a2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/address_v6.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:scope_id ip::address_v6::scope_id]
+
+[indexterm2 scope_id..ip::address_v6]
+The scope ID of the address.
+
+
+ unsigned long ``[link boost_asio.reference.ip__address_v6.scope_id.overload1 scope_id]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.scope_id.overload1 more...]]``
+
+ void ``[link boost_asio.reference.ip__address_v6.scope_id.overload2 scope_id]``(
+ unsigned long id);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.scope_id.overload2 more...]]``
+
+
+[section:overload1 ip::address_v6::scope_id (1 of 2 overloads)]
+
+
+The scope ID of the address.
+
+
+ unsigned long scope_id() const;
+
+
+Returns the scope ID associated with the IPv6 address.
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v6::scope_id (2 of 2 overloads)]
+
+
+The scope ID of the address.
+
+
+ void scope_id(
+ unsigned long id);
+
+
+Modifies the scope ID associated with the IPv6 address.
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:to_bytes ip::address_v6::to_bytes]
+
+[indexterm2 to_bytes..ip::address_v6]
+Get the address in bytes, in network byte order.
+
+
+ bytes_type to_bytes() const;
+
+
+
+[endsect]
+
+
+[section:to_string ip::address_v6::to_string]
+
+[indexterm2 to_string..ip::address_v6]
+Get the address as a string.
+
+
+ std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload1 to_string]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.to_string.overload1 more...]]``
+
+ std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__address_v6.to_string.overload2 more...]]``
+
+
+[section:overload1 ip::address_v6::to_string (1 of 2 overloads)]
+
+
+Get the address as a string.
+
+
+ std::string to_string() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address_v6::to_string (2 of 2 overloads)]
+
+
+Get the address as a string.
+
+
+ std::string to_string(
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:to_v4 ip::address_v6::to_v4]
+
+[indexterm2 to_v4..ip::address_v6]
+Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
+
+
+ address_v4 to_v4() const;
+
+
+
+[endsect]
+
+
+
+[section:v4_compatible ip::address_v6::v4_compatible]
+
+[indexterm2 v4_compatible..ip::address_v6]
+Create an IPv4-compatible IPv6 address.
+
+
+ static address_v6 v4_compatible(
+ const address_v4 & addr);
+
+
+
+[endsect]
+
+
+
+[section:v4_mapped ip::address_v6::v4_mapped]
+
+[indexterm2 v4_mapped..ip::address_v6]
+Create an IPv4-mapped IPv6 address.
+
+
+ static address_v6 v4_mapped(
+ const address_v4 & addr);
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__basic_endpoint ip::basic_endpoint]
+
+
+Describes an endpoint for a version-independent IP socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_endpoint
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint.
+
+ Set the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+
+ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
+ [Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+ Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:address ip::basic_endpoint::address]
+
+[indexterm2 address..ip::basic_endpoint]
+Get the IP address associated with the endpoint.
+
+
+ boost::asio::ip::address ``[link boost_asio.reference.ip__basic_endpoint.address.overload1 address]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.address.overload1 more...]]``
+
+
+Set the IP address associated with the endpoint.
+
+
+ void ``[link boost_asio.reference.ip__basic_endpoint.address.overload2 address]``(
+ const boost::asio::ip::address & addr);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.address.overload2 more...]]``
+
+
+[section:overload1 ip::basic_endpoint::address (1 of 2 overloads)]
+
+
+Get the IP address associated with the endpoint.
+
+
+ boost::asio::ip::address address() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_endpoint::address (2 of 2 overloads)]
+
+
+Set the IP address associated with the endpoint.
+
+
+ void address(
+ const boost::asio::ip::address & addr);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_endpoint ip::basic_endpoint::basic_endpoint]
+
+[indexterm2 basic_endpoint..ip::basic_endpoint]
+Default constructor.
+
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 more...]]``
+
+
+Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR\_ANY or in6addr\_any). This constructor would typically be used for accepting new connections.
+
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
+ const InternetProtocol & internet_protocol,
+ unsigned short port_num);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 more...]]``
+
+
+Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
+ const boost::asio::ip::address & addr,
+ unsigned short port_num);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 more...]]``
+
+
+Copy constructor.
+
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
+ const basic_endpoint & other);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 more...]]``
+
+
+[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+
+
+Default constructor.
+
+
+ basic_endpoint();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+
+
+Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR\_ANY or in6addr\_any). This constructor would typically be used for accepting new connections.
+
+
+ basic_endpoint(
+ const InternetProtocol & internet_protocol,
+ unsigned short port_num);
+
+
+
+[heading Examples]
+
+To initialise an IPv4 TCP endpoint for port 1234, use:
+
+ boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), 1234);
+
+
+
+
+To specify an IPv6 UDP endpoint for port 9876, use:
+
+ boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)]
+
+
+Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+
+ basic_endpoint(
+ const boost::asio::ip::address & addr,
+ unsigned short port_num);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)]
+
+
+Copy constructor.
+
+
+ basic_endpoint(
+ const basic_endpoint & other);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:capacity ip::basic_endpoint::capacity]
+
+[indexterm2 capacity..ip::basic_endpoint]
+Get the capacity of the endpoint in the native type.
+
+
+ std::size_t capacity() const;
+
+
+
+[endsect]
+
+
+[section:data ip::basic_endpoint::data]
+
+[indexterm2 data..ip::basic_endpoint]
+Get the underlying endpoint in the native type.
+
+
+ data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload1 data]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.data.overload1 more...]]``
+
+ const data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload2 data]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.data.overload2 more...]]``
+
+
+[section:overload1 ip::basic_endpoint::data (1 of 2 overloads)]
+
+
+Get the underlying endpoint in the native type.
+
+
+ data_type * data();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_endpoint::data (2 of 2 overloads)]
+
+
+Get the underlying endpoint in the native type.
+
+
+ const data_type * data() const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:data_type ip::basic_endpoint::data_type]
+
+[indexterm2 data_type..ip::basic_endpoint]
+The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+
+
+ typedef implementation_defined data_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::basic_endpoint::operator!=]
+
+[indexterm2 operator!=..ip::basic_endpoint]
+Compare two endpoints for inequality.
+
+
+ friend bool operator!=(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt_ ip::basic_endpoint::operator<]
+
+[indexterm2 operator<..ip::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator<(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ ip::basic_endpoint::operator<<]
+
+[indexterm2 operator<<..ip::basic_endpoint]
+Output an endpoint as a string.
+
+
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const basic_endpoint< InternetProtocol > & endpoint);
+
+
+Used to output a human-readable string for a specified endpoint.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[endpoint][The endpoint to be written.]]
+
+]
+
+
+[heading Return Value]
+
+The output stream.
+
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__eq_ ip::basic_endpoint::operator<=]
+
+[indexterm2 operator<=..ip::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator<=(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq_ ip::basic_endpoint::operator=]
+
+[indexterm2 operator=..ip::basic_endpoint]
+Assign from another endpoint.
+
+
+ basic_endpoint & operator=(
+ const basic_endpoint & other);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::basic_endpoint::operator==]
+
+[indexterm2 operator==..ip::basic_endpoint]
+Compare two endpoints for equality.
+
+
+ friend bool operator==(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt_ ip::basic_endpoint::operator>]
+
+[indexterm2 operator>..ip::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator>(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt__eq_ ip::basic_endpoint::operator>=]
+
+[indexterm2 operator>=..ip::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator>=(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:port ip::basic_endpoint::port]
+
+[indexterm2 port..ip::basic_endpoint]
+Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+
+ unsigned short ``[link boost_asio.reference.ip__basic_endpoint.port.overload1 port]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.port.overload1 more...]]``
+
+
+Set the port associated with the endpoint. The port number is always in the host's byte order.
+
+
+ void ``[link boost_asio.reference.ip__basic_endpoint.port.overload2 port]``(
+ unsigned short port_num);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_endpoint.port.overload2 more...]]``
+
+
+[section:overload1 ip::basic_endpoint::port (1 of 2 overloads)]
+
+
+Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+
+ unsigned short port() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_endpoint::port (2 of 2 overloads)]
+
+
+Set the port associated with the endpoint. The port number is always in the host's byte order.
+
+
+ void port(
+ unsigned short port_num);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:protocol ip::basic_endpoint::protocol]
+
+[indexterm2 protocol..ip::basic_endpoint]
+The protocol associated with the endpoint.
+
+
+ protocol_type protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::basic_endpoint::protocol_type]
+
+[indexterm2 protocol_type..ip::basic_endpoint]
+The protocol type associated with the endpoint.
+
+
+ typedef InternetProtocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:resize ip::basic_endpoint::resize]
+
+[indexterm2 resize..ip::basic_endpoint]
+Set the underlying size of the endpoint in the native type.
+
+
+ void resize(
+ std::size_t new_size);
+
+
+
+[endsect]
+
+
+
+[section:size ip::basic_endpoint::size]
+
+[indexterm2 size..ip::basic_endpoint]
+Get the underlying size of the endpoint in the native type.
+
+
+ std::size_t size() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__basic_resolver ip::basic_resolver]
+
+
+Provides endpoint resolution functionality.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``,
+ typename ``[link boost_asio.reference.ResolverService ResolverService]`` = resolver_service<InternetProtocol>>
+ class basic_resolver :
+ public basic_io_object< ResolverService >
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously perform forward resolution of a query to a list of entries.
+
+ Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
+ [Perform forward resolution of a query to a list of entries.
+
+ Perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:async_resolve ip::basic_resolver::async_resolve]
+
+[indexterm2 async_resolve..ip::basic_resolver]
+Asynchronously perform forward resolution of a query to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void ``[link boost_asio.reference.ip__basic_resolver.async_resolve.overload1 async_resolve]``(
+ const query & q,
+ ResolveHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.async_resolve.overload1 more...]]``
+
+
+Asynchronously perform reverse resolution of an endpoint to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void ``[link boost_asio.reference.ip__basic_resolver.async_resolve.overload2 async_resolve]``(
+ const endpoint_type & e,
+ ResolveHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.async_resolve.overload2 more...]]``
+
+
+[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)]
+
+
+Asynchronously perform forward resolution of a query to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void async_resolve(
+ const query & q,
+ ResolveHandler handler);
+
+
+This function is used to asynchronously resolve a query into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[q][A query object that determines what endpoints will be returned.]]
+
+[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ resolver::iterator iterator // Forward-only iterator that can
+ // be used to traverse the list
+ // of endpoint entries.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful resolve operation is guaranteed to pass at least one entry to the handler.
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver::async_resolve (2 of 2 overloads)]
+
+
+Asynchronously perform reverse resolution of an endpoint to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void async_resolve(
+ const endpoint_type & e,
+ ResolveHandler handler);
+
+
+This function is used to asynchronously resolve an endpoint into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[e][An endpoint object that determines what endpoints will be returned.]]
+
+[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ resolver::iterator iterator // Forward-only iterator that can
+ // be used to traverse the list
+ // of endpoint entries.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
+]
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful resolve operation is guaranteed to pass at least one entry to the handler.
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:basic_resolver ip::basic_resolver::basic_resolver]
+
+[indexterm2 basic_resolver..ip::basic_resolver]
+Constructor.
+
+
+ basic_resolver(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`].
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]]
+
+]
+
+
+
+
+[endsect]
+
+
+
+[section:cancel ip::basic_resolver::cancel]
+
+[indexterm2 cancel..ip::basic_resolver]
+Cancel any asynchronous operations that are waiting on the resolver.
+
+
+ void cancel();
+
+
+This function forces the completion of any pending asynchronous operations on the host resolver. The handler for each cancelled operation will be invoked with the `boost::asio::error::operation_aborted` error code.
+
+
+[endsect]
+
+
+
+[section:endpoint_type ip::basic_resolver::endpoint_type]
+
+[indexterm2 endpoint_type..ip::basic_resolver]
+The endpoint type.
+
+
+ typedef InternetProtocol::endpoint endpoint_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:get_io_service ip::basic_resolver::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..ip::basic_resolver]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+
+
+
+
+[endsect]
+
+
+
+[section:implementation ip::basic_resolver::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..ip::basic_resolver]
+The underlying implementation of the I/O object.
+
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type ip::basic_resolver::implementation_type]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation_type..ip::basic_resolver]
+The underlying implementation type of I/O object.
+
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:iterator ip::basic_resolver::iterator]
+
+[indexterm2 iterator..ip::basic_resolver]
+The iterator type.
+
+
+ typedef basic_resolver_iterator< InternetProtocol > iterator;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo.
+
+ Create an iterator from an endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
+
+ Increment operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+
+ const basic_resolver_entry<InternetProtocol>
+
+
+
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::basic_resolver::protocol_type]
+
+[indexterm2 protocol_type..ip::basic_resolver]
+The protocol type.
+
+
+ typedef InternetProtocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:query ip::basic_resolver::query]
+
+[indexterm2 query..ip::basic_resolver]
+The query type.
+
+
+ typedef basic_resolver_query< InternetProtocol > query;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol.
+
+ Construct with specified service name for a given protocol.
+
+ Construct with specified host name and service name for any protocol.
+
+ Construct with specified host name and service name for a given protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
+ [Get the service name associated with the query. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:resolve ip::basic_resolver::resolve]
+
+[indexterm2 resolve..ip::basic_resolver]
+Perform forward resolution of a query to a list of entries.
+
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
+ const query & q);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload1 more...]]``
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload2 resolve]``(
+ const query & q,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload2 more...]]``
+
+
+Perform reverse resolution of an endpoint to a list of entries.
+
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload3 resolve]``(
+ const endpoint_type & e);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload3 more...]]``
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload4 resolve]``(
+ const endpoint_type & e,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver.resolve.overload4 more...]]``
+
+
+[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)]
+
+
+Perform forward resolution of a query to a list of entries.
+
+
+ iterator resolve(
+ const query & q);
+
+
+This function is used to resolve a query into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[q][A query object that determines what endpoints will be returned.]]
+
+]
+
+
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful call to this function is guaranteed to return at least one entry.
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver::resolve (2 of 4 overloads)]
+
+
+Perform forward resolution of a query to a list of entries.
+
+
+ iterator resolve(
+ const query & q,
+ boost::system::error_code & ec);
+
+
+This function is used to resolve a query into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[q][A query object that determines what endpoints will be returned.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful call to this function is guaranteed to return at least one entry.
+
+
+[endsect]
+
+
+
+[section:overload3 ip::basic_resolver::resolve (3 of 4 overloads)]
+
+
+Perform reverse resolution of an endpoint to a list of entries.
+
+
+ iterator resolve(
+ const endpoint_type & e);
+
+
+This function is used to resolve an endpoint into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[e][An endpoint object that determines what endpoints will be returned.]]
+
+]
+
+
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful call to this function is guaranteed to return at least one entry.
+
+
+[endsect]
+
+
+
+[section:overload4 ip::basic_resolver::resolve (4 of 4 overloads)]
+
+
+Perform reverse resolution of an endpoint to a list of entries.
+
+
+ iterator resolve(
+ const endpoint_type & e,
+ boost::system::error_code & ec);
+
+
+This function is used to resolve an endpoint into a list of endpoint entries.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[e][An endpoint object that determines what endpoints will be returned.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries. Returns a default constructed iterator if an error occurs.
+
+
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
+
+A successful call to this function is guaranteed to return at least one entry.
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:service ip::basic_resolver::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..ip::basic_resolver]
+The service associated with the I/O object.
+
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type ip::basic_resolver::service_type]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service_type..ip::basic_resolver]
+The type of the service that will be used to provide I/O operations.
+
+
+ typedef ResolverService service_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__basic_resolver_entry ip::basic_resolver_entry]
+
+
+An entry produced by a resolver.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_entry
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]]
+ [The endpoint type associated with the endpoint entry. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint entry. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry [*basic_resolver_entry]]]
+ [Default constructor.
+
+ Construct with specified endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_entry.endpoint [*endpoint]]]
+ [Get the endpoint associated with the entry. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_entry.host_name [*host_name]]]
+ [Get the host name associated with the entry. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_entry.operator_endpoint_type [*operator endpoint_type]]]
+ [Convert to the endpoint associated with the entry. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_entry.service_name [*service_name]]]
+ [Get the service name associated with the entry. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_entry `ip::basic_resolver_entry`] class template describes an entry as returned by a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:basic_resolver_entry ip::basic_resolver_entry::basic_resolver_entry]
+
+[indexterm2 basic_resolver_entry..ip::basic_resolver_entry]
+Default constructor.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 basic_resolver_entry]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 more...]]``
+
+
+Construct with specified endpoint, host name and service name.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload2 basic_resolver_entry]``(
+ const endpoint_type & ep,
+ const std::string & host,
+ const std::string & service);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload2 more...]]``
+
+
+[section:overload1 ip::basic_resolver_entry::basic_resolver_entry (1 of 2 overloads)]
+
+
+Default constructor.
+
+
+ basic_resolver_entry();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads)]
+
+
+Construct with specified endpoint, host name and service name.
+
+
+ basic_resolver_entry(
+ const endpoint_type & ep,
+ const std::string & host,
+ const std::string & service);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:endpoint ip::basic_resolver_entry::endpoint]
+
+[indexterm2 endpoint..ip::basic_resolver_entry]
+Get the endpoint associated with the entry.
+
+
+ endpoint_type endpoint() const;
+
+
+
+[endsect]
+
+
+
+[section:endpoint_type ip::basic_resolver_entry::endpoint_type]
+
+[indexterm2 endpoint_type..ip::basic_resolver_entry]
+The endpoint type associated with the endpoint entry.
+
+
+ typedef InternetProtocol::endpoint endpoint_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:host_name ip::basic_resolver_entry::host_name]
+
+[indexterm2 host_name..ip::basic_resolver_entry]
+Get the host name associated with the entry.
+
+
+ std::string host_name() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type]
+
+[indexterm2 operator endpoint_type..ip::basic_resolver_entry]
+Convert to the endpoint associated with the entry.
+
+
+ operator endpoint_type() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::basic_resolver_entry::protocol_type]
+
+[indexterm2 protocol_type..ip::basic_resolver_entry]
+The protocol type associated with the endpoint entry.
+
+
+ typedef InternetProtocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_entry.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:service_name ip::basic_resolver_entry::service_name]
+
+[indexterm2 service_name..ip::basic_resolver_entry]
+Get the service name associated with the entry.
+
+
+ std::string service_name() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__basic_resolver_iterator ip::basic_resolver_iterator]
+
+
+An iterator over the entries produced by a resolver.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_iterator
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo.
+
+ Create an iterator from an endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
+
+ Increment operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+
+ const basic_resolver_entry<InternetProtocol>
+
+
+
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator]
+
+[indexterm2 basic_resolver_iterator..ip::basic_resolver_iterator]
+Default constructor creates an end iterator.
+
+
+ basic_resolver_iterator();
+
+
+
+[endsect]
+
+
+[section:create ip::basic_resolver_iterator::create]
+
+[indexterm2 create..ip::basic_resolver_iterator]
+Create an iterator from an addrinfo list returned by getaddrinfo.
+
+
+ static basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.create.overload1 create]``(
+ boost::asio::detail::addrinfo_type * address_info,
+ const std::string & host_name,
+ const std::string & service_name);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.create.overload1 more...]]``
+
+
+Create an iterator from an endpoint, host name and service name.
+
+
+ static basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.create.overload2 create]``(
+ const typename InternetProtocol::endpoint & endpoint,
+ const std::string & host_name,
+ const std::string & service_name);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.create.overload2 more...]]``
+
+
+[section:overload1 ip::basic_resolver_iterator::create (1 of 2 overloads)]
+
+
+Create an iterator from an addrinfo list returned by getaddrinfo.
+
+
+ static basic_resolver_iterator create(
+ boost::asio::detail::addrinfo_type * address_info,
+ const std::string & host_name,
+ const std::string & service_name);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver_iterator::create (2 of 2 overloads)]
+
+
+Create an iterator from an endpoint, host name and service name.
+
+
+ static basic_resolver_iterator create(
+ const typename InternetProtocol::endpoint & endpoint,
+ const std::string & host_name,
+ const std::string & service_name);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:operator__star_ ip::basic_resolver_iterator::operator *]
+
+[indexterm2 operator *..ip::basic_resolver_iterator]
+Dereference an iterator.
+
+
+ const basic_resolver_entry< InternetProtocol > & operator *() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::basic_resolver_iterator::operator!=]
+
+[indexterm2 operator!=..ip::basic_resolver_iterator]
+Test two iterators for inequality.
+
+
+ friend bool operator!=(
+ const basic_resolver_iterator & a,
+ const basic_resolver_iterator & b);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:operator_plus__plus_ ip::basic_resolver_iterator::operator++]
+
+[indexterm2 operator++..ip::basic_resolver_iterator]
+Increment operator (prefix).
+
+
+ basic_resolver_iterator & ``[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload1 operator++]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload1 more...]]``
+
+
+Increment operator (postfix).
+
+
+ basic_resolver_iterator ``[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload2 operator++]``(
+ int );
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_.overload2 more...]]``
+
+
+[section:overload1 ip::basic_resolver_iterator::operator++ (1 of 2 overloads)]
+
+
+Increment operator (prefix).
+
+
+ basic_resolver_iterator & operator++();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver_iterator::operator++ (2 of 2 overloads)]
+
+
+Increment operator (postfix).
+
+
+ basic_resolver_iterator operator++(
+ int );
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:operator_arrow_ ip::basic_resolver_iterator::operator->]
+
+[indexterm2 operator->..ip::basic_resolver_iterator]
+Dereference an iterator.
+
+
+ const basic_resolver_entry< InternetProtocol > * operator->() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::basic_resolver_iterator::operator==]
+
+[indexterm2 operator==..ip::basic_resolver_iterator]
+Test two iterators for equality.
+
+
+ friend bool operator==(
+ const basic_resolver_iterator & a,
+ const basic_resolver_iterator & b);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_iterator.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__basic_resolver_query ip::basic_resolver_query]
+
+
+An query to be passed to a resolver.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_query :
+ public ip::resolver_query_base
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol.
+
+ Construct with specified service name for a given protocol.
+
+ Construct with specified host name and service name for any protocol.
+
+ Construct with specified host name and service name for a given protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
+ [Get the service name associated with the query. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:address_configured ip::basic_resolver_query::address_configured]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 address_configured..ip::basic_resolver_query]
+Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
+
+
+ static const flags address_configured = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:all_matching ip::basic_resolver_query::all_matching]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 all_matching..ip::basic_resolver_query]
+If used with v4\_mapped, return all matching IPv6 and IPv4 addresses.
+
+
+ static const flags all_matching = implementation_defined;
+
+
+
+[endsect]
+
+
+[section:basic_resolver_query ip::basic_resolver_query::basic_resolver_query]
+
+[indexterm2 basic_resolver_query..ip::basic_resolver_query]
+Construct with specified service name for any protocol.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload1 basic_resolver_query]``(
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = passive|address_configured);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload1 more...]]``
+
+
+Construct with specified service name for a given protocol.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 basic_resolver_query]``(
+ const protocol_type & protocol,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = passive|address_configured);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 more...]]``
+
+
+Construct with specified host name and service name for any protocol.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload3 basic_resolver_query]``(
+ const std::string & host,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = address_configured);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload3 more...]]``
+
+
+Construct with specified host name and service name for a given protocol.
+
+
+ ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload4 basic_resolver_query]``(
+ const protocol_type & protocol,
+ const std::string & host,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = address_configured);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload4 more...]]``
+
+
+[section:overload1 ip::basic_resolver_query::basic_resolver_query (1 of 4 overloads)]
+
+
+Construct with specified service name for any protocol.
+
+
+ basic_resolver_query(
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = passive|address_configured);
+
+
+This constructor is typically used to perform name resolution for local service binding.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.]]
+
+[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.]]
+
+]
+
+
+[heading Remarks]
+
+On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads)]
+
+
+Construct with specified service name for a given protocol.
+
+
+ basic_resolver_query(
+ const protocol_type & protocol,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = passive|address_configured);
+
+
+This constructor is typically used to perform name resolution for local service binding with a specific protocol version.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]]
+
+[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.]]
+
+[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.]]
+
+]
+
+
+[heading Remarks]
+
+On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads)]
+
+
+Construct with specified host name and service name for any protocol.
+
+
+ basic_resolver_query(
+ const std::string & host,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = address_configured);
+
+
+This constructor is typically used to perform name resolution for communication with remote hosts.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]]
+
+[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]]
+
+[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]]
+
+]
+
+
+[heading Remarks]
+
+On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows).
+
+On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
+
+
+[endsect]
+
+
+
+[section:overload4 ip::basic_resolver_query::basic_resolver_query (4 of 4 overloads)]
+
+
+Construct with specified host name and service name for a given protocol.
+
+
+ basic_resolver_query(
+ const protocol_type & protocol,
+ const std::string & host,
+ const std::string & service,
+ resolver_query_base::flags resolve_flags = address_configured);
+
+
+This constructor is typically used to perform name resolution for communication with remote hosts.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.]]
+
+[[host][A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.]]
+
+[[service][A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.]]
+
+[[resolve_flags][A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.]]
+
+]
+
+
+[heading Remarks]
+
+On POSIX systems, host names may be locally defined in the file `/etc/hosts`. On Windows, host names may be defined in the file `c:\windows\system32\drivers\etc\hosts`. Remote host name resolution is performed using DNS. Operating systems may use additional locations when resolving host names (such as NETBIOS names on Windows).
+
+On POSIX systems, service names are typically defined in the file `/etc/services`. On Windows, service names may be found in the file `c:\windows\system32\drivers\etc\services`. Operating systems may use additional locations when resolving service names.
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:canonical_name ip::basic_resolver_query::canonical_name]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 canonical_name..ip::basic_resolver_query]
+Determine the canonical name of the host specified in the query.
+
+
+ static const flags canonical_name = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:flags ip::basic_resolver_query::flags]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 flags..ip::basic_resolver_query]
+A bitmask type (C++ Std [lib.bitmask.types]).
+
+
+ typedef unspecified flags;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:hints ip::basic_resolver_query::hints]
+
+[indexterm2 hints..ip::basic_resolver_query]
+Get the hints associated with the query.
+
+
+ const boost::asio::detail::addrinfo_type & hints() const;
+
+
+
+[endsect]
+
+
+
+[section:host_name ip::basic_resolver_query::host_name]
+
+[indexterm2 host_name..ip::basic_resolver_query]
+Get the host name associated with the query.
+
+
+ std::string host_name() const;
+
+
+
+[endsect]
+
+
+
+[section:numeric_host ip::basic_resolver_query::numeric_host]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 numeric_host..ip::basic_resolver_query]
+Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
+
+
+ static const flags numeric_host = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:numeric_service ip::basic_resolver_query::numeric_service]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 numeric_service..ip::basic_resolver_query]
+Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
+
+
+ static const flags numeric_service = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:passive ip::basic_resolver_query::passive]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 passive..ip::basic_resolver_query]
+Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+
+
+ static const flags passive = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::basic_resolver_query::protocol_type]
+
+[indexterm2 protocol_type..ip::basic_resolver_query]
+The protocol type associated with the endpoint query.
+
+
+ typedef InternetProtocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/basic_resolver_query.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:service_name ip::basic_resolver_query::service_name]
+
+[indexterm2 service_name..ip::basic_resolver_query]
+Get the service name associated with the query.
+
+
+ std::string service_name() const;
+
+
+
+[endsect]
+
+
+
+[section:v4_mapped ip::basic_resolver_query::v4_mapped]
+
+
+['Inherited from ip::resolver_query_base.]
+
+[indexterm2 v4_mapped..ip::basic_resolver_query]
+If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
+
+
+ static const flags v4_mapped = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__host_name ip::host_name]
+
+[indexterm1 ip::host_name]
+Get the current host name.
+
+
+ std::string ``[link boost_asio.reference.ip__host_name.overload1 host_name]``();
+ `` [''''&raquo;''' [link boost_asio.reference.ip__host_name.overload1 more...]]``
+
+ std::string ``[link boost_asio.reference.ip__host_name.overload2 host_name]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__host_name.overload2 more...]]``
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/host_name.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:overload1 ip::host_name (1 of 2 overloads)]
+
+
+Get the current host name.
+
+
+ std::string host_name();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::host_name (2 of 2 overloads)]
+
+
+Get the current host name.
+
+
+ std::string host_name(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:ip__icmp ip::icmp]
+
+
+Encapsulates the flags needed for ICMP.
+
+
+ class icmp
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__icmp.endpoint [*endpoint]]]
+ [The type of a ICMP endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__icmp.resolver [*resolver]]]
+ [The ICMP resolver type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__icmp.socket [*socket]]]
+ [The ICMP socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__icmp.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__icmp.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__icmp.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__icmp.v4 [*v4]]]
+ [Construct to represent the IPv4 ICMP protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__icmp.v6 [*v6]]]
+ [Construct to represent the IPv6 ICMP protocol. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__icmp.operator_not__eq_ [*operator!=]]]
+ [Compare two protocols for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__icmp.operator_eq__eq_ [*operator==]]]
+ [Compare two protocols for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__icmp `ip::icmp`] class contains flags necessary for ICMP sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:endpoint ip::icmp::endpoint]
+
+[indexterm2 endpoint..ip::icmp]
+The type of a ICMP endpoint.
+
+
+ typedef basic_endpoint< icmp > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint.
+
+ Set the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+
+ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
+ [Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+ Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:family ip::icmp::family]
+
+[indexterm2 family..ip::icmp]
+Obtain an identifier for the protocol family.
+
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::icmp::operator!=]
+
+[indexterm2 operator!=..ip::icmp]
+Compare two protocols for inequality.
+
+
+ friend bool operator!=(
+ const icmp & p1,
+ const icmp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::icmp::operator==]
+
+[indexterm2 operator==..ip::icmp]
+Compare two protocols for equality.
+
+
+ friend bool operator==(
+ const icmp & p1,
+ const icmp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol ip::icmp::protocol]
+
+[indexterm2 protocol..ip::icmp]
+Obtain an identifier for the protocol.
+
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:resolver ip::icmp::resolver]
+
+[indexterm2 resolver..ip::icmp]
+The ICMP resolver type.
+
+
+ typedef basic_resolver< icmp > resolver;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously perform forward resolution of a query to a list of entries.
+
+ Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
+ [Perform forward resolution of a query to a list of entries.
+
+ Perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:socket ip::icmp::socket]
+
+[indexterm2 socket..ip::icmp]
+The ICMP socket type.
+
+
+ typedef basic_raw_socket< icmp > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_raw_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.basic_raw_socket [*basic_raw_socket]]]
+ [Construct a basic_raw_socket without opening it.
+
+ Construct and open a basic_raw_socket.
+
+ Construct a basic_raw_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_raw_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.receive [*receive]]]
+ [Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.receive_from [*receive_from]]]
+ [Receive raw data with the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.send [*send]]]
+ [Send some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.send_to [*send_to]]]
+ [Send raw data to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_raw_socket `basic_raw_socket`] class template provides asynchronous and blocking raw-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/icmp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:type ip::icmp::type]
+
+[indexterm2 type..ip::icmp]
+Obtain an identifier for the type of the protocol.
+
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[section:v4 ip::icmp::v4]
+
+[indexterm2 v4..ip::icmp]
+Construct to represent the IPv4 ICMP protocol.
+
+
+ static icmp v4();
+
+
+
+[endsect]
+
+
+
+[section:v6 ip::icmp::v6]
+
+[indexterm2 v6..ip::icmp]
+Construct to represent the IPv6 ICMP protocol.
+
+
+ static icmp v6();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:ip__multicast__enable_loopback ip::multicast::enable_loopback]
+
+[indexterm1 ip::multicast::enable_loopback]
+Socket option determining whether outgoing multicast packets will be received on the same socket if it is a member of the multicast group.
+
+
+ typedef implementation_defined enable_loopback;
+
+
+
+Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::enable_loopback option(true);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::enable_loopback option;
+ socket.get_option(option);
+ bool is_set = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/multicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:ip__multicast__hops ip::multicast::hops]
+
+[indexterm1 ip::multicast::hops]
+Socket option for time-to-live associated with outgoing multicast packets.
+
+
+ typedef implementation_defined hops;
+
+
+
+Implements the IPPROTO\_IP/IP\_MULTICAST\_TTL socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::hops option(4);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::hops option;
+ socket.get_option(option);
+ int ttl = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/multicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:ip__multicast__join_group ip::multicast::join_group]
+
+[indexterm1 ip::multicast::join_group]
+Socket option to join a multicast group on a specified interface.
+
+
+ typedef implementation_defined join_group;
+
+
+
+Implements the IPPROTO\_IP/IP\_ADD\_MEMBERSHIP socket option.
+
+
+[heading Examples]
+
+Setting the option to join a multicast group:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::address multicast_address =
+ boost::asio::ip::address::from_string("225.0.0.1");
+ boost::asio::ip::multicast::join_group option(multicast_address);
+ socket.set_option(option);
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/multicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:ip__multicast__leave_group ip::multicast::leave_group]
+
+[indexterm1 ip::multicast::leave_group]
+Socket option to leave a multicast group on a specified interface.
+
+
+ typedef implementation_defined leave_group;
+
+
+
+Implements the IPPROTO\_IP/IP\_DROP\_MEMBERSHIP socket option.
+
+
+[heading Examples]
+
+Setting the option to leave a multicast group:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::address multicast_address =
+ boost::asio::ip::address::from_string("225.0.0.1");
+ boost::asio::ip::multicast::leave_group option(multicast_address);
+ socket.set_option(option);
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/multicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:ip__multicast__outbound_interface ip::multicast::outbound_interface]
+
+[indexterm1 ip::multicast::outbound_interface]
+Socket option for local interface to use for outgoing multicast packets.
+
+
+ typedef implementation_defined outbound_interface;
+
+
+
+Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::address_v4 local_interface =
+ boost::asio::ip::address_v4::from_string("1.2.3.4");
+ boost::asio::ip::multicast::outbound_interface option(local_interface);
+ socket.set_option(option);
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/multicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:ip__resolver_query_base ip::resolver_query_base]
+
+
+The [link boost_asio.reference.ip__resolver_query_base `ip::resolver_query_base`] class is used as a base for the [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class templates to provide a common place to define the flag constants.
+
+
+ class resolver_query_base
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_query_base.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base._resolver_query_base [*~resolver_query_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_query_base.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_query_base.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:address_configured ip::resolver_query_base::address_configured]
+
+[indexterm2 address_configured..ip::resolver_query_base]
+Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
+
+
+ static const flags address_configured = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:all_matching ip::resolver_query_base::all_matching]
+
+[indexterm2 all_matching..ip::resolver_query_base]
+If used with v4\_mapped, return all matching IPv6 and IPv4 addresses.
+
+
+ static const flags all_matching = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:canonical_name ip::resolver_query_base::canonical_name]
+
+[indexterm2 canonical_name..ip::resolver_query_base]
+Determine the canonical name of the host specified in the query.
+
+
+ static const flags canonical_name = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:flags ip::resolver_query_base::flags]
+
+[indexterm2 flags..ip::resolver_query_base]
+A bitmask type (C++ Std [lib.bitmask.types]).
+
+
+ typedef unspecified flags;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_query_base.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:numeric_host ip::resolver_query_base::numeric_host]
+
+[indexterm2 numeric_host..ip::resolver_query_base]
+Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
+
+
+ static const flags numeric_host = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:numeric_service ip::resolver_query_base::numeric_service]
+
+[indexterm2 numeric_service..ip::resolver_query_base]
+Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
+
+
+ static const flags numeric_service = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:passive ip::resolver_query_base::passive]
+
+[indexterm2 passive..ip::resolver_query_base]
+Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+
+
+ static const flags passive = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:v4_mapped ip::resolver_query_base::v4_mapped]
+
+[indexterm2 v4_mapped..ip::resolver_query_base]
+If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
+
+
+ static const flags v4_mapped = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:_resolver_query_base ip::resolver_query_base::~resolver_query_base]
+
+[indexterm2 ~resolver_query_base..ip::resolver_query_base]
+Protected destructor to prevent deletion through this type.
+
+
+ ~resolver_query_base();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__resolver_service ip::resolver_service]
+
+
+Default service implementation for a resolver.
+
+
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class resolver_service :
+ public io_service::service
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_service.implementation_type [*implementation_type]]]
+ [The type of a resolver implementation. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_service.iterator_type [*iterator_type]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__resolver_service.query_type [*query_type]]]
+ [The query type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.async_resolve [*async_resolve]]]
+ [Asynchronously resolve a query to a list of entries.
+
+ Asynchronously resolve an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.cancel [*cancel]]]
+ [Cancel pending asynchronous operations. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.construct [*construct]]]
+ [Construct a new resolver implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.destroy [*destroy]]]
+ [Destroy a resolver implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.resolve [*resolve]]]
+ [Resolve a query to a list of entries.
+
+ Resolve an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.resolver_service [*resolver_service]]]
+ [Construct a new resolver service for the specified io_service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__resolver_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:async_resolve ip::resolver_service::async_resolve]
+
+[indexterm2 async_resolve..ip::resolver_service]
+Asynchronously resolve a query to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ void ``[link boost_asio.reference.ip__resolver_service.async_resolve.overload1 async_resolve]``(
+ implementation_type & impl,
+ const query_type & query,
+ Handler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.async_resolve.overload1 more...]]``
+
+
+Asynchronously resolve an endpoint to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void ``[link boost_asio.reference.ip__resolver_service.async_resolve.overload2 async_resolve]``(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ ResolveHandler handler);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.async_resolve.overload2 more...]]``
+
+
+[section:overload1 ip::resolver_service::async_resolve (1 of 2 overloads)]
+
+
+Asynchronously resolve a query to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ void async_resolve(
+ implementation_type & impl,
+ const query_type & query,
+ Handler handler);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::resolver_service::async_resolve (2 of 2 overloads)]
+
+
+Asynchronously resolve an endpoint to a list of entries.
+
+
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void async_resolve(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ ResolveHandler handler);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:cancel ip::resolver_service::cancel]
+
+[indexterm2 cancel..ip::resolver_service]
+Cancel pending asynchronous operations.
+
+
+ void cancel(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:construct ip::resolver_service::construct]
+
+[indexterm2 construct..ip::resolver_service]
+Construct a new resolver implementation.
+
+
+ void construct(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:destroy ip::resolver_service::destroy]
+
+[indexterm2 destroy..ip::resolver_service]
+Destroy a resolver implementation.
+
+
+ void destroy(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:endpoint_type ip::resolver_service::endpoint_type]
+
+[indexterm2 endpoint_type..ip::resolver_service]
+The endpoint type.
+
+
+ typedef InternetProtocol::endpoint endpoint_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:get_io_service ip::resolver_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..ip::resolver_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:id ip::resolver_service::id]
+
+[indexterm2 id..ip::resolver_service]
+The unique service identifier.
+
+
+ static boost::asio::io_service::id id;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type ip::resolver_service::implementation_type]
+
+[indexterm2 implementation_type..ip::resolver_service]
+The type of a resolver implementation.
+
+
+ typedef implementation_defined implementation_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:iterator_type ip::resolver_service::iterator_type]
+
+[indexterm2 iterator_type..ip::resolver_service]
+The iterator type.
+
+
+ typedef basic_resolver_iterator< InternetProtocol > iterator_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo.
+
+ Create an iterator from an endpoint, host name and service name. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator__star_ [*operator *]]]
+ [Dereference an iterator. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_plus__plus_ [*operator++]]]
+ [Increment operator (prefix).
+
+ Increment operator (postfix). ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_arrow_ [*operator->]]]
+ [Dereference an iterator. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_not__eq_ [*operator!=]]]
+ [Test two iterators for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_iterator.operator_eq__eq_ [*operator==]]]
+ [Test two iterators for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_iterator `ip::basic_resolver_iterator`] class template is used to define iterators over the results returned by a resolver.
+
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+
+ const basic_resolver_entry<InternetProtocol>
+
+
+
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::resolver_service::protocol_type]
+
+[indexterm2 protocol_type..ip::resolver_service]
+The protocol type.
+
+
+ typedef InternetProtocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:query_type ip::resolver_service::query_type]
+
+[indexterm2 query_type..ip::resolver_service]
+The query type.
+
+
+ typedef basic_resolver_query< InternetProtocol > query_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.flags [*flags]]]
+ [A bitmask type (C++ Std \[lib.bitmask.types\]). ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol.
+
+ Construct with specified service name for a given protocol.
+
+ Construct with specified host name and service name for any protocol.
+
+ Construct with specified host name and service name for a given protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
+ [Get the service name associated with the query. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.address_configured [*address_configured]]]
+ [Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
+ [Determine the canonical name of the host specified in the query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver_query `ip::basic_resolver_query`] class template describes a query that can be passed to a resolver.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/resolver_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:resolve ip::resolver_service::resolve]
+
+[indexterm2 resolve..ip::resolver_service]
+Resolve a query to a list of entries.
+
+
+ iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload1 resolve]``(
+ implementation_type & impl,
+ const query_type & query,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.resolve.overload1 more...]]``
+
+
+Resolve an endpoint to a list of entries.
+
+
+ iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload2 resolve]``(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.ip__resolver_service.resolve.overload2 more...]]``
+
+
+[section:overload1 ip::resolver_service::resolve (1 of 2 overloads)]
+
+
+Resolve a query to a list of entries.
+
+
+ iterator_type resolve(
+ implementation_type & impl,
+ const query_type & query,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::resolver_service::resolve (2 of 2 overloads)]
+
+
+Resolve an endpoint to a list of entries.
+
+
+ iterator_type resolve(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:resolver_service ip::resolver_service::resolver_service]
+
+[indexterm2 resolver_service..ip::resolver_service]
+Construct a new resolver service for the specified [link boost_asio.reference.io_service `io_service`].
+
+
+ resolver_service(
+ boost::asio::io_service & io_service);
+
+
+
+[endsect]
+
+
+
+[section:shutdown_service ip::resolver_service::shutdown_service]
+
+[indexterm2 shutdown_service..ip::resolver_service]
+Destroy all user-defined handler objects owned by the service.
+
+
+ virtual void shutdown_service();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__tcp ip::tcp]
+
+
+Encapsulates the flags needed for TCP.
+
+
+ class tcp
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.acceptor [*acceptor]]]
+ [The TCP acceptor type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.endpoint [*endpoint]]]
+ [The type of a TCP endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.iostream [*iostream]]]
+ [The TCP iostream type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.no_delay [*no_delay]]]
+ [Socket option for disabling the Nagle algorithm. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.resolver [*resolver]]]
+ [The TCP resolver type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.socket [*socket]]]
+ [The TCP socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__tcp.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__tcp.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__tcp.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__tcp.v4 [*v4]]]
+ [Construct to represent the IPv4 TCP protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__tcp.v6 [*v6]]]
+ [Construct to represent the IPv6 TCP protocol. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__tcp.operator_not__eq_ [*operator!=]]]
+ [Compare two protocols for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__tcp.operator_eq__eq_ [*operator==]]]
+ [Compare two protocols for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__tcp `ip::tcp`] class contains flags necessary for TCP sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:acceptor ip::tcp::acceptor]
+
+[indexterm2 acceptor..ip::tcp]
+The TCP acceptor type.
+
+
+ typedef basic_socket_acceptor< tcp > acceptor;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle_type [*native_handle_type]]]
+ [The native representation of an acceptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection.
+
+ Accept a new connection and obtain the endpoint of the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
+ [Assigns an existing native acceptor to the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
+ [Construct an acceptor without opening it.
+
+ Construct an open acceptor.
+
+ Construct an acceptor opened on the given endpoint.
+
+ Construct a basic_socket_acceptor on an existing native acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
+ [Bind the acceptor to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
+ [Close the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
+ [Get an option from the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.io_control [*io_control]]]
+ [Perform an IO control command on the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
+ [Place the acceptor into the state where it will listen for new connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native acceptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle [*native_handle]]]
+ [Get the native acceptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native acceptor implementation.
+
+ Sets the non-blocking mode of the native acceptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the acceptor.
+
+ Sets the non-blocking mode of the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
+ [Open the acceptor using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
+ [Set an option on the acceptor. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:endpoint ip::tcp::endpoint]
+
+[indexterm2 endpoint..ip::tcp]
+The type of a TCP endpoint.
+
+
+ typedef basic_endpoint< tcp > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint.
+
+ Set the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+
+ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
+ [Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+ Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:family ip::tcp::family]
+
+[indexterm2 family..ip::tcp]
+Obtain an identifier for the protocol family.
+
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:iostream ip::tcp::iostream]
+
+[indexterm2 iostream..ip::tcp]
+The TCP iostream type.
+
+
+ typedef basic_socket_iostream< tcp > iostream;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection.
+
+ Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
+ [Close the connection. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
+ [Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.error [*error]]]
+ [Get the last error associated with the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_at [*expires_at]]]
+ [Get the stream's expiry time as an absolute time.
+
+ Set the stream's expiry time as an absolute time. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]]
+ [Get the timer's expiry time relative to now.
+
+ Set the stream's expiry time relative to now. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
+ [Return a pointer to the underlying streambuf. ]
+ ]
+
+]
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:no_delay ip::tcp::no_delay]
+
+[indexterm2 no_delay..ip::tcp]
+Socket option for disabling the Nagle algorithm.
+
+
+ typedef implementation_defined no_delay;
+
+
+
+Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option;
+ socket.get_option(option);
+ bool is_set = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::tcp::operator!=]
+
+[indexterm2 operator!=..ip::tcp]
+Compare two protocols for inequality.
+
+
+ friend bool operator!=(
+ const tcp & p1,
+ const tcp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::tcp::operator==]
+
+[indexterm2 operator==..ip::tcp]
+Compare two protocols for equality.
+
+
+ friend bool operator==(
+ const tcp & p1,
+ const tcp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol ip::tcp::protocol]
+
+[indexterm2 protocol..ip::tcp]
+Obtain an identifier for the protocol.
+
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:resolver ip::tcp::resolver]
+
+[indexterm2 resolver..ip::tcp]
+The TCP resolver type.
+
+
+ typedef basic_resolver< tcp > resolver;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously perform forward resolution of a query to a list of entries.
+
+ Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
+ [Perform forward resolution of a query to a list of entries.
+
+ Perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:socket ip::tcp::socket]
+
+[indexterm2 socket..ip::tcp]
+The TCP socket type.
+
+
+ typedef basic_stream_socket< tcp > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
+ [Construct a basic_stream_socket without opening it.
+
+ Construct and open a basic_stream_socket.
+
+ Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_stream_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
+ [Read some data from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
+ [Receive some data on the socket.
+
+ Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.send [*send]]]
+ [Send some data on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
+ [Write some data to the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/tcp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:type ip::tcp::type]
+
+[indexterm2 type..ip::tcp]
+Obtain an identifier for the type of the protocol.
+
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[section:v4 ip::tcp::v4]
+
+[indexterm2 v4..ip::tcp]
+Construct to represent the IPv4 TCP protocol.
+
+
+ static tcp v4();
+
+
+
+[endsect]
+
+
+
+[section:v6 ip::tcp::v6]
+
+[indexterm2 v6..ip::tcp]
+Construct to represent the IPv6 TCP protocol.
+
+
+ static tcp v6();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__udp ip::udp]
+
+
+Encapsulates the flags needed for UDP.
+
+
+ class udp
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__udp.endpoint [*endpoint]]]
+ [The type of a UDP endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__udp.resolver [*resolver]]]
+ [The UDP resolver type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__udp.socket [*socket]]]
+ [The UDP socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__udp.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__udp.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__udp.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__udp.v4 [*v4]]]
+ [Construct to represent the IPv4 UDP protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__udp.v6 [*v6]]]
+ [Construct to represent the IPv6 UDP protocol. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__udp.operator_not__eq_ [*operator!=]]]
+ [Compare two protocols for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__udp.operator_eq__eq_ [*operator==]]]
+ [Compare two protocols for equality. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__udp `ip::udp`] class contains flags necessary for UDP sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:endpoint ip::udp::endpoint]
+
+[indexterm2 endpoint..ip::udp]
+The type of a UDP endpoint.
+
+
+ typedef basic_endpoint< udp > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint.
+
+ Set the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections.
+
+ Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.port [*port]]]
+ [Get the port associated with the endpoint. The port number is always in the host's byte order.
+
+ Set the port associated with the endpoint. The port number is always in the host's byte order. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_endpoint `ip::basic_endpoint`] class template describes an endpoint that may be associated with a particular socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:family ip::udp::family]
+
+[indexterm2 family..ip::udp]
+Obtain an identifier for the protocol family.
+
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::udp::operator!=]
+
+[indexterm2 operator!=..ip::udp]
+Compare two protocols for inequality.
+
+
+ friend bool operator!=(
+ const udp & p1,
+ const udp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::udp::operator==]
+
+[indexterm2 operator==..ip::udp]
+Compare two protocols for equality.
+
+
+ friend bool operator==(
+ const udp & p1,
+ const udp & p2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol ip::udp::protocol]
+
+[indexterm2 protocol..ip::udp]
+Obtain an identifier for the protocol.
+
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:resolver ip::udp::resolver]
+
+[indexterm2 resolver..ip::udp]
+The UDP resolver type.
+
+
+ typedef basic_resolver< udp > resolver;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously perform forward resolution of a query to a list of entries.
+
+ Asynchronously perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
+ [Perform forward resolution of a query to a list of entries.
+
+ Perform reverse resolution of an endpoint to a list of entries. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.ip__basic_resolver `ip::basic_resolver`] class template provides the ability to resolve a query to a list of endpoints.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:socket ip::udp::socket]
+
+[indexterm2 socket..ip::udp]
+The UDP socket type.
+
+
+ typedef basic_datagram_socket< udp > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
+ [Construct a basic_datagram_socket without opening it.
+
+ Construct and open a basic_datagram_socket.
+
+ Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_datagram_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]]
+ [Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
+ [Send some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/udp.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:type ip::udp::type]
+
+[indexterm2 type..ip::udp]
+Obtain an identifier for the type of the protocol.
+
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[section:v4 ip::udp::v4]
+
+[indexterm2 v4..ip::udp]
+Construct to represent the IPv4 UDP protocol.
+
+
+ static udp v4();
+
+
+
+[endsect]
+
+
+
+[section:v6 ip::udp::v6]
+
+[indexterm2 v6..ip::udp]
+Construct to represent the IPv6 UDP protocol.
+
+
+ static udp v6();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:ip__unicast__hops ip::unicast::hops]
+
+[indexterm1 ip::unicast::hops]
+Socket option for time-to-live associated with outgoing unicast packets.
+
+
+ typedef implementation_defined hops;
+
+
+
+Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option(4);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option;
+ socket.get_option(option);
+ int ttl = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/unicast.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:ip__v6_only ip::v6_only]
+
+[indexterm1 ip::v6_only]
+Socket option for determining whether an IPv6 socket supports IPv6 communication only.
+
+
+ typedef implementation_defined v6_only;
+
+
+
+Implements the IPPROTO\_IPV6/IP\_V6ONLY socket option.
+
+
+[heading Examples]
+
+Setting the option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::v6_only option(true);
+ socket.set_option(option);
+
+
+
+
+
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::v6_only option;
+ socket.get_option(option);
+ bool v6_only = option.value();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/ip/v6_only.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:is_match_condition is_match_condition]
+
+
+Type trait used to determine whether a type can be used as a match condition function with read\_until and async\_read\_until.
+
+
+ template<
+ typename T>
+ struct is_match_condition
+
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.is_match_condition.value [*value]]]
+ [The value member is true if the type may be used as a match condition. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/read_until.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:value is_match_condition::value]
+
+[indexterm2 value..is_match_condition]
+The value member is true if the type may be used as a match condition.
+
+
+ static const bool value;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:is_read_buffered is_read_buffered]
+
+
+The [link boost_asio.reference.is_read_buffered `is_read_buffered`] class is a traits class that may be used to determine whether a stream type supports buffering of read data.
+
+
+ template<
+ typename Stream>
+ class is_read_buffered
+
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.is_read_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of read data. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/is_read_buffered.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:value is_read_buffered::value]
+
+[indexterm2 value..is_read_buffered]
+The value member is true only if the Stream type supports buffering of read data.
+
+
+ static const bool value;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:is_write_buffered is_write_buffered]
+
+
+The [link boost_asio.reference.is_write_buffered `is_write_buffered`] class is a traits class that may be used to determine whether a stream type supports buffering of written data.
+
+
+ template<
+ typename Stream>
+ class is_write_buffered
+
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.is_write_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of written data. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/is_write_buffered.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:value is_write_buffered::value]
+
+[indexterm2 value..is_write_buffered]
+The value member is true only if the Stream type supports buffering of written data.
+
+
+ static const bool value;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:local__basic_endpoint local::basic_endpoint]
+
+
+Describes an endpoint for a UNIX socket.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class basic_endpoint
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using the specified path name.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
+ [Get the path associated with the endpoint.
+
+ Set the path associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:basic_endpoint local::basic_endpoint::basic_endpoint]
+
+[indexterm2 basic_endpoint..local::basic_endpoint]
+Default constructor.
+
+
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload1 more...]]``
+
+
+Construct an endpoint using the specified path name.
+
+
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
+ const char * path_name);
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload2 more...]]``
+
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
+ const std::string & path_name);
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 more...]]``
+
+
+Copy constructor.
+
+
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
+ const basic_endpoint & other);
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 more...]]``
+
+
+[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+
+
+Default constructor.
+
+
+ basic_endpoint();
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+
+
+Construct an endpoint using the specified path name.
+
+
+ basic_endpoint(
+ const char * path_name);
+
+
+
+[endsect]
+
+
+
+[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 overloads)]
+
+
+Construct an endpoint using the specified path name.
+
+
+ basic_endpoint(
+ const std::string & path_name);
+
+
+
+[endsect]
+
+
+
+[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 overloads)]
+
+
+Copy constructor.
+
+
+ basic_endpoint(
+ const basic_endpoint & other);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:capacity local::basic_endpoint::capacity]
+
+[indexterm2 capacity..local::basic_endpoint]
+Get the capacity of the endpoint in the native type.
+
+
+ std::size_t capacity() const;
+
+
+
+[endsect]
+
+
+[section:data local::basic_endpoint::data]
+
+[indexterm2 data..local::basic_endpoint]
+Get the underlying endpoint in the native type.
+
+
+ data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload1 data]``();
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.data.overload1 more...]]``
+
+ const data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload2 data]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.data.overload2 more...]]``
+
+
+[section:overload1 local::basic_endpoint::data (1 of 2 overloads)]
+
+
+Get the underlying endpoint in the native type.
+
+
+ data_type * data();
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::basic_endpoint::data (2 of 2 overloads)]
+
+
+Get the underlying endpoint in the native type.
+
+
+ const data_type * data() const;
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:data_type local::basic_endpoint::data_type]
+
+[indexterm2 data_type..local::basic_endpoint]
+The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+
+
+ typedef implementation_defined data_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ local::basic_endpoint::operator!=]
+
+[indexterm2 operator!=..local::basic_endpoint]
+Compare two endpoints for inequality.
+
+
+ friend bool operator!=(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt_ local::basic_endpoint::operator<]
+
+[indexterm2 operator<..local::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator<(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ local::basic_endpoint::operator<<]
+
+[indexterm2 operator<<..local::basic_endpoint]
+Output an endpoint as a string.
+
+
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const basic_endpoint< Protocol > & endpoint);
+
+
+Used to output a human-readable string for a specified endpoint.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[endpoint][The endpoint to be written.]]
+
+]
+
+
+[heading Return Value]
+
+The output stream.
+
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__eq_ local::basic_endpoint::operator<=]
+
+[indexterm2 operator<=..local::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator<=(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_eq_ local::basic_endpoint::operator=]
+
+[indexterm2 operator=..local::basic_endpoint]
+Assign from another endpoint.
+
+
+ basic_endpoint & operator=(
+ const basic_endpoint & other);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ local::basic_endpoint::operator==]
+
+[indexterm2 operator==..local::basic_endpoint]
+Compare two endpoints for equality.
+
+
+ friend bool operator==(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt_ local::basic_endpoint::operator>]
+
+[indexterm2 operator>..local::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator>(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:operator_gt__eq_ local::basic_endpoint::operator>=]
+
+[indexterm2 operator>=..local::basic_endpoint]
+Compare endpoints for ordering.
+
+
+ friend bool operator>=(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:path local::basic_endpoint::path]
+
+[indexterm2 path..local::basic_endpoint]
+Get the path associated with the endpoint.
+
+
+ std::string ``[link boost_asio.reference.local__basic_endpoint.path.overload1 path]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload1 more...]]``
+
+
+Set the path associated with the endpoint.
+
+
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload2 path]``(
+ const char * p);
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload2 more...]]``
+
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload3 path]``(
+ const std::string & p);
+ `` [''''&raquo;''' [link boost_asio.reference.local__basic_endpoint.path.overload3 more...]]``
+
+
+[section:overload1 local::basic_endpoint::path (1 of 3 overloads)]
+
+
+Get the path associated with the endpoint.
+
+
+ std::string path() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::basic_endpoint::path (2 of 3 overloads)]
+
+
+Set the path associated with the endpoint.
+
+
+ void path(
+ const char * p);
+
+
+
+[endsect]
+
+
+
+[section:overload3 local::basic_endpoint::path (3 of 3 overloads)]
+
+
+Set the path associated with the endpoint.
+
+
+ void path(
+ const std::string & p);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:protocol local::basic_endpoint::protocol]
+
+[indexterm2 protocol..local::basic_endpoint]
+The protocol associated with the endpoint.
+
+
+ protocol_type protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol_type local::basic_endpoint::protocol_type]
+
+[indexterm2 protocol_type..local::basic_endpoint]
+The protocol type associated with the endpoint.
+
+
+ typedef Protocol protocol_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/basic_endpoint.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:resize local::basic_endpoint::resize]
+
+[indexterm2 resize..local::basic_endpoint]
+Set the underlying size of the endpoint in the native type.
+
+
+ void resize(
+ std::size_t new_size);
+
+
+
+[endsect]
+
+
+
+[section:size local::basic_endpoint::size]
+
+[indexterm2 size..local::basic_endpoint]
+Get the underlying size of the endpoint in the native type.
+
+
+ std::size_t size() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:local__connect_pair local::connect_pair]
+
+[indexterm1 local::connect_pair]
+Create a pair of connected sockets.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService SocketService2]``>
+ void ``[link boost_asio.reference.local__connect_pair.overload1 connect_pair]``(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2);
+ `` [''''&raquo;''' [link boost_asio.reference.local__connect_pair.overload1 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService SocketService2]``>
+ boost::system::error_code ``[link boost_asio.reference.local__connect_pair.overload2 connect_pair]``(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.local__connect_pair.overload2 more...]]``
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/connect_pair.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:overload1 local::connect_pair (1 of 2 overloads)]
+
+
+Create a pair of connected sockets.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService SocketService2]``>
+ void connect_pair(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2);
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::connect_pair (2 of 2 overloads)]
+
+
+Create a pair of connected sockets.
+
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService SocketService2]``>
+ boost::system::error_code connect_pair(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:local__datagram_protocol local::datagram_protocol]
+
+
+Encapsulates the flags needed for datagram-oriented UNIX sockets.
+
+
+ class datagram_protocol
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__datagram_protocol.endpoint [*endpoint]]]
+ [The type of a UNIX domain endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__datagram_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+]
+
+The [link boost_asio.reference.local__datagram_protocol `local::datagram_protocol`] class contains flags necessary for datagram-oriented UNIX domain sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/datagram_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:endpoint local::datagram_protocol::endpoint]
+
+[indexterm2 endpoint..local::datagram_protocol]
+The type of a UNIX domain endpoint.
+
+
+ typedef basic_endpoint< datagram_protocol > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using the specified path name.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
+ [Get the path associated with the endpoint.
+
+ Set the path associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/datagram_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:family local::datagram_protocol::family]
+
+[indexterm2 family..local::datagram_protocol]
+Obtain an identifier for the protocol family.
+
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol local::datagram_protocol::protocol]
+
+[indexterm2 protocol..local::datagram_protocol]
+Obtain an identifier for the protocol.
+
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:socket local::datagram_protocol::socket]
+
+[indexterm2 socket..local::datagram_protocol]
+The UNIX domain socket type.
+
+
+ typedef basic_datagram_socket< datagram_protocol > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
+ [Construct a basic_datagram_socket without opening it.
+
+ Construct and open a basic_datagram_socket.
+
+ Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_datagram_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]]
+ [Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
+ [Send some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/datagram_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:type local::datagram_protocol::type]
+
+[indexterm2 type..local::datagram_protocol]
+Obtain an identifier for the type of the protocol.
+
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:local__stream_protocol local::stream_protocol]
+
+
+Encapsulates the flags needed for stream-oriented UNIX sockets.
+
+
+ class stream_protocol
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.acceptor [*acceptor]]]
+ [The UNIX domain acceptor type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.endpoint [*endpoint]]]
+ [The type of a UNIX domain endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.iostream [*iostream]]]
+ [The UNIX domain iostream type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+]
+
+The [link boost_asio.reference.local__stream_protocol `local::stream_protocol`] class contains flags necessary for stream-oriented UNIX domain sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/stream_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:acceptor local::stream_protocol::acceptor]
+
+[indexterm2 acceptor..local::stream_protocol]
+The UNIX domain acceptor type.
+
+
+ typedef basic_socket_acceptor< stream_protocol > acceptor;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle_type [*native_handle_type]]]
+ [The native representation of an acceptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of an acceptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection.
+
+ Accept a new connection and obtain the endpoint of the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
+ [Assigns an existing native acceptor to the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
+ [Construct an acceptor without opening it.
+
+ Construct an open acceptor.
+
+ Construct an acceptor opened on the given endpoint.
+
+ Construct a basic_socket_acceptor on an existing native acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
+ [Bind the acceptor to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
+ [Close the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
+ [Get an option from the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.io_control [*io_control]]]
+ [Perform an IO control command on the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
+ [Place the acceptor into the state where it will listen for new connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native acceptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native_handle [*native_handle]]]
+ [Get the native acceptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native acceptor implementation.
+
+ Sets the non-blocking mode of the native acceptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the acceptor.
+
+ Sets the non-blocking mode of the acceptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
+ [Open the acceptor using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
+ [Set an option on the acceptor. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/stream_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:endpoint local::stream_protocol::endpoint]
+
+[indexterm2 endpoint..local::stream_protocol]
+The type of a UNIX domain endpoint.
+
+
+ typedef basic_endpoint< stream_protocol > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor.
+
+ Construct an endpoint using the specified path name.
+
+ Copy constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
+ [Get the path associated with the endpoint.
+
+ Set the path associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
+ [Get the underlying size of the endpoint in the native type. ]
+ ]
+
+]
+
+[heading Friends]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
+ [Compare endpoints for ordering. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/stream_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:family local::stream_protocol::family]
+
+[indexterm2 family..local::stream_protocol]
+Obtain an identifier for the protocol family.
+
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:iostream local::stream_protocol::iostream]
+
+[indexterm2 iostream..local::stream_protocol]
+The UNIX domain iostream type.
+
+
+ typedef basic_socket_iostream< stream_protocol > iostream;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_iostream.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection.
+
+ Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
+ [Close the connection. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
+ [Establish a connection to an endpoint corresponding to a resolver query. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.error [*error]]]
+ [Get the last error associated with the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_at [*expires_at]]]
+ [Get the stream's expiry time as an absolute time.
+
+ Set the stream's expiry time as an absolute time. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.expires_from_now [*expires_from_now]]]
+ [Get the timer's expiry time relative to now.
+
+ Set the stream's expiry time relative to now. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
+ [Return a pointer to the underlying streambuf. ]
+ ]
+
+]
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/stream_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:protocol local::stream_protocol::protocol]
+
+[indexterm2 protocol..local::stream_protocol]
+Obtain an identifier for the protocol.
+
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:socket local::stream_protocol::socket]
+
+[indexterm2 socket..local::stream_protocol]
+The UNIX domain socket type.
+
+
+ typedef basic_stream_socket< stream_protocol > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.native_handle_type [*native_handle_type]]]
+ [The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
+ [Construct a basic_stream_socket without opening it.
+
+ Construct and open a basic_stream_socket.
+
+ Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
+
+ Construct a basic_stream_socket on an existing native socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.close [*close]]]
+ [Close the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_handle [*native_handle]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
+ [Read some data from the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
+ [Receive some data on the socket.
+
+ Receive some data on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.send [*send]]]
+ [Send some data on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
+ [Write some data to the socket. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/local/stream_protocol.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:type local::stream_protocol::type]
+
+[indexterm2 type..local::stream_protocol]
+Obtain an identifier for the type of the protocol.
+
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:mutable_buffer mutable_buffer]
+
+
+Holds a buffer that can be modified.
+
+
+ class mutable_buffer
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer.
+
+ Construct a buffer to represent a given memory range. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
+ ]
+
+]
+
+The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
+
+
+[heading Accessing Buffer Contents]
+
+
+
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
+
+
+
+ boost::asio::mutable_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
+
+
+
+
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:mutable_buffer mutable_buffer::mutable_buffer]
+
+[indexterm2 mutable_buffer..mutable_buffer]
+Construct an empty buffer.
+
+
+ ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 mutable_buffer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 more...]]``
+
+
+Construct a buffer to represent a given memory range.
+
+
+ ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 mutable_buffer]``(
+ void * data,
+ std::size_t size);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 more...]]``
+
+
+[section:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
+
+
+Construct an empty buffer.
+
+
+ mutable_buffer();
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
+
+
+Construct a buffer to represent a given memory range.
+
+
+ mutable_buffer(
+ void * data,
+ std::size_t size);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:operator_plus_ mutable_buffer::operator+]
+
+[indexterm2 operator+..mutable_buffer]
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload1 operator+]``(
+ const mutable_buffer & b,
+ std::size_t start);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.operator_plus_.overload1 more...]]``
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.operator_plus_.overload2 more...]]``
+
+
+[section:overload1 mutable_buffer::operator+ (1 of 2 overloads)]
+
+
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer operator+(
+ const mutable_buffer & b,
+ std::size_t start);
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffer::operator+ (2 of 2 overloads)]
+
+
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+
+[section:mutable_buffers_1 mutable_buffers_1]
+
+
+Adapts a single modifiable buffer so that it meets the requirements of the MutableBufferSequence concept.
+
+
+ class mutable_buffers_1 :
+ public mutable_buffer
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.mutable_buffers_1.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1 [*mutable_buffers_1]]]
+ [Construct to represent a given memory range.
+
+ Construct to represent a single modifiable buffer. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:begin mutable_buffers_1::begin]
+
+[indexterm2 begin..mutable_buffers_1]
+Get a random-access iterator to the first element.
+
+
+ const_iterator begin() const;
+
+
+
+[endsect]
+
+
+
+[section:const_iterator mutable_buffers_1::const_iterator]
+
+[indexterm2 const_iterator..mutable_buffers_1]
+A random-access iterator type that may be used to read elements.
+
+
+ typedef const mutable_buffer * const_iterator;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:end mutable_buffers_1::end]
+
+[indexterm2 end..mutable_buffers_1]
+Get a random-access iterator for one past the last element.
+
+
+ const_iterator end() const;
+
+
+
+[endsect]
+
+
+[section:mutable_buffers_1 mutable_buffers_1::mutable_buffers_1]
+
+[indexterm2 mutable_buffers_1..mutable_buffers_1]
+Construct to represent a given memory range.
+
+
+ ``[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload1 mutable_buffers_1]``(
+ void * data,
+ std::size_t size);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload1 more...]]``
+
+
+Construct to represent a single modifiable buffer.
+
+
+ explicit ``[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload2 mutable_buffers_1]``(
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload2 more...]]``
+
+
+[section:overload1 mutable_buffers_1::mutable_buffers_1 (1 of 2 overloads)]
+
+
+Construct to represent a given memory range.
+
+
+ mutable_buffers_1(
+ void * data,
+ std::size_t size);
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffers_1::mutable_buffers_1 (2 of 2 overloads)]
+
+
+Construct to represent a single modifiable buffer.
+
+
+ mutable_buffers_1(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:operator_plus_ mutable_buffers_1::operator+]
+
+[indexterm2 operator+..mutable_buffers_1]
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload1 operator+]``(
+ const mutable_buffer & b,
+ std::size_t start);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.operator_plus_.overload1 more...]]``
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const mutable_buffer & b);
+ `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 more...]]``
+
+
+[section:overload1 mutable_buffers_1::operator+ (1 of 2 overloads)]
+
+
+['Inherited from mutable_buffer.]
+
+
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer operator+(
+ const mutable_buffer & b,
+ std::size_t start);
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffers_1::operator+ (2 of 2 overloads)]
+
+
+['Inherited from mutable_buffer.]
+
+
+Create a new modifiable buffer that is offset from the start of another.
+
+
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:value_type mutable_buffers_1::value_type]
+
+[indexterm2 value_type..mutable_buffers_1]
+The type for each element in the list of buffers.
+
+
+ typedef mutable_buffer value_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer.
+
+ Construct a buffer to represent a given memory range. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
+ ]
+
+]
+
+The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
+
+
+[heading Accessing Buffer Contents]
+
+
+
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
+
+
+
+ boost::asio::mutable_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
+
+
+
+
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:null_buffers null_buffers]
+
+
+An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
+
+
+ class null_buffers
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.null_buffers.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.null_buffers.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.null_buffers.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.null_buffers.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
+ ]
+
+]
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[section:begin null_buffers::begin]
+
+[indexterm2 begin..null_buffers]
+Get a random-access iterator to the first element.
+
+
+ const_iterator begin() const;
+
+
+
+[endsect]
+
+
+
+[section:const_iterator null_buffers::const_iterator]
+
+[indexterm2 const_iterator..null_buffers]
+A random-access iterator type that may be used to read elements.
+
+
+ typedef const mutable_buffer * const_iterator;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:end null_buffers::end]
+
+[indexterm2 end..null_buffers]
+Get a random-access iterator for one past the last element.
+
+
+ const_iterator end() const;
+
+
+
+[endsect]
+
+
+
+[section:value_type null_buffers::value_type]
+
+[indexterm2 value_type..null_buffers]
+The type for each element in the list of buffers.
+
+
+ typedef mutable_buffer value_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive on a connected socket. ]
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer.
+
+ Construct a buffer to represent a given memory range. ]
   ]
   
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive. ]
+ [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
   ]
   
- [
- [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
- [Start an asynchronous send on a connected socket. ]
- ]
+]
+
+The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
+
+
+[heading Accessing Buffer Contents]
   
+
+
+The contents of a buffer may be accessed using the [link boost_asio.reference.buffer_size `buffer_size`] and [link boost_asio.reference.buffer_cast `buffer_cast`] functions:
+
+
+
+ boost::asio::mutable_buffer b1 = ...;
+ std::size_t s1 = boost::asio::buffer_size(b1);
+ unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
+
+
+
+
+The `boost::asio::buffer_cast` function permits violations of type safety, so uses of it in application code should be carefully considered.
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/buffer.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:placeholders__bytes_transferred placeholders::bytes_transferred]
+
+[indexterm1 placeholders::bytes_transferred]
+An argument placeholder, for use with boost::bind(), that corresponds to the bytes\_transferred argument of a handler for asynchronous functions such as `boost::asio::basic_stream_socket::async_write_some` or `boost::asio::async_write`.
+
+
+ unspecified bytes_transferred;
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/placeholders.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:placeholders__error placeholders::error]
+
+[indexterm1 placeholders::error]
+An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
+
+
+ unspecified error;
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/placeholders.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:placeholders__iterator placeholders::iterator]
+
+[indexterm1 placeholders::iterator]
+An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as boost::asio::basic\_resolver::resolve.
+
+
+ unspecified iterator;
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/placeholders.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:posix__basic_descriptor posix::basic_descriptor]
+
+
+Provides POSIX descriptor functionality.
+
+
+ template<
+ typename ``[link boost_asio.reference.DescriptorService DescriptorService]``>
+ class basic_descriptor :
+ public basic_io_object< DescriptorService >,
+ public posix::descriptor_base
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
- ]
+
+ [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
   
- [
- [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
+
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
- [Construct a basic_datagram_socket without opening it.
 
- Construct and open a basic_datagram_socket.
+ [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
+
+ ]
 
- Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
+ [
 
- Construct a basic_datagram_socket on an existing native socket. ]
- ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle_type [*native_handle_type]]]
+ [The native representation of a descriptor. ]
   
- [
- [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
+
+ [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ]
   
+ ]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.close [*close]]]
- [Close the socket. ]
+
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
+
   ]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
+ [Construct a basic_descriptor without opening it.
+
+ Construct a basic_descriptor on an existing native descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
+ [Close the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
      Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
- [Get the native socket representation. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle [*native_handle]]]
+ [Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]]
- [Receive some data on a connected socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
+
+ Sets the non-blocking mode of the native descriptor implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
- [Receive a datagram with the endpoint of the sender. ]
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
+
+ Sets the non-blocking mode of the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
   ]
   
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
- [Send some data on a connected socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor._basic_descriptor [*~basic_descriptor]]]
+ [Protected destructor to prevent deletion through this type. ]
   ]
   
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
   [
- [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
   ]
+
+]
+
+The [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor.
+
+
+[heading Thread Safety]
   
- [
- [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+[section:assign posix::basic_descriptor::assign]
+
+[indexterm2 assign..posix::basic_descriptor]
+Assign an existing native descriptor to the descriptor.
+
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.assign.overload1 assign]``(
+ const native_handle_type & native_descriptor);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.assign.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.assign.overload2 assign]``(
+ const native_handle_type & native_descriptor,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.assign.overload2 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::assign (1 of 2 overloads)]
+
+
+Assign an existing native descriptor to the descriptor.
+
+
+ void assign(
+ const native_handle_type & native_descriptor);
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::assign (2 of 2 overloads)]
+
+
+Assign an existing native descriptor to the descriptor.
+
+
+ boost::system::error_code assign(
+ const native_handle_type & native_descriptor,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_descriptor posix::basic_descriptor::basic_descriptor]
+
+[indexterm2 basic_descriptor..posix::basic_descriptor]
+Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] without opening it.
+
+
+ explicit ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 more...]]``
+
+
+Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] on an existing native descriptor.
+
+
+ ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload2 basic_descriptor]``(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_descriptor);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload2 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::basic_descriptor (1 of 2 overloads)]
+
+
+Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] without opening it.
+
+
+ basic_descriptor(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a descriptor without opening it.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
+
+]
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::basic_descriptor (2 of 2 overloads)]
+
+
+Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] on an existing native descriptor.
+
+
+ basic_descriptor(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_descriptor);
+
+
+This constructor creates a descriptor object to hold an existing native descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
+
+[[native_descriptor][A native descriptor.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:bytes_readable posix::basic_descriptor::bytes_readable]
+
+
+['Inherited from posix::descriptor_base.]
+
+[indexterm2 bytes_readable..posix::basic_descriptor]
+IO control command to get the amount of data that can be read without blocking.
+
+
+ typedef implementation_defined bytes_readable;
+
+
+
+Implements the FIONREAD IO control command.
+
+
+[heading Example]
+
+
+
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::bytes_readable command(true);
+ descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
+
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:cancel posix::basic_descriptor::cancel]
+
+[indexterm2 cancel..posix::basic_descriptor]
+Cancel all asynchronous operations associated with the descriptor.
+
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.cancel.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.cancel.overload2 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::cancel (1 of 2 overloads)]
+
+
+Cancel all asynchronous operations associated with the descriptor.
+
+
+ void cancel();
+
+
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+
+
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure. ]]
+
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
+[endsect]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
+
+
+[section:overload2 posix::basic_descriptor::cancel (2 of 2 overloads)]
+
+
+Cancel all asynchronous operations associated with the descriptor.
+
+
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
+
+
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
 
 ]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+
+[endsect]
+
+
+[endsect]
+
+[section:close posix::basic_descriptor::close]
+
+[indexterm2 close..posix::basic_descriptor]
+Close the descriptor.
+
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.close.overload1 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.close.overload2 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::close (1 of 2 overloads)]
+
+
+Close the descriptor.
+
+
+ void close();
+
+
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
 ]
 
-The [link boost_asio.reference.basic_datagram_socket `basic_datagram_socket`] class template provides asynchronous and blocking datagram-oriented socket functionality.
 
 
-[heading Thread Safety]
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::close (2 of 2 overloads)]
+
+
+Close the descriptor.
+
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+
+
+[heading Parameters]
+
+
+[variablelist
   
-[*Distinct] [*objects:] Safe.
+[[ec][Set to indicate what error occurred, if any. ]]
 
-[*Shared] [*objects:] Unsafe.
+]
 
 
 
 
-[heading Requirements]
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service posix::basic_descriptor::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..posix::basic_descriptor]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
-[*Header: ][^boost/asio/local/datagram_protocol.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:type local::datagram_protocol::type]
+[section:implementation posix::basic_descriptor::implementation]
 
-[indexterm2 type..local::datagram_protocol]
-Obtain an identifier for the type of the protocol.
 
+['Inherited from basic_io_object.]
 
- int type() const;
+[indexterm2 implementation..posix::basic_descriptor]
+The underlying implementation of the I/O object.
+
+
+ implementation_type implementation;
 
 
 
@@ -50670,364 +64537,391 @@
 
 
 
+[section:implementation_type posix::basic_descriptor::implementation_type]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation_type..posix::basic_descriptor]
+The underlying implementation type of I/O object.
+
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
 [endsect]
 
-[section:local__stream_protocol local::stream_protocol]
 
+[section:io_control posix::basic_descriptor::io_control]
 
-Encapsulates the flags needed for stream-oriented UNIX sockets.
+[indexterm2 io_control..posix::basic_descriptor]
+Perform an IO control command on the descriptor.
 
 
- class stream_protocol
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.io_control.overload1 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.io_control.overload2 more...]]``
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[section:overload1 posix::basic_descriptor::io_control (1 of 2 overloads)]
 
- [[link boost_asio.reference.local__stream_protocol.acceptor [*acceptor]]]
- [The UNIX domain acceptor type. ]
-
- ]
 
- [
+Perform an IO control command on the descriptor.
 
- [[link boost_asio.reference.local__stream_protocol.endpoint [*endpoint]]]
- [The type of a UNIX domain endpoint. ]
-
- ]
 
- [
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
 
- [[link boost_asio.reference.local__stream_protocol.iostream [*iostream]]]
- [The UNIX domain iostream type. ]
-
- ]
 
- [
+This function is used to execute an IO control command on the descriptor.
 
- [[link boost_asio.reference.local__stream_protocol.socket [*socket]]]
- [The UNIX domain socket type. ]
+
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[command][The IO control command to be performed on the descriptor.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.local__stream_protocol.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.local__stream_protocol.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.local__stream_protocol.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure.]]
+
 ]
 
-The [link boost_asio.reference.local__stream_protocol `local::stream_protocol`] class contains flags necessary for stream-oriented UNIX domain sockets.
 
 
-[heading Thread Safety]
+[heading Example]
   
-[*Distinct] [*objects:] Safe.
+Getting the number of bytes ready to read:
 
-[*Shared] [*objects:] Safe.
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::posix::stream_descriptor::bytes_readable command;
+ descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/local/stream_protocol.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[endsect]
 
-[section:acceptor local::stream_protocol::acceptor]
 
-[indexterm2 acceptor..local::stream_protocol]
-The UNIX domain acceptor type.
 
+[section:overload2 posix::basic_descriptor::io_control (2 of 2 overloads)]
 
- typedef basic_socket_acceptor< stream_protocol > acceptor;
 
+Perform an IO control command on the descriptor.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
+This function is used to execute an IO control command on the descriptor.
 
- [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
+[variablelist
   
- ]
+[[command][The IO control command to be performed on the descriptor.]]
 
- [
+[[ec][Set to indicate what error occurred, if any.]]
 
- [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
+
+[heading Example]
   
- ]
+Getting the number of bytes ready to read:
 
- [
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::posix::stream_descriptor::bytes_readable command;
+ boost::system::error_code ec;
+ descriptor.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
 
- [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
+[section:is_open posix::basic_descriptor::is_open]
 
- [
+[indexterm2 is_open..posix::basic_descriptor]
+Determine whether the descriptor is open.
 
- [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
 
- [
+ bool is_open() const;
 
- [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+[endsect]
 
- [
 
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+[section:lowest_layer posix::basic_descriptor::lowest_layer]
+
+[indexterm2 lowest_layer..posix::basic_descriptor]
+Get a reference to the lowest layer.
+
+
+ lowest_layer_type & ``[link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload1 more...]]``
+
+
+Get a const reference to the lowest layer.
+
+
+ const lowest_layer_type & ``[link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload2 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::lowest_layer (1 of 2 overloads)]
+
+
+Get a reference to the lowest layer.
+
+
+ lowest_layer_type & lowest_layer();
+
+
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
+
+
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::lowest_layer (2 of 2 overloads)]
+
+
+Get a const reference to the lowest layer.
+
+
+ const lowest_layer_type & lowest_layer() const;
+
+
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
+
+
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:lowest_layer_type posix::basic_descriptor::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..posix::basic_descriptor]
+A [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] is always the lowest layer.
+
+
+ typedef basic_descriptor< DescriptorService > lowest_layer_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
+ [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle_type [*native_handle_type]]]
+ [The native representation of a descriptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ]
   
   ]
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
   [
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
- [Accept a new connection.
 
- Accept a new connection and obtain the endpoint of the peer. ]
- ]
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
   
- [
- [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
- [Assigns an existing native acceptor to the acceptor. ]
   ]
-
+
   [
- [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
- [Start an asynchronous accept. ]
- ]
+
+ [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
- [
- [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
- [Construct an acceptor without opening it.
+ ]
 
- Construct an open acceptor.
+]
 
- Construct an acceptor opened on the given endpoint.
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
- Construct a basic_socket_acceptor on an existing native acceptor. ]
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
- [Bind the acceptor to the given local endpoint. ]
+ [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
+ [Construct a basic_descriptor without opening it.
+
+ Construct a basic_descriptor on an existing native descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
- [Close the acceptor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
+ [Close the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
- [Get an option from the acceptor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
- [Determine whether the acceptor is open. ]
+ [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer.
+
+ Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.listen [*listen]]]
- [Place the acceptor into the state where it will listen for new connections. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the acceptor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle [*native_handle]]]
+ [Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
- [Get the native acceptor representation. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
+
+ Sets the non-blocking mode of the native descriptor implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
- [Open the acceptor using the specified protocol. ]
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
+
+ Sets the non-blocking mode of the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
- [Set an option on the acceptor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
   ]
   
 ]
 
-[heading Data Members]
+[heading Protected Member Functions]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
+ [[link boost_asio.reference.posix__basic_descriptor._basic_descriptor [*~basic_descriptor]]]
+ [Protected destructor to prevent deletion through this type. ]
   ]
-
+
 ]
 
 [heading Protected Data Members]
@@ -51035,47 +64929,85 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
+ [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
+ [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_socket_acceptor `basic_socket_acceptor`] class template is used for accepting new socket connections.
+The [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor.
 
 
 [heading Thread Safety]
   
 [*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[*Shared] [*objects:] Unsafe.
 
 
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
 
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
- acceptor.open(endpoint.protocol());
- acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen();
 
+[heading Requirements]
+
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
+[section:native posix::basic_descriptor::native]
+
+[indexterm2 native..posix::basic_descriptor]
+(Deprecated: Use `native_handle()`.) Get the native descriptor representation.
+
+
+ native_type native();
+
+
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle posix::basic_descriptor::native_handle]
+
+[indexterm2 native_handle..posix::basic_descriptor]
+Get the native descriptor representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
 
 
 
+[section:native_handle_type posix::basic_descriptor::native_handle_type]
+
+[indexterm2 native_handle_type..posix::basic_descriptor]
+The native representation of a descriptor.
+
+
+ typedef DescriptorService::native_handle_type native_handle_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/stream_protocol.hpp]
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -51083,151 +65015,143 @@
 [endsect]
 
 
+[section:native_non_blocking posix::basic_descriptor::native_non_blocking]
 
-[section:endpoint local::stream_protocol::endpoint]
+[indexterm2 native_non_blocking..posix::basic_descriptor]
+Gets the non-blocking mode of the native descriptor implementation.
 
-[indexterm2 endpoint..local::stream_protocol]
-The type of a UNIX domain endpoint.
 
+ bool ``[link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload1 more...]]``
 
- typedef basic_endpoint< stream_protocol > endpoint;
 
+Sets the non-blocking mode of the native descriptor implementation.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+ void ``[link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload2 more...]]``
 
- [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.native_non_blocking.overload3 more...]]``
 
- [
 
- [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+[section:overload1 posix::basic_descriptor::native_non_blocking (1 of 3 overloads)]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+Gets the non-blocking mode of the native descriptor implementation.
 
- [
- [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor.
 
- Construct an endpoint using the specified path name.
+ bool native_non_blocking() const;
 
- Copy constructor. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
- [Get the path associated with the endpoint.
 
- Set the path associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
- ]
+This function is used to retrieve the non-blocking mode of the underlying native descriptor. This mode has no effect on the behaviour of the descriptor object's synchronous operations.
+
+
+[heading Return Value]
+
+`true` if the underlying descriptor is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
+
+
+[heading Remarks]
+
+The current non-blocking mode is cached by the descriptor object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native descriptor.
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::native_non_blocking (2 of 3 overloads)]
+
+
+Sets the non-blocking mode of the native descriptor implementation.
+
+
+ void native_non_blocking(
+ bool mode);
+
+
+This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
+
+
+[heading Parameters]
+
+
+[variablelist
   
+[[mode][If `true`, the underlying descriptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
+
 ]
 
-[heading Friends]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__eq_ [*operator<=]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt_ [*operator>]]]
- [Compare endpoints for ordering. ]
- ]
-
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_gt__eq_ [*operator>=]]]
- [Compare endpoints for ordering. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
+
 ]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
+
+
+[endsect]
+
+
+
+[section:overload3 posix::basic_descriptor::native_non_blocking (3 of 3 overloads)]
+
+
+Sets the non-blocking mode of the native descriptor implementation.
+
+
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
+
+This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
+
+
+[heading Parameters]
+
+
+[variablelist
   
+[[mode][If `true`, the underlying descriptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
+
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
+
 ]
 
-The [link boost_asio.reference.local__basic_endpoint `local::basic_endpoint`] class template describes an endpoint that may be associated with a particular UNIX socket.
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[endsect]
+
+
+[endsect]
+
+
+[section:native_type posix::basic_descriptor::native_type]
+
+[indexterm2 native_type..posix::basic_descriptor]
+(Deprecated: Use native\_handle\_type.) The native representation of a descriptor.
 
 
+ typedef DescriptorService::native_handle_type native_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/stream_protocol.hpp]
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -51235,14 +65159,48 @@
 [endsect]
 
 
+[section:non_blocking posix::basic_descriptor::non_blocking]
 
-[section:family local::stream_protocol::family]
+[indexterm2 non_blocking..posix::basic_descriptor]
+Gets the non-blocking mode of the descriptor.
 
-[indexterm2 family..local::stream_protocol]
-Obtain an identifier for the protocol family.
 
+ bool ``[link boost_asio.reference.posix__basic_descriptor.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the descriptor.
+
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.non_blocking.overload2 more...]]``
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.non_blocking.overload3 more...]]``
+
+
+[section:overload1 posix::basic_descriptor::non_blocking (1 of 3 overloads)]
+
+
+Gets the non-blocking mode of the descriptor.
+
+
+ bool non_blocking() const;
+
+
+
+[heading Return Value]
+
+`true` if the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
- int family() const;
 
 
 
@@ -51250,47 +65208,119 @@
 
 
 
-[section:iostream local::stream_protocol::iostream]
+[section:overload2 posix::basic_descriptor::non_blocking (2 of 3 overloads)]
 
-[indexterm2 iostream..local::stream_protocol]
-The UNIX domain iostream type.
 
+Sets the non-blocking mode of the descriptor.
 
- typedef basic_socket_iostream< stream_protocol > iostream;
 
+ void non_blocking(
+ bool mode);
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
- [Construct a basic_socket_iostream without establishing a connection.
 
- Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_iostream.close [*close]]]
- [Close the connection. ]
- ]
+[heading Parameters]
+
+
+[variablelist
   
- [
- [[link boost_asio.reference.basic_socket_iostream.connect [*connect]]]
- [Establish a connection to an endpoint corresponding to a resolver query. ]
- ]
+[[mode][If `true`, the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+]
+
+
+[heading Exceptions]
+
+
+[variablelist
   
- [
- [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
- [Return a pointer to the underlying streambuf. ]
- ]
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 posix::basic_descriptor::non_blocking (3 of 3 overloads)]
+
+
+Sets the non-blocking mode of the descriptor.
+
+
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
+
+
+[heading Parameters]
+
+
+[variablelist
   
+[[mode][If `true`, the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
 ]
 
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:non_blocking_io posix::basic_descriptor::non_blocking_io]
+
+
+['Inherited from posix::descriptor_base.]
+
+[indexterm2 non_blocking_io..posix::basic_descriptor]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor.
+
+
+ typedef implementation_defined non_blocking_io;
+
+
+
+Implements the FIONBIO IO control command.
+
+
+[heading Example]
+
+
+
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
+
+
+
+
+
+
+
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/stream_protocol.hpp]
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -51299,177 +65329,143 @@
 
 
 
-[section:protocol local::stream_protocol::protocol]
+[section:release posix::basic_descriptor::release]
 
-[indexterm2 protocol..local::stream_protocol]
-Obtain an identifier for the protocol.
+[indexterm2 release..posix::basic_descriptor]
+Release ownership of the native descriptor implementation.
 
 
- int protocol() const;
+ native_handle_type release();
 
 
+This function may be used to obtain the underlying representation of the descriptor. After calling this function, `is_open()` returns false. The caller is responsible for closing the descriptor.
+
+All outstanding asynchronous read or write operations will finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+
 
 [endsect]
 
 
 
-[section:socket local::stream_protocol::socket]
+[section:service posix::basic_descriptor::service]
 
-[indexterm2 socket..local::stream_protocol]
-The UNIX domain socket type.
 
+['Inherited from basic_io_object.]
 
- typedef basic_stream_socket< stream_protocol > socket;
+[indexterm2 service..posix::basic_descriptor]
+The service associated with the I/O object.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ service_type & service;
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+[section:service_type posix::basic_descriptor::service_type]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+['Inherited from basic_io_object.]
 
- [
+[indexterm2 service_type..posix::basic_descriptor]
+The type of the service that will be used to provide I/O operations.
 
- [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
 
- [
+ typedef DescriptorService service_type;
 
- [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[heading Requirements]
+
+[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
 
- [
+[section:_basic_descriptor posix::basic_descriptor::~basic_descriptor]
 
- [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[indexterm2 ~basic_descriptor..posix::basic_descriptor]
+Protected destructor to prevent deletion through this type.
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+ ~basic_descriptor();
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+[endsect]
 
- [
+[section:posix__basic_stream_descriptor posix::basic_stream_descriptor]
 
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
 
- [
+Provides stream-oriented descriptor functionality.
 
- [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+
+ template<
+ typename ``[link boost_asio.reference.StreamDescriptorService StreamDescriptorService]`` = stream_descriptor_service>
+ class basic_stream_descriptor :
+ public posix::basic_descriptor< StreamDescriptorService >
+
+
+[heading Types]
+[table
+ [[Name][Description]]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_handle_type [*native_handle_type]]]
+ [The native representation of a descriptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
   
   ]
 
@@ -51480,205 +65476,117 @@
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_read_some [*async_read_some]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_read_some [*async_read_some]]]
     [Start an asynchronous read. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]]
     [Start an asynchronous write. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
- [Construct a basic_stream_socket without opening it.
-
- Construct and open a basic_stream_socket.
-
- Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
+ [[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor [*basic_stream_descriptor]]]
+ [Construct a basic_stream_descriptor without opening it.
 
- Construct a basic_stream_socket on an existing native socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ Construct a basic_stream_descriptor on an existing native descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.close [*close]]]
+ [Close the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]]
     [Get the io_service associated with the object. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
      Get a const reference to the lowest layer. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
- [Read some data from the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_handle [*native_handle]]]
+ [Get the native descriptor representation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the socket.
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
 
- Receive some data on a connected socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ Sets the non-blocking mode of the native descriptor implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.send [*send]]]
- [Send some data on the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
+
+ Sets the non-blocking mode of the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.read_some [*read_some]]]
+ [Read some data from the descriptor. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
   ]
   
   [
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]]
+ [Write some data to the descriptor. ]
   ]
   
 ]
 
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
-
-]
-
 [heading Protected Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]]
     [The underlying implementation of the I/O object. ]
   ]
 
   [
- [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
     [The service associated with the I/O object. ]
   ]
 
 ]
 
-The [link boost_asio.reference.basic_stream_socket `basic_stream_socket`] class template provides asynchronous and blocking stream-oriented socket functionality.
+The [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template provides asynchronous and blocking stream-oriented descriptor functionality.
 
 
 [heading Thread Safety]
@@ -51690,25 +65598,39 @@
 
 
 
-
 [heading Requirements]
 
-[*Header: ][^boost/asio/local/stream_protocol.hpp]
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
+[section:assign posix::basic_stream_descriptor::assign]
+
+[indexterm2 assign..posix::basic_stream_descriptor]
+Assign an existing native descriptor to the descriptor.
 
-[endsect]
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 assign]``(
+ const native_handle_type & native_descriptor);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 more...]]``
 
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload2 assign]``(
+ const native_handle_type & native_descriptor,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.assign.overload2 more...]]``
 
-[section:type local::stream_protocol::type]
 
-[indexterm2 type..local::stream_protocol]
-Obtain an identifier for the type of the protocol.
+[section:overload1 posix::basic_stream_descriptor::assign (1 of 2 overloads)]
 
 
- int type() const;
+['Inherited from posix::basic_descriptor.]
+
+
+Assign an existing native descriptor to the descriptor.
+
+
+ void assign(
+ const native_handle_type & native_descriptor);
 
 
 
@@ -51716,187 +65638,225 @@
 
 
 
+[section:overload2 posix::basic_stream_descriptor::assign (2 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+
+Assign an existing native descriptor to the descriptor.
+
+
+ boost::system::error_code assign(
+ const native_handle_type & native_descriptor,
+ boost::system::error_code & ec);
+
+
+
 [endsect]
 
-[section:mutable_buffer mutable_buffer]
 
+[endsect]
 
-Holds a buffer that can be modified.
 
+[section:async_read_some posix::basic_stream_descriptor::async_read_some]
 
- class mutable_buffer
+[indexterm2 async_read_some..posix::basic_stream_descriptor]
+Start an asynchronous read.
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer.
 
- Construct a buffer to represent a given memory range. ]
- ]
+This function is used to asynchronously read data from the stream descriptor. The function call always returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
   
+[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+
+[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes read.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+
 ]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.mutable_buffer.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
- [Create a new modifiable buffer that is offset from the start of another. ]
- ]
+[heading Remarks]
+
+The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
+
+
+[heading Example]
   
-]
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
+ descriptor.async_read_some(boost::asio::buffer(data, size), handler);
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:buffer_cast mutable_buffer::buffer_cast]
 
-[indexterm2 buffer_cast..mutable_buffer]
-Cast a non-modifiable buffer to a specified pointer to POD type.
+[endsect]
 
 
- template<
- typename PointerToPodType>
- PointerToPodType buffer_cast(
- const mutable_buffer & b);
 
+[section:async_write_some posix::basic_stream_descriptor::async_write_some]
+
+[indexterm2 async_write_some..posix::basic_stream_descriptor]
+Start an asynchronous write.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
 
+This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
 
-[section:buffer_size mutable_buffer::buffer_size]
 
-[indexterm2 buffer_size..mutable_buffer]
-Get the number of bytes in a non-modifiable buffer.
+[heading Parameters]
+
 
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
 
- std::size_t buffer_size(
- const mutable_buffer & b);
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes written.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
 
+]
 
 
-[endsect]
+[heading Remarks]
+
+The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
 
 
-[section:mutable_buffer mutable_buffer::mutable_buffer]
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[indexterm2 mutable_buffer..mutable_buffer]
-Construct an empty buffer.
+ descriptor.async_write_some(boost::asio::buffer(data, size), handler);
 
 
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 mutable_buffer]``();
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 more...]]``
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
-Construct a buffer to represent a given memory range.
 
 
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 mutable_buffer]``(
- void * data,
- std::size_t size);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 more...]]``
+[endsect]
 
 
-[section:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
+[section:basic_stream_descriptor posix::basic_stream_descriptor::basic_stream_descriptor]
 
+[indexterm2 basic_stream_descriptor..posix::basic_stream_descriptor]
+Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] without opening it.
 
-Construct an empty buffer.
 
+ explicit ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 basic_stream_descriptor]``(
+ boost::asio::io_service & io_service);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 more...]]``
 
- mutable_buffer();
 
+Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] on an existing native descriptor.
 
 
-[endsect]
+ ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 basic_stream_descriptor]``(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_descriptor);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 more...]]``
 
 
+[section:overload1 posix::basic_stream_descriptor::basic_stream_descriptor (1 of 2 overloads)]
 
-[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
 
+Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] without opening it.
 
-Construct a buffer to represent a given memory range.
 
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service);
 
- mutable_buffer(
- void * data,
- std::size_t size);
 
+This constructor creates a stream descriptor without opening it. The descriptor needs to be opened and then connected or accepted before data can be sent or received on it.
 
 
-[endsect]
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
 
-[endsect]
+]
 
-[section:operator_plus_ mutable_buffer::operator+]
 
-[indexterm2 operator+..mutable_buffer]
-Create a new modifiable buffer that is offset from the start of another.
 
 
- mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload1 operator+]``(
- const mutable_buffer & b,
- std::size_t start);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.operator_plus_.overload1 more...]]``
+[endsect]
 
- mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const mutable_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffer.operator_plus_.overload2 more...]]``
 
 
-[section:overload1 mutable_buffer::operator+ (1 of 2 overloads)]
+[section:overload2 posix::basic_stream_descriptor::basic_stream_descriptor (2 of 2 overloads)]
 
 
-Create a new modifiable buffer that is offset from the start of another.
+Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] on an existing native descriptor.
 
 
- mutable_buffer operator+(
- const mutable_buffer & b,
- std::size_t start);
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service,
+ const native_handle_type & native_descriptor);
 
 
+This constructor creates a stream descriptor object to hold an existing native descriptor.
 
-[endsect]
 
+[heading Parameters]
+
 
+[variablelist
+
+[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
 
-[section:overload2 mutable_buffer::operator+ (2 of 2 overloads)]
+[[native_descriptor][The new underlying descriptor implementation.]]
 
+]
 
-Create a new modifiable buffer that is offset from the start of another.
 
+[heading Exceptions]
+
 
- mutable_buffer operator+(
- std::size_t start,
- const mutable_buffer & b);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
 
-[endsect]
 
 
 [endsect]
@@ -51904,202 +65864,165 @@
 
 [endsect]
 
-[section:mutable_buffers_1 mutable_buffers_1]
 
+[section:bytes_readable posix::basic_stream_descriptor::bytes_readable]
 
-Adapts a single modifiable buffer so that it meets the requirements of the MutableBufferSequence concept.
 
+['Inherited from posix::descriptor_base.]
 
- class mutable_buffers_1 :
- public mutable_buffer
+[indexterm2 bytes_readable..posix::basic_stream_descriptor]
+IO control command to get the amount of data that can be read without blocking.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ typedef implementation_defined bytes_readable;
 
- [
 
- [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
-
- ]
 
- [
+Implements the FIONREAD IO control command.
 
- [[link boost_asio.reference.mutable_buffers_1.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+
+[heading Example]
   
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::bytes_readable command(true);
+ descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
+
+
 
- [
- [[link boost_asio.reference.mutable_buffers_1.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffers_1.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1 [*mutable_buffers_1]]]
- [Construct to represent a given memory range.
 
- Construct to represent a single modifiable buffer. ]
- ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.mutable_buffers_1.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffers_1.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffers_1.operator_plus_ [*operator+]]]
- [Create a new modifiable buffer that is offset from the start of another. ]
- ]
-
-]
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:begin mutable_buffers_1::begin]
+[endsect]
 
-[indexterm2 begin..mutable_buffers_1]
-Get a random-access iterator to the first element.
 
+[section:cancel posix::basic_stream_descriptor::cancel]
 
- const_iterator begin() const;
+[indexterm2 cancel..posix::basic_stream_descriptor]
+Cancel all asynchronous operations associated with the descriptor.
 
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 cancel]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 more...]]``
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 more...]]``
 
 
+[section:overload1 posix::basic_stream_descriptor::cancel (1 of 2 overloads)]
 
-[section:buffer_cast mutable_buffers_1::buffer_cast]
 
+['Inherited from posix::basic_descriptor.]
 
-['Inherited from mutable_buffer.]
 
-[indexterm2 buffer_cast..mutable_buffers_1]
-Cast a non-modifiable buffer to a specified pointer to POD type.
+Cancel all asynchronous operations associated with the descriptor.
 
 
- template<
- typename PointerToPodType>
- PointerToPodType buffer_cast(
- const mutable_buffer & b);
+ void cancel();
 
 
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
-[endsect]
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
-[section:buffer_size mutable_buffers_1::buffer_size]
+]
 
 
-['Inherited from mutable_buffer.]
 
-[indexterm2 buffer_size..mutable_buffers_1]
-Get the number of bytes in a non-modifiable buffer.
 
+[endsect]
 
- std::size_t buffer_size(
- const mutable_buffer & b);
 
 
+[section:overload2 posix::basic_stream_descriptor::cancel (2 of 2 overloads)]
 
-[endsect]
 
+['Inherited from posix::basic_descriptor.]
 
 
-[section:const_iterator mutable_buffers_1::const_iterator]
+Cancel all asynchronous operations associated with the descriptor.
 
-[indexterm2 const_iterator..mutable_buffers_1]
-A random-access iterator type that may be used to read elements.
 
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
 
- typedef const mutable_buffer * const_iterator;
 
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/buffer.hpp]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
 
-[*Convenience header: ][^boost/asio.hpp]
+]
 
 
-[endsect]
 
 
+[endsect]
 
-[section:end mutable_buffers_1::end]
 
-[indexterm2 end..mutable_buffers_1]
-Get a random-access iterator for one past the last element.
+[endsect]
 
+[section:close posix::basic_stream_descriptor::close]
 
- const_iterator end() const;
+[indexterm2 close..posix::basic_stream_descriptor]
+Close the descriptor.
 
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 close]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 more...]]``
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 close]``(
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 more...]]``
 
 
-[section:mutable_buffers_1 mutable_buffers_1::mutable_buffers_1]
+[section:overload1 posix::basic_stream_descriptor::close (1 of 2 overloads)]
 
-[indexterm2 mutable_buffers_1..mutable_buffers_1]
-Construct to represent a given memory range.
 
+['Inherited from posix::basic_descriptor.]
 
- ``[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload1 mutable_buffers_1]``(
- void * data,
- std::size_t size);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload1 more...]]``
 
+Close the descriptor.
 
-Construct to represent a single modifiable buffer.
 
+ void close();
 
- explicit ``[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload2 mutable_buffers_1]``(
- const mutable_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload2 more...]]``
 
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
-[section:overload1 mutable_buffers_1::mutable_buffers_1 (1 of 2 overloads)]
 
+[heading Exceptions]
+
 
-Construct to represent a given memory range.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
- mutable_buffers_1(
- void * data,
- std::size_t size);
 
 
 
@@ -52107,128 +66030,99 @@
 
 
 
-[section:overload2 mutable_buffers_1::mutable_buffers_1 (2 of 2 overloads)]
+[section:overload2 posix::basic_stream_descriptor::close (2 of 2 overloads)]
 
 
-Construct to represent a single modifiable buffer.
+['Inherited from posix::basic_descriptor.]
 
 
- mutable_buffers_1(
- const mutable_buffer & b);
+Close the descriptor.
 
 
+ boost::system::error_code close(
+ boost::system::error_code & ec);
 
-[endsect]
 
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
-[endsect]
 
-[section:operator_plus_ mutable_buffers_1::operator+]
+[heading Parameters]
+
 
-[indexterm2 operator+..mutable_buffers_1]
-Create a new modifiable buffer that is offset from the start of another.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
 
+]
 
- mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload1 operator+]``(
- const mutable_buffer & b,
- std::size_t start);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.operator_plus_.overload1 more...]]``
 
- mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const mutable_buffer & b);
- `` [''''&raquo;''' [link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 more...]]``
 
 
-[section:overload1 mutable_buffers_1::operator+ (1 of 2 overloads)]
+[endsect]
 
 
-['Inherited from mutable_buffer.]
+[endsect]
 
 
-Create a new modifiable buffer that is offset from the start of another.
+[section:get_io_service posix::basic_stream_descriptor::get_io_service]
 
 
- mutable_buffer operator+(
- const mutable_buffer & b,
- std::size_t start);
+['Inherited from basic_io_object.]
 
+[indexterm2 get_io_service..posix::basic_stream_descriptor]
+Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
 
-[endsect]
+ boost::asio::io_service & get_io_service();
 
 
+This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
-[section:overload2 mutable_buffers_1::operator+ (2 of 2 overloads)]
 
+[heading Return Value]
+
+A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
-['Inherited from mutable_buffer.]
 
 
-Create a new modifiable buffer that is offset from the start of another.
 
+[endsect]
 
- mutable_buffer operator+(
- std::size_t start,
- const mutable_buffer & b);
 
 
+[section:implementation posix::basic_stream_descriptor::implementation]
 
-[endsect]
 
+['Inherited from basic_io_object.]
 
-[endsect]
+[indexterm2 implementation..posix::basic_stream_descriptor]
+The underlying implementation of the I/O object.
 
 
-[section:value_type mutable_buffers_1::value_type]
+ implementation_type implementation;
 
-[indexterm2 value_type..mutable_buffers_1]
-The type for each element in the list of buffers.
 
 
- typedef mutable_buffer value_type;
+[endsect]
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer.
+[section:implementation_type posix::basic_stream_descriptor::implementation_type]
 
- Construct a buffer to represent a given memory range. ]
- ]
-
-]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+['Inherited from basic_io_object.]
 
- [
- [[link boost_asio.reference.mutable_buffer.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
- [Create a new modifiable buffer that is offset from the start of another. ]
- ]
-
-]
+[indexterm2 implementation_type..posix::basic_stream_descriptor]
+The underlying implementation type of I/O object.
+
+
+ typedef service_type::implementation_type implementation_type;
 
-The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -52236,68 +66130,74 @@
 [endsect]
 
 
+[section:io_control posix::basic_stream_descriptor::io_control]
 
-[endsect]
+[indexterm2 io_control..posix::basic_stream_descriptor]
+Perform an IO control command on the descriptor.
 
-[section:null_buffers null_buffers]
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 more...]]``
 
-An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 more...]]``
 
 
- class null_buffers
+[section:overload1 posix::basic_stream_descriptor::io_control (1 of 2 overloads)]
 
 
-[heading Types]
-[table
- [[Name][Description]]
+['Inherited from posix::basic_descriptor.]
 
- [
 
- [[link boost_asio.reference.null_buffers.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
-
- ]
+Perform an IO control command on the descriptor.
 
- [
 
- [[link boost_asio.reference.null_buffers.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
+
+
+This function is used to execute an IO control command on the descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
   
- ]
+[[command][The IO control command to be performed on the descriptor.]]
 
 ]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.null_buffers.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
- ]
-
- [
- [[link boost_asio.reference.null_buffers.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
   
+[[boost::system::system_error][Thrown on failure.]]
+
 ]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[heading Example]
+
+Getting the number of bytes ready to read:
 
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::posix::stream_descriptor::bytes_readable command;
+ descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
 
-[section:begin null_buffers::begin]
 
-[indexterm2 begin..null_buffers]
-Get a random-access iterator to the first element.
 
 
- const_iterator begin() const;
 
 
 
@@ -52305,171 +66205,162 @@
 
 
 
-[section:const_iterator null_buffers::const_iterator]
+[section:overload2 posix::basic_stream_descriptor::io_control (2 of 2 overloads)]
 
-[indexterm2 const_iterator..null_buffers]
-A random-access iterator type that may be used to read elements.
 
+['Inherited from posix::basic_descriptor.]
 
- typedef const mutable_buffer * const_iterator;
 
+Perform an IO control command on the descriptor.
 
 
-[heading Requirements]
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
-[*Header: ][^boost/asio/buffer.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+This function is used to execute an IO control command on the descriptor.
 
 
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the descriptor.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
-[section:end null_buffers::end]
 
-[indexterm2 end..null_buffers]
-Get a random-access iterator for one past the last element.
 
+[heading Example]
+
+Getting the number of bytes ready to read:
 
- const_iterator end() const;
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::posix::stream_descriptor::bytes_readable command;
+ boost::system::error_code ec;
+ descriptor.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
 
 
 
-[endsect]
 
 
 
-[section:value_type null_buffers::value_type]
 
-[indexterm2 value_type..null_buffers]
-The type for each element in the list of buffers.
+[endsect]
 
 
- typedef mutable_buffer value_type;
+[endsect]
 
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:is_open posix::basic_stream_descriptor::is_open]
 
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer.
 
- Construct a buffer to represent a given memory range. ]
- ]
-
-]
+['Inherited from posix::basic_descriptor.]
 
-[heading Related Functions]
-[table
- [[Name][Description]]
+[indexterm2 is_open..posix::basic_stream_descriptor]
+Determine whether the descriptor is open.
 
- [
- [[link boost_asio.reference.mutable_buffer.buffer_cast [*buffer_cast]]]
- [Cast a non-modifiable buffer to a specified pointer to POD type. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
- [Create a new modifiable buffer that is offset from the start of another. ]
- ]
-
-]
 
-The [link boost_asio.reference.mutable_buffer `mutable_buffer`] class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.
+ bool is_open() const;
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/buffer.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[section:lowest_layer posix::basic_stream_descriptor::lowest_layer]
 
-[endsect]
+[indexterm2 lowest_layer..posix::basic_stream_descriptor]
+Get a reference to the lowest layer.
 
 
+ lowest_layer_type & ``[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload1 lowest_layer]``();
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload1 more...]]``
 
-[endsect]
 
+Get a const reference to the lowest layer.
 
-[section:placeholders__bytes_transferred placeholders::bytes_transferred]
 
-[indexterm1 placeholders::bytes_transferred]
-An argument placeholder, for use with boost::bind(), that corresponds to the bytes\_transferred argument of a handler for asynchronous functions such as `boost::asio::basic_stream_socket::async_write_some` or `boost::asio::async_write`.
+ const lowest_layer_type & ``[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload2 lowest_layer]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload2 more...]]``
 
 
- unspecified bytes_transferred;
+[section:overload1 posix::basic_stream_descriptor::lowest_layer (1 of 2 overloads)]
 
 
-[heading Requirements]
+['Inherited from posix::basic_descriptor.]
 
-[*Header: ][^boost/asio/placeholders.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+Get a reference to the lowest layer.
 
 
-[endsect]
+ lowest_layer_type & lowest_layer();
 
 
+This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
 
-[section:placeholders__error placeholders::error]
 
-[indexterm1 placeholders::error]
-An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
 
- unspecified error;
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/placeholders.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+
+[section:overload2 posix::basic_stream_descriptor::lowest_layer (2 of 2 overloads)]
 
 
-[endsect]
+['Inherited from posix::basic_descriptor.]
 
 
+Get a const reference to the lowest layer.
 
-[section:placeholders__iterator placeholders::iterator]
 
-[indexterm1 placeholders::iterator]
-An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as boost::asio::basic\_resolver::resolve.
+ const lowest_layer_type & lowest_layer() const;
 
 
- unspecified iterator;
+This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Requirements]
+[heading Return Value]
+
+A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
-[*Header: ][^boost/asio/placeholders.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:posix__basic_descriptor posix::basic_descriptor]
+[endsect]
 
 
-Provides POSIX descriptor functionality.
+[section:lowest_layer_type posix::basic_stream_descriptor::lowest_layer_type]
 
 
- template<
- typename ``[link boost_asio.reference.DescriptorService DescriptorService]``>
- class basic_descriptor :
- public basic_io_object< DescriptorService >,
- public posix::descriptor_base
+['Inherited from posix::basic_descriptor.]
+
+[indexterm2 lowest_layer_type..posix::basic_stream_descriptor]
+A [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] is always the lowest layer.
+
+
+ typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
 
 
 [heading Types]
@@ -52499,15 +66390,22 @@
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle_type [*native_handle_type]]]
     [The native representation of a descriptor. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
   
   ]
 
@@ -52557,11 +66455,6 @@
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
     [Determine whether the descriptor is open. ]
   ]
@@ -52575,9 +66468,33 @@
   
   [
     [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.native_handle [*native_handle]]]
     [Get the native descriptor representation. ]
   ]
   
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
+
+ Sets the non-blocking mode of the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
+
+ Sets the non-blocking mode of the descriptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
+ ]
+
 ]
 
 [heading Protected Member Functions]
@@ -52618,101 +66535,122 @@
 
 
 
+
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:assign posix::basic_descriptor::assign]
 
-[indexterm2 assign..posix::basic_descriptor]
-Assign an existing native descriptor to the descriptor.
+[endsect]
 
 
- void ``[link boost_asio.reference.posix__basic_descriptor.assign.overload1 assign]``(
- const native_type & native_descriptor);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.assign.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.assign.overload2 assign]``(
- const native_type & native_descriptor,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.assign.overload2 more...]]``
+[section:native posix::basic_stream_descriptor::native]
 
 
-[section:overload1 posix::basic_descriptor::assign (1 of 2 overloads)]
+['Inherited from posix::basic_descriptor.]
+
+[indexterm2 native..posix::basic_stream_descriptor]
+(Deprecated: Use `native_handle()`.) Get the native descriptor representation.
 
 
-Assign an existing native descriptor to the descriptor.
+ native_type native();
 
 
- void assign(
- const native_type & native_descriptor);
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle posix::basic_stream_descriptor::native_handle]
+
+
+['Inherited from posix::basic_descriptor.]
+
+[indexterm2 native_handle..posix::basic_stream_descriptor]
+Get the native descriptor representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
 
 
 
-[endsect]
+[section:native_handle_type posix::basic_stream_descriptor::native_handle_type]
 
+[indexterm2 native_handle_type..posix::basic_stream_descriptor]
+The native representation of a descriptor.
 
 
-[section:overload2 posix::basic_descriptor::assign (2 of 2 overloads)]
+ typedef StreamDescriptorService::native_handle_type native_handle_type;
 
 
-Assign an existing native descriptor to the descriptor.
 
+[heading Requirements]
 
- boost::system::error_code assign(
- const native_type & native_descriptor,
- boost::system::error_code & ec);
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
+[section:native_non_blocking posix::basic_stream_descriptor::native_non_blocking]
 
-[section:basic_descriptor posix::basic_descriptor::basic_descriptor]
+[indexterm2 native_non_blocking..posix::basic_stream_descriptor]
+Gets the non-blocking mode of the native descriptor implementation.
 
-[indexterm2 basic_descriptor..posix::basic_descriptor]
-Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] without opening it.
 
+ bool ``[link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload1 native_non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload1 more...]]``
 
- explicit ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 more...]]``
 
+Sets the non-blocking mode of the native descriptor implementation.
 
-Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] on an existing native descriptor.
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload2 native_non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload2 more...]]``
 
- ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload2 basic_descriptor]``(
- boost::asio::io_service & io_service,
- const native_type & native_descriptor);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload2 more...]]``
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload3 native_non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking.overload3 more...]]``
 
 
-[section:overload1 posix::basic_descriptor::basic_descriptor (1 of 2 overloads)]
+[section:overload1 posix::basic_stream_descriptor::native_non_blocking (1 of 3 overloads)]
 
 
-Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] without opening it.
+['Inherited from posix::basic_descriptor.]
 
 
- basic_descriptor(
- boost::asio::io_service & io_service);
+Gets the non-blocking mode of the native descriptor implementation.
 
 
-This constructor creates a descriptor without opening it.
+ bool native_non_blocking() const;
 
 
-[heading Parameters]
-
+This function is used to retrieve the non-blocking mode of the underlying native descriptor. This mode has no effect on the behaviour of the descriptor object's synchronous operations.
 
-[variablelist
-
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
 
-]
+[heading Return Value]
+
+`true` if the underlying descriptor is in non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).
+
+
+[heading Remarks]
+
+The current non-blocking mode is cached by the descriptor object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native descriptor.
 
 
 
@@ -52721,18 +66659,20 @@
 
 
 
-[section:overload2 posix::basic_descriptor::basic_descriptor (2 of 2 overloads)]
+[section:overload2 posix::basic_stream_descriptor::native_non_blocking (2 of 3 overloads)]
 
 
-Construct a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] on an existing native descriptor.
+['Inherited from posix::basic_descriptor.]
 
 
- basic_descriptor(
- boost::asio::io_service & io_service,
- const native_type & native_descriptor);
+Sets the non-blocking mode of the native descriptor implementation.
 
 
-This constructor creates a descriptor object to hold an existing native descriptor.
+ void native_non_blocking(
+ bool mode);
+
+
+This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
 
 
 [heading Parameters]
@@ -52740,9 +66680,7 @@
 
 [variablelist
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
-
-[[native_descriptor][A native descriptor.]]
+[[mode][If `true`, the underlying descriptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
 ]
 
@@ -52752,7 +66690,7 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
 
 ]
 
@@ -52762,114 +66700,108 @@
 [endsect]
 
 
-[endsect]
 
+[section:overload3 posix::basic_stream_descriptor::native_non_blocking (3 of 3 overloads)]
 
-[section:bytes_readable posix::basic_descriptor::bytes_readable]
 
+['Inherited from posix::basic_descriptor.]
 
-['Inherited from posix::descriptor_base.]
 
-[indexterm2 bytes_readable..posix::basic_descriptor]
-IO control command to get the amount of data that can be read without blocking.
+Sets the non-blocking mode of the native descriptor implementation.
 
 
- typedef implementation_defined bytes_readable;
+ boost::system::error_code native_non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
 
 
+This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
 
-Implements the FIONREAD IO control command.
 
+[heading Parameters]
+
 
-[heading Example]
+[variablelist
   
+[[mode][If `true`, the underlying descriptor is put into non-blocking mode and direct system calls may fail with `boost::asio::error::would_block` (or the equivalent system error).]]
 
+[[ec][Set to indicate what error occurred, if any. If the `mode` is `false`, but the current value of `non_blocking()` is `true`, this function fails with `boost::asio::error::invalid_argument`, as the combination does not make sense. ]]
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::bytes_readable command(true);
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
-
-
-
-
-
+]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[endsect]
 
 
 [endsect]
 
 
-[section:cancel posix::basic_descriptor::cancel]
+[section:native_type posix::basic_stream_descriptor::native_type]
 
-[indexterm2 cancel..posix::basic_descriptor]
-Cancel all asynchronous operations associated with the descriptor.
+[indexterm2 native_type..posix::basic_stream_descriptor]
+(Deprecated: Use native\_handle\_type.) The native representation of a descriptor.
 
 
- void ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.cancel.overload1 more...]]``
+ typedef StreamDescriptorService::native_handle_type native_type;
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.cancel.overload2 more...]]``
 
 
-[section:overload1 posix::basic_descriptor::cancel (1 of 2 overloads)]
+[heading Requirements]
 
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
-Cancel all asynchronous operations associated with the descriptor.
+[*Convenience header: ][^boost/asio.hpp]
 
 
- void cancel();
+[endsect]
 
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
+[section:non_blocking posix::basic_stream_descriptor::non_blocking]
 
+[indexterm2 non_blocking..posix::basic_stream_descriptor]
+Gets the non-blocking mode of the descriptor.
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ bool ``[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload1 non_blocking]``() const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload1 more...]]``
 
-]
 
+Sets the non-blocking mode of the descriptor.
 
 
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload2 non_blocking]``(
+ bool mode);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload2 more...]]``
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload3 non_blocking]``(
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.non_blocking.overload3 more...]]``
 
 
+[section:overload1 posix::basic_stream_descriptor::non_blocking (1 of 3 overloads)]
 
-[section:overload2 posix::basic_descriptor::cancel (2 of 2 overloads)]
 
+['Inherited from posix::basic_descriptor.]
 
-Cancel all asynchronous operations associated with the descriptor.
 
+Gets the non-blocking mode of the descriptor.
 
- boost::system::error_code cancel(
- boost::system::error_code & ec);
 
+ bool non_blocking() const;
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Parameters]
-
+[heading Return Value]
+
+`true` if the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
 
-]
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
 
@@ -52877,32 +66809,29 @@
 [endsect]
 
 
-[endsect]
-
-[section:close posix::basic_descriptor::close]
 
-[indexterm2 close..posix::basic_descriptor]
-Close the descriptor.
+[section:overload2 posix::basic_stream_descriptor::non_blocking (2 of 3 overloads)]
 
 
- void ``[link boost_asio.reference.posix__basic_descriptor.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.close.overload1 more...]]``
+['Inherited from posix::basic_descriptor.]
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.close.overload2 more...]]``
 
+Sets the non-blocking mode of the descriptor.
 
-[section:overload1 posix::basic_descriptor::close (1 of 2 overloads)]
 
+ void non_blocking(
+ bool mode);
 
-Close the descriptor.
 
 
- void close();
+[heading Parameters]
+
 
+[variablelist
+
+[[mode][If `true`, the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
 
-This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+]
 
 
 [heading Exceptions]
@@ -52910,28 +66839,35 @@
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
 
 ]
 
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
+
+
 
 
 [endsect]
 
 
 
-[section:overload2 posix::basic_descriptor::close (2 of 2 overloads)]
+[section:overload3 posix::basic_stream_descriptor::non_blocking (3 of 3 overloads)]
 
 
-Close the descriptor.
+['Inherited from posix::basic_descriptor.]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
+Sets the non-blocking mode of the descriptor.
 
 
-This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+ boost::system::error_code non_blocking(
+ bool mode,
+ boost::system::error_code & ec);
+
 
 
 [heading Parameters]
@@ -52939,78 +66875,60 @@
 
 [variablelist
   
-[[ec][Set to indicate what error occurred, if any. ]]
+[[mode][If `true`, the descriptor's synchronous operations will fail with `boost::asio::error::would_block` if they are unable to perform the requested operation immediately. If `false`, synchronous operations will block until complete.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
+[heading Remarks]
+
+The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error `boost::asio::error::would_block`.
 
 
-[endsect]
 
 
 [endsect]
 
 
-[section:get_io_service posix::basic_descriptor::get_io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 get_io_service..posix::basic_descriptor]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & get_io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
 [endsect]
 
 
-
-[section:implementation posix::basic_descriptor::implementation]
+[section:non_blocking_io posix::basic_stream_descriptor::non_blocking_io]
 
 
-['Inherited from basic_io_object.]
+['Inherited from posix::descriptor_base.]
 
-[indexterm2 implementation..posix::basic_descriptor]
-The underlying implementation of the I/O object.
+[indexterm2 non_blocking_io..posix::basic_stream_descriptor]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor.
 
 
- implementation_type implementation;
+ typedef implementation_defined non_blocking_io;
 
 
 
-[endsect]
+Implements the FIONBIO IO control command.
 
 
+[heading Example]
+
 
-[section:implementation_type posix::basic_descriptor::implementation_type]
 
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
 
-['Inherited from basic_io_object.]
 
-[indexterm2 implementation_type..posix::basic_descriptor]
-The underlying implementation type of I/O object.
 
 
- typedef service_type::implementation_type implementation_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -53018,39 +66936,39 @@
 [endsect]
 
 
-[section:io_control posix::basic_descriptor::io_control]
+[section:read_some posix::basic_stream_descriptor::read_some]
 
-[indexterm2 io_control..posix::basic_descriptor]
-Perform an IO control command on the descriptor.
+[indexterm2 read_some..posix::basic_stream_descriptor]
+Read some data from the descriptor.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload1 io_control]``(
- IoControlCommand & command);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.io_control.overload1 more...]]``
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload1 more...]]``
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.io_control.overload2 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload2 more...]]``
 
 
-[section:overload1 posix::basic_descriptor::io_control (1 of 2 overloads)]
+[section:overload1 posix::basic_stream_descriptor::read_some (1 of 2 overloads)]
 
 
-Perform an IO control command on the descriptor.
+Read some data from the descriptor.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
 
 
-This function is used to execute an IO control command on the descriptor.
+This function is used to read data from the stream descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -53058,34 +66976,39 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the descriptor.]]
+[[buffers][One or more buffers into which the data will be read.]]
 
 ]
 
 
+[heading Return Value]
+
+The number of bytes read.
+
+
 [heading Exceptions]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
 ]
 
 
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+
 
 [heading Example]
   
-Getting the number of bytes ready to read:
-
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::posix::stream_descriptor::bytes_readable command;
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ descriptor.read_some(boost::asio::buffer(data, size));
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
 
@@ -53094,20 +67017,20 @@
 
 
 
-[section:overload2 posix::basic_descriptor::io_control (2 of 2 overloads)]
+[section:overload2 posix::basic_stream_descriptor::read_some (2 of 2 overloads)]
 
 
-Perform an IO control command on the descriptor.
+Read some data from the descriptor.
 
 
   template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
 
 
-This function is used to execute an IO control command on the descriptor.
+This function is used to read data from the stream descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
 
 [heading Parameters]
@@ -53115,31 +67038,21 @@
 
 [variablelist
   
-[[command][The IO control command to be performed on the descriptor.]]
+[[buffers][One or more buffers into which the data will be read.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
-
-[heading Example]
-
-Getting the number of bytes ready to read:
-
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::posix::stream_descriptor::bytes_readable command;
- boost::system::error_code ec;
- descriptor.io_control(command, ec);
- if (ec)
- {
- // An error occurred.
- }
- std::size_t bytes_readable = command.get();
-
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
 
 
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
 
 
@@ -53150,328 +67063,254 @@
 [endsect]
 
 
-[section:io_service posix::basic_descriptor::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..posix::basic_descriptor]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[section:release posix::basic_stream_descriptor::release]
 
 
- boost::asio::io_service & io_service();
+['Inherited from posix::basic_descriptor.]
 
+[indexterm2 release..posix::basic_stream_descriptor]
+Release ownership of the native descriptor implementation.
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+ native_handle_type release();
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+This function may be used to obtain the underlying representation of the descriptor. After calling this function, `is_open()` returns false. The caller is responsible for closing the descriptor.
 
+All outstanding asynchronous read or write operations will finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
 [endsect]
 
 
 
-[section:is_open posix::basic_descriptor::is_open]
-
-[indexterm2 is_open..posix::basic_descriptor]
-Determine whether the descriptor is open.
-
-
- bool is_open() const;
-
-
-
-[endsect]
+[section:service posix::basic_stream_descriptor::service]
 
 
-[section:lowest_layer posix::basic_descriptor::lowest_layer]
+['Inherited from basic_io_object.]
 
-[indexterm2 lowest_layer..posix::basic_descriptor]
-Get a reference to the lowest layer.
+[indexterm2 service..posix::basic_stream_descriptor]
+The service associated with the I/O object.
 
 
- lowest_layer_type & ``[link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload1 more...]]``
+ service_type & service;
 
 
-Get a const reference to the lowest layer.
 
+[endsect]
 
- const lowest_layer_type & ``[link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_descriptor.lowest_layer.overload2 more...]]``
 
 
-[section:overload1 posix::basic_descriptor::lowest_layer (1 of 2 overloads)]
+[section:service_type posix::basic_stream_descriptor::service_type]
 
 
-Get a reference to the lowest layer.
+['Inherited from basic_io_object.]
 
+[indexterm2 service_type..posix::basic_stream_descriptor]
+The type of the service that will be used to provide I/O operations.
 
- lowest_layer_type & lowest_layer();
 
+ typedef StreamDescriptorService service_type;
 
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+[heading Requirements]
 
+[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[section:write_some posix::basic_stream_descriptor::write_some]
 
-[section:overload2 posix::basic_descriptor::lowest_layer (2 of 2 overloads)]
-
-
-Get a const reference to the lowest layer.
-
-
- const lowest_layer_type & lowest_layer() const;
-
-
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
-
-
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
-
+[indexterm2 write_some..posix::basic_stream_descriptor]
+Write some data to the descriptor.
 
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload1 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload2 more...]]``
 
 
-[endsect]
+[section:overload1 posix::basic_stream_descriptor::write_some (1 of 2 overloads)]
 
 
-[section:lowest_layer_type posix::basic_descriptor::lowest_layer_type]
+Write some data to the descriptor.
 
-[indexterm2 lowest_layer_type..posix::basic_descriptor]
-A [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] is always the lowest layer.
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
 
- typedef basic_descriptor< DescriptorService > lowest_layer_type;
 
+This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[heading Parameters]
+
 
- [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
+[variablelist
   
- ]
+[[buffers][One or more data buffers to be written to the descriptor.]]
 
- [
+]
 
- [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
 
- [
+[heading Return Value]
+
+The number of bytes written.
 
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
-
- ]
 
- [
+[heading Exceptions]
+
 
- [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
- [
+]
 
- [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
-
- ]
 
- [
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
- [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
 
-]
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+ descriptor.write_some(boost::asio::buffer(data, size));
 
- [
- [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
- [Assign an existing native descriptor to the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
- [Construct a basic_descriptor without opening it.
 
- Construct a basic_descriptor on an existing native descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
- [Close the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
- [Get the native descriptor representation. ]
- ]
-
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.posix__basic_descriptor._basic_descriptor [*~basic_descriptor]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[endsect]
 
- [
- [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
 
- [
- [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
 
-]
+[section:overload2 posix::basic_stream_descriptor::write_some (2 of 2 overloads)]
 
-The [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor.
 
+Write some data to the descriptor.
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
+This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
-[heading Requirements]
+[heading Parameters]
+
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes written. Returns 0 if an error occurred.
 
 
+[heading Remarks]
+
+The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
-[section:native posix::basic_descriptor::native]
 
-[indexterm2 native..posix::basic_descriptor]
-Get the native descriptor representation.
 
 
- native_type native();
+[endsect]
 
 
-This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+[endsect]
 
 
 [endsect]
 
+[section:posix__descriptor_base posix::descriptor_base]
 
 
-[section:native_type posix::basic_descriptor::native_type]
+The [link boost_asio.reference.posix__descriptor_base `posix::descriptor_base`] class is used as a base for the [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template so that we have a common place to define the associated IO control commands.
 
-[indexterm2 native_type..posix::basic_descriptor]
-The native representation of a descriptor.
 
+ class descriptor_base
 
- typedef DescriptorService::native_type native_type;
 
+[heading Types]
+[table
+ [[Name][Description]]
 
+ [
 
-[heading Requirements]
+ [[link boost_asio.reference.posix__descriptor_base.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+ [
 
-[*Convenience header: ][^boost/asio.hpp]
+ [[link boost_asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
+
+ ]
 
+]
 
-[endsect]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.posix__descriptor_base._descriptor_base [*~descriptor_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/posix/descriptor_base.hpp]
 
-[section:non_blocking_io posix::basic_descriptor::non_blocking_io]
+[*Convenience header: ][^boost/asio.hpp]
 
 
-['Inherited from posix::descriptor_base.]
+[section:bytes_readable posix::descriptor_base::bytes_readable]
 
-[indexterm2 non_blocking_io..posix::basic_descriptor]
-IO control command to set the blocking mode of the descriptor.
+[indexterm2 bytes_readable..posix::descriptor_base]
+IO control command to get the amount of data that can be read without blocking.
 
 
- typedef implementation_defined non_blocking_io;
+ typedef implementation_defined bytes_readable;
 
 
 
-Implements the FIONBIO IO control command.
+Implements the FIONREAD IO control command.
 
 
 [heading Example]
@@ -53480,8 +67319,9 @@
 
    boost::asio::posix::stream_descriptor descriptor(io_service);
    ...
- boost::asio::descriptor_base::non_blocking_io command(true);
+ boost::asio::descriptor_base::bytes_readable command(true);
    descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
 
 
 
@@ -53491,7 +67331,7 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+[*Header: ][^boost/asio/posix/descriptor_base.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -53500,39 +67340,37 @@
 
 
 
-[section:service posix::basic_descriptor::service]
-
-
-['Inherited from basic_io_object.]
+[section:non_blocking_io posix::descriptor_base::non_blocking_io]
 
-[indexterm2 service..posix::basic_descriptor]
-The service associated with the I/O object.
+[indexterm2 non_blocking_io..posix::descriptor_base]
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the descriptor.
 
 
- service_type & service;
+ typedef implementation_defined non_blocking_io;
 
 
 
-[endsect]
+Implements the FIONBIO IO control command.
 
 
+[heading Example]
+
 
-[section:service_type posix::basic_descriptor::service_type]
 
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
 
-['Inherited from basic_io_object.]
 
-[indexterm2 service_type..posix::basic_descriptor]
-The type of the service that will be used to provide I/O operations.
 
 
- typedef DescriptorService service_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_descriptor.hpp]
+[*Header: ][^boost/asio/posix/descriptor_base.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -53541,13 +67379,13 @@
 
 
 
-[section:_basic_descriptor posix::basic_descriptor::~basic_descriptor]
+[section:_descriptor_base posix::descriptor_base::~descriptor_base]
 
-[indexterm2 ~basic_descriptor..posix::basic_descriptor]
+[indexterm2 ~descriptor_base..posix::descriptor_base]
 Protected destructor to prevent deletion through this type.
 
 
- ~basic_descriptor();
+ ~descriptor_base();
 
 
 
@@ -53557,16 +67395,14 @@
 
 [endsect]
 
-[section:posix__basic_stream_descriptor posix::basic_stream_descriptor]
 
+[section:posix__stream_descriptor posix::stream_descriptor]
 
-Provides stream-oriented descriptor functionality.
+[indexterm1 posix::stream_descriptor]
+Typedef for the typical usage of a stream-oriented descriptor.
 
 
- template<
- typename ``[link boost_asio.reference.StreamDescriptorService StreamDescriptorService]`` = stream_descriptor_service>
- class basic_stream_descriptor :
- public posix::basic_descriptor< StreamDescriptorService >
+ typedef basic_stream_descriptor stream_descriptor;
 
 
 [heading Types]
@@ -53596,15 +67432,22 @@
 
   [
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_handle_type [*native_handle_type]]]
     [The native representation of a descriptor. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a descriptor. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. ]
   
   ]
 
@@ -53664,11 +67507,6 @@
   ]
   
   [
- [[link boost_asio.reference.posix__basic_stream_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.posix__basic_stream_descriptor.is_open [*is_open]]]
     [Determine whether the descriptor is open. ]
   ]
@@ -53682,15 +67520,39 @@
   
   [
     [[link boost_asio.reference.posix__basic_stream_descriptor.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_handle [*native_handle]]]
     [Get the native descriptor representation. ]
   ]
   
   [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
+
+ Sets the non-blocking mode of the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
+
+ Sets the non-blocking mode of the descriptor. ]
+ ]
+
+ [
     [[link boost_asio.reference.posix__basic_stream_descriptor.read_some [*read_some]]]
     [Read some data from the descriptor. ]
   ]
   
   [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
+ ]
+
+ [
     [[link boost_asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]]
     [Write some data to the descriptor. ]
   ]
@@ -53725,508 +67587,375 @@
 
 
 
+
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
+[*Header: ][^boost/asio/posix/stream_descriptor.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
-[section:assign posix::basic_stream_descriptor::assign]
-
-[indexterm2 assign..posix::basic_stream_descriptor]
-Assign an existing native descriptor to the descriptor.
-
-
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 assign]``(
- const native_type & native_descriptor);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 more...]]``
-
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload2 assign]``(
- const native_type & native_descriptor,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.assign.overload2 more...]]``
-
-
-[section:overload1 posix::basic_stream_descriptor::assign (1 of 2 overloads)]
-
-
-['Inherited from posix::basic_descriptor.]
-
-
-Assign an existing native descriptor to the descriptor.
-
-
- void assign(
- const native_type & native_descriptor);
-
-
 
 [endsect]
 
 
+[section:posix__stream_descriptor_service posix::stream_descriptor_service]
 
-[section:overload2 posix::basic_stream_descriptor::assign (2 of 2 overloads)]
-
-
-['Inherited from posix::basic_descriptor.]
-
-
-Assign an existing native descriptor to the descriptor.
-
-
- boost::system::error_code assign(
- const native_type & native_descriptor,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:async_read_some posix::basic_stream_descriptor::async_read_some]
-
-[indexterm2 async_read_some..posix::basic_stream_descriptor]
-Start an asynchronous read.
 
+Default service implementation for a stream descriptor.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
 
+ class stream_descriptor_service :
+ public io_service::service
 
-This function is used to asynchronously read data from the stream descriptor. The function call always returns immediately.
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[heading Parameters]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.posix__stream_descriptor_service.implementation_type [*implementation_type]]]
+ [The type of a stream descriptor implementation. ]
   
-[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes read.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
-
-]
-
-
-[heading Remarks]
-
-The read operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.async_read `async_read`] function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
+ ]
 
+ [
 
-[heading Example]
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_handle_type [*native_handle_type]]]
+ [The native descriptor type. ]
   
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
-
- descriptor.async_read_some(boost::asio::buffer(data, size), handler);
-
-
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-
-
-
-
-[endsect]
-
-
-
-[section:async_write_some posix::basic_stream_descriptor::async_write_some]
-
-[indexterm2 async_write_some..posix::basic_stream_descriptor]
-Start an asynchronous write.
-
-
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
-
-
-This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
-
+ ]
 
-[heading Parameters]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native descriptor type. ]
   
-[[buffers][One or more data buffers to be written to the descriptor. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes written.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
+ ]
 
 ]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[heading Remarks]
-
-The write operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.async_write `async_write`] function if you need to ensure that all data is written before the asynchronous operation completes.
-
-
-[heading Example]
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.assign [*assign]]]
+ [Assign an existing native descriptor to a stream descriptor. ]
+ ]
   
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
-
- descriptor.async_write_some(boost::asio::buffer(data, size), handler);
-
-
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-
-
-
-
-[endsect]
-
-
-[section:basic_stream_descriptor posix::basic_stream_descriptor::basic_stream_descriptor]
-
-[indexterm2 basic_stream_descriptor..posix::basic_stream_descriptor]
-Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] without opening it.
-
-
- explicit ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 basic_stream_descriptor]``(
- boost::asio::io_service & io_service);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 more...]]``
-
-
-Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] on an existing native descriptor.
-
-
- ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 basic_stream_descriptor]``(
- boost::asio::io_service & io_service,
- const native_type & native_descriptor);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload2 more...]]``
-
-
-[section:overload1 posix::basic_stream_descriptor::basic_stream_descriptor (1 of 2 overloads)]
-
-
-Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] without opening it.
-
-
- basic_stream_descriptor(
- boost::asio::io_service & io_service);
-
-
-This constructor creates a stream descriptor without opening it. The descriptor needs to be opened and then connected or accepted before data can be sent or received on it.
-
-
-[heading Parameters]
-
-
-[variablelist
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
-
-]
-
-
-
-
-[endsect]
-
-
-
-[section:overload2 posix::basic_stream_descriptor::basic_stream_descriptor (2 of 2 overloads)]
-
-
-Construct a [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] on an existing native descriptor.
-
-
- basic_stream_descriptor(
- boost::asio::io_service & io_service,
- const native_type & native_descriptor);
-
-
-This constructor creates a stream descriptor object to hold an existing native descriptor.
-
-
-[heading Parameters]
-
-
-[variablelist
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
   
-[[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
-
-[[native_descriptor][The new underlying descriptor implementation.]]
-
-]
-
-
-[heading Exceptions]
-
-
-[variablelist
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
+ ]
   
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:bytes_readable posix::basic_stream_descriptor::bytes_readable]
-
-
-['Inherited from posix::descriptor_base.]
-
-[indexterm2 bytes_readable..posix::basic_stream_descriptor]
-IO control command to get the amount of data that can be read without blocking.
-
-
- typedef implementation_defined bytes_readable;
-
-
-
-Implements the FIONREAD IO control command.
-
-
-[heading Example]
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.close [*close]]]
+ [Close a stream descriptor implementation. ]
+ ]
   
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.construct [*construct]]]
+ [Construct a new stream descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.destroy [*destroy]]]
+ [Destroy a stream descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_handle [*native_handle]]]
+ [Get the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native descriptor implementation.
 
+ Sets the non-blocking mode of the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the descriptor.
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::bytes_readable command(true);
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
-
-
-
+ Sets the non-blocking mode of the descriptor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.read_some [*read_some]]]
+ [Read some data from the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.release [*release]]]
+ [Release ownership of the native descriptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.stream_descriptor_service [*stream_descriptor_service]]]
+ [Construct a new stream descriptor service for the specified io_service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.write_some [*write_some]]]
+ [Write the given data to the stream. ]
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
 
+]
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
+[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
-
-
-[section:cancel posix::basic_stream_descriptor::cancel]
-
-[indexterm2 cancel..posix::basic_stream_descriptor]
-Cancel all asynchronous operations associated with the descriptor.
+[section:assign posix::stream_descriptor_service::assign]
 
+[indexterm2 assign..posix::stream_descriptor_service]
+Assign an existing native descriptor to a stream descriptor.
 
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 cancel]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const native_handle_type & native_descriptor,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 more...]]``
 
 
-[section:overload1 posix::basic_stream_descriptor::cancel (1 of 2 overloads)]
 
+[endsect]
 
-['Inherited from posix::basic_descriptor.]
 
 
-Cancel all asynchronous operations associated with the descriptor.
+[section:async_read_some posix::stream_descriptor_service::async_read_some]
 
+[indexterm2 async_read_some..posix::stream_descriptor_service]
+Start an asynchronous read.
 
- void cancel();
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
 
-[heading Exceptions]
-
+[endsect]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
 
+[section:async_write_some posix::stream_descriptor_service::async_write_some]
 
+[indexterm2 async_write_some..posix::stream_descriptor_service]
+Start an asynchronous write.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
 
 
 
-[section:overload2 posix::basic_stream_descriptor::cancel (2 of 2 overloads)]
+[endsect]
 
 
-['Inherited from posix::basic_descriptor.]
 
+[section:cancel posix::stream_descriptor_service::cancel]
 
+[indexterm2 cancel..posix::stream_descriptor_service]
 Cancel all asynchronous operations associated with the descriptor.
 
 
   boost::system::error_code cancel(
+ implementation_type & impl,
       boost::system::error_code & ec);
 
 
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the `boost::asio::error::operation_aborted` error.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
 
-]
+[section:close posix::stream_descriptor_service::close]
 
+[indexterm2 close..posix::stream_descriptor_service]
+Close a stream descriptor implementation.
 
 
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
-[endsect]
 
 
 [endsect]
 
-[section:close posix::basic_stream_descriptor::close]
-
-[indexterm2 close..posix::basic_stream_descriptor]
-Close the descriptor.
 
 
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 close]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 more...]]``
+[section:construct posix::stream_descriptor_service::construct]
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 more...]]``
+[indexterm2 construct..posix::stream_descriptor_service]
+Construct a new stream descriptor implementation.
 
 
-[section:overload1 posix::basic_stream_descriptor::close (1 of 2 overloads)]
+ void construct(
+ implementation_type & impl);
 
 
-['Inherited from posix::basic_descriptor.]
 
+[endsect]
 
-Close the descriptor.
 
 
- void close();
+[section:destroy posix::stream_descriptor_service::destroy]
 
+[indexterm2 destroy..posix::stream_descriptor_service]
+Destroy a stream descriptor implementation.
 
-This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
 
+ void destroy(
+ implementation_type & impl);
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
+[endsect]
 
 
 
+[section:get_io_service posix::stream_descriptor_service::get_io_service]
 
-[endsect]
 
+['Inherited from io_service.]
 
+[indexterm2 get_io_service..posix::stream_descriptor_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
-[section:overload2 posix::basic_stream_descriptor::close (2 of 2 overloads)]
 
+ boost::asio::io_service & get_io_service();
 
-['Inherited from posix::basic_descriptor.]
 
 
-Close the descriptor.
+[endsect]
 
 
- boost::system::error_code close(
- boost::system::error_code & ec);
 
+[section:id posix::stream_descriptor_service::id]
 
-This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the `boost::asio::error::operation_aborted` error.
+[indexterm2 id..posix::stream_descriptor_service]
+The unique service identifier.
 
 
-[heading Parameters]
-
+ static boost::asio::io_service::id id;
 
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
 
-]
 
+[endsect]
 
 
 
-[endsect]
+[section:implementation_type posix::stream_descriptor_service::implementation_type]
 
+[indexterm2 implementation_type..posix::stream_descriptor_service]
+The type of a stream descriptor implementation.
 
-[endsect]
 
+ typedef implementation_defined implementation_type;
 
-[section:get_io_service posix::basic_stream_descriptor::get_io_service]
 
 
-['Inherited from basic_io_object.]
+[heading Requirements]
 
-[indexterm2 get_io_service..posix::basic_stream_descriptor]
-Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
+[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
- boost::asio::io_service & get_io_service();
 
+[endsect]
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[section:io_control posix::stream_descriptor_service::io_control]
 
+[indexterm2 io_control..posix::stream_descriptor_service]
+Perform an IO control command on the descriptor.
 
 
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
+ boost::system::error_code & ec);
 
-[endsect]
 
 
+[endsect]
 
-[section:implementation posix::basic_stream_descriptor::implementation]
 
 
-['Inherited from basic_io_object.]
+[section:is_open posix::stream_descriptor_service::is_open]
 
-[indexterm2 implementation..posix::basic_stream_descriptor]
-The underlying implementation of the I/O object.
+[indexterm2 is_open..posix::stream_descriptor_service]
+Determine whether the descriptor is open.
 
 
- implementation_type implementation;
+ bool is_open(
+ const implementation_type & impl) const;
 
 
 
@@ -54234,97 +67963,85 @@
 
 
 
-[section:implementation_type posix::basic_stream_descriptor::implementation_type]
-
+[section:native posix::stream_descriptor_service::native]
 
-['Inherited from basic_io_object.]
+[indexterm2 native..posix::stream_descriptor_service]
+(Deprecated: Use `native_handle()`.) Get the native descriptor implementation.
 
-[indexterm2 implementation_type..posix::basic_stream_descriptor]
-The underlying implementation type of I/O object.
 
+ native_type native(
+ implementation_type & impl);
 
- typedef service_type::implementation_type implementation_type;
 
 
+[endsect]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:native_handle posix::stream_descriptor_service::native_handle]
 
+[indexterm2 native_handle..posix::stream_descriptor_service]
+Get the native descriptor implementation.
 
-[endsect]
 
+ native_handle_type native_handle(
+ implementation_type & impl);
 
-[section:io_control posix::basic_stream_descriptor::io_control]
 
-[indexterm2 io_control..posix::basic_stream_descriptor]
-Perform an IO control command on the descriptor.
 
+[endsect]
 
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 io_control]``(
- IoControlCommand & command);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 more...]]``
 
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 io_control]``(
- IoControlCommand & command,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 more...]]``
 
+[section:native_handle_type posix::stream_descriptor_service::native_handle_type]
 
-[section:overload1 posix::basic_stream_descriptor::io_control (1 of 2 overloads)]
+[indexterm2 native_handle_type..posix::stream_descriptor_service]
+The native descriptor type.
 
 
-['Inherited from posix::basic_descriptor.]
+ typedef implementation_defined native_handle_type;
 
 
-Perform an IO control command on the descriptor.
 
+[heading Requirements]
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
+[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-This function is used to execute an IO control command on the descriptor.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[command][The IO control command to be performed on the descriptor.]]
+[section:native_non_blocking posix::stream_descriptor_service::native_non_blocking]
 
-]
+[indexterm2 native_non_blocking..posix::stream_descriptor_service]
+Gets the non-blocking mode of the native descriptor implementation.
 
 
-[heading Exceptions]
-
+ bool ``[link boost_asio.reference.posix__stream_descriptor_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__stream_descriptor_service.native_non_blocking.overload1 more...]]``
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
+Sets the non-blocking mode of the native descriptor implementation.
 
 
+ boost::system::error_code ``[link boost_asio.reference.posix__stream_descriptor_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__stream_descriptor_service.native_non_blocking.overload2 more...]]``
 
-[heading Example]
-
-Getting the number of bytes ready to read:
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::posix::stream_descriptor::bytes_readable command;
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
+[section:overload1 posix::stream_descriptor_service::native_non_blocking (1 of 2 overloads)]
 
 
+Gets the non-blocking mode of the native descriptor implementation.
 
 
+ bool native_non_blocking(
+ const implementation_type & impl) const;
 
 
 
@@ -54332,84 +68049,74 @@
 
 
 
-[section:overload2 posix::basic_stream_descriptor::io_control (2 of 2 overloads)]
-
-
-['Inherited from posix::basic_descriptor.]
+[section:overload2 posix::stream_descriptor_service::native_non_blocking (2 of 2 overloads)]
 
 
-Perform an IO control command on the descriptor.
+Sets the non-blocking mode of the native descriptor implementation.
 
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
       boost::system::error_code & ec);
 
 
-This function is used to execute an IO control command on the descriptor.
-
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[command][The IO control command to be performed on the descriptor.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[endsect]
 
-]
 
+[section:native_type posix::stream_descriptor_service::native_type]
 
+[indexterm2 native_type..posix::stream_descriptor_service]
+(Deprecated: Use native\_handle\_type.) The native descriptor type.
 
-[heading Example]
-
-Getting the number of bytes ready to read:
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::posix::stream_descriptor::bytes_readable command;
- boost::system::error_code ec;
- descriptor.io_control(command, ec);
- if (ec)
- {
- // An error occurred.
- }
- std::size_t bytes_readable = command.get();
+ typedef implementation_defined native_type;
 
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
+[section:non_blocking posix::stream_descriptor_service::non_blocking]
+
+[indexterm2 non_blocking..posix::stream_descriptor_service]
+Gets the non-blocking mode of the descriptor.
 
 
-[section:io_service posix::basic_stream_descriptor::io_service]
+ bool ``[link boost_asio.reference.posix__stream_descriptor_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.posix__stream_descriptor_service.non_blocking.overload1 more...]]``
 
 
-['Inherited from basic_io_object.]
+Sets the non-blocking mode of the descriptor.
 
-[indexterm2 io_service..posix::basic_stream_descriptor]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
 
+ boost::system::error_code ``[link boost_asio.reference.posix__stream_descriptor_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.posix__stream_descriptor_service.non_blocking.overload2 more...]]``
 
- boost::asio::io_service & io_service();
 
+[section:overload1 posix::stream_descriptor_service::non_blocking (1 of 2 overloads)]
 
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
 
+Gets the non-blocking mode of the descriptor.
 
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
 
+ bool non_blocking(
+ const implementation_type & impl) const;
 
 
 
@@ -54417,58 +68124,66 @@
 
 
 
-[section:is_open posix::basic_stream_descriptor::is_open]
+[section:overload2 posix::stream_descriptor_service::non_blocking (2 of 2 overloads)]
 
 
-['Inherited from posix::basic_descriptor.]
+Sets the non-blocking mode of the descriptor.
 
-[indexterm2 is_open..posix::basic_stream_descriptor]
-Determine whether the descriptor is open.
+
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
- bool is_open() const;
 
+[endsect]
 
 
 [endsect]
 
 
-[section:lowest_layer posix::basic_stream_descriptor::lowest_layer]
+[section:read_some posix::stream_descriptor_service::read_some]
 
-[indexterm2 lowest_layer..posix::basic_stream_descriptor]
-Get a reference to the lowest layer.
+[indexterm2 read_some..posix::stream_descriptor_service]
+Read some data from the stream.
 
 
- lowest_layer_type & ``[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload1 lowest_layer]``();
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload1 more...]]``
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
-Get a const reference to the lowest layer.
 
+[endsect]
 
- const lowest_layer_type & ``[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload2 lowest_layer]``() const;
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer.overload2 more...]]``
 
 
-[section:overload1 posix::basic_stream_descriptor::lowest_layer (1 of 2 overloads)]
+[section:release posix::stream_descriptor_service::release]
 
+[indexterm2 release..posix::stream_descriptor_service]
+Release ownership of the native descriptor implementation.
 
-['Inherited from posix::basic_descriptor.]
 
+ native_handle_type release(
+ implementation_type & impl);
 
-Get a reference to the lowest layer.
 
 
- lowest_layer_type & lowest_layer();
+[endsect]
 
 
-This function returns a reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
 
+[section:shutdown_service posix::stream_descriptor_service::shutdown_service]
+
+[indexterm2 shutdown_service..posix::stream_descriptor_service]
+Destroy all user-defined handler objects owned by the service.
 
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
 
+ virtual void shutdown_service();
 
 
 
@@ -54476,44 +68191,52 @@
 
 
 
-[section:overload2 posix::basic_stream_descriptor::lowest_layer (2 of 2 overloads)]
-
+[section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service]
 
-['Inherited from posix::basic_descriptor.]
+[indexterm2 stream_descriptor_service..posix::stream_descriptor_service]
+Construct a new stream descriptor service for the specified [link boost_asio.reference.io_service `io_service`].
 
 
-Get a const reference to the lowest layer.
+ stream_descriptor_service(
+ boost::asio::io_service & io_service);
 
 
- const lowest_layer_type & lowest_layer() const;
 
+[endsect]
 
-This function returns a const reference to the lowest layer in a stack of layers. Since a [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] cannot contain any further layers, it simply returns a reference to itself.
 
 
-[heading Return Value]
-
-A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+[section:write_some posix::stream_descriptor_service::write_some]
 
+[indexterm2 write_some..posix::stream_descriptor_service]
+Write the given data to the stream.
 
 
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
 
-[endsect]
 
 
 [endsect]
 
 
-[section:lowest_layer_type posix::basic_stream_descriptor::lowest_layer_type]
 
+[endsect]
 
-['Inherited from posix::basic_descriptor.]
+[section:raw_socket_service raw_socket_service]
 
-[indexterm2 lowest_layer_type..posix::basic_stream_descriptor]
-A [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] is always the lowest layer.
 
+Default service implementation for a raw socket.
 
- typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class raw_socket_service :
+ public io_service::service
 
 
 [heading Types]
@@ -54522,376 +68245,533 @@
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
+ [[link boost_asio.reference.raw_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+ [[link boost_asio.reference.raw_socket_service.implementation_type [*implementation_type]]]
+ [The type of a raw socket. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
+ [[link boost_asio.reference.raw_socket_service.native_handle_type [*native_handle_type]]]
+ [The native socket type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native socket type. ]
   
   ]
 
   [
 
- [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
   
   ]
 
- [
+]
 
- [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a raw socket. ]
+ ]
   
+ [
+ [[link boost_asio.reference.raw_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
   ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive that will get the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.bind [*bind]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.close [*close]]]
+ [Close a raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.connect [*connect]]]
+ [Connect the raw socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.construct [*construct]]]
+ [Construct a new raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.destroy [*destroy]]]
+ [Destroy a raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.native_handle [*native_handle]]]
+ [Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
+ Sets the non-blocking mode of the socket. ]
+ ]
+
   [
- [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
- [Assign an existing native descriptor to the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.open [*open]]]
+ []
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
- [Construct a basic_descriptor without opening it.
-
- Construct a basic_descriptor on an existing native descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]]
+ [Construct a new raw socket service for the specified io_service. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
- [Close the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.receive_from [*receive_from]]]
+ [Receive raw data with the endpoint of the sender. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.raw_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.raw_socket_service.send_to [*send_to]]]
+ [Send raw data to the specified endpoint. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
+ [[link boost_asio.reference.raw_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
-
- Get a const reference to the lowest layer. ]
+ [[link boost_asio.reference.raw_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
   ]
   
   [
- [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
- [Get the native descriptor representation. ]
+ [[link boost_asio.reference.raw_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
   ]
   
 ]
 
-[heading Protected Member Functions]
+[heading Data Members]
 [table
   [[Name][Description]]
 
   [
- [[link boost_asio.reference.posix__basic_descriptor._basic_descriptor [*~basic_descriptor]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.raw_socket_service.id [*id]]]
+ [The unique service identifier. ]
   ]
-
+
 ]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[heading Requirements]
 
- [
- [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
- [
- [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[*Convenience header: ][^boost/asio.hpp]
 
-]
 
-The [link boost_asio.reference.posix__basic_descriptor `posix::basic_descriptor`] class template provides the ability to wrap a POSIX descriptor.
+[section:assign raw_socket_service::assign]
 
+[indexterm2 assign..raw_socket_service]
+Assign an existing native socket to a raw socket.
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
+ boost::system::error_code & ec);
 
 
 
+[endsect]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[section:async_connect raw_socket_service::async_connect]
+
+[indexterm2 async_connect..raw_socket_service]
+Start an asynchronous connect.
+
+
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
+
 
 
 [endsect]
 
 
 
-[section:native posix::basic_stream_descriptor::native]
+[section:async_receive raw_socket_service::async_receive]
 
+[indexterm2 async_receive..raw_socket_service]
+Start an asynchronous receive.
 
-['Inherited from posix::basic_descriptor.]
 
-[indexterm2 native..posix::basic_stream_descriptor]
-Get the native descriptor representation.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ ReadHandler handler);
 
 
- native_type native();
 
+[endsect]
+
+
+
+[section:async_receive_from raw_socket_service::async_receive_from]
+
+[indexterm2 async_receive_from..raw_socket_service]
+Start an asynchronous receive that will get the endpoint of the sender.
+
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive_from(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ ReadHandler handler);
 
-This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
 
 
 [endsect]
 
 
 
-[section:native_type posix::basic_stream_descriptor::native_type]
+[section:async_send raw_socket_service::async_send]
 
-[indexterm2 native_type..posix::basic_stream_descriptor]
-The native representation of a descriptor.
+[indexterm2 async_send..raw_socket_service]
+Start an asynchronous send.
 
 
- typedef StreamDescriptorService::native_type native_type;
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
 
 
-[heading Requirements]
+[endsect]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+
+[section:async_send_to raw_socket_service::async_send_to]
+
+[indexterm2 async_send_to..raw_socket_service]
+Start an asynchronous send.
+
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send_to(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
+ WriteHandler handler);
+
 
 
 [endsect]
 
 
 
-[section:non_blocking_io posix::basic_stream_descriptor::non_blocking_io]
+[section:at_mark raw_socket_service::at_mark]
 
+[indexterm2 at_mark..raw_socket_service]
+Determine whether the socket is at the out-of-band data mark.
 
-['Inherited from posix::descriptor_base.]
 
-[indexterm2 non_blocking_io..posix::basic_stream_descriptor]
-IO control command to set the blocking mode of the descriptor.
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
- typedef implementation_defined non_blocking_io;
 
+[endsect]
 
 
-Implements the FIONBIO IO control command.
 
+[section:available raw_socket_service::available]
 
-[heading Example]
-
+[indexterm2 available..raw_socket_service]
+Determine the number of bytes available for reading.
 
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::non_blocking_io command(true);
- descriptor.io_control(command);
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
 
+[endsect]
 
 
 
+[section:bind raw_socket_service::bind]
 
-[heading Requirements]
+[indexterm2 bind..raw_socket_service]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:read_some posix::basic_stream_descriptor::read_some]
 
-[indexterm2 read_some..posix::basic_stream_descriptor]
-Read some data from the descriptor.
+[section:cancel raw_socket_service::cancel]
 
+[indexterm2 cancel..raw_socket_service]
+Cancel all asynchronous operations associated with the socket.
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
+ boost::system::error_code cancel(
+ implementation_type & impl,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.read_some.overload2 more...]]``
 
 
-[section:overload1 posix::basic_stream_descriptor::read_some (1 of 2 overloads)]
 
+[endsect]
 
-Read some data from the descriptor.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+[section:close raw_socket_service::close]
 
+[indexterm2 close..raw_socket_service]
+Close a raw socket implementation.
 
-This function is used to read data from the stream descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
 
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
 
-]
+[endsect]
 
 
-[heading Return Value]
-
-The number of bytes read.
 
+[section:connect raw_socket_service::connect]
 
-[heading Exceptions]
-
+[indexterm2 connect..raw_socket_service]
+Connect the raw socket to the specified endpoint.
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
 
-]
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
 
 
-[heading Remarks]
-
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
 
+[endsect]
 
-[heading Example]
-
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
- descriptor.read_some(boost::asio::buffer(data, size));
 
+[section:construct raw_socket_service::construct]
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[indexterm2 construct..raw_socket_service]
+Construct a new raw socket implementation.
 
 
+ void construct(
+ implementation_type & impl);
+
 
 
 [endsect]
 
 
 
-[section:overload2 posix::basic_stream_descriptor::read_some (2 of 2 overloads)]
+[section:destroy raw_socket_service::destroy]
 
+[indexterm2 destroy..raw_socket_service]
+Destroy a raw socket implementation.
 
-Read some data from the descriptor.
 
+ void destroy(
+ implementation_type & impl);
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
 
 
-This function is used to read data from the stream descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+[endsect]
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
+[section:endpoint_type raw_socket_service::endpoint_type]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[indexterm2 endpoint_type..raw_socket_service]
+The endpoint type.
 
-]
 
+ typedef Protocol::endpoint endpoint_type;
 
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
 
 
-[heading Remarks]
-
-The read\_some operation may not read all of the requested number of bytes. Consider using the [link boost_asio.reference.read `read`] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+[heading Requirements]
 
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
 
+[section:get_io_service raw_socket_service::get_io_service]
 
-[section:service posix::basic_stream_descriptor::service]
 
+['Inherited from io_service.]
 
-['Inherited from basic_io_object.]
+[indexterm2 get_io_service..raw_socket_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
-[indexterm2 service..posix::basic_stream_descriptor]
-The service associated with the I/O object.
 
+ boost::asio::io_service & get_io_service();
 
- service_type & service;
+
+
+[endsect]
+
+
+
+[section:get_option raw_socket_service::get_option]
+
+[indexterm2 get_option..raw_socket_service]
+Get a socket option.
+
+
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ const implementation_type & impl,
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
 
 
@@ -54899,22 +68779,33 @@
 
 
 
-[section:service_type posix::basic_stream_descriptor::service_type]
+[section:id raw_socket_service::id]
+
+[indexterm2 id..raw_socket_service]
+The unique service identifier.
 
 
-['Inherited from basic_io_object.]
+ static boost::asio::io_service::id id;
 
-[indexterm2 service_type..posix::basic_stream_descriptor]
-The type of the service that will be used to provide I/O operations.
 
 
- typedef StreamDescriptorService service_type;
+[endsect]
+
+
+
+[section:implementation_type raw_socket_service::implementation_type]
+
+[indexterm2 implementation_type..raw_socket_service]
+The type of a raw socket.
+
+
+ typedef implementation_defined implementation_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/basic_stream_descriptor.hpp]
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -54922,214 +68813,175 @@
 [endsect]
 
 
-[section:write_some posix::basic_stream_descriptor::write_some]
 
-[indexterm2 write_some..posix::basic_stream_descriptor]
-Write some data to the descriptor.
+[section:io_control raw_socket_service::io_control]
 
+[indexterm2 io_control..raw_socket_service]
+Perform an IO control command on the socket.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload1 more...]]``
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.posix__basic_stream_descriptor.write_some.overload2 more...]]``
 
 
-[section:overload1 posix::basic_stream_descriptor::write_some (1 of 2 overloads)]
-
 
-Write some data to the descriptor.
+[endsect]
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
 
+[section:is_open raw_socket_service::is_open]
 
-This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+[indexterm2 is_open..raw_socket_service]
+Determine whether the socket is open.
 
 
-[heading Parameters]
-
+ bool is_open(
+ const implementation_type & impl) const;
 
-[variablelist
-
-[[buffers][One or more data buffers to be written to the descriptor.]]
 
-]
 
+[endsect]
 
-[heading Return Value]
-
-The number of bytes written.
 
 
-[heading Exceptions]
-
+[section:local_endpoint raw_socket_service::local_endpoint]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the connection was closed by the peer.]]
+[indexterm2 local_endpoint..raw_socket_service]
+Get the local endpoint.
 
-]
 
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
-[heading Example]
-
-To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+[endsect]
 
- descriptor.write_some(boost::asio::buffer(data, size));
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[section:native raw_socket_service::native]
 
+[indexterm2 native..raw_socket_service]
+(Deprecated: Use `native_handle()`.) Get the native socket implementation.
 
 
+ native_type native(
+ implementation_type & impl);
 
-[endsect]
 
 
+[endsect]
 
-[section:overload2 posix::basic_stream_descriptor::write_some (2 of 2 overloads)]
 
 
-Write some data to the descriptor.
+[section:native_handle raw_socket_service::native_handle]
 
+[indexterm2 native_handle..raw_socket_service]
+Get the native socket implementation.
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
 
+ native_handle_type native_handle(
+ implementation_type & impl);
 
-This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
 
 
-[heading Parameters]
-
+[endsect]
 
-[variablelist
-
-[[buffers][One or more data buffers to be written to the descriptor.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[section:native_handle_type raw_socket_service::native_handle_type]
 
+[indexterm2 native_handle_type..raw_socket_service]
+The native socket type.
 
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
 
+ typedef implementation_defined native_handle_type;
 
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the [link boost_asio.reference.write `write`] function if you need to ensure that all data is written before the blocking operation completes.
 
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
-[endsect]
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[endsect]
+[section:native_non_blocking raw_socket_service::native_non_blocking]
 
-[section:posix__descriptor_base posix::descriptor_base]
+[indexterm2 native_non_blocking..raw_socket_service]
+Gets the non-blocking mode of the native socket implementation.
 
 
-The [link boost_asio.reference.posix__descriptor_base `posix::descriptor_base`] class is used as a base for the [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template so that we have a common place to define the associated IO control commands.
+ bool ``[link boost_asio.reference.raw_socket_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.raw_socket_service.native_non_blocking.overload1 more...]]``
 
 
- class descriptor_base
+Sets the non-blocking mode of the native socket implementation.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ boost::system::error_code ``[link boost_asio.reference.raw_socket_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.raw_socket_service.native_non_blocking.overload2 more...]]``
 
- [
 
- [[link boost_asio.reference.posix__descriptor_base.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+[section:overload1 raw_socket_service::native_non_blocking (1 of 2 overloads)]
 
- [
 
- [[link boost_asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
-
- ]
+Gets the non-blocking mode of the native socket implementation.
 
-]
 
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ bool native_non_blocking(
+ const implementation_type & impl) const;
 
- [
- [[link boost_asio.reference.posix__descriptor_base._descriptor_base [*~descriptor_base]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/descriptor_base.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:bytes_readable posix::descriptor_base::bytes_readable]
+[section:overload2 raw_socket_service::native_non_blocking (2 of 2 overloads)]
 
-[indexterm2 bytes_readable..posix::descriptor_base]
-IO control command to get the amount of data that can be read without blocking.
 
+Sets the non-blocking mode of the native socket implementation.
 
- typedef implementation_defined bytes_readable;
 
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
-Implements the FIONREAD IO control command.
 
+[endsect]
 
-[heading Example]
-
 
+[endsect]
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::bytes_readable command(true);
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
 
+[section:native_type raw_socket_service::native_type]
 
+[indexterm2 native_type..raw_socket_service]
+(Deprecated: Use native\_handle\_type.) The native socket type.
 
 
+ typedef implementation_defined native_type;
 
 
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/posix/descriptor_base.hpp]
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
@@ -55137,382 +68989,202 @@
 [endsect]
 
 
+[section:non_blocking raw_socket_service::non_blocking]
 
-[section:non_blocking_io posix::descriptor_base::non_blocking_io]
+[indexterm2 non_blocking..raw_socket_service]
+Gets the non-blocking mode of the socket.
 
-[indexterm2 non_blocking_io..posix::descriptor_base]
-IO control command to set the blocking mode of the descriptor.
 
+ bool ``[link boost_asio.reference.raw_socket_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.raw_socket_service.non_blocking.overload1 more...]]``
 
- typedef implementation_defined non_blocking_io;
 
+Sets the non-blocking mode of the socket.
 
 
-Implements the FIONBIO IO control command.
+ boost::system::error_code ``[link boost_asio.reference.raw_socket_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.raw_socket_service.non_blocking.overload2 more...]]``
 
 
-[heading Example]
-
+[section:overload1 raw_socket_service::non_blocking (1 of 2 overloads)]
 
 
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::non_blocking_io command(true);
- descriptor.io_control(command);
+Gets the non-blocking mode of the socket.
 
 
+ bool non_blocking(
+ const implementation_type & impl) const;
 
 
 
+[endsect]
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/descriptor_base.hpp]
+[section:overload2 raw_socket_service::non_blocking (2 of 2 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Sets the non-blocking mode of the socket.
 
-[endsect]
 
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
-[section:_descriptor_base posix::descriptor_base::~descriptor_base]
 
-[indexterm2 ~descriptor_base..posix::descriptor_base]
-Protected destructor to prevent deletion through this type.
+[endsect]
 
 
- ~descriptor_base();
+[endsect]
 
 
+[section:open raw_socket_service::open]
 
-[endsect]
+[indexterm2 open..raw_socket_service]
 
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
 
 
-[endsect]
 
+[endsect]
 
-[section:posix__stream_descriptor posix::stream_descriptor]
 
-[indexterm1 posix::stream_descriptor]
-Typedef for the typical usage of a stream-oriented descriptor.
 
+[section:protocol_type raw_socket_service::protocol_type]
 
- typedef basic_stream_descriptor stream_descriptor;
+[indexterm2 protocol_type..raw_socket_service]
+The protocol type.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ typedef Protocol protocol_type;
 
- [
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
 
- [
+[heading Requirements]
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[*Header: ][^boost/asio/raw_socket_service.hpp]
 
- [
+[*Convenience header: ][^boost/asio.hpp]
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
-
- ]
 
- [
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
-
- ]
+[section:raw_socket_service raw_socket_service::raw_socket_service]
 
- [
+[indexterm2 raw_socket_service..raw_socket_service]
+Construct a new raw socket service for the specified [link boost_asio.reference.io_service `io_service`].
 
- [[link boost_asio.reference.posix__basic_stream_descriptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
 
-]
+ raw_socket_service(
+ boost::asio::io_service & io_service);
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.assign [*assign]]]
- [Assign an existing native descriptor to the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor [*basic_stream_descriptor]]]
- [Construct a basic_stream_descriptor without opening it.
 
- Construct a basic_stream_descriptor on an existing native descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.close [*close]]]
- [Close the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer.
+[endsect]
 
- Get a const reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.native [*native]]]
- [Get the native descriptor representation. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.read_some [*read_some]]]
- [Read some data from the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]]
- [Write some data to the descriptor. ]
- ]
-
-]
 
-[heading Protected Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+[section:receive raw_socket_service::receive]
 
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+[indexterm2 receive..raw_socket_service]
+Receive some data from the peer.
 
-]
 
-The [link boost_asio.reference.posix__basic_stream_descriptor `posix::basic_stream_descriptor`] class template provides asynchronous and blocking stream-oriented descriptor functionality.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
 
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
 
-[*Shared] [*objects:] Unsafe.
+[endsect]
 
 
 
+[section:receive_from raw_socket_service::receive_from]
 
+[indexterm2 receive_from..raw_socket_service]
+Receive raw data with the endpoint of the sender.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/stream_descriptor.hpp]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive_from(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
-[section:posix__stream_descriptor_service posix::stream_descriptor_service]
-
-
-Default service implementation for a stream descriptor.
 
+[section:remote_endpoint raw_socket_service::remote_endpoint]
 
- class stream_descriptor_service :
- public io_service::service
+[indexterm2 remote_endpoint..raw_socket_service]
+Get the remote endpoint.
 
 
-[heading Types]
-[table
- [[Name][Description]]
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
- [
 
- [[link boost_asio.reference.posix__stream_descriptor_service.implementation_type [*implementation_type]]]
- [The type of a stream descriptor implementation. ]
-
- ]
 
- [
+[endsect]
 
- [[link boost_asio.reference.posix__stream_descriptor_service.native_type [*native_type]]]
- [The native descriptor type. ]
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:send raw_socket_service::send]
 
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.assign [*assign]]]
- [Assign an existing native descriptor to a stream descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.close [*close]]]
- [Close a stream descriptor implementation. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.construct [*construct]]]
- [Construct a new stream descriptor implementation. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.destroy [*destroy]]]
- [Destroy a stream descriptor implementation. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.native [*native]]]
- [Get the native descriptor implementation. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.read_some [*read_some]]]
- [Read some data from the stream. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined descriptorr objects owned by the service. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.stream_descriptor_service [*stream_descriptor_service]]]
- [Construct a new stream descriptor service for the specified io_service. ]
- ]
-
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.write_some [*write_some]]]
- [Write the given data to the stream. ]
- ]
-
-]
+[indexterm2 send..raw_socket_service]
+Send the given data to the peer.
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.posix__stream_descriptor_service.id [*id]]]
- [The unique service identifier. ]
- ]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
-]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:assign posix::stream_descriptor_service::assign]
+[section:send_to raw_socket_service::send_to]
 
-[indexterm2 assign..posix::stream_descriptor_service]
-Assign an existing native descriptor to a stream descriptor.
+[indexterm2 send_to..raw_socket_service]
+Send raw data to the specified endpoint.
 
 
- boost::system::error_code assign(
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send_to(
       implementation_type & impl,
- const native_type & native_descriptor,
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
       boost::system::error_code & ec);
 
 
@@ -55521,19 +69193,18 @@
 
 
 
-[section:async_read_some posix::stream_descriptor_service::async_read_some]
+[section:set_option raw_socket_service::set_option]
 
-[indexterm2 async_read_some..posix::stream_descriptor_service]
-Start an asynchronous read.
+[indexterm2 set_option..raw_socket_service]
+Set a socket option.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
       implementation_type & impl,
- const MutableBufferSequence & buffers,
- ReadHandler descriptorr);
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
 
 
@@ -55541,19 +69212,16 @@
 
 
 
-[section:async_write_some posix::stream_descriptor_service::async_write_some]
+[section:shutdown raw_socket_service::shutdown]
 
-[indexterm2 async_write_some..posix::stream_descriptor_service]
-Start an asynchronous write.
+[indexterm2 shutdown..raw_socket_service]
+Disable sends or receives on the socket.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
+ boost::system::error_code shutdown(
       implementation_type & impl,
- const ConstBufferSequence & buffers,
- WriteHandler descriptorr);
+ socket_base::shutdown_type what,
+ boost::system::error_code & ec);
 
 
 
@@ -55561,15 +69229,13 @@
 
 
 
-[section:cancel posix::stream_descriptor_service::cancel]
+[section:shutdown_service raw_socket_service::shutdown_service]
 
-[indexterm2 cancel..posix::stream_descriptor_service]
-Cancel all asynchronous operations associated with the descriptor.
+[indexterm2 shutdown_service..raw_socket_service]
+Destroy all user-defined handler objects owned by the service.
 
 
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+ virtual void shutdown_service();
 
 
 
@@ -55577,62 +69243,170 @@
 
 
 
-[section:close posix::stream_descriptor_service::close]
+[endsect]
 
-[indexterm2 close..posix::stream_descriptor_service]
-Close a stream descriptor implementation.
+[section:read read]
 
+[indexterm1 read]
+Attempt to read a certain amount of data from a stream before returning.
 
- boost::system::error_code close(
- implementation_type & impl,
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.read.overload1 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload1 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.read.overload2 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload2 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload3 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload3 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload4 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload4 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read.overload5 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload5 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read.overload6 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload6 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload7 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload7 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload8 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read.overload8 more...]]``
 
+[heading Requirements]
 
+[*Header: ][^boost/asio/read.hpp]
 
-[section:construct posix::stream_descriptor_service::construct]
+[*Convenience header: ][^boost/asio.hpp]
 
-[indexterm2 construct..posix::stream_descriptor_service]
-Construct a new stream descriptor implementation.
 
+[section:overload1 read (1 of 8 overloads)]
 
- void construct(
- implementation_type & impl);
 
+Attempt to read a certain amount of data from a stream before returning.
 
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers);
+
 
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
 
-[section:destroy posix::stream_descriptor_service::destroy]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Exceptions]
+
 
-[indexterm2 destroy..posix::stream_descriptor_service]
-Destroy a stream descriptor implementation.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
- void destroy(
- implementation_type & impl);
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ boost::asio::read(s, boost::asio::buffer(data, size));
 
-[endsect]
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
-[section:get_io_service posix::stream_descriptor_service::get_io_service]
+[heading Remarks]
+
+This overload is equivalent to calling:
 
+ boost::asio::read(
+ s, buffers,
+ boost::asio::transfer_all());
 
-['Inherited from io_service.]
 
-[indexterm2 get_io_service..posix::stream_descriptor_service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
 
- boost::asio::io_service & get_io_service();
 
 
 
@@ -55640,169 +69414,220 @@
 
 
 
-[section:id posix::stream_descriptor_service::id]
+[section:overload2 read (2 of 8 overloads)]
 
-[indexterm2 id..posix::stream_descriptor_service]
-The unique service identifier.
 
+Attempt to read a certain amount of data from a stream before returning.
 
- static boost::asio::io_service::id id;
 
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
-[endsect]
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
 
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
-[section:implementation_type posix::stream_descriptor_service::implementation_type]
 
-[indexterm2 implementation_type..posix::stream_descriptor_service]
-The type of a stream descriptor implementation.
+* An error occurred.
 
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
- typedef implementation_defined implementation_type;
 
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[heading Requirements]
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
 
-[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
+[[ec][Set to indicate what error occurred, if any.]]
 
-[*Convenience header: ][^boost/asio.hpp]
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes transferred.
 
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-[section:io_control posix::stream_descriptor_service::io_control]
+ boost::asio::read(s, boost::asio::buffer(data, size), ec);
 
-[indexterm2 io_control..posix::stream_descriptor_service]
-Perform an IO control command on the descriptor.
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
 
+[heading Remarks]
+
+This overload is equivalent to calling:
 
+ boost::asio::read(
+ s, buffers,
+ boost::asio::transfer_all(), ec);
 
-[endsect]
 
 
 
-[section:io_service posix::stream_descriptor_service::io_service]
 
 
-['Inherited from io_service.]
 
-[indexterm2 io_service..posix::stream_descriptor_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[endsect]
 
 
- boost::asio::io_service & io_service();
 
+[section:overload3 read (3 of 8 overloads)]
 
 
-[endsect]
+Attempt to read a certain amount of data from a stream before returning.
 
 
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition);
 
-[section:is_open posix::stream_descriptor_service::is_open]
 
-[indexterm2 is_open..posix::stream_descriptor_service]
-Determine whether the descriptor is open.
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
 
- bool is_open(
- const implementation_type & impl) const;
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
 
+* The completion\_condition function object returns 0.
 
-[endsect]
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
 
+[heading Parameters]
+
 
-[section:native posix::stream_descriptor_service::native]
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[indexterm2 native..posix::stream_descriptor_service]
-Get the native descriptor implementation.
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
 
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some operation.
+ const boost::system::error_code& error,
 
- native_type native(
- implementation_type & impl);
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
 
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes transferred.
 
 
+[heading Exceptions]
+
 
-[section:native_type posix::stream_descriptor_service::native_type]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[indexterm2 native_type..posix::stream_descriptor_service]
-The native descriptor type.
+]
 
 
- typedef implementation_defined native_type;
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ boost::asio::read(s, boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32));
 
 
-[heading Requirements]
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[*Header: ][^boost/asio/posix/stream_descriptor_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:read_some posix::stream_descriptor_service::read_some]
+[section:overload4 read (4 of 8 overloads)]
 
-[indexterm2 read_some..posix::stream_descriptor_service]
-Read some data from the stream.
+
+Attempt to read a certain amount of data from a stream before returning.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- implementation_type & impl,
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
       const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
       boost::system::error_code & ec);
 
 
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
-[endsect]
 
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
 
-[section:shutdown_service posix::stream_descriptor_service::shutdown_service]
+* The completion\_condition function object returns 0.
 
-[indexterm2 shutdown_service..posix::stream_descriptor_service]
-Destroy all user-defined descriptorr objects owned by the service.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
 
- virtual void shutdown_service();
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
 
-[endsect]
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some operation.
+ const boost::system::error_code& error,
 
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
-[section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service]
+]
 
-[indexterm2 stream_descriptor_service..posix::stream_descriptor_service]
-Construct a new stream descriptor service for the specified [link boost_asio.reference.io_service `io_service`].
 
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
 
- stream_descriptor_service(
- boost::asio::io_service & io_service);
 
 
 
@@ -55810,282 +69635,126 @@
 
 
 
-[section:write_some posix::stream_descriptor_service::write_some]
+[section:overload5 read (5 of 8 overloads)]
 
-[indexterm2 write_some..posix::stream_descriptor_service]
-Write the given data to the stream.
+
+Attempt to read a certain amount of data from a stream before returning.
 
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b);
 
 
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
-[endsect]
 
+* An error occurred.
 
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
-[endsect]
 
-[section:raw_socket_service raw_socket_service]
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-Default service implementation for a raw socket.
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
+]
 
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class raw_socket_service :
- public io_service::service
 
+[heading Return Value]
+
+The number of bytes transferred.
 
-[heading Types]
-[table
- [[Name][Description]]
 
- [
+[heading Exceptions]
+
 
- [[link boost_asio.reference.raw_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+[variablelist
   
- ]
+[[boost::system::system_error][Thrown on failure.]]
 
- [
+]
 
- [[link boost_asio.reference.raw_socket_service.implementation_type [*implementation_type]]]
- [The type of a raw socket. ]
-
- ]
 
- [
+[heading Remarks]
+
+This overload is equivalent to calling:
 
- [[link boost_asio.reference.raw_socket_service.native_type [*native_type]]]
- [The native socket type. ]
-
- ]
+ boost::asio::read(
+ s, b,
+ boost::asio::transfer_all());
 
- [
 
- [[link boost_asio.reference.raw_socket_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
 
-]
 
-[heading Member Functions]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.raw_socket_service.assign [*assign]]]
- [Assign an existing native socket to a raw socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive that will get the endpoint of the sender. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_send [*async_send]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.bind [*bind]]]
- []
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.close [*close]]]
- [Close a raw socket implementation. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.connect [*connect]]]
- [Connect the raw socket to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.construct [*construct]]]
- [Construct a new raw socket implementation. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.destroy [*destroy]]]
- [Destroy a raw socket implementation. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.get_option [*get_option]]]
- [Get a socket option. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.is_open [*is_open]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.native [*native]]]
- [Get the native socket implementation. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.open [*open]]]
- []
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]]
- [Construct a new raw socket service for the specified io_service. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.receive_from [*receive_from]]]
- [Receive raw data with the endpoint of the sender. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.send [*send]]]
- [Send the given data to the peer. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.send_to [*send_to]]]
- [Send raw data to the specified endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
- ]
-
-]
 
-[heading Data Members]
-[table
- [[Name][Description]]
 
- [
- [[link boost_asio.reference.raw_socket_service.id [*id]]]
- [The unique service identifier. ]
- ]
+[endsect]
 
-]
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/raw_socket_service.hpp]
+[section:overload6 read (6 of 8 overloads)]
 
-[*Convenience header: ][^boost/asio.hpp]
 
+Attempt to read a certain amount of data from a stream before returning.
 
-[section:assign raw_socket_service::assign]
 
-[indexterm2 assign..raw_socket_service]
-Assign an existing native socket to a raw socket.
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
 
 
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
 
+* An error occurred.
 
-[endsect]
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
 
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::read(
+ s, b,
+ boost::asio::transfer_all(), ec);
 
-[section:async_connect raw_socket_service::async_connect]
 
-[indexterm2 async_connect..raw_socket_service]
-Start an asynchronous connect.
 
 
- template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
 
 
 
@@ -56093,63 +69762,68 @@
 
 
 
-[section:async_receive raw_socket_service::async_receive]
+[section:overload7 read (7 of 8 overloads)]
 
-[indexterm2 async_receive..raw_socket_service]
-Start an asynchronous receive.
+
+Attempt to read a certain amount of data from a stream before returning.
 
 
   template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- ReadHandler handler);
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
 
 
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
-[endsect]
 
+* The completion\_condition function object returns 0.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
 
-[section:async_receive_from raw_socket_service::async_receive_from]
+[heading Parameters]
+
 
-[indexterm2 async_receive_from..raw_socket_service]
-Start an asynchronous receive that will get the endpoint of the sender.
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive_from(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
- ReadHandler handler);
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some operation.
+ const boost::system::error_code& error,
 
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
 
+]
 
-[endsect]
 
+[heading Return Value]
+
+The number of bytes transferred.
 
 
-[section:async_send raw_socket_service::async_send]
+[heading Exceptions]
+
 
-[indexterm2 async_send..raw_socket_service]
-Start an asynchronous send.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
 
+]
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- WriteHandler handler);
 
 
 
@@ -56157,147 +69831,242 @@
 
 
 
-[section:async_send_to raw_socket_service::async_send_to]
+[section:overload8 read (8 of 8 overloads)]
 
-[indexterm2 async_send_to..raw_socket_service]
-Start an asynchronous send.
+
+Attempt to read a certain amount of data from a stream before returning.
 
 
   template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send_to(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- const endpoint_type & destination,
- socket_base::message_flags flags,
- WriteHandler handler);
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
 
 
+This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
 
-[endsect]
 
+* The completion\_condition function object returns 0.
 
+This operation is implemented in terms of zero or more calls to the stream's read\_some function.
 
-[section:at_mark raw_socket_service::at_mark]
 
-[indexterm2 at_mark..raw_socket_service]
-Determine whether the socket is at the out-of-band data mark.
+[heading Parameters]
+
 
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
- bool at_mark(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some operation.
+ const boost::system::error_code& error,
 
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
 
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[section:available raw_socket_service::available]
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
 
-[indexterm2 available..raw_socket_service]
-Determine the number of bytes available for reading.
 
 
- std::size_t available(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
 
+[endsect]
 
 
 [endsect]
 
+[section:read_at read_at]
 
+[indexterm1 read_at]
+Attempt to read a certain amount of data at the specified offset before returning.
 
-[section:bind raw_socket_service::bind]
-
-[indexterm2 bind..raw_socket_service]
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.read_at.overload1 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload1 more...]]``
 
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.read_at.overload2 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
       boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload2 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read_at.overload3 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload3 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read_at.overload4 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload4 more...]]``
 
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_at.overload5 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload5 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_at.overload6 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload6 more...]]``
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read_at.overload7 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload7 more...]]``
 
-[section:cancel raw_socket_service::cancel]
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read_at.overload8 read_at]``(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_at.overload8 more...]]``
 
-[indexterm2 cancel..raw_socket_service]
-Cancel all asynchronous operations associated with the socket.
+[heading Requirements]
 
+[*Header: ][^boost/asio/read_at.hpp]
 
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+[*Convenience header: ][^boost/asio.hpp]
 
 
+[section:overload1 read_at (1 of 8 overloads)]
 
-[endsect]
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
 
-[section:close raw_socket_service::close]
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers);
 
-[indexterm2 close..raw_socket_service]
-Close a raw socket implementation.
 
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
 
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
 
-[endsect]
+* An error occurred.
 
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
 
-[section:connect raw_socket_service::connect]
+[heading Parameters]
+
 
-[indexterm2 connect..raw_socket_service]
-Connect the raw socket to the specified endpoint.
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
+[[offset][The offset at which the data will be read.]]
 
- boost::system::error_code connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
 
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes transferred.
 
 
+[heading Exceptions]
+
 
-[section:construct raw_socket_service::construct]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[indexterm2 construct..raw_socket_service]
-Construct a new raw socket implementation.
+]
 
 
- void construct(
- implementation_type & impl);
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+
+ boost::asio::read_at(d, 42, boost::asio::buffer(data, size));
 
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
-[endsect]
 
+[heading Remarks]
+
+This overload is equivalent to calling:
 
+ boost::asio::read_at(
+ d, 42, buffers,
+ boost::asio::transfer_all());
 
-[section:destroy raw_socket_service::destroy]
 
-[indexterm2 destroy..raw_socket_service]
-Destroy a raw socket implementation.
 
 
- void destroy(
- implementation_type & impl);
 
 
 
@@ -56305,127 +70074,162 @@
 
 
 
-[section:endpoint_type raw_socket_service::endpoint_type]
+[section:overload2 read_at (2 of 8 overloads)]
 
-[indexterm2 endpoint_type..raw_socket_service]
-The endpoint type.
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
- typedef Protocol::endpoint endpoint_type;
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
 
 
-[heading Requirements]
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
-[*Header: ][^boost/asio/raw_socket_service.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
 
-[endsect]
+* An error occurred.
 
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
 
-[section:get_io_service raw_socket_service::get_io_service]
+[heading Parameters]
+
 
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
-['Inherited from io_service.]
+[[offset][The offset at which the data will be read.]]
 
-[indexterm2 get_io_service..raw_socket_service]
-Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
- boost::asio::io_service & get_io_service();
+]
 
 
+[heading Return Value]
+
+The number of bytes transferred.
 
-[endsect]
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
+ boost::asio::read_at(d, 42,
+ boost::asio::buffer(data, size), ec);
 
-[section:get_option raw_socket_service::get_option]
 
-[indexterm2 get_option..raw_socket_service]
-Get a socket option.
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
 
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- const implementation_type & impl,
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+[heading Remarks]
+
+This overload is equivalent to calling:
 
+ boost::asio::read_at(
+ d, 42, buffers,
+ boost::asio::transfer_all(), ec);
 
 
-[endsect]
 
 
 
-[section:id raw_socket_service::id]
 
-[indexterm2 id..raw_socket_service]
-The unique service identifier.
 
+[endsect]
 
- static boost::asio::io_service::id id;
 
 
+[section:overload3 read_at (3 of 8 overloads)]
 
-[endsect]
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
 
-[section:implementation_type raw_socket_service::implementation_type]
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition);
 
-[indexterm2 implementation_type..raw_socket_service]
-The type of a raw socket.
 
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
- typedef implementation_defined implementation_type;
 
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
 
-[heading Requirements]
+* The completion\_condition function object returns 0.
 
-[*Header: ][^boost/asio/raw_socket_service.hpp]
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
-[*Convenience header: ][^boost/asio.hpp]
 
+[heading Parameters]
+
 
-[endsect]
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
+[[offset][The offset at which the data will be read.]]
 
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
 
-[section:io_control raw_socket_service::io_control]
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some_at operation.
+ const boost::system::error_code& error,
 
-[indexterm2 io_control..raw_socket_service]
-Perform an IO control command on the socket.
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
+]
 
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
 
+[heading Return Value]
+
+The number of bytes transferred.
 
 
-[endsect]
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
+]
 
-[section:io_service raw_socket_service::io_service]
 
+[heading Example]
+
+To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
 
-['Inherited from io_service.]
+ boost::asio::read_at(d, 42, boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32));
 
-[indexterm2 io_service..raw_socket_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
 
- boost::asio::io_service & io_service();
 
 
 
@@ -56433,45 +70237,67 @@
 
 
 
-[section:is_open raw_socket_service::is_open]
+[section:overload4 read_at (4 of 8 overloads)]
 
-[indexterm2 is_open..raw_socket_service]
-Determine whether the socket is open.
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
- bool is_open(
- const implementation_type & impl) const;
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
 
 
-[endsect]
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
 
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
 
-[section:local_endpoint raw_socket_service::local_endpoint]
 
-[indexterm2 local_endpoint..raw_socket_service]
-Get the local endpoint.
+* The completion\_condition function object returns 0.
 
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
 
+[heading Parameters]
+
 
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
-[endsect]
+[[offset][The offset at which the data will be read.]]
 
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
 
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some_at operation.
+ const boost::system::error_code& error,
 
-[section:native raw_socket_service::native]
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
-[indexterm2 native..raw_socket_service]
-Get the native socket implementation.
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
+
+
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
 
- native_type native(
- implementation_type & impl);
 
 
 
@@ -56479,112 +70305,132 @@
 
 
 
-[section:native_type raw_socket_service::native_type]
+[section:overload5 read_at (5 of 8 overloads)]
 
-[indexterm2 native_type..raw_socket_service]
-The native socket type.
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
- typedef implementation_defined native_type;
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b);
 
 
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/raw_socket_service.hpp]
+* An error occurred.
 
-[*Convenience header: ][^boost/asio.hpp]
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
 
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
+[[offset][The offset at which the data will be read.]]
 
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
-[section:open raw_socket_service::open]
+]
 
-[indexterm2 open..raw_socket_service]
 
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
+[heading Return Value]
+
+The number of bytes transferred.
+
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
+[heading Remarks]
+
+This overload is equivalent to calling:
 
-[section:protocol_type raw_socket_service::protocol_type]
+ boost::asio::read_at(
+ d, 42, b,
+ boost::asio::transfer_all());
 
-[indexterm2 protocol_type..raw_socket_service]
-The protocol type.
 
 
- typedef Protocol protocol_type;
 
 
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/raw_socket_service.hpp]
+[endsect]
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
-[endsect]
+[section:overload6 read_at (6 of 8 overloads)]
 
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
-[section:raw_socket_service raw_socket_service::raw_socket_service]
 
-[indexterm2 raw_socket_service..raw_socket_service]
-Construct a new raw socket service for the specified [link boost_asio.reference.io_service `io_service`].
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
 
 
- raw_socket_service(
- boost::asio::io_service & io_service);
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
 
+* An error occurred.
 
-[endsect]
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
 
+[heading Parameters]
+
 
-[section:receive raw_socket_service::receive]
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
-[indexterm2 receive..raw_socket_service]
-Receive some data from the peer.
+[[offset][The offset at which the data will be read.]]
 
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
+[[ec][Set to indicate what error occurred, if any.]]
 
+]
 
 
-[endsect]
+[heading Return Value]
+
+The number of bytes transferred.
+
 
+[heading Remarks]
+
+This overload is equivalent to calling:
 
+ boost::asio::read_at(
+ d, 42, b,
+ boost::asio::transfer_all(), ec);
 
-[section:receive_from raw_socket_service::receive_from]
 
-[indexterm2 receive_from..raw_socket_service]
-Receive raw data with the endpoint of the sender.
 
 
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive_from(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
 
 
 
@@ -56592,56 +70438,71 @@
 
 
 
-[section:remote_endpoint raw_socket_service::remote_endpoint]
+[section:overload7 read_at (7 of 8 overloads)]
 
-[indexterm2 remote_endpoint..raw_socket_service]
-Get the remote endpoint.
 
+Attempt to read a certain amount of data at the specified offset before returning.
 
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
 
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
 
 
-[endsect]
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
 
+* The completion\_condition function object returns 0.
 
-[section:send raw_socket_service::send]
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
-[indexterm2 send..raw_socket_service]
-Send the given data to the peer.
 
+[heading Parameters]
+
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
+[[offset][The offset at which the data will be read.]]
 
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
-[endsect]
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some_at operation.
+ const boost::system::error_code& error,
 
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
+]
 
-[section:send_to raw_socket_service::send_to]
 
-[indexterm2 send_to..raw_socket_service]
-Send raw data to the specified endpoint.
+[heading Return Value]
+
+The number of bytes transferred.
 
 
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send_to(
- implementation_type & impl,
- const ConstBufferSequence & buffers,
- const endpoint_type & destination,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
 
 
 
@@ -56649,152 +70510,189 @@
 
 
 
-[section:set_option raw_socket_service::set_option]
+[section:overload8 read_at (8 of 8 overloads)]
 
-[indexterm2 set_option..raw_socket_service]
-Set a socket option.
+
+Attempt to read a certain amount of data at the specified offset before returning.
 
 
   template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- implementation_type & impl,
- const SettableSocketOption & option,
+ typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
       boost::system::error_code & ec);
 
 
-
-[endsect]
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
 
+* The completion\_condition function object returns 0.
 
-[section:shutdown raw_socket_service::shutdown]
+This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
-[indexterm2 shutdown..raw_socket_service]
-Disable sends or receives on the socket.
 
+[heading Parameters]
+
 
- boost::system::error_code shutdown(
- implementation_type & impl,
- socket_base::shutdown_type what,
- boost::system::error_code & ec);
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
+[[offset][The offset at which the data will be read.]]
 
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
-[endsect]
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ std::size_t completion_condition(
+ // Result of latest read_some_at operation.
+ const boost::system::error_code& error,
 
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
+[[ec][Set to indicate what error occurred, if any.]]
 
-[section:shutdown_service raw_socket_service::shutdown_service]
+]
 
-[indexterm2 shutdown_service..raw_socket_service]
-Destroy all user-defined handler objects owned by the service.
 
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
 
- virtual void shutdown_service();
 
 
 
 [endsect]
 
 
-
 [endsect]
 
-[section:read read]
+[section:read_until read_until]
 
-[indexterm1 read]
-Attempt to read a certain amount of data from a stream before returning.
+[indexterm1 read_until]
+Read data into a streambuf until it contains a delimiter, matches a regular expression, or a function object indicates a match.
 
       
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.read.overload1 read]``(
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_until.overload1 read_until]``(
       SyncReadStream & s,
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload1 more...]]``
+ boost::asio::basic_streambuf< Allocator > & b,
+ char delim);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload1 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload2 read]``(
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_until.overload2 read_until]``(
       SyncReadStream & s,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload2 more...]]``
+ boost::asio::basic_streambuf< Allocator > & b,
+ char delim,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload2 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload3 read]``(
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_until.overload3 read_until]``(
       SyncReadStream & s,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const std::string & delim);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload3 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_until.overload4 read_until]``(
+ SyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const std::string & delim,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload3 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload4 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
       typename Allocator>
- std::size_t ``[link boost_asio.reference.read.overload4 read]``(
+ std::size_t ``[link boost_asio.reference.read_until.overload5 read_until]``(
       SyncReadStream & s,
- basic_streambuf< Allocator > & b);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload4 more...]]``
+ boost::asio::basic_streambuf< Allocator > & b,
+ const boost::regex & expr);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload5 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read_until.overload6 read_until]``(
+ SyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const boost::regex & expr,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload6 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
       typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload5 read]``(
+ typename MatchCondition>
+ std::size_t ``[link boost_asio.reference.read_until.overload7 read_until]``(
       SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload5 more...]]``
+ boost::asio::basic_streambuf< Allocator > & b,
+ MatchCondition match_condition,
+ typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload7 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
       typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload6 read]``(
+ typename MatchCondition>
+ std::size_t ``[link boost_asio.reference.read_until.overload8 read_until]``(
       SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read.overload6 more...]]``
+ boost::asio::basic_streambuf< Allocator > & b,
+ MatchCondition match_condition,
+ boost::system::error_code & ec,
+ typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
+ `` [''''&raquo;''' [link boost_asio.reference.read_until.overload8 more...]]``
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/read.hpp]
+[*Header: ][^boost/asio/read_until.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload1 read (1 of 6 overloads)]
+[section:overload1 read_until (1 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until it contains a specified delimiter.
 
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read(
+ typename Allocator>
+ std::size_t read_until(
       SyncReadStream & s,
- const MutableBufferSequence & buffers);
+ boost::asio::basic_streambuf< Allocator > & b,
+ char delim);
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
 
 
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+* The get area of the streambuf contains the specified delimiter.
 
 
 * An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
 
 
 [heading Parameters]
@@ -56804,14 +70702,16 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
+[[b][A streambuf object into which the data will be read.]]
+
+[[delim][The delimiter character.]]
 
 ]
 
 
 [heading Return Value]
       
-The number of bytes transferred.
+The number of bytes in the streambuf's get area up to and including the delimiter.
 
 
 [heading Exceptions]
@@ -56824,26 +70724,38 @@
 ]
 
 
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
+
+
 [heading Example]
   
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+To read data into a streambuf until a newline is encountered:
 
- boost::asio::read(s, boost::asio::buffer(data, size));
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, '\n');
+ std::istream is(&b);
+ std::string line;
+ std::getline(is, line);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+After the `read_until` operation completes successfully, the buffer `b` contains the delimiter:
 
+ { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
 
-[heading Remarks]
-
-This overload is equivalent to calling:
 
- boost::asio::read(
- s, buffers,
- boost::asio::transfer_all());
+The call to `std::getline` then extracts the data up to and including the delimiter, so that the string `line` contains:
 
+ { 'a', 'b', ..., 'c', '\n' }
+
+
+The remaining data is left in the buffer `b` as follows:
+
+ { 'd', 'e', ... }
 
 
+This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
 
 
 
@@ -56852,31 +70764,31 @@
 
 
 
-[section:overload2 read (2 of 6 overloads)]
+[section:overload2 read_until (2 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until it contains a specified delimiter.
 
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t read(
+ typename Allocator>
+ std::size_t read_until(
       SyncReadStream & s,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition);
+ boost::asio::basic_streambuf< Allocator > & b,
+ char delim,
+ boost::system::error_code & ec);
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
 
 
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+* The get area of the streambuf contains the specified delimiter.
 
 
-* The completion\_condition function object returns 0.
+* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
 
 
 [heading Parameters]
@@ -56886,26 +70798,74 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
+[[b][A streambuf object into which the data will be read.]]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some operation.
- const boost::system::error_code& error,
+[[delim][The delimiter character.]]
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
 [heading Return Value]
       
-The number of bytes transferred.
+The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
+
+
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 read_until (3 of 8 overloads)]
+
+
+Read data into a streambuf until it contains a specified delimiter.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t read_until(
+ SyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const std::string & delim);
+
+
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
+
+
+* The get area of the streambuf contains the specified delimiter.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[b][A streambuf object into which the data will be read.]]
+
+[[delim][The delimiter string.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the delimiter.
 
 
 [heading Exceptions]
@@ -56918,15 +70878,38 @@
 ]
 
 
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
+
+
 [heading Example]
   
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+To read data into a streambuf until a newline is encountered:
 
- boost::asio::read(s, boost::asio::buffer(data, size),
- boost::asio::transfer_at_least(32));
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, "\r\n");
+ std::istream is(&b);
+ std::string line;
+ std::getline(is, line);
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+After the `read_until` operation completes successfully, the buffer `b` contains the delimiter:
+
+ { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+
+The call to `std::getline` then extracts the data up to and including the delimiter, so that the string `line` contains:
+
+ { 'a', 'b', ..., 'c', '\r', '\n' }
+
+
+The remaining data is left in the buffer `b` as follows:
+
+ { 'd', 'e', ... }
+
+
+This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
 
 
 
@@ -56935,32 +70918,31 @@
 
 
 
-[section:overload3 read (3 of 6 overloads)]
+[section:overload4 read_until (4 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until it contains a specified delimiter.
 
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t read(
+ typename Allocator>
+ std::size_t read_until(
       SyncReadStream & s,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const std::string & delim,
       boost::system::error_code & ec);
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
 
 
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+* The get area of the streambuf contains the specified delimiter.
 
 
-* The completion\_condition function object returns 0.
+* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
 
 
 [heading Parameters]
@@ -56970,19 +70952,9 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
-
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some operation.
- const boost::system::error_code& error,
+[[b][A streambuf object into which the data will be read.]]
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
+[[delim][The delimiter string.]]
 
 [[ec][Set to indicate what error occurred, if any.]]
 
@@ -56991,7 +70963,12 @@
 
 [heading Return Value]
       
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
+
+
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
 
 
@@ -57000,26 +70977,30 @@
 
 
 
-[section:overload4 read (4 of 6 overloads)]
+[section:overload5 read_until (5 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until some part of the data it contains matches a regular expression.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t read_until(
+ SyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ const boost::regex & expr);
 
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b);
+This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+* A substring of the streambuf's get area matches the regular expression.
 
 
 * An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains data that matches the regular expression, the function returns immediately.
 
 
 [heading Parameters]
@@ -57029,14 +71010,16 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
+[[b][A streambuf object into which the data will be read.]]
+
+[[expr][The regular expression.]]
 
 ]
 
 
 [heading Return Value]
       
-The number of bytes transferred.
+The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression.
 
 
 [heading Exceptions]
@@ -57051,15 +71034,37 @@
 
 [heading Remarks]
       
-This overload is equivalent to calling:
+After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the regular expression. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
- boost::asio::read(
- s, b,
- boost::asio::transfer_all());
+
+[heading Example]
+
+To read data into a streambuf until a CR-LF sequence is encountered:
+
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, boost::regex("\r\n"));
+ std::istream is(&b);
+ std::string line;
+ std::getline(is, line);
 
 
+After the `read_until` operation completes successfully, the buffer `b` contains the data which matched the regular expression:
+
+ { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+
+
+The call to `std::getline` then extracts the data up to and including the match, so that the string `line` contains:
+
+ { 'a', 'b', ..., 'c', '\r', '\n' }
 
 
+The remaining data is left in the buffer `b` as follows:
+
+ { 'd', 'e', ... }
+
+
+This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
+
 
 
 
@@ -57067,28 +71072,31 @@
 
 
 
-[section:overload5 read (5 of 6 overloads)]
+[section:overload6 read_until (6 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until some part of the data it contains matches a regular expression.
 
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t read(
+ typename Allocator>
+ std::size_t read_until(
       SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
+ boost::asio::basic_streambuf< Allocator > & b,
+ const boost::regex & expr,
+ boost::system::error_code & ec);
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
 
 
-* The completion\_condition function object returns 0.
+* A substring of the streambuf's get area matches the regular expression.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains data that matches the regular expression, the function returns immediately.
 
 
 [heading Parameters]
@@ -57098,36 +71106,23 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
+[[b][A streambuf object into which the data will be read.]]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some operation.
- const boost::system::error_code& error,
+[[expr][The regular expression.]]
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
+[[ec][Set to indicate what error occurred, if any.]]
 
 ]
 
 
 [heading Return Value]
       
-The number of bytes transferred.
-
-
-[heading Exceptions]
-
+The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression. Returns 0 if an error occurred.
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
 
-]
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the regular expression. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
 
 
@@ -57136,29 +71131,32 @@
 
 
 
-[section:overload6 read (6 of 6 overloads)]
+[section:overload7 read_until (7 of 8 overloads)]
 
 
-Attempt to read a certain amount of data from a stream before returning.
+Read data into a streambuf until a function object indicates a match.
 
 
   template<
       typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
       typename Allocator,
- typename CompletionCondition>
- std::size_t read(
+ typename MatchCondition>
+ std::size_t read_until(
       SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition,
- boost::system::error_code & ec);
+ boost::asio::basic_streambuf< Allocator > & b,
+ MatchCondition match_condition,
+ typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
 
 
-This function is used to read a certain number of bytes of data from a stream. The call will block until one of the following conditions is true:
+This function is used to read data into the specified streambuf until a user-defined match condition function object, when applied to the data contained in the streambuf, indicates a successful match. The call will block until one of the following conditions is true:
 
 
-* The completion\_condition function object returns 0.
+* The match condition function object returns a std::pair where the second element evaluates to true.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function.
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
 
 
 [heading Parameters]
@@ -57168,189 +71166,167 @@
   
 [[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
+[[b][A streambuf object into which the data will be read.]]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+[[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be:
 ``
- std::size_t completion_condition(
- // Result of latest read_some operation.
- const boost::system::error_code& error,
-
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
+ pair<iterator, bool> match_condition(iterator begin, iterator end);
 ``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the stream's read\_some function.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+where `iterator` represents the type:
+``
+ buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
+``
+The iterator parameters `begin` and `end` define the range of bytes to be scanned to determine whether there is a match. The `first` member of the return value is an iterator marking one-past-the-end of the bytes that have been consumed by the match function. This iterator is used to calculate the `begin` parameter for any subsequent invocation of the match condition. The `second` member of the return value is true if a match has been found, false otherwise.]]
 
 ]
 
 
 [heading Return Value]
       
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+The number of bytes in the streambuf's get area that have been fully consumed by the match function.
 
 
+[heading Exceptions]
+
 
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
 
-[endsect]
+]
 
 
-[endsect]
+[heading Remarks]
+
+After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the function object. An application will typically leave that data in the streambuf for a subsequent
 
-[section:read_at read_at]
+The default implementation of the `is_match_condition` type trait evaluates to true for function pointers and function objects with a `result_type` typedef. It must be specialised for other user-defined function objects.
 
-[indexterm1 read_at]
-Attempt to read a certain amount of data at the specified offset before returning.
 
-
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.read_at.overload1 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload1 more...]]``
+[heading Examples]
+
+To read data into a streambuf until whitespace is encountered:
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read_at.overload2 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload2 more...]]``
+ typedef boost::asio::buffers_iterator<
+ boost::asio::streambuf::const_buffers_type> iterator;
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read_at.overload3 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload3 more...]]``
+ std::pair<iterator, bool>
+ match_whitespace(iterator begin, iterator end)
+ {
+ iterator i = begin;
+ while (i != end)
+ if (std::isspace(*i++))
+ return std::make_pair(i, true);
+ return std::make_pair(i, false);
+ }
+ ...
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, match_whitespace);
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_at.overload4 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload4 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read_at.overload5 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload5 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read_at.overload6 read_at]``(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read_at.overload6 more...]]``
 
-[heading Requirements]
+To read data into a streambuf until a matching character is found:
 
-[*Header: ][^boost/asio/read_at.hpp]
+ class match_char
+ {
+ public:
+ explicit match_char(char c) : c_(c) {}
 
-[*Convenience header: ][^boost/asio.hpp]
+ template <typename Iterator>
+ std::pair<Iterator, bool> operator()(
+ Iterator begin, Iterator end) const
+ {
+ Iterator i = begin;
+ while (i != end)
+ if (c_ == *i++)
+ return std::make_pair(i, true);
+ return std::make_pair(i, false);
+ }
 
+ private:
+ char c_;
+ };
 
-[section:overload1 read_at (1 of 6 overloads)]
+ namespace asio {
+ template <> struct is_match_condition<match_char>
+ : public boost::true_type {};
+ } // namespace asio
+ ...
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, match_char('a'));
 
 
-Attempt to read a certain amount of data at the specified offset before returning.
 
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers);
 
+[endsect]
 
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
 
 
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+[section:overload8 read_until (8 of 8 overloads)]
 
 
-* An error occurred.
+Read data into a streambuf until a function object indicates a match.
 
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream 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 * = 0);
 
-[heading Parameters]
-
 
-[variablelist
-
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
+This function is used to read data into the specified streambuf until a user-defined match condition function object, when applied to the data contained in the streambuf, indicates a successful match. The call will block until one of the following conditions is true:
 
-[[offset][The offset at which the data will be read.]]
 
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
+* The match condition function object returns a std::pair where the second element evaluates to true.
 
-]
 
+* An error occurred.
 
-[heading Return Value]
-
-The number of bytes transferred.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
 
 
-[heading Exceptions]
+[heading Parameters]
     
 
 [variablelist
   
-[[boost::system::system_error][Thrown on failure.]]
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-]
+[[b][A streambuf object into which the data will be read.]]
 
+[[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be:
+``
+ pair<iterator, bool> match_condition(iterator begin, iterator end);
+``
+where `iterator` represents the type:
+``
+ buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
+``
+The iterator parameters `begin` and `end` define the range of bytes to be scanned to determine whether there is a match. The `first` member of the return value is an iterator marking one-past-the-end of the bytes that have been consumed by the match function. This iterator is used to calculate the `begin` parameter for any subsequent invocation of the match condition. The `second` member of the return value is true if a match has been found, false otherwise.]]
 
-[heading Example]
-
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+[[ec][Set to indicate what error occurred, if any.]]
 
- boost::asio::read_at(d, 42, boost::asio::buffer(data, size));
+]
 
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[heading Return Value]
+
+The number of bytes in the streambuf's get area that have been fully consumed by the match function. Returns 0 if an error occurred.
 
 
 [heading Remarks]
       
-This overload is equivalent to calling:
-
- boost::asio::read_at(
- d, 42, buffers,
- boost::asio::transfer_all());
-
-
+After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the function object. An application will typically leave that data in the streambuf for a subsequent
 
+The default implementation of the `is_match_condition` type trait evaluates to true for function pointers and function objects with a `result_type` typedef. It must be specialised for other user-defined function objects.
 
 
 
@@ -57358,154 +71334,286 @@
 [endsect]
 
 
+[endsect]
 
-[section:overload2 read_at (2 of 6 overloads)]
+[section:seq_packet_socket_service seq_packet_socket_service]
 
 
-Attempt to read a certain amount of data at the specified offset before returning.
+Default service implementation for a sequenced packet socket.
 
 
   template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition);
-
-
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
-
-
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
-
-
-* The completion\_condition function object returns 0.
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class seq_packet_socket_service :
+ public io_service::service
 
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
+[heading Types]
+[table
+ [[Name][Description]]
 
-[heading Parameters]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.seq_packet_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
   
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
-
-[[offset][The offset at which the data will be read.]]
-
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
+ ]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some_at operation.
- const boost::system::error_code& error,
+ [
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
+ [[link boost_asio.reference.seq_packet_socket_service.implementation_type [*implementation_type]]]
+ [The type of a sequenced packet socket implementation. ]
+
+ ]
 
-]
+ [
 
+ [[link boost_asio.reference.seq_packet_socket_service.native_handle_type [*native_handle_type]]]
+ [The native socket type. ]
+
+ ]
 
-[heading Return Value]
-
-The number of bytes transferred.
+ [
 
+ [[link boost_asio.reference.seq_packet_socket_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native socket type. ]
+
+ ]
 
-[heading Exceptions]
-
+ [
 
-[variablelist
+ [[link boost_asio.reference.seq_packet_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
   
-[[boost::system::system_error][Thrown on failure.]]
+ ]
 
 ]
 
+[heading Member Functions]
+[table
+ [[Name][Description]]
 
-[heading Example]
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a sequenced packet socket. ]
+ ]
   
-To read into a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
-
- boost::asio::read_at(d, 42, boost::asio::buffer(data, size),
- boost::asio::transfer_at_least(32));
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.bind [*bind]]]
+ [Bind the sequenced packet socket to the specified local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.close [*close]]]
+ [Close a sequenced packet socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.connect [*connect]]]
+ [Connect the sequenced packet socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.construct [*construct]]]
+ [Construct a new sequenced packet socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.destroy [*destroy]]]
+ [Destroy a sequenced packet socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.native_handle [*native_handle]]]
+ [Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
 
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
 
-See the [link boost_asio.reference.buffer `buffer`] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.open [*open]]]
+ [Open a sequenced packet socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.seq_packet_socket_service [*seq_packet_socket_service]]]
+ [Construct a new sequenced packet socket service for the specified io_service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
+ ]
+
+]
 
+[heading Data Members]
+[table
+ [[Name][Description]]
 
+ [
+ [[link boost_asio.reference.seq_packet_socket_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
 
+]
 
-[endsect]
+[heading Requirements]
 
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[section:overload3 read_at (3 of 6 overloads)]
 
+[section:assign seq_packet_socket_service::assign]
 
-Attempt to read a certain amount of data at the specified offset before returning.
+[indexterm2 assign..seq_packet_socket_service]
+Assign an existing native socket to a sequenced packet socket.
 
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename CompletionCondition>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition,
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
-
 
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+[endsect]
 
 
-* The completion\_condition function object returns 0.
 
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
+[section:async_connect seq_packet_socket_service::async_connect]
 
+[indexterm2 async_connect..seq_packet_socket_service]
+Start an asynchronous connect.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
 
-[[offset][The offset at which the data will be read.]]
 
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the device.]]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some_at operation.
- const boost::system::error_code& error,
+[endsect]
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[section:async_receive seq_packet_socket_service::async_receive]
 
+[indexterm2 async_receive..seq_packet_socket_service]
+Start an asynchronous receive.
 
-[heading Return Value]
-
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
 
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
+ ReadHandler handler);
 
 
 
@@ -57513,69 +71621,52 @@
 
 
 
-[section:overload4 read_at (4 of 6 overloads)]
-
+[section:async_send seq_packet_socket_service::async_send]
 
-Attempt to read a certain amount of data at the specified offset before returning.
+[indexterm2 async_send..seq_packet_socket_service]
+Start an asynchronous send.
 
 
   template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b);
-
-
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
-
-
-* An error occurred.
-
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
-
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
 
-[heading Parameters]
-
 
-[variablelist
-
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
 
-[[offset][The offset at which the data will be read.]]
+[endsect]
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
-]
 
+[section:at_mark seq_packet_socket_service::at_mark]
 
-[heading Return Value]
-
-The number of bytes transferred.
+[indexterm2 at_mark..seq_packet_socket_service]
+Determine whether the socket is at the out-of-band data mark.
 
 
-[heading Exceptions]
-
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
+[endsect]
 
-[heading Remarks]
-
-This overload is equivalent to calling:
 
- boost::asio::read_at(
- d, 42, b,
- boost::asio::transfer_all());
 
+[section:available seq_packet_socket_service::available]
 
+[indexterm2 available..seq_packet_socket_service]
+Determine the number of bytes available for reading.
 
 
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
 
 
@@ -57583,71 +71674,48 @@
 
 
 
-[section:overload5 read_at (5 of 6 overloads)]
-
+[section:bind seq_packet_socket_service::bind]
 
-Attempt to read a certain amount of data at the specified offset before returning.
-
-
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
+[indexterm2 bind..seq_packet_socket_service]
+Bind the sequenced packet socket to the specified local endpoint.
 
 
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
 
 
-* The completion\_condition function object returns 0.
 
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
+[endsect]
 
 
-[heading Parameters]
-
 
-[variablelist
-
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
+[section:cancel seq_packet_socket_service::cancel]
 
-[[offset][The offset at which the data will be read.]]
+[indexterm2 cancel..seq_packet_socket_service]
+Cancel all asynchronous operations associated with the socket.
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some_at operation.
- const boost::system::error_code& error,
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
-]
 
+[endsect]
 
-[heading Return Value]
-
-The number of bytes transferred.
 
 
-[heading Exceptions]
-
+[section:close seq_packet_socket_service::close]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 close..seq_packet_socket_service]
+Close a sequenced packet socket implementation.
 
-]
 
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
 
 
 
@@ -57655,620 +71723,385 @@
 
 
 
-[section:overload6 read_at (6 of 6 overloads)]
-
+[section:connect seq_packet_socket_service::connect]
 
-Attempt to read a certain amount of data at the specified offset before returning.
+[indexterm2 connect..seq_packet_socket_service]
+Connect the sequenced packet socket to the specified endpoint.
 
 
- template<
- typename ``[link boost_asio.reference.SyncRandomAccessReadDevice SyncRandomAccessReadDevice]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t read_at(
- SyncRandomAccessReadDevice & d,
- boost::uint64_t offset,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition,
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
       boost::system::error_code & ec);
 
 
-This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
-
 
-* The completion\_condition function object returns 0.
+[endsect]
 
-This operation is implemented in terms of zero or more calls to the device's read\_some\_at function.
 
 
-[heading Parameters]
-
+[section:construct seq_packet_socket_service::construct]
 
-[variablelist
-
-[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
+[indexterm2 construct..seq_packet_socket_service]
+Construct a new sequenced packet socket implementation.
 
-[[offset][The offset at which the data will be read.]]
 
-[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object into which the data will be read.]]
+ void construct(
+ implementation_type & impl);
 
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- std::size_t completion_condition(
- // Result of latest read_some_at operation.
- const boost::system::error_code& error,
 
- // Number of bytes transferred so far.
- std::size_t bytes_transferred
- );
-``
-A return value of 0 indicates that the read operation is complete. A non-zero return value indicates the maximum number of bytes to be read on the next call to the device's read\_some\_at function.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[endsect]
 
-]
 
 
-[heading Return Value]
-
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+[section:destroy seq_packet_socket_service::destroy]
 
+[indexterm2 destroy..seq_packet_socket_service]
+Destroy a sequenced packet socket implementation.
 
 
+ void destroy(
+ implementation_type & impl);
 
-[endsect]
 
 
 [endsect]
 
-[section:read_until read_until]
-
-[indexterm1 read_until]
-Read data into a streambuf until it contains a delimiter, matches a regular expression, or a function object indicates a match.
-
-
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload1 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- char delim);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload1 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload2 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- char delim,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload2 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload3 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const std::string & delim);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload3 more...]]``
+[section:endpoint_type seq_packet_socket_service::endpoint_type]
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload4 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const std::string & delim,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload4 more...]]``
+[indexterm2 endpoint_type..seq_packet_socket_service]
+The endpoint type.
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload5 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const boost::regex & expr);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload5 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read_until.overload6 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const boost::regex & expr,
- boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload6 more...]]``
+ typedef Protocol::endpoint endpoint_type;
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename MatchCondition>
- std::size_t ``[link boost_asio.reference.read_until.overload7 read_until]``(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- MatchCondition match_condition,
- typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload7 more...]]``
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename MatchCondition>
- std::size_t ``[link boost_asio.reference.read_until.overload8 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);
- `` [''''&raquo;''' [link boost_asio.reference.read_until.overload8 more...]]``
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/read_until.hpp]
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload1 read_until (1 of 8 overloads)]
-
+[endsect]
 
-Read data into a streambuf until it contains a specified delimiter.
 
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- char delim);
+[section:get_io_service seq_packet_socket_service::get_io_service]
 
 
-This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
+['Inherited from io_service.]
 
+[indexterm2 get_io_service..seq_packet_socket_service]
+Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
 
-* The get area of the streambuf contains the specified delimiter.
 
+ boost::asio::io_service & get_io_service();
 
-* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
 
+[endsect]
 
-[heading Parameters]
-
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][A streambuf object into which the data will be read.]]
+[section:get_option seq_packet_socket_service::get_option]
 
-[[delim][The delimiter character.]]
+[indexterm2 get_option..seq_packet_socket_service]
+Get a socket option.
 
-]
 
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ const implementation_type & impl,
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
 
 
-[heading Exceptions]
-
+[endsect]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
 
-]
 
+[section:id seq_packet_socket_service::id]
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
+[indexterm2 id..seq_packet_socket_service]
+The unique service identifier.
 
 
-[heading Example]
-
-To read data into a streambuf until a newline is encountered:
+ static boost::asio::io_service::id id;
 
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, '\n');
- std::istream is(&b);
- std::string line;
- std::getline(is, line);
 
 
-After the `read_until` operation completes successfully, the buffer `b` contains the delimiter:
+[endsect]
 
- { 'a', 'b', ..., 'c', '\n', 'd', 'e', ... }
 
 
-The call to `std::getline` then extracts the data up to and including the delimiter, so that the string `line` contains:
+[section:implementation_type seq_packet_socket_service::implementation_type]
 
- { 'a', 'b', ..., 'c', '\n' }
+[indexterm2 implementation_type..seq_packet_socket_service]
+The type of a sequenced packet socket implementation.
 
 
-The remaining data is left in the buffer `b` as follows:
+ typedef implementation_defined implementation_type;
 
- { 'd', 'e', ... }
 
 
-This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
+[heading Requirements]
 
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
 
-[section:overload2 read_until (2 of 8 overloads)]
-
+[section:io_control seq_packet_socket_service::io_control]
 
-Read data into a streambuf until it contains a specified delimiter.
+[indexterm2 io_control..seq_packet_socket_service]
+Perform an IO control command on the socket.
 
 
   template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- char delim,
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
       boost::system::error_code & ec);
 
 
-This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
-
-
-* The get area of the streambuf contains the specified delimiter.
-
-
-* An error occurred.
-
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-
-[[b][A streambuf object into which the data will be read.]]
-
-[[delim][The delimiter character.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
-
-
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
-
-
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
-
-
-
 
 [endsect]
 
 
 
-[section:overload3 read_until (3 of 8 overloads)]
-
-
-Read data into a streambuf until it contains a specified delimiter.
-
-
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const std::string & delim);
-
-
-This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
-
-
-* The get area of the streambuf contains the specified delimiter.
-
-
-* An error occurred.
-
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-
-[[b][A streambuf object into which the data will be read.]]
-
-[[delim][The delimiter string.]]
-
-]
-
-
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
-
-
-[heading Exceptions]
-
+[section:is_open seq_packet_socket_service::is_open]
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[indexterm2 is_open..seq_packet_socket_service]
+Determine whether the socket is open.
 
-]
 
+ bool is_open(
+ const implementation_type & impl) const;
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
 
-[heading Example]
-
-To read data into a streambuf until a newline is encountered:
+[endsect]
 
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, "\r\n");
- std::istream is(&b);
- std::string line;
- std::getline(is, line);
 
 
-After the `read_until` operation completes successfully, the buffer `b` contains the delimiter:
+[section:local_endpoint seq_packet_socket_service::local_endpoint]
 
- { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+[indexterm2 local_endpoint..seq_packet_socket_service]
+Get the local endpoint.
 
 
-The call to `std::getline` then extracts the data up to and including the delimiter, so that the string `line` contains:
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
- { 'a', 'b', ..., 'c', '\r', '\n' }
 
 
-The remaining data is left in the buffer `b` as follows:
+[endsect]
 
- { 'd', 'e', ... }
 
 
-This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
+[section:native seq_packet_socket_service::native]
 
+[indexterm2 native..seq_packet_socket_service]
+(Deprecated: Use `native_handle()`.) Get the native socket implementation.
 
 
+ native_type native(
+ implementation_type & impl);
 
-[endsect]
 
 
+[endsect]
 
-[section:overload4 read_until (4 of 8 overloads)]
 
 
-Read data into a streambuf until it contains a specified delimiter.
+[section:native_handle seq_packet_socket_service::native_handle]
 
+[indexterm2 native_handle..seq_packet_socket_service]
+Get the native socket implementation.
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const std::string & delim,
- boost::system::error_code & ec);
 
+ native_handle_type native_handle(
+ implementation_type & impl);
 
-This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
 
 
-* The get area of the streambuf contains the specified delimiter.
+[endsect]
 
 
-* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
+[section:native_handle_type seq_packet_socket_service::native_handle_type]
 
+[indexterm2 native_handle_type..seq_packet_socket_service]
+The native socket type.
 
-[heading Parameters]
-
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+ typedef implementation_defined native_handle_type;
 
-[[b][A streambuf object into which the data will be read.]]
 
-[[delim][The delimiter string.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
+[heading Requirements]
 
-]
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
 
+[endsect]
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond the delimiter. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
+[section:native_non_blocking seq_packet_socket_service::native_non_blocking]
 
+[indexterm2 native_non_blocking..seq_packet_socket_service]
+Gets the non-blocking mode of the native socket implementation.
 
 
-[endsect]
+ bool ``[link boost_asio.reference.seq_packet_socket_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.seq_packet_socket_service.native_non_blocking.overload1 more...]]``
 
 
+Sets the non-blocking mode of the native socket implementation.
 
-[section:overload5 read_until (5 of 8 overloads)]
 
+ boost::system::error_code ``[link boost_asio.reference.seq_packet_socket_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.seq_packet_socket_service.native_non_blocking.overload2 more...]]``
 
-Read data into a streambuf until some part of the data it contains matches a regular expression.
 
+[section:overload1 seq_packet_socket_service::native_non_blocking (1 of 2 overloads)]
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const boost::regex & expr);
 
+Gets the non-blocking mode of the native socket implementation.
 
-This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
 
+ bool native_non_blocking(
+ const implementation_type & impl) const;
 
-* A substring of the streambuf's get area matches the regular expression.
 
 
-* An error occurred.
+[endsect]
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains data that matches the regular expression, the function returns immediately.
 
 
-[heading Parameters]
-
+[section:overload2 seq_packet_socket_service::native_non_blocking (2 of 2 overloads)]
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][A streambuf object into which the data will be read.]]
+Sets the non-blocking mode of the native socket implementation.
 
-[[expr][The regular expression.]]
 
-]
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression.
 
+[endsect]
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[endsect]
 
-]
 
+[section:native_type seq_packet_socket_service::native_type]
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the regular expression. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
+[indexterm2 native_type..seq_packet_socket_service]
+(Deprecated: Use native\_handle\_type.) The native socket type.
 
 
-[heading Example]
-
-To read data into a streambuf until a CR-LF sequence is encountered:
+ typedef implementation_defined native_type;
 
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, boost::regex("\r\n"));
- std::istream is(&b);
- std::string line;
- std::getline(is, line);
 
 
-After the `read_until` operation completes successfully, the buffer `b` contains the data which matched the regular expression:
+[heading Requirements]
 
- { 'a', 'b', ..., 'c', '\r', '\n', 'd', 'e', ... }
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
-The call to `std::getline` then extracts the data up to and including the match, so that the string `line` contains:
 
- { 'a', 'b', ..., 'c', '\r', '\n' }
+[endsect]
 
 
-The remaining data is left in the buffer `b` as follows:
+[section:non_blocking seq_packet_socket_service::non_blocking]
 
- { 'd', 'e', ... }
+[indexterm2 non_blocking..seq_packet_socket_service]
+Gets the non-blocking mode of the socket.
 
 
-This data may be the start of a new line, to be extracted by a subsequent `read_until` operation.
+ bool ``[link boost_asio.reference.seq_packet_socket_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.seq_packet_socket_service.non_blocking.overload1 more...]]``
 
 
+Sets the non-blocking mode of the socket.
 
 
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.seq_packet_socket_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.seq_packet_socket_service.non_blocking.overload2 more...]]``
 
 
+[section:overload1 seq_packet_socket_service::non_blocking (1 of 2 overloads)]
 
-[section:overload6 read_until (6 of 8 overloads)]
 
+Gets the non-blocking mode of the socket.
 
-Read data into a streambuf until some part of the data it contains matches a regular expression.
 
+ bool non_blocking(
+ const implementation_type & impl) const;
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- const boost::regex & expr,
- boost::system::error_code & ec);
 
 
-This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
+[endsect]
 
 
-* A substring of the streambuf's get area matches the regular expression.
 
+[section:overload2 seq_packet_socket_service::non_blocking (2 of 2 overloads)]
 
-* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains data that matches the regular expression, the function returns immediately.
+Sets the non-blocking mode of the socket.
 
 
-[heading Parameters]
-
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][A streambuf object into which the data will be read.]]
 
-[[expr][The regular expression.]]
+[endsect]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[endsect]
 
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression. Returns 0 if an error occurred.
+[section:open seq_packet_socket_service::open]
 
+[indexterm2 open..seq_packet_socket_service]
+Open a sequenced packet socket.
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the regular expression. An application will typically leave that data in the streambuf for a subsequent read\_until operation to examine.
 
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
 
 
 
@@ -58276,209 +72109,149 @@
 
 
 
-[section:overload7 read_until (7 of 8 overloads)]
+[section:protocol_type seq_packet_socket_service::protocol_type]
 
+[indexterm2 protocol_type..seq_packet_socket_service]
+The protocol type.
 
-Read data into a streambuf until a function object indicates a match.
 
+ typedef Protocol protocol_type;
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream 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);
 
 
-This function is used to read data into the specified streambuf until a user-defined match condition function object, when applied to the data contained in the streambuf, indicates a successful match. The call will block until one of the following conditions is true:
+[heading Requirements]
 
+[*Header: ][^boost/asio/seq_packet_socket_service.hpp]
 
-* The match condition function object returns a std::pair where the second element evaluates to true.
+[*Convenience header: ][^boost/asio.hpp]
 
 
-* An error occurred.
+[endsect]
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
 
 
-[heading Parameters]
-
+[section:receive seq_packet_socket_service::receive]
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[indexterm2 receive..seq_packet_socket_service]
+Receive some data from the peer.
 
-[[b][A streambuf object into which the data will be read.]]
 
-[[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be:
-``
- pair<iterator, bool> match_condition(iterator begin, iterator end);
-``
-where `iterator` represents the type:
-``
- buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
-``
-The iterator parameters `begin` and `end` define the range of bytes to be scanned to determine whether there is a match. The `first` member of the return value is an iterator marking one-past-the-end of the bytes that have been consumed by the match function. This iterator is used to calculate the `begin` parameter for any subsequent invocation of the match condition. The `second` member of the return value is true if a match has been found, false otherwise.]]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags in_flags,
+ socket_base::message_flags & out_flags,
+ boost::system::error_code & ec);
 
-]
 
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area that have been fully consumed by the match function.
+[endsect]
 
 
-[heading Exceptions]
-
 
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[section:remote_endpoint seq_packet_socket_service::remote_endpoint]
 
-]
+[indexterm2 remote_endpoint..seq_packet_socket_service]
+Get the remote endpoint.
 
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the function object. An application will typically leave that data in the streambuf for a subsequent
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
 
-The default implementation of the `is_match_condition` type trait evaluates to true for function pointers and function objects with a `result_type` typedef. It must be specialised for other user-defined function objects.
 
 
-[heading Examples]
-
-To read data into a streambuf until whitespace is encountered:
+[endsect]
 
- typedef boost::asio::buffers_iterator<
- boost::asio::streambuf::const_buffers_type> iterator;
 
- std::pair<iterator, bool>
- match_whitespace(iterator begin, iterator end)
- {
- iterator i = begin;
- while (i != end)
- if (std::isspace(*i++))
- return std::make_pair(i, true);
- return std::make_pair(i, false);
- }
- ...
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, match_whitespace);
 
+[section:send seq_packet_socket_service::send]
 
+[indexterm2 send..seq_packet_socket_service]
+Send the given data to the peer.
 
 
-To read data into a streambuf until a matching character is found:
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
 
- class match_char
- {
- public:
- explicit match_char(char c) : c_(c) {}
 
- template <typename Iterator>
- std::pair<Iterator, bool> operator()(
- Iterator begin, Iterator end) const
- {
- Iterator i = begin;
- while (i != end)
- if (c_ == *i++)
- return std::make_pair(i, true);
- return std::make_pair(i, false);
- }
 
- private:
- char c_;
- };
+[endsect]
 
- namespace asio {
- template <> struct is_match_condition<match_char>
- : public boost::true_type {};
- } // namespace asio
- ...
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, match_char('a'));
 
 
+[section:seq_packet_socket_service seq_packet_socket_service::seq_packet_socket_service]
 
+[indexterm2 seq_packet_socket_service..seq_packet_socket_service]
+Construct a new sequenced packet socket service for the specified [link boost_asio.reference.io_service `io_service`].
 
 
-[endsect]
+ seq_packet_socket_service(
+ boost::asio::io_service & io_service);
 
 
 
-[section:overload8 read_until (8 of 8 overloads)]
+[endsect]
 
 
-Read data into a streambuf until a function object indicates a match.
 
+[section:set_option seq_packet_socket_service::set_option]
 
- template<
- typename ``[link boost_asio.reference.SyncReadStream 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 * = 0);
+[indexterm2 set_option..seq_packet_socket_service]
+Set a socket option.
 
 
-This function is used to read data into the specified streambuf until a user-defined match condition function object, when applied to the data contained in the streambuf, indicates a successful match. The call will block until one of the following conditions is true:
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ implementation_type & impl,
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
 
 
-* The match condition function object returns a std::pair where the second element evaluates to true.
 
+[endsect]
 
-* An error occurred.
 
-This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
 
+[section:shutdown seq_packet_socket_service::shutdown]
 
-[heading Parameters]
-
+[indexterm2 shutdown..seq_packet_socket_service]
+Disable sends or receives on the socket.
 
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
 
-[[b][A streambuf object into which the data will be read.]]
+ boost::system::error_code shutdown(
+ implementation_type & impl,
+ socket_base::shutdown_type what,
+ boost::system::error_code & ec);
 
-[[match_condition][The function object to be called to determine whether a match exists. The signature of the function object must be:
-``
- pair<iterator, bool> match_condition(iterator begin, iterator end);
-``
-where `iterator` represents the type:
-``
- buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
-``
-The iterator parameters `begin` and `end` define the range of bytes to be scanned to determine whether there is a match. The `first` member of the return value is an iterator marking one-past-the-end of the bytes that have been consumed by the match function. This iterator is used to calculate the `begin` parameter for any subsequent invocation of the match condition. The `second` member of the return value is true if a match has been found, false otherwise.]]
 
-[[ec][Set to indicate what error occurred, if any.]]
 
-]
+[endsect]
 
 
-[heading Return Value]
-
-The number of bytes in the streambuf's get area that have been fully consumed by the match function. Returns 0 if an error occurred.
 
+[section:shutdown_service seq_packet_socket_service::shutdown_service]
 
-[heading Remarks]
-
-After a successful read\_until operation, the streambuf may contain additional data beyond that which matched the function object. An application will typically leave that data in the streambuf for a subsequent
+[indexterm2 shutdown_service..seq_packet_socket_service]
+Destroy all user-defined handler objects owned by the service.
 
-The default implementation of the `is_match_condition` type trait evaluates to true for function pointers and function objects with a `result_type` typedef. It must be specialised for other user-defined function objects.
 
+ virtual void shutdown_service();
 
 
 
 [endsect]
 
 
+
 [endsect]
 
 
@@ -58511,13 +72284,20 @@
 
   [
 
- [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_serial_port.native_handle_type [*native_handle_type]]]
     [The native representation of a serial port. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a serial port. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -58574,11 +72354,6 @@
   ]
   
   [
- [[link boost_asio.reference.basic_serial_port.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
     [Determine whether the serial port is open. ]
   ]
@@ -58592,6 +72367,11 @@
   
   [
     [[link boost_asio.reference.basic_serial_port.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native serial port representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.native_handle [*native_handle]]]
     [Get the native serial port representation. ]
   ]
   
@@ -59409,11 +73189,18 @@
 
   [
 
- [[link boost_asio.reference.serial_port_service.native_type [*native_type]]]
+ [[link boost_asio.reference.serial_port_service.native_handle_type [*native_handle_type]]]
     [The native handle type. ]
   
   ]
 
+ [
+
+ [[link boost_asio.reference.serial_port_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native handle type. ]
+
+ ]
+
 ]
 
 [heading Member Functions]
@@ -59466,17 +73253,17 @@
   ]
   
   [
- [[link boost_asio.reference.serial_port_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.serial_port_service.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
   
   [
     [[link boost_asio.reference.serial_port_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.native_handle [*native_handle]]]
     [Get the native handle implementation. ]
   ]
   
@@ -59543,7 +73330,7 @@
 
   boost::system::error_code assign(
       implementation_type & impl,
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -59725,16 +73512,14 @@
 
 
 
-[section:io_service serial_port_service::io_service]
-
-
-['Inherited from io_service.]
+[section:is_open serial_port_service::is_open]
 
-[indexterm2 io_service..serial_port_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[indexterm2 is_open..serial_port_service]
+Determine whether the handle is open.
 
 
- boost::asio::io_service & io_service();
+ bool is_open(
+ const implementation_type & impl) const;
 
 
 
@@ -59742,14 +73527,14 @@
 
 
 
-[section:is_open serial_port_service::is_open]
+[section:native serial_port_service::native]
 
-[indexterm2 is_open..serial_port_service]
-Determine whether the handle is open.
+[indexterm2 native..serial_port_service]
+(Deprecated: Use `native_handle()`.) Get the native handle implementation.
 
 
- bool is_open(
- const implementation_type & impl) const;
+ native_type native(
+ implementation_type & impl);
 
 
 
@@ -59757,13 +73542,13 @@
 
 
 
-[section:native serial_port_service::native]
+[section:native_handle serial_port_service::native_handle]
 
-[indexterm2 native..serial_port_service]
+[indexterm2 native_handle..serial_port_service]
 Get the native handle implementation.
 
 
- native_type native(
+ native_handle_type native_handle(
       implementation_type & impl);
 
 
@@ -59772,10 +73557,31 @@
 
 
 
+[section:native_handle_type serial_port_service::native_handle_type]
+
+[indexterm2 native_handle_type..serial_port_service]
+The native handle type.
+
+
+ typedef implementation_defined native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/serial_port_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type serial_port_service::native_type]
 
 [indexterm2 native_type..serial_port_service]
-The native handle type.
+(Deprecated: Use native\_handle\_type.) The native handle type.
 
 
   typedef implementation_defined native_type;
@@ -59987,13 +73793,20 @@
 
   [
 
- [[link boost_asio.reference.socket_acceptor_service.native_type [*native_type]]]
+ [[link boost_asio.reference.socket_acceptor_service.native_handle_type [*native_handle_type]]]
     [The native acceptor type. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.socket_acceptor_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native acceptor type. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]]
     [The protocol type. ]
   
@@ -60061,11 +73874,6 @@
   ]
   
   [
- [[link boost_asio.reference.socket_acceptor_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.socket_acceptor_service.is_open [*is_open]]]
     [Determine whether the acceptor is open. ]
   ]
@@ -60082,10 +73890,29 @@
   
   [
     [[link boost_asio.reference.socket_acceptor_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native acceptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.socket_acceptor_service.native_handle [*native_handle]]]
     [Get the native acceptor implementation. ]
   ]
   
   [
+ [[link boost_asio.reference.socket_acceptor_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native acceptor implementation.
+
+ Sets the non-blocking mode of the native acceptor implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.socket_acceptor_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the acceptor.
+
+ Sets the non-blocking mode of the acceptor. ]
+ ]
+
+ [
     [[link boost_asio.reference.socket_acceptor_service.open [*open]]]
     [Open a new socket acceptor implementation. ]
   ]
@@ -60154,7 +73981,7 @@
   boost::system::error_code assign(
       implementation_type & impl,
       const protocol_type & protocol,
- const native_type & native_acceptor,
+ const native_handle_type & native_acceptor,
       boost::system::error_code & ec);
 
 
@@ -60374,16 +74201,31 @@
 
 
 
-[section:io_service socket_acceptor_service::io_service]
+[section:is_open socket_acceptor_service::is_open]
+
+[indexterm2 is_open..socket_acceptor_service]
+Determine whether the acceptor is open.
 
 
-['Inherited from io_service.]
+ bool is_open(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:listen socket_acceptor_service::listen]
 
-[indexterm2 io_service..socket_acceptor_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[indexterm2 listen..socket_acceptor_service]
+Place the socket acceptor into the state where it will listen for new connections.
 
 
- boost::asio::io_service & io_service();
+ boost::system::error_code listen(
+ implementation_type & impl,
+ int backlog,
+ boost::system::error_code & ec);
 
 
 
@@ -60391,89 +74233,201 @@
 
 
 
-[section:is_open socket_acceptor_service::is_open]
+[section:local_endpoint socket_acceptor_service::local_endpoint]
 
-[indexterm2 is_open..socket_acceptor_service]
-Determine whether the acceptor is open.
+[indexterm2 local_endpoint..socket_acceptor_service]
+Get the local endpoint.
+
+
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+
+[section:native socket_acceptor_service::native]
+
+[indexterm2 native..socket_acceptor_service]
+(Deprecated: Use `native_handle()`.) Get the native acceptor implementation.
+
+
+ native_type native(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:native_handle socket_acceptor_service::native_handle]
+
+[indexterm2 native_handle..socket_acceptor_service]
+Get the native acceptor implementation.
+
+
+ native_handle_type native_handle(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:native_handle_type socket_acceptor_service::native_handle_type]
+
+[indexterm2 native_handle_type..socket_acceptor_service]
+The native acceptor type.
+
+
+ typedef implementation_defined native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/socket_acceptor_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:native_non_blocking socket_acceptor_service::native_non_blocking]
+
+[indexterm2 native_non_blocking..socket_acceptor_service]
+Gets the non-blocking mode of the native acceptor implementation.
+
+
+ bool ``[link boost_asio.reference.socket_acceptor_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.socket_acceptor_service.native_non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the native acceptor implementation.
+
+
+ boost::system::error_code ``[link boost_asio.reference.socket_acceptor_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.socket_acceptor_service.native_non_blocking.overload2 more...]]``
+
+
+[section:overload1 socket_acceptor_service::native_non_blocking (1 of 2 overloads)]
+
+
+Gets the non-blocking mode of the native acceptor implementation.
+
+
+ bool native_non_blocking(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 socket_acceptor_service::native_non_blocking (2 of 2 overloads)]
+
+
+Sets the non-blocking mode of the native acceptor implementation.
+
+
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
 
- bool is_open(
- const implementation_type & impl) const;
 
+[endsect]
 
 
 [endsect]
 
 
+[section:native_type socket_acceptor_service::native_type]
 
-[section:listen socket_acceptor_service::listen]
+[indexterm2 native_type..socket_acceptor_service]
+(Deprecated: Use native\_handle\_type.) The native acceptor type.
 
-[indexterm2 listen..socket_acceptor_service]
-Place the socket acceptor into the state where it will listen for new connections.
 
+ typedef implementation_defined native_type;
 
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
 
 
+[heading Requirements]
 
-[endsect]
+[*Header: ][^boost/asio/socket_acceptor_service.hpp]
 
+[*Convenience header: ][^boost/asio.hpp]
 
 
-[section:local_endpoint socket_acceptor_service::local_endpoint]
+[endsect]
 
-[indexterm2 local_endpoint..socket_acceptor_service]
-Get the local endpoint.
 
+[section:non_blocking socket_acceptor_service::non_blocking]
 
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+[indexterm2 non_blocking..socket_acceptor_service]
+Gets the non-blocking mode of the acceptor.
 
 
+ bool ``[link boost_asio.reference.socket_acceptor_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.socket_acceptor_service.non_blocking.overload1 more...]]``
 
-[endsect]
 
+Sets the non-blocking mode of the acceptor.
 
 
-[section:native socket_acceptor_service::native]
+ boost::system::error_code ``[link boost_asio.reference.socket_acceptor_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.socket_acceptor_service.non_blocking.overload2 more...]]``
 
-[indexterm2 native..socket_acceptor_service]
-Get the native acceptor implementation.
 
+[section:overload1 socket_acceptor_service::non_blocking (1 of 2 overloads)]
 
- native_type native(
- implementation_type & impl);
 
+Gets the non-blocking mode of the acceptor.
 
 
-[endsect]
+ bool non_blocking(
+ const implementation_type & impl) const;
 
 
 
-[section:native_type socket_acceptor_service::native_type]
+[endsect]
 
-[indexterm2 native_type..socket_acceptor_service]
-The native acceptor type.
 
 
- typedef implementation_defined native_type;
+[section:overload2 socket_acceptor_service::non_blocking (2 of 2 overloads)]
 
 
+Sets the non-blocking mode of the acceptor.
 
-[heading Requirements]
 
-[*Header: ][^boost/asio/socket_acceptor_service.hpp]
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
 
-[*Convenience header: ][^boost/asio.hpp]
 
 
 [endsect]
 
 
+[endsect]
+
 
 [section:open socket_acceptor_service::open]
 
@@ -60635,7 +74589,7 @@
   [
 
     [[link boost_asio.reference.socket_base.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+ [(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. ]
   
   ]
 
@@ -60709,6 +74663,11 @@
   ]
 
   [
+ [[link boost_asio.reference.socket_base.message_end_of_record [*message_end_of_record]]]
+ [Specifies that the data marks the end of a record. ]
+ ]
+
+ [
     [[link boost_asio.reference.socket_base.message_out_of_band [*message_out_of_band]]]
     [Process out-of-band data. ]
   ]
@@ -61102,6 +75061,20 @@
 
 
 
+[section:message_end_of_record socket_base::message_end_of_record]
+
+[indexterm2 message_end_of_record..socket_base]
+Specifies that the data marks the end of a record.
+
+
+ static const int message_end_of_record = implementation_defined;
+
+
+
+[endsect]
+
+
+
 [section:message_flags socket_base::message_flags]
 
 [indexterm2 message_flags..socket_base]
@@ -61154,7 +75127,7 @@
 [section:non_blocking_io socket_base::non_blocking_io]
 
 [indexterm2 non_blocking_io..socket_base]
-IO control command to set the blocking mode of the socket.
+(Deprecated: Use non\_blocking().) IO control command to set the blocking mode of the socket.
 
 
   typedef implementation_defined non_blocking_io;
@@ -63787,11 +77760,6 @@
   ]
   
   [
- [[link boost_asio.reference.ssl__context_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.ssl__context_service.load_verify_file [*load_verify_file]]]
     [Load a certification authority file for performing verification. ]
   ]
@@ -63981,23 +77949,6 @@
 
 
 
-[section:io_service ssl::context_service::io_service]
-
-
-['Inherited from io_service.]
-
-[indexterm2 io_service..ssl::context_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
-
-
- boost::asio::io_service & io_service();
-
-
-
-[endsect]
-
-
-
 [section:load_verify_file ssl::context_service::load_verify_file]
 
 [indexterm2 load_verify_file..ssl::context_service]
@@ -64285,11 +78236,6 @@
   ]
   
   [
- [[link boost_asio.reference.ssl__stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.ssl__stream.lowest_layer [*lowest_layer]]]
     [Get a reference to the lowest layer.
 
@@ -64796,29 +78742,6 @@
 
 [endsect]
 
-
-[section:io_service ssl::stream::io_service]
-
-[indexterm2 io_service..ssl::stream]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the stream uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
 [section:lowest_layer ssl::stream::lowest_layer]
 
 [indexterm2 lowest_layer..ssl::stream]
@@ -65592,11 +79515,6 @@
   ]
   
   [
- [[link boost_asio.reference.ssl__stream_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.ssl__stream_service.null [*null]]]
     [Return a null stream implementation. ]
   ]
@@ -65865,23 +79783,6 @@
 
 
 
-[section:io_service ssl::stream_service::io_service]
-
-
-['Inherited from io_service.]
-
-[indexterm2 io_service..ssl::stream_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
-
-
- boost::asio::io_service & io_service();
-
-
-
-[endsect]
-
-
-
 [section:null ssl::stream_service::null]
 
 [indexterm2 null..ssl::stream_service]
@@ -66034,11 +79935,6 @@
   ]
   
   [
- [[link boost_asio.reference.io_service__strand.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the strand. ]
- ]
-
- [
     [[link boost_asio.reference.io_service__strand.post [*post]]]
     [Request the strand to invoke the given handler and return immediately. ]
   ]
@@ -66159,13 +80055,20 @@
 
   [
 
- [[link boost_asio.reference.stream_socket_service.native_type [*native_type]]]
+ [[link boost_asio.reference.stream_socket_service.native_handle_type [*native_handle_type]]]
     [The native socket type. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.stream_socket_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native socket type. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.stream_socket_service.protocol_type [*protocol_type]]]
     [The protocol type. ]
   
@@ -66253,11 +80156,6 @@
   ]
   
   [
- [[link boost_asio.reference.stream_socket_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.stream_socket_service.is_open [*is_open]]]
     [Determine whether the socket is open. ]
   ]
@@ -66269,10 +80167,29 @@
   
   [
     [[link boost_asio.reference.stream_socket_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.native_handle [*native_handle]]]
     [Get the native socket implementation. ]
   ]
   
   [
+ [[link boost_asio.reference.stream_socket_service.native_non_blocking [*native_non_blocking]]]
+ [Gets the non-blocking mode of the native socket implementation.
+
+ Sets the non-blocking mode of the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.non_blocking [*non_blocking]]]
+ [Gets the non-blocking mode of the socket.
+
+ Sets the non-blocking mode of the socket. ]
+ ]
+
+ [
     [[link boost_asio.reference.stream_socket_service.open [*open]]]
     [Open a stream socket. ]
   ]
@@ -66341,7 +80258,7 @@
   boost::system::error_code assign(
       implementation_type & impl,
       const protocol_type & protocol,
- const native_type & native_socket,
+ const native_handle_type & native_socket,
       boost::system::error_code & ec);
 
 
@@ -66650,23 +80567,6 @@
 
 
 
-[section:io_service stream_socket_service::io_service]
-
-
-['Inherited from io_service.]
-
-[indexterm2 io_service..stream_socket_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
-
-
- boost::asio::io_service & io_service();
-
-
-
-[endsect]
-
-
-
 [section:is_open stream_socket_service::is_open]
 
 [indexterm2 is_open..stream_socket_service]
@@ -66701,7 +80601,7 @@
 [section:native stream_socket_service::native]
 
 [indexterm2 native..stream_socket_service]
-Get the native socket implementation.
+(Deprecated: Use `native_handle()`.) Get the native socket implementation.
 
 
   native_type native(
@@ -66713,10 +80613,100 @@
 
 
 
+[section:native_handle stream_socket_service::native_handle]
+
+[indexterm2 native_handle..stream_socket_service]
+Get the native socket implementation.
+
+
+ native_handle_type native_handle(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:native_handle_type stream_socket_service::native_handle_type]
+
+[indexterm2 native_handle_type..stream_socket_service]
+The native socket type.
+
+
+ typedef implementation_defined native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/stream_socket_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+[section:native_non_blocking stream_socket_service::native_non_blocking]
+
+[indexterm2 native_non_blocking..stream_socket_service]
+Gets the non-blocking mode of the native socket implementation.
+
+
+ bool ``[link boost_asio.reference.stream_socket_service.native_non_blocking.overload1 native_non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.stream_socket_service.native_non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the native socket implementation.
+
+
+ boost::system::error_code ``[link boost_asio.reference.stream_socket_service.native_non_blocking.overload2 native_non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.stream_socket_service.native_non_blocking.overload2 more...]]``
+
+
+[section:overload1 stream_socket_service::native_non_blocking (1 of 2 overloads)]
+
+
+Gets the non-blocking mode of the native socket implementation.
+
+
+ bool native_non_blocking(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 stream_socket_service::native_non_blocking (2 of 2 overloads)]
+
+
+Sets the non-blocking mode of the native socket implementation.
+
+
+ boost::system::error_code native_non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
 [section:native_type stream_socket_service::native_type]
 
 [indexterm2 native_type..stream_socket_service]
-The native socket type.
+(Deprecated: Use native\_handle\_type.) The native socket type.
 
 
   typedef implementation_defined native_type;
@@ -66733,6 +80723,60 @@
 [endsect]
 
 
+[section:non_blocking stream_socket_service::non_blocking]
+
+[indexterm2 non_blocking..stream_socket_service]
+Gets the non-blocking mode of the socket.
+
+
+ bool ``[link boost_asio.reference.stream_socket_service.non_blocking.overload1 non_blocking]``(
+ const implementation_type & impl) const;
+ `` [''''&raquo;''' [link boost_asio.reference.stream_socket_service.non_blocking.overload1 more...]]``
+
+
+Sets the non-blocking mode of the socket.
+
+
+ boost::system::error_code ``[link boost_asio.reference.stream_socket_service.non_blocking.overload2 non_blocking]``(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.stream_socket_service.non_blocking.overload2 more...]]``
+
+
+[section:overload1 stream_socket_service::non_blocking (1 of 2 overloads)]
+
+
+Gets the non-blocking mode of the socket.
+
+
+ bool non_blocking(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 stream_socket_service::non_blocking (2 of 2 overloads)]
+
+
+Sets the non-blocking mode of the socket.
+
+
+ boost::system::error_code non_blocking(
+ implementation_type & impl,
+ bool mode,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
 
 [section:open stream_socket_service::open]
 
@@ -67339,6 +81383,53 @@
 
 
 
+[section:transfer_exactly transfer_exactly]
+
+[indexterm1 transfer_exactly]
+Return a completion condition function object that indicates that a read or write operation should continue until an exact number of bytes has been transferred, or until an error occurs.
+
+
+ unspecified transfer_exactly(
+ std::size_t minimum);
+
+
+This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
+
+
+[heading Example]
+
+Reading until a buffer is full or contains exactly 64 bytes:
+
+ boost::array<char, 128> buf;
+ boost::system::error_code ec;
+ std::size_t n = boost::asio::read(
+ sock, boost::asio::buffer(buf),
+ boost::asio::transfer_exactly(64), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ // n == 64
+ }
+
+
+
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/completion_condition.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:use_service use_service]
 
 [indexterm1 use_service]
@@ -67410,13 +81501,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -67456,11 +81554,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -67474,6 +81567,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -67530,11 +81628,11 @@
 
 
   void ``[link boost_asio.reference.windows__basic_handle.assign.overload1 assign]``(
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_handle.assign.overload1 more...]]``
 
   boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.assign.overload2 assign]``(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_handle.assign.overload2 more...]]``
 
@@ -67546,7 +81644,7 @@
 
 
   void assign(
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 
@@ -67561,7 +81659,7 @@
 
 
   boost::system::error_code assign(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -67587,7 +81685,7 @@
 
   ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload2 basic_handle]``(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_handle.basic_handle.overload2 more...]]``
 
 
@@ -67628,7 +81726,7 @@
 
   basic_handle(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 This constructor creates a handle object to hold an existing native handle.
@@ -67641,7 +81739,7 @@
   
 [[io_service][The [link boost_asio.reference.io_service `io_service`] object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
 
-[[native_handle][A native handle.]]
+[[handle][A native handle.]]
 
 ]
 
@@ -67875,32 +81973,6 @@
 
 
 
-[section:io_service windows::basic_handle::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..windows::basic_handle]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:is_open windows::basic_handle::is_open]
 
 [indexterm2 is_open..windows::basic_handle]
@@ -68008,13 +82080,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -68054,11 +82133,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -68072,6 +82146,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -68130,7 +82209,7 @@
 [section:native windows::basic_handle::native]
 
 [indexterm2 native..windows::basic_handle]
-Get the native handle representation.
+(Deprecated: Use `native_handle()`.) Get the native handle representation.
 
 
   native_type native();
@@ -68143,13 +82222,50 @@
 
 
 
+[section:native_handle windows::basic_handle::native_handle]
+
+[indexterm2 native_handle..windows::basic_handle]
+Get the native handle representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle_type windows::basic_handle::native_handle_type]
+
+[indexterm2 native_handle_type..windows::basic_handle]
+The native representation of a handle.
+
+
+ typedef HandleService::native_handle_type native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/windows/basic_handle.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type windows::basic_handle::native_type]
 
 [indexterm2 native_type..windows::basic_handle]
-The native representation of a handle.
+(Deprecated: Use native\_handle\_type.) The native representation of a handle.
 
 
- typedef HandleService::native_type native_type;
+ typedef HandleService::native_handle_type native_type;
 
 
 
@@ -68253,13 +82369,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_random_access_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -68309,11 +82432,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_random_access_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_random_access_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -68327,6 +82445,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -68382,11 +82505,11 @@
 
 
   void ``[link boost_asio.reference.windows__basic_random_access_handle.assign.overload1 assign]``(
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_random_access_handle.assign.overload1 more...]]``
 
   boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.assign.overload2 assign]``(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_random_access_handle.assign.overload2 more...]]``
 
@@ -68401,7 +82524,7 @@
 
 
   void assign(
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 
@@ -68419,7 +82542,7 @@
 
 
   boost::system::error_code assign(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -68565,7 +82688,7 @@
 
   ``[link boost_asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 basic_random_access_handle]``(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload2 more...]]``
 
 
@@ -68606,7 +82729,7 @@
 
   basic_random_access_handle(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 This constructor creates a random-access handle object to hold an existing native handle.
@@ -68619,7 +82742,7 @@
   
 [[io_service][The [link boost_asio.reference.io_service `io_service`] object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
 
-[[native_handle][The new underlying handle implementation.]]
+[[handle][The new underlying handle implementation.]]
 
 ]
 
@@ -68865,32 +82988,6 @@
 
 
 
-[section:io_service windows::basic_random_access_handle::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..windows::basic_random_access_handle]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:is_open windows::basic_random_access_handle::is_open]
 
 
@@ -69010,13 +83107,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -69056,11 +83160,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -69074,6 +83173,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -69135,7 +83239,7 @@
 ['Inherited from windows::basic_handle.]
 
 [indexterm2 native..windows::basic_random_access_handle]
-Get the native handle representation.
+(Deprecated: Use `native_handle()`.) Get the native handle representation.
 
 
   native_type native();
@@ -69148,13 +83252,53 @@
 
 
 
+[section:native_handle windows::basic_random_access_handle::native_handle]
+
+
+['Inherited from windows::basic_handle.]
+
+[indexterm2 native_handle..windows::basic_random_access_handle]
+Get the native handle representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle_type windows::basic_random_access_handle::native_handle_type]
+
+[indexterm2 native_handle_type..windows::basic_random_access_handle]
+The native representation of a handle.
+
+
+ typedef RandomAccessHandleService::native_handle_type native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/windows/basic_random_access_handle.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type windows::basic_random_access_handle::native_type]
 
 [indexterm2 native_type..windows::basic_random_access_handle]
-The native representation of a handle.
+(Deprecated: Use native\_handle\_type.) The native representation of a handle.
 
 
- typedef RandomAccessHandleService::native_type native_type;
+ typedef RandomAccessHandleService::native_handle_type native_type;
 
 
 
@@ -69512,13 +83656,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_stream_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_stream_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -69568,11 +83719,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_stream_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_stream_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -69586,6 +83732,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_stream_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -69642,11 +83793,11 @@
 
 
   void ``[link boost_asio.reference.windows__basic_stream_handle.assign.overload1 assign]``(
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_stream_handle.assign.overload1 more...]]``
 
   boost::system::error_code ``[link boost_asio.reference.windows__basic_stream_handle.assign.overload2 assign]``(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_stream_handle.assign.overload2 more...]]``
 
@@ -69661,7 +83812,7 @@
 
 
   void assign(
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 
@@ -69679,7 +83830,7 @@
 
 
   boost::system::error_code assign(
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -69819,7 +83970,7 @@
 
   ``[link boost_asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 basic_stream_handle]``(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
   `` [''''&raquo;''' [link boost_asio.reference.windows__basic_stream_handle.basic_stream_handle.overload2 more...]]``
 
 
@@ -69860,7 +84011,7 @@
 
   basic_stream_handle(
       boost::asio::io_service & io_service,
- const native_type & native_handle);
+ const native_handle_type & handle);
 
 
 This constructor creates a stream handle object to hold an existing native handle.
@@ -69873,7 +84024,7 @@
   
 [[io_service][The [link boost_asio.reference.io_service `io_service`] object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
 
-[[native_handle][The new underlying handle implementation.]]
+[[handle][The new underlying handle implementation.]]
 
 ]
 
@@ -70119,32 +84270,6 @@
 
 
 
-[section:io_service windows::basic_stream_handle::io_service]
-
-
-['Inherited from basic_io_object.]
-
-[indexterm2 io_service..windows::basic_stream_handle]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] associated with the object.
-
-
- boost::asio::io_service & io_service();
-
-
-This function may be used to obtain the [link boost_asio.reference.io_service `io_service`] object that the I/O object uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the [link boost_asio.reference.io_service `io_service`] object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-
-[endsect]
-
-
-
 [section:is_open windows::basic_stream_handle::is_open]
 
 
@@ -70264,13 +84389,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -70305,13 +84437,8 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_handle.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
- ]
-
- [
- [[link boost_asio.reference.windows__basic_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.windows__basic_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
   ]
   
   [
@@ -70328,6 +84455,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -70389,7 +84521,7 @@
 ['Inherited from windows::basic_handle.]
 
 [indexterm2 native..windows::basic_stream_handle]
-Get the native handle representation.
+(Deprecated: Use `native_handle()`.) Get the native handle representation.
 
 
   native_type native();
@@ -70402,13 +84534,53 @@
 
 
 
+[section:native_handle windows::basic_stream_handle::native_handle]
+
+
+['Inherited from windows::basic_handle.]
+
+[indexterm2 native_handle..windows::basic_stream_handle]
+Get the native handle representation.
+
+
+ native_handle_type native_handle();
+
+
+This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_handle_type windows::basic_stream_handle::native_handle_type]
+
+[indexterm2 native_handle_type..windows::basic_stream_handle]
+The native representation of a handle.
+
+
+ typedef StreamHandleService::native_handle_type native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/windows/basic_stream_handle.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type windows::basic_stream_handle::native_type]
 
 [indexterm2 native_type..windows::basic_stream_handle]
-The native representation of a handle.
+(Deprecated: Use native\_handle\_type.) The native representation of a handle.
 
 
- typedef StreamHandleService::native_type native_type;
+ typedef StreamHandleService::native_handle_type native_type;
 
 
 
@@ -71012,13 +85184,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_random_access_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -71068,11 +85247,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_random_access_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_random_access_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -71086,6 +85260,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -71162,11 +85341,18 @@
 
   [
 
- [[link boost_asio.reference.windows__random_access_handle_service.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__random_access_handle_service.native_handle_type [*native_handle_type]]]
     [The native handle type. ]
   
   ]
 
+ [
+
+ [[link boost_asio.reference.windows__random_access_handle_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native handle type. ]
+
+ ]
+
 ]
 
 [heading Member Functions]
@@ -71214,17 +85400,17 @@
   ]
   
   [
- [[link boost_asio.reference.windows__random_access_handle_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.windows__random_access_handle_service.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
   
   [
     [[link boost_asio.reference.windows__random_access_handle_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.native_handle [*native_handle]]]
     [Get the native handle implementation. ]
   ]
   
@@ -71276,7 +85462,7 @@
 
   boost::system::error_code assign(
       implementation_type & impl,
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -71441,16 +85627,14 @@
 
 
 
-[section:io_service windows::random_access_handle_service::io_service]
-
-
-['Inherited from io_service.]
+[section:is_open windows::random_access_handle_service::is_open]
 
-[indexterm2 io_service..windows::random_access_handle_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[indexterm2 is_open..windows::random_access_handle_service]
+Determine whether the handle is open.
 
 
- boost::asio::io_service & io_service();
+ bool is_open(
+ const implementation_type & impl) const;
 
 
 
@@ -71458,14 +85642,14 @@
 
 
 
-[section:is_open windows::random_access_handle_service::is_open]
+[section:native windows::random_access_handle_service::native]
 
-[indexterm2 is_open..windows::random_access_handle_service]
-Determine whether the handle is open.
+[indexterm2 native..windows::random_access_handle_service]
+(Deprecated: Use `native_handle()`.) Get the native handle implementation.
 
 
- bool is_open(
- const implementation_type & impl) const;
+ native_type native(
+ implementation_type & impl);
 
 
 
@@ -71473,13 +85657,13 @@
 
 
 
-[section:native windows::random_access_handle_service::native]
+[section:native_handle windows::random_access_handle_service::native_handle]
 
-[indexterm2 native..windows::random_access_handle_service]
+[indexterm2 native_handle..windows::random_access_handle_service]
 Get the native handle implementation.
 
 
- native_type native(
+ native_handle_type native_handle(
       implementation_type & impl);
 
 
@@ -71488,10 +85672,31 @@
 
 
 
+[section:native_handle_type windows::random_access_handle_service::native_handle_type]
+
+[indexterm2 native_handle_type..windows::random_access_handle_service]
+The native handle type.
+
+
+ typedef implementation_defined native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/windows/random_access_handle_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type windows::random_access_handle_service::native_type]
 
 [indexterm2 native_type..windows::random_access_handle_service]
-The native handle type.
+(Deprecated: Use native\_handle\_type.) The native handle type.
 
 
   typedef implementation_defined native_type;
@@ -71610,13 +85815,20 @@
 
   [
 
- [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__basic_stream_handle.native_handle_type [*native_handle_type]]]
     [The native representation of a handle. ]
   
   ]
 
   [
 
+ [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native representation of a handle. ]
+
+ ]
+
+ [
+
     [[link boost_asio.reference.windows__basic_stream_handle.service_type [*service_type]]]
     [The type of the service that will be used to provide I/O operations. ]
   
@@ -71666,11 +85878,6 @@
   ]
   
   [
- [[link boost_asio.reference.windows__basic_stream_handle.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
- ]
-
- [
     [[link boost_asio.reference.windows__basic_stream_handle.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
@@ -71684,6 +85891,11 @@
   
   [
     [[link boost_asio.reference.windows__basic_stream_handle.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.native_handle [*native_handle]]]
     [Get the native handle representation. ]
   ]
   
@@ -71761,11 +85973,18 @@
 
   [
 
- [[link boost_asio.reference.windows__stream_handle_service.native_type [*native_type]]]
+ [[link boost_asio.reference.windows__stream_handle_service.native_handle_type [*native_handle_type]]]
     [The native handle type. ]
   
   ]
 
+ [
+
+ [[link boost_asio.reference.windows__stream_handle_service.native_type [*native_type]]]
+ [(Deprecated: Use native_handle_type.) The native handle type. ]
+
+ ]
+
 ]
 
 [heading Member Functions]
@@ -71813,17 +86032,17 @@
   ]
   
   [
- [[link boost_asio.reference.windows__stream_handle_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
     [[link boost_asio.reference.windows__stream_handle_service.is_open [*is_open]]]
     [Determine whether the handle is open. ]
   ]
   
   [
     [[link boost_asio.reference.windows__stream_handle_service.native [*native]]]
+ [(Deprecated: Use native_handle().) Get the native handle implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__stream_handle_service.native_handle [*native_handle]]]
     [Get the native handle implementation. ]
   ]
   
@@ -71875,7 +86094,7 @@
 
   boost::system::error_code assign(
       implementation_type & impl,
- const native_type & native_handle,
+ const native_handle_type & handle,
       boost::system::error_code & ec);
 
 
@@ -72038,16 +86257,14 @@
 
 
 
-[section:io_service windows::stream_handle_service::io_service]
-
-
-['Inherited from io_service.]
+[section:is_open windows::stream_handle_service::is_open]
 
-[indexterm2 io_service..windows::stream_handle_service]
-(Deprecated: use `get_io_service()`.) Get the [link boost_asio.reference.io_service `io_service`] object that owns the service.
+[indexterm2 is_open..windows::stream_handle_service]
+Determine whether the handle is open.
 
 
- boost::asio::io_service & io_service();
+ bool is_open(
+ const implementation_type & impl) const;
 
 
 
@@ -72055,14 +86272,14 @@
 
 
 
-[section:is_open windows::stream_handle_service::is_open]
+[section:native windows::stream_handle_service::native]
 
-[indexterm2 is_open..windows::stream_handle_service]
-Determine whether the handle is open.
+[indexterm2 native..windows::stream_handle_service]
+(Deprecated: Use `native_handle()`.) Get the native handle implementation.
 
 
- bool is_open(
- const implementation_type & impl) const;
+ native_type native(
+ implementation_type & impl);
 
 
 
@@ -72070,13 +86287,13 @@
 
 
 
-[section:native windows::stream_handle_service::native]
+[section:native_handle windows::stream_handle_service::native_handle]
 
-[indexterm2 native..windows::stream_handle_service]
+[indexterm2 native_handle..windows::stream_handle_service]
 Get the native handle implementation.
 
 
- native_type native(
+ native_handle_type native_handle(
       implementation_type & impl);
 
 
@@ -72085,10 +86302,31 @@
 
 
 
+[section:native_handle_type windows::stream_handle_service::native_handle_type]
+
+[indexterm2 native_handle_type..windows::stream_handle_service]
+The native handle type.
+
+
+ typedef implementation_defined native_handle_type;
+
+
+
+[heading Requirements]
+
+[*Header: ][^boost/asio/windows/stream_handle_service.hpp]
+
+[*Convenience header: ][^boost/asio.hpp]
+
+
+[endsect]
+
+
+
 [section:native_type windows::stream_handle_service::native_type]
 
 [indexterm2 native_type..windows::stream_handle_service]
-The native handle type.
+(Deprecated: Use native\_handle\_type.) The native handle type.
 
 
   typedef implementation_defined native_type;
@@ -72191,12 +86429,11 @@
 
   template<
       typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename CompletionCondition>
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
   std::size_t ``[link boost_asio.reference.write.overload2 write]``(
       SyncWriteStream & s,
       const ConstBufferSequence & buffers,
- CompletionCondition completion_condition);
+ boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.write.overload2 more...]]``
 
   template<
@@ -72206,38 +86443,57 @@
   std::size_t ``[link boost_asio.reference.write.overload3 write]``(
       SyncWriteStream & s,
       const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload3 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.write.overload4 write]``(
+ SyncWriteStream & s,
+ const ConstBufferSequence & buffers,
       CompletionCondition completion_condition,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.write.overload3 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload4 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
       typename Allocator>
- std::size_t ``[link boost_asio.reference.write.overload4 write]``(
+ std::size_t ``[link boost_asio.reference.write.overload5 write]``(
       SyncWriteStream & s,
       basic_streambuf< Allocator > & b);
- `` [''''&raquo;''' [link boost_asio.reference.write.overload4 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload5 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.write.overload6 write]``(
+ SyncWriteStream & s,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload6 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
       typename Allocator,
       typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.write.overload5 write]``(
+ std::size_t ``[link boost_asio.reference.write.overload7 write]``(
       SyncWriteStream & s,
       basic_streambuf< Allocator > & b,
       CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.write.overload5 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload7 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
       typename Allocator,
       typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.write.overload6 write]``(
+ std::size_t ``[link boost_asio.reference.write.overload8 write]``(
       SyncWriteStream & s,
       basic_streambuf< Allocator > & b,
       CompletionCondition completion_condition,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.write.overload6 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write.overload8 more...]]``
 
 [heading Requirements]
 
@@ -72246,7 +86502,7 @@
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload1 write (1 of 6 overloads)]
+[section:overload1 write (1 of 8 overloads)]
 
 
 Write all of the supplied data to a stream before returning.
@@ -72326,7 +86582,80 @@
 
 
 
-[section:overload2 write (2 of 6 overloads)]
+[section:overload2 write (2 of 8 overloads)]
+
+
+Write all of the supplied data to a stream before returning.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write(
+ SyncWriteStream & s,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+This function is used to write a certain number of bytes of data to a stream. The call will block until one of the following conditions is true:
+
+
+* All of the data in the supplied buffers has been written. That is, the bytes transferred is equal to the sum of the buffer sizes.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's write\_some function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream to which the data is to be written. The type must support the SyncWriteStream concept.]]
+
+[[buffers][One or more buffers containing the data to be written. The sum of the buffer sizes indicates the maximum number of bytes to write to the stream.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+
+ boost::asio::write(s, boost::asio::buffer(data, size), ec);
+
+
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::write(
+ s, buffers,
+ boost::asio::transfer_all(), ec);
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 write (3 of 8 overloads)]
 
 
 Write a certain amount of data to a stream before returning.
@@ -72409,7 +86738,7 @@
 
 
 
-[section:overload3 write (3 of 6 overloads)]
+[section:overload4 write (4 of 8 overloads)]
 
 
 Write a certain amount of data to a stream before returning.
@@ -72474,7 +86803,7 @@
 
 
 
-[section:overload4 write (4 of 6 overloads)]
+[section:overload5 write (5 of 8 overloads)]
 
 
 Write all of the supplied data to a stream before returning.
@@ -72544,7 +86873,70 @@
 
 
 
-[section:overload5 write (5 of 6 overloads)]
+[section:overload6 write (6 of 8 overloads)]
+
+
+Write all of the supplied data to a stream before returning.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
+ typename Allocator>
+ std::size_t write(
+ SyncWriteStream & s,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+
+
+This function is used to write a certain number of bytes of data to a stream. The call will block until one of the following conditions is true:
+
+
+* All of the data in the supplied [link boost_asio.reference.basic_streambuf `basic_streambuf`] has been written.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's write\_some function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream to which the data is to be written. The type must support the SyncWriteStream concept.]]
+
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object from which data will be written.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::write(
+ s, b,
+ boost::asio::transfer_all(), ec);
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload7 write (7 of 8 overloads)]
 
 
 Write a certain amount of data to a stream before returning.
@@ -72616,7 +87008,7 @@
 
 
 
-[section:overload6 write (6 of 6 overloads)]
+[section:overload8 write (8 of 8 overloads)]
 
 
 Write a certain amount of data to a stream before returning.
@@ -72699,13 +87091,12 @@
 
   template<
       typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename CompletionCondition>
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
   std::size_t ``[link boost_asio.reference.write_at.overload2 write_at]``(
       SyncRandomAccessWriteDevice & d,
       boost::uint64_t offset,
       const ConstBufferSequence & buffers,
- CompletionCondition completion_condition);
+ boost::system::error_code & ec);
   `` [''''&raquo;''' [link boost_asio.reference.write_at.overload2 more...]]``
 
   template<
@@ -72716,41 +87107,62 @@
       SyncRandomAccessWriteDevice & d,
       boost::uint64_t offset,
       const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition);
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload3 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.write_at.overload4 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
       CompletionCondition completion_condition,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.write_at.overload3 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload4 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
       typename Allocator>
- std::size_t ``[link boost_asio.reference.write_at.overload4 write_at]``(
+ std::size_t ``[link boost_asio.reference.write_at.overload5 write_at]``(
       SyncRandomAccessWriteDevice & d,
       boost::uint64_t offset,
       basic_streambuf< Allocator > & b);
- `` [''''&raquo;''' [link boost_asio.reference.write_at.overload4 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload5 more...]]``
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.write_at.overload6 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload6 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
       typename Allocator,
       typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.write_at.overload5 write_at]``(
+ std::size_t ``[link boost_asio.reference.write_at.overload7 write_at]``(
       SyncRandomAccessWriteDevice & d,
       boost::uint64_t offset,
       basic_streambuf< Allocator > & b,
       CompletionCondition completion_condition);
- `` [''''&raquo;''' [link boost_asio.reference.write_at.overload5 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload7 more...]]``
 
   template<
       typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
       typename Allocator,
       typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.write_at.overload6 write_at]``(
+ std::size_t ``[link boost_asio.reference.write_at.overload8 write_at]``(
       SyncRandomAccessWriteDevice & d,
       boost::uint64_t offset,
       basic_streambuf< Allocator > & b,
       CompletionCondition completion_condition,
       boost::system::error_code & ec);
- `` [''''&raquo;''' [link boost_asio.reference.write_at.overload6 more...]]``
+ `` [''''&raquo;''' [link boost_asio.reference.write_at.overload8 more...]]``
 
 [heading Requirements]
 
@@ -72759,7 +87171,7 @@
 [*Convenience header: ][^boost/asio.hpp]
 
 
-[section:overload1 write_at (1 of 6 overloads)]
+[section:overload1 write_at (1 of 8 overloads)]
 
 
 Write all of the supplied data at the specified offset before returning.
@@ -72842,7 +87254,84 @@
 
 
 
-[section:overload2 write_at (2 of 6 overloads)]
+[section:overload2 write_at (2 of 8 overloads)]
+
+
+Write all of the supplied data at the specified offset before returning.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+This function is used to write a certain number of bytes of data to a random access device at a specified offset. The call will block until one of the following conditions is true:
+
+
+* All of the data in the supplied buffers has been written. That is, the bytes transferred is equal to the sum of the buffer sizes.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the device's write\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device to which the data is to be written. The type must support the SyncRandomAccessWriteDevice concept.]]
+
+[[offset][The offset at which the data will be written.]]
+
+[[buffers][One or more buffers containing the data to be written. The sum of the buffer sizes indicates the maximum number of bytes to write to the device.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Example]
+
+To write a single data buffer use the [link boost_asio.reference.buffer `buffer`] function as follows:
+
+ boost::asio::write_at(d, 42,
+ boost::asio::buffer(data, size), ec);
+
+
+See the [link boost_asio.reference.buffer `buffer`] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::write_at(
+ d, offset, buffers,
+ boost::asio::transfer_all(), ec);
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 write_at (3 of 8 overloads)]
 
 
 Write a certain amount of data at a specified offset before returning.
@@ -72928,7 +87417,7 @@
 
 
 
-[section:overload3 write_at (3 of 6 overloads)]
+[section:overload4 write_at (4 of 8 overloads)]
 
 
 Write a certain amount of data at a specified offset before returning.
@@ -72996,7 +87485,7 @@
 
 
 
-[section:overload4 write_at (4 of 6 overloads)]
+[section:overload5 write_at (5 of 8 overloads)]
 
 
 Write all of the supplied data at the specified offset before returning.
@@ -73069,7 +87558,73 @@
 
 
 
-[section:overload5 write_at (5 of 6 overloads)]
+[section:overload6 write_at (6 of 8 overloads)]
+
+
+Write all of the supplied data at the specified offset before returning.
+
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ boost::system::error_code & ec);
+
+
+This function is used to write a certain number of bytes of data to a random access device at a specified offset. The call will block until one of the following conditions is true:
+
+
+* All of the data in the supplied [link boost_asio.reference.basic_streambuf `basic_streambuf`] has been written.
+
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the device's write\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device to which the data is to be written. The type must support the SyncRandomAccessWriteDevice concept.]]
+
+[[offset][The offset at which the data will be written.]]
+
+[[b][The [link boost_asio.reference.basic_streambuf `basic_streambuf`] object from which data will be written.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::write_at(
+ d, 42, b,
+ boost::asio::transfer_all(), ec);
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload7 write_at (7 of 8 overloads)]
 
 
 Write a certain amount of data at a specified offset before returning.
@@ -73144,7 +87699,7 @@
 
 
 
-[section:overload6 write_at (6 of 6 overloads)]
+[section:overload8 write_at (8 of 8 overloads)]
 
 
 Write a certain amount of data at a specified offset before returning.
@@ -73394,9 +87949,9 @@
 
 [heading Requirements]
 
-[*Header: ][^boost/asio/error.hpp]
+[*Header: ][^boost/asio/ssl/error.hpp]
 
-[*Convenience header: ][^boost/asio.hpp]
+[*Convenience header: ][^boost/asio/ssl.hpp]
 
 
 [section:value boost::system::is_error_code_enum< boost::asio::error::ssl_errors >::value]

Modified: trunk/libs/asio/doc/reference.xsl
==============================================================================
--- trunk/libs/asio/doc/reference.xsl (original)
+++ trunk/libs/asio/doc/reference.xsl 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,6 +43,7 @@
 [include requirements/AsyncReadStream.qbk]
 [include requirements/AsyncWriteStream.qbk]
 [include requirements/CompletionHandler.qbk]
+[include requirements/ComposedConnectHandler.qbk]
 [include requirements/ConnectHandler.qbk]
 [include requirements/ConstBufferSequence.qbk]
 [include requirements/ConvertibleToConstBuffer.qbk]
@@ -64,6 +65,7 @@
 [include requirements/ReadHandler.qbk]
 [include requirements/ResolveHandler.qbk]
 [include requirements/ResolverService.qbk]
+[include requirements/SeqPacketSocketService.qbk]
 [include requirements/SerialPortService.qbk]
 [include requirements/Service.qbk]
 [include requirements/SettableSerialPortOption.qbk]
@@ -1281,6 +1283,9 @@
         <xsl:when test="declname = 'CompletionCondition'">
           <xsl:value-of select="declname"/>
         </xsl:when>
+ <xsl:when test="declname = 'ConnectCondition'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
         <xsl:when test="declname = 'Context_Service'">
           <xsl:value-of select="declname"/>
         </xsl:when>
@@ -1296,6 +1301,9 @@
         <xsl:when test="declname = 'HandshakeHandler'">
           <xsl:value-of select="declname"/>
         </xsl:when>
+ <xsl:when test="declname = 'Iterator'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
         <xsl:when test="declname = 'MatchCondition'">
           <xsl:value-of select="declname"/>
         </xsl:when>

Modified: trunk/libs/asio/doc/requirements/AsyncReadStream.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/AsyncReadStream.qbk (original)
+++ trunk/libs/asio/doc/requirements/AsyncReadStream.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -16,7 +16,7 @@
 [table Buffer-oriented asynchronous read stream requirements
   [[operation] [type] [semantics, pre/post-conditions]]
   [
- [`a.io_service();`]
+ [`a.get_io_service();`]
     [`io_service&`]
     [Returns the `io_service` object through which the `async_read_some`
     handler `h` will be invoked.]
@@ -27,7 +27,7 @@
     [
       Initiates an asynchronous operation to read one or more bytes of data
       from the stream `a`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/AsyncWriteStream.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/AsyncWriteStream.qbk (original)
+++ trunk/libs/asio/doc/requirements/AsyncWriteStream.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -15,7 +15,7 @@
 [table Buffer-oriented asynchronous write stream requirements
   [[operation] [type] [semantics, pre/post-conditions]]
   [
- [`a.io_service();`]
+ [`a.get_io_service();`]
     [`io_service&`]
     [Returns the `io_service` object through which the `async_write_some`
     handler `h` will be invoked.]
@@ -26,7 +26,7 @@
     [
       Initiates an asynchronous operation to write one or more bytes of data to
       the stream `a`. The operation is performed via the `io_service` object
- `a.io_service()` and behaves according to [link
+ `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Added: trunk/libs/asio/doc/requirements/ComposedConnectHandler.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/asio/doc/requirements/ComposedConnectHandler.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,56 @@
+[/
+ / 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)
+ /]
+
+[section:ComposedConnectHandler Composed connect handler requirements]
+
+A composed connect handler must meet the requirements for a [link
+boost_asio.reference.Handler handler]. A value `h` of a composed connect handler
+class should work correctly in the expression `h(ec, i)`, where `ec` is an
+lvalue of type `const error_code` and `i` is an lvalue of the type `Iterator`
+used in the corresponding `connect()` or async_connect()` function.
+
+[heading Examples]
+
+A free function as a composed connect handler:
+
+ void connect_handler(
+ const boost::system::error_code& ec,
+ boost::asio::ip::tcp::resolver::iterator iterator)
+ {
+ ...
+ }
+
+A composed connect handler function object:
+
+ struct connect_handler
+ {
+ ...
+ template <typename Iterator>
+ void operator()(
+ const boost::system::error_code& ec,
+ Iterator iterator)
+ {
+ ...
+ }
+ ...
+ };
+
+A non-static class member function adapted to a composed connect handler using `bind()`:
+
+ void my_class::connect_handler(
+ const boost::system::error_code& ec,
+ boost::asio::ip::tcp::resolver::iterator iterator)
+ {
+ ...
+ }
+ ...
+ boost::asio::async_connect(...,
+ boost::bind(&my_class::connect_handler,
+ this, boost::asio::placeholders::error,
+ boost::asio::placeholders::iterator));
+
+[endsect]

Modified: trunk/libs/asio/doc/requirements/DatagramSocketService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/DatagramSocketService.qbk (original)
+++ trunk/libs/asio/doc/requirements/DatagramSocketService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -48,7 +48,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from a connected socket `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -95,7 +95,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from an unconnected socket `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -145,7 +145,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       a connected socket `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -198,7 +198,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       an unconnected socket `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/DescriptorService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/DescriptorService.qbk (original)
+++ trunk/libs/asio/doc/requirements/DescriptorService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -13,14 +13,14 @@
 
 In the table below, `X` denotes a descriptor service class, `a` denotes a value
 of type `X`, `b` denotes a value of type `X::implementation_type`, `n` denotes
-a value of type `X::native_type`, `ec` denotes a value of type `error_code`,
-`i` denotes a value meeting [link boost_asio.reference.IoControlCommand
+a value of type `X::native_handle_type`, `ec` denotes a value of type
+`error_code`, `i` denotes a value meeting [link boost_asio.reference.IoControlCommand
 `IoControlCommand`] requirements, and `u` and `v` denote identifiers.
 
 [table DescriptorService requirements
   [[expression] [return type] [assertion/note\npre/post-condition]]
   [
- [`X::native_type`]
+ [`X::native_handle_type`]
     []
     [
       The implementation-defined native representation of a descriptor. Must
@@ -88,9 +88,9 @@
   ]
   [
     [``
- a.native(b);
+ a.native_handle(b);
     ``]
- [`X::native_type`]
+ [`X::native_handle_type`]
     [
     ]
   ]

Modified: trunk/libs/asio/doc/requirements/HandleService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/HandleService.qbk (original)
+++ trunk/libs/asio/doc/requirements/HandleService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -13,13 +13,13 @@
 
 In the table below, `X` denotes a handle service class, `a` denotes a value of
 type `X`, `b` denotes a value of type `X::implementation_type`, `n` denotes a
-value of type `X::native_type`, `ec` denotes a value of type `error_code`, and
-`u` and `v` denote identifiers.
+value of type `X::native_handle_type`, `ec` denotes a value of type
+`error_code`, and `u` and `v` denote identifiers.
 
 [table HandleService requirements
   [[expression] [return type] [assertion/note\npre/post-condition]]
   [
- [`X::native_type`]
+ [`X::native_handle_type`]
     []
     [
       The implementation-defined native representation of a handle. Must
@@ -87,9 +87,9 @@
   ]
   [
     [``
- a.native(b);
+ a.native_handle(b);
     ``]
- [`X::native_type`]
+ [`X::native_handle_type`]
     [
     ]
   ]

Modified: trunk/libs/asio/doc/requirements/RawSocketService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/RawSocketService.qbk (original)
+++ trunk/libs/asio/doc/requirements/RawSocketService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -48,7 +48,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from a connected socket `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -95,7 +95,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from an unconnected socket `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -145,7 +145,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       a connected socket `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -198,7 +198,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       an unconnected socket `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/ResolverService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/ResolverService.qbk (original)
+++ trunk/libs/asio/doc/requirements/ResolverService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -62,7 +62,7 @@
     []
     [
       Initiates an asynchronous resolve operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -93,7 +93,7 @@
     []
     [
       Initiates an asynchronous resolve operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Added: trunk/libs/asio/doc/requirements/SeqPacketSocketService.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/asio/doc/requirements/SeqPacketSocketService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,127 @@
+[/
+ / 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)
+ /]
+
+[section:SeqPacketSocketService Sequenced packet socket service requirements]
+
+A sequenced packet socket service must meet the requirements for a [link
+boost_asio.reference.SocketService socket service], as well as the additional
+requirements listed below.
+
+In the table below, `X` denotes a stream socket service class, `a` denotes a
+value of type `X`, `b` denotes a value of type `X::implementation_type`, `ec`
+denotes a value of type `error_code`, `f` denotes a value of type
+`socket_base::message_flags`, `g` denotes an lvalue of type
+`socket_base::message_flags`, `mb` denotes a value satisfying [link
+boost_asio.reference.MutableBufferSequence mutable buffer sequence] requirements,
+`rh` denotes a value meeting [link boost_asio.reference.ReadHandler `ReadHandler`]
+requirements, `cb` denotes a value satisfying [link
+boost_asio.reference.ConstBufferSequence constant buffer sequence] requirements, and
+`wh` denotes a value meeting [link boost_asio.reference.WriteHandler `WriteHandler`]
+requirements.
+
+[table StreamSocketService requirements
+ [[expression] [return type] [assertion/note\npre/post-condition]]
+ [
+ [`a.receive(b, mb, f, g, ec);`]
+ [`size_t`]
+ [
+ pre: `a.is_open(b)`.\n
+ \n
+ Reads one or more bytes of data from a connected socket `b`.\n
+ \n
+ The mutable buffer sequence `mb` specifies memory where the data should
+ be placed. The operation shall always fill a buffer in the sequence
+ completely before proceeding to the next.\n
+ \n
+ If successful, sets `g` to the flags associated with the received data,
+ and returns the number of bytes read. Otherwise, sets `g` to `0` and
+ returns `0`.
+ ]
+ ]
+ [
+ [`a.async_receive(b, mb, f, g, rh);`]
+ [`void`]
+ [
+ pre: `a.is_open(b)`.\n
+ \n
+ Initiates an asynchronous operation to read one or more bytes of data
+ from a connected socket `b`. The operation is performed via the
+ `io_service` object `a.get_io_service()` and behaves according to [link
+ boost_asio.reference.asynchronous_operations asynchronous operation]
+ requirements.\n
+ \n
+ The mutable buffer sequence `mb` specifies memory where the data should
+ be placed. The operation shall always fill a buffer in the sequence
+ completely before proceeding to the next.\n
+ \n
+ The implementation shall maintain one or more copies of `mb` until such
+ time as the read operation no longer requires access to the memory
+ specified by the buffers in the sequence. The program must ensure the
+ memory is valid until:\n
+ \n
+ [mdash] the last copy of `mb` is destroyed, or\n
+ \n
+ [mdash] the handler for the asynchronous operation is invoked,\n
+ \n
+ whichever comes first.\n
+ \n
+ If the operation completes successfully, sets `g` to the flags associated
+ with the received data, then invokes the `ReadHandler` object `rh` with
+ the number of bytes transferred. Otherwise, sets `g` to `0` and invokes
+ `rh` with `0` bytes transferred.
+ ]
+ ]
+ [
+ [`a.send(b, cb, f, ec);`]
+ [`size_t`]
+ [
+ pre: `a.is_open(b)`.\n
+ \n
+ Writes one or more bytes of data to a connected socket `b`.\n
+ \n
+ The constant buffer sequence `cb` specifies memory where the data to be
+ written is located. The operation shall always write a buffer in the
+ sequence completely before proceeding to the next.\n
+ \n
+ If successful, returns the number of bytes written. Otherwise returns `0`.
+ ]
+ ]
+ [
+ [`a.async_send(b, cb, f, wh);`]
+ [`void`]
+ [
+ pre: `a.is_open(b)`.\n
+ \n
+ Initiates an asynchronous operation to write one or more bytes of data to
+ a connected socket `b`. The operation is performed via the `io_service`
+ object `a.get_io_service()` and behaves according to [link
+ boost_asio.reference.asynchronous_operations asynchronous operation]
+ requirements.\n
+ \n
+ The constant buffer sequence `cb` specifies memory where the data to be
+ written is located. The operation shall always write a buffer in the
+ sequence completely before proceeding to the next.\n
+ \n
+ The implementation shall maintain one or more copies of `cb` until such
+ time as the write operation no longer requires access to the memory
+ specified by the buffers in the sequence. The program must ensure the
+ memory is valid until:\n
+ \n
+ [mdash] the last copy of `cb` is destroyed, or\n
+ \n
+ [mdash] the handler for the asynchronous operation is invoked,\n
+ \n
+ whichever comes first.\n
+ \n
+ If the operation completes successfully, the `WriteHandler` object `wh`
+ is invoked with the number of bytes transferred. Otherwise it is invoked
+ with `0`.
+ ]
+ ]
+]
+
+[endsect]

Modified: trunk/libs/asio/doc/requirements/SerialPortService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/SerialPortService.qbk (original)
+++ trunk/libs/asio/doc/requirements/SerialPortService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -14,8 +14,8 @@
 In the table below, `X` denotes a serial port service class, `a` denotes a
 value of type `X`, `d` denotes a serial port device name of type `std::string`,
 `b` denotes a value of type `X::implementation_type`, `n` denotes a value of
-type `X::native_type`, `ec` denotes a value of type `error_code`, `s` denotes a
-value meeting [link boost_asio.reference.SettableSerialPortOption
+type `X::native_handle_type`, `ec` denotes a value of type `error_code`, `s`
+denotes a value meeting [link boost_asio.reference.SettableSerialPortOption
 `SettableSerialPortOption`] requirements, `g` denotes a value meeting [link
 boost_asio.reference.GettableSerialPortOption `GettableSerialPortOption`]
 requirements, `mb` denotes a value satisfying [link
@@ -29,7 +29,7 @@
 [table SerialPortService requirements
   [[expression] [return type] [assertion/note\npre/post-condition]]
   [
- [`X::native_type`]
+ [`X::native_handle_type`]
     []
     [
       The implementation-defined native representation of a serial port. Must
@@ -108,9 +108,9 @@
   ]
   [
     [``
- a.native(b);
+ a.native_handle(b);
     ``]
- [`X::native_type`]
+ [`X::native_handle_type`]
     [
     ]
   ]

Modified: trunk/libs/asio/doc/requirements/SocketAcceptorService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/SocketAcceptorService.qbk (original)
+++ trunk/libs/asio/doc/requirements/SocketAcceptorService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -14,12 +14,12 @@
 In the table below, `X` denotes a socket acceptor service class for protocol
 [link boost_asio.reference.Protocol `Protocol`], `a` denotes a value of type
 `X`, `b` denotes a value of type `X::implementation_type`, `p` denotes a value
-of type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
-value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
-`s` denotes a value meeting [link boost_asio.reference.SettableSocketOption
-`SettableSocketOption`] requirements, `g` denotes a value meeting [link
-boost_asio.reference.GettableSocketOption `GettableSocketOption`]
-requirements, `i` denotes a value meeting [link
+of type `Protocol`, `n` denotes a value of type `X::native_handle_type`, `e`
+denotes a value of type `Protocol::endpoint`, `ec` denotes a value of type
+`error_code`, `s` denotes a value meeting [link
+boost_asio.reference.SettableSocketOption `SettableSocketOption`] requirements, `g`
+denotes a value meeting [link boost_asio.reference.GettableSocketOption
+`GettableSocketOption`] requirements, `i` denotes a value meeting [link
 boost_asio.reference.IoControlCommand `IoControlCommand`] requirements, `k`
 denotes a value of type `basic_socket<Protocol, SocketService>` where
 `SocketService` is a type meeting [link boost_asio.reference.SocketService
@@ -30,7 +30,7 @@
 [table SocketAcceptorService requirements
   [[expression] [return type] [assertion/note\npre/post-condition]]
   [
- [`X::native_type`]
+ [`X::native_handle_type`]
     []
     [
       The implementation-defined native representation of a socket acceptor.
@@ -108,9 +108,9 @@
   ]
   [
     [``
- a.native(b);
+ a.native_handle(b);
     ``]
- [`X::native_type`]
+ [`X::native_handle_type`]
     [
     ]
   ]
@@ -222,7 +222,7 @@
     [
       pre: `a.is_open(b) && !k.is_open()`.\n
       Initiates an asynchronous accept operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n\n
       The program must ensure the objects `k` and `e` are valid until the
@@ -237,7 +237,7 @@
     [
       pre: `a.is_open(b) && !k.is_open()`.\n
       Initiates an asynchronous accept operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n\n
       The program must ensure the object `k` is valid until the handler for the

Modified: trunk/libs/asio/doc/requirements/SocketService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/SocketService.qbk (original)
+++ trunk/libs/asio/doc/requirements/SocketService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -14,12 +14,12 @@
 In the table below, `X` denotes a socket service class for protocol [link
 boost_asio.reference.Protocol `Protocol`], `a` denotes a value of type `X`,
 `b` denotes a value of type `X::implementation_type`, `p` denotes a value of
-type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
-value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
-`s` denotes a value meeting [link boost_asio.reference.SettableSocketOption
-`SettableSocketOption`] requirements, `g` denotes a value meeting [link
-boost_asio.reference.GettableSocketOption `GettableSocketOption`]
-requirements, `i` denotes a value meeting [link
+type `Protocol`, `n` denotes a value of type `X::native_handle_type`, `e`
+denotes a value of type `Protocol::endpoint`, `ec` denotes a value of type
+`error_code`, `s` denotes a value meeting [link
+boost_asio.reference.SettableSocketOption `SettableSocketOption`] requirements, `g`
+denotes a value meeting [link boost_asio.reference.GettableSocketOption
+`GettableSocketOption`] requirements, `i` denotes a value meeting [link
 boost_asio.reference.IoControlCommand `IoControlCommand`] requirements, `h`
 denotes a value of type `socket_base::shutdown_type`, `ch` denotes a value
 meeting [link boost_asio.reference.ConnectHandler `ConnectHandler`]
@@ -28,7 +28,7 @@
 [table SocketService requirements
   [[expression] [return type] [assertion/note\npre/post-condition]]
   [
- [`X::native_type`]
+ [`X::native_handle_type`]
     []
     [
       The implementation-defined native representation of a socket. Must
@@ -106,9 +106,9 @@
   ]
   [
     [``
- a.native(b);
+ a.native_handle(b);
     ``]
- [`X::native_type`]
+ [`X::native_handle_type`]
     [
     ]
   ]
@@ -280,7 +280,7 @@
     [
       pre: `a.is_open(b)`.\n
       Initiates an asynchronous connect operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.
     ]

Modified: trunk/libs/asio/doc/requirements/StreamDescriptorService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/StreamDescriptorService.qbk (original)
+++ trunk/libs/asio/doc/requirements/StreamDescriptorService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -51,7 +51,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from a descriptor `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -106,7 +106,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       a descriptor `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/StreamHandleService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/StreamHandleService.qbk (original)
+++ trunk/libs/asio/doc/requirements/StreamHandleService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -51,7 +51,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from a handle `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -106,7 +106,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       a handle `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/StreamSocketService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/StreamSocketService.qbk (original)
+++ trunk/libs/asio/doc/requirements/StreamSocketService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -52,7 +52,7 @@
       \n
       Initiates an asynchronous operation to read one or more bytes of data
       from a connected socket `b`. The operation is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n
@@ -107,7 +107,7 @@
       \n
       Initiates an asynchronous operation to write one or more bytes of data to
       a connected socket `b`. The operation is performed via the `io_service`
- object `a.io_service()` and behaves according to [link
+ object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/TimerService.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/TimerService.qbk (original)
+++ trunk/libs/asio/doc/requirements/TimerService.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -91,7 +91,7 @@
     []
     [
       Initiates an asynchronous wait operation that is performed via the
- `io_service` object `a.io_service()` and behaves according to [link
+ `io_service` object `a.get_io_service()` and behaves according to [link
       boost_asio.reference.asynchronous_operations asynchronous operation]
       requirements.\n
       \n

Modified: trunk/libs/asio/doc/requirements/asynchronous_operations.qbk
==============================================================================
--- trunk/libs/asio/doc/requirements/asynchronous_operations.qbk (original)
+++ trunk/libs/asio/doc/requirements/asynchronous_operations.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -38,9 +38,9 @@
 
 All asynchronous operations have an associated `io_service` object. Where the
 initiating function is a member function, the associated `io_service` is that
-returned by the `io_service()` member function on the same object. Where the
+returned by the `get_io_service()` member function on the same object. Where the
 initiating function is not a member function, the associated `io_service` is
-that returned by the `io_service()` member function of the first argument to
+that returned by the `get_io_service()` member function of the first argument to
 the initiating function.
 
 Arguments to initiating functions will be treated as follows:
@@ -71,11 +71,11 @@
 
 [mdash] The thread is executing any member function, constructor or destructor
 of an object of a class defined in this clause, where the object's
-`io_service()` member function returns the associated `io_service` object.
+`get_io_service()` member function returns the associated `io_service` object.
 
 [mdash] The thread is executing any function defined in this clause, where any
-argument to the function has an `io_service()` member function that returns the
-associated `io_service` object.
+argument to the function has an `get_io_service()` member function that returns
+the associated `io_service` object.
 
 [blurb Boost.Asio may use one or more hidden threads to emulate asynchronous
 functionality. The above requirements are intended to prevent these hidden

Modified: trunk/libs/asio/doc/tutorial.qbk
==============================================================================
--- trunk/libs/asio/doc/tutorial.qbk (original)
+++ trunk/libs/asio/doc/tutorial.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -888,27 +888,19 @@
 
 
 
-The list of endpoints is returned using an iterator of type [link boost_asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator]. A default constructed [link boost_asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator] object is used as the end iterator.
+The list of endpoints is returned using an iterator of type [link boost_asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator]. (Note that a default constructed [link boost_asio.reference.ip__basic_resolver.iterator ip::tcp::resolver::iterator] object can be used as an end iterator.)
 
 
   ``''''''`` tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
- ``''''''`` tcp::resolver::iterator end;
 
 
 
-Now we create and connect the socket. The list of endpoints obtained above may contain both IPv4 and IPv6 endpoints, so we need to try each of them until we find one that works. This keeps the client program independent of a specific IP version.
+Now we create and connect the socket. The list of endpoints obtained above may contain both IPv4 and IPv6 endpoints, so we need to try each of them until we find one that works. This keeps the client program independent of a specific IP version. The boost::asio::connect() function does this for us automatically.
 
 
 
   ``''''''`` tcp::socket socket(io_service);
- ``''''''`` boost::system::error_code error = boost::asio::error::host_not_found;
- ``''''''`` while (error && endpoint_iterator != end)
- ``''''''`` {
- ``''''''`` socket.close();
- ``''''''`` socket.connect(*endpoint_iterator++, error);
- ``''''''`` }
- ``''''''`` if (error)
- ``''''''`` throw boost::system::system_error(error);
+ ``''''''`` boost::asio::connect(socket, endpoint_iterator);
 
 
 
@@ -994,17 +986,9 @@
   ``''''''`` tcp::resolver resolver(io_service);
   ``''''''`` tcp::resolver::query query(argv[1], "daytime");
   ``''''''`` tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
- ``''''''`` tcp::resolver::iterator end;
 
   ``''''''`` tcp::socket socket(io_service);
- ``''''''`` boost::system::error_code error = boost::asio::error::host_not_found;
- ``''''''`` while (error && endpoint_iterator != end)
- ``''''''`` {
- ``''''''`` socket.close();
- ``''''''`` socket.connect(*endpoint_iterator++, error);
- ``''''''`` }
- ``''''''`` if (error)
- ``''''''`` throw boost::system::system_error(error);
+ ``''''''`` boost::asio::connect(socket, endpoint_iterator);
 
   ``''''''`` for (;;)
   ``''''''`` {
@@ -1098,8 +1082,7 @@
   ``''''''`` std::string message = make_daytime_string();
 
   ``''''''`` boost::system::error_code ignored_error;
- ``''''''`` boost::asio::write(socket, boost::asio::buffer(message),
- ``''''''`` boost::asio::transfer_all(), ignored_error);
+ ``''''''`` boost::asio::write(socket, boost::asio::buffer(message), ignored_error);
   ``''''''`` }
   ``''''''`` }
 
@@ -1171,8 +1154,7 @@
   ``''''''`` std::string message = make_daytime_string();
 
   ``''''''`` boost::system::error_code ignored_error;
- ``''''''`` boost::asio::write(socket, boost::asio::buffer(message),
- ``''''''`` boost::asio::transfer_all(), ignored_error);
+ ``''''''`` boost::asio::write(socket, boost::asio::buffer(message), ignored_error);
   ``''''''`` }
   ``''''''`` }
   ``''''''`` catch (std::exception& e)
@@ -1254,7 +1236,7 @@
   ``''''''`` void start_accept()
   ``''''''`` {
   ``''''''`` tcp_connection::pointer new_connection =
- ``''''''`` tcp_connection::create(acceptor_.io_service());
+ ``''''''`` tcp_connection::create(acceptor_.get_io_service());
 
   ``''''''`` acceptor_.async_accept(new_connection->socket(),
   ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection,
@@ -1464,7 +1446,7 @@
   ``''''''`` void start_accept()
   ``''''''`` {
   ``''''''`` tcp_connection::pointer new_connection =
- ``''''''`` tcp_connection::create(acceptor_.io_service());
+ ``''''''`` tcp_connection::create(acceptor_.get_io_service());
 
   ``''''''`` acceptor_.async_accept(new_connection->socket(),
   ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection,
@@ -1560,7 +1542,7 @@
   ``''''''`` udp::socket socket(io_service);
   ``''''''`` socket.open(udp::v4());
 
- ``''''''`` boost::array<char, 1> send_buf = { 0 };
+ ``''''''`` boost::array<char, 1> send_buf = {{ 0 }};
   ``''''''`` socket.send_to(boost::asio::buffer(send_buf), receiver_endpoint);
 
 
@@ -1638,7 +1620,7 @@
   ``''''''`` udp::socket socket(io_service);
   ``''''''`` socket.open(udp::v4());
 
- ``''''''`` boost::array<char, 1> send_buf = { 0 };
+ ``''''''`` boost::array<char, 1> send_buf = {{ 0 }};
   ``''''''`` socket.send_to(boost::asio::buffer(send_buf), receiver_endpoint);
 
   ``''''''`` boost::array<char, 128> recv_buf;
@@ -2161,7 +2143,7 @@
   ``''''''`` void start_accept()
   ``''''''`` {
   ``''''''`` tcp_connection::pointer new_connection =
- ``''''''`` tcp_connection::create(acceptor_.io_service());
+ ``''''''`` tcp_connection::create(acceptor_.get_io_service());
 
   ``''''''`` acceptor_.async_accept(new_connection->socket(),
   ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection,
@@ -2322,7 +2304,7 @@
   ``''''''`` void start_accept()
   ``''''''`` {
   ``''''''`` tcp_connection::pointer new_connection =
- ``''''''`` tcp_connection::create(acceptor_.io_service());
+ ``''''''`` tcp_connection::create(acceptor_.get_io_service());
 
   ``''''''`` acceptor_.async_accept(new_connection->socket(),
   ``''''''`` boost::bind(&tcp_server::handle_accept, this, new_connection,

Modified: trunk/libs/asio/doc/using.qbk
==============================================================================
--- trunk/libs/asio/doc/using.qbk (original)
+++ trunk/libs/asio/doc/using.qbk 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -139,6 +139,9 @@
 in the project\/compiler settings. Alternatively, `BOOST_ASIO_DYN_LINK` may be
 defined to build a separately-compiled Boost.Asio as part of a shared library.
 
+If using Boost.Asio's SSL support, you will also need to add `#include
+<boost/asio/ssl/impl/src.hpp>`.
+
 [heading Macros]
 
 The macros listed in the table below may be used to control the behaviour of

Modified: trunk/libs/asio/example/chat/chat_client.cpp
==============================================================================
--- trunk/libs/asio/example/chat/chat_client.cpp (original)
+++ trunk/libs/asio/example/chat/chat_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -28,10 +28,9 @@
     : io_service_(io_service),
       socket_(io_service)
   {
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
+ boost::asio::async_connect(socket_, endpoint_iterator,
         boost::bind(&chat_client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
+ boost::asio::placeholders::error));
   }
 
   void write(const chat_message& msg)
@@ -46,8 +45,7 @@
 
 private:
 
- void handle_connect(const boost::system::error_code& error,
- tcp::resolver::iterator endpoint_iterator)
+ void handle_connect(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -56,14 +54,6 @@
           boost::bind(&chat_client::handle_read_header, this,
             boost::asio::placeholders::error));
     }
- else if (endpoint_iterator != tcp::resolver::iterator())
- {
- socket_.close();
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
- boost::bind(&chat_client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
- }
   }
 
   void handle_read_header(const boost::system::error_code& error)

Modified: trunk/libs/asio/example/chat/chat_message.hpp
==============================================================================
--- trunk/libs/asio/example/chat/chat_message.hpp (original)
+++ trunk/libs/asio/example/chat/chat_message.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -56,9 +56,9 @@
     return body_length_;
   }
 
- void body_length(size_t length)
+ void body_length(size_t new_length)
   {
- body_length_ = length;
+ body_length_ = new_length;
     if (body_length_ > max_body_length)
       body_length_ = max_body_length;
   }

Modified: trunk/libs/asio/example/chat/posix_chat_client.cpp
==============================================================================
--- trunk/libs/asio/example/chat/posix_chat_client.cpp (original)
+++ trunk/libs/asio/example/chat/posix_chat_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -31,17 +31,14 @@
       output_(io_service, ::dup(STDOUT_FILENO)),
       input_buffer_(chat_message::max_body_length)
   {
- // Try connecting to the first endpoint.
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
+ boost::asio::async_connect(socket_, endpoint_iterator,
         boost::bind(&posix_chat_client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
+ boost::asio::placeholders::error));
   }
 
 private:
 
- void handle_connect(const boost::system::error_code& error,
- tcp::resolver::iterator endpoint_iterator)
+ void handle_connect(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -57,15 +54,6 @@
             boost::asio::placeholders::error,
             boost::asio::placeholders::bytes_transferred));
     }
- else if (endpoint_iterator != tcp::resolver::iterator())
- {
- // That endpoint didn't work, try the next one.
- socket_.close();
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
- boost::bind(&posix_chat_client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
- }
   }
 
   void handle_read_header(const boost::system::error_code& error)

Modified: trunk/libs/asio/example/echo/blocking_tcp_echo_client.cpp
==============================================================================
--- trunk/libs/asio/example/echo/blocking_tcp_echo_client.cpp (original)
+++ trunk/libs/asio/example/echo/blocking_tcp_echo_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -34,7 +34,7 @@
     tcp::resolver::iterator iterator = resolver.resolve(query);
 
     tcp::socket s(io_service);
- s.connect(*iterator);
+ boost::asio::connect(s, iterator);
 
     using namespace std; // For strlen.
     std::cout << "Enter message: ";

Modified: trunk/libs/asio/example/http/client/async_client.cpp
==============================================================================
--- trunk/libs/asio/example/http/client/async_client.cpp (original)
+++ trunk/libs/asio/example/http/client/async_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -49,12 +49,11 @@
   {
     if (!err)
     {
- // Attempt a connection to the first endpoint in the list. Each endpoint
- // will be tried until we successfully establish a connection.
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
+ // Attempt a connection to each endpoint in the list until we
+ // successfully establish a connection.
+ boost::asio::async_connect(socket_, endpoint_iterator,
           boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
+ boost::asio::placeholders::error));
     }
     else
     {
@@ -62,8 +61,7 @@
     }
   }
 
- void handle_connect(const boost::system::error_code& err,
- tcp::resolver::iterator endpoint_iterator)
+ void handle_connect(const boost::system::error_code& err)
   {
     if (!err)
     {
@@ -72,15 +70,6 @@
           boost::bind(&client::handle_write_request, this,
             boost::asio::placeholders::error));
     }
- else if (endpoint_iterator != tcp::resolver::iterator())
- {
- // The connection failed. Try the next endpoint in the list.
- socket_.close();
- tcp::endpoint endpoint = *endpoint_iterator;
- socket_.async_connect(endpoint,
- boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
- }
     else
     {
       std::cout << "Error: " << err.message() << "\n";

Modified: trunk/libs/asio/example/http/client/sync_client.cpp
==============================================================================
--- trunk/libs/asio/example/http/client/sync_client.cpp (original)
+++ trunk/libs/asio/example/http/client/sync_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -34,18 +34,10 @@
     tcp::resolver resolver(io_service);
     tcp::resolver::query query(argv[1], "http");
     tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
- tcp::resolver::iterator end;
 
     // Try each endpoint until we successfully establish a connection.
     tcp::socket socket(io_service);
- boost::system::error_code error = boost::asio::error::host_not_found;
- while (error && endpoint_iterator != end)
- {
- socket.close();
- socket.connect(*endpoint_iterator++, error);
- }
- if (error)
- throw boost::system::system_error(error);
+ boost::asio::connect(socket, endpoint_iterator);
 
     // Form the request. We specify the "Connection: close" header so that the
     // server will close the socket after transmitting the response. This will
@@ -99,6 +91,7 @@
       std::cout << &response;
 
     // Read until EOF, writing data to output as we go.
+ boost::system::error_code error;
     while (boost::asio::read(socket, response,
           boost::asio::transfer_at_least(1), error))
       std::cout << &response;

Modified: trunk/libs/asio/example/http/server2/server.cpp
==============================================================================
--- trunk/libs/asio/example/http/server2/server.cpp (original)
+++ trunk/libs/asio/example/http/server2/server.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,7 +23,7 @@
     request_handler_(doc_root)
 {
   // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
- boost::asio::ip::tcp::resolver resolver(acceptor_.io_service());
+ boost::asio::ip::tcp::resolver resolver(acceptor_.get_io_service());
   boost::asio::ip::tcp::resolver::query query(address, port);
   boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
   acceptor_.open(endpoint.protocol());

Modified: trunk/libs/asio/example/iostreams/Jamfile
==============================================================================
--- trunk/libs/asio/example/iostreams/Jamfile (original)
+++ trunk/libs/asio/example/iostreams/Jamfile 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -43,3 +43,15 @@
     <mingw><*><find-library>mswsock
     $(SOCKET_LIBS)
   ;
+
+exe http_client
+ : <lib>@boost/libs/system/build/boost_system
+ http_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)
+ ;

Modified: trunk/libs/asio/example/iostreams/Jamfile.v2
==============================================================================
--- trunk/libs/asio/example/iostreams/Jamfile.v2 (original)
+++ trunk/libs/asio/example/iostreams/Jamfile.v2 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -39,3 +39,4 @@
 
 exe daytime_client : daytime_client.cpp ;
 exe daytime_server : daytime_server.cpp ;
+exe http_client : http_client.cpp ;

Modified: trunk/libs/asio/example/iostreams/daytime_client.cpp
==============================================================================
--- trunk/libs/asio/example/iostreams/daytime_client.cpp (original)
+++ trunk/libs/asio/example/iostreams/daytime_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -25,6 +25,12 @@
     }
 
     tcp::iostream s(argv[1], "daytime");
+ if (!s)
+ {
+ std::cout << "Unable to connect: " << s.error().message() << std::endl;
+ return 1;
+ }
+
     std::string line;
     std::getline(s, line);
     std::cout << line << std::endl;

Added: trunk/libs/asio/example/iostreams/http_client.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/example/iostreams/http_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,91 @@
+//
+// sync_client.cpp
+// ~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+#include <iostream>
+#include <istream>
+#include <ostream>
+#include <string>
+#include <boost/asio/ip/tcp.hpp>
+
+using boost::asio::ip::tcp;
+
+int main(int argc, char* argv[])
+{
+ try
+ {
+ if (argc != 3)
+ {
+ std::cout << "Usage: http_client <server> <path>\n";
+ std::cout << "Example:\n";
+ std::cout << " http_client www.boost.org /LICENSE_1_0.txt\n";
+ return 1;
+ }
+
+ boost::asio::ip::tcp::iostream s;
+
+ // The entire sequence of I/O operations must complete within 60 seconds.
+ // If an expiry occurs, the socket is automatically closed and the stream
+ // becomes bad.
+ s.expires_from_now(boost::posix_time::seconds(60));
+
+ // Establish a connection to the server.
+ s.connect(argv[1], "http");
+ if (!s)
+ {
+ std::cout << "Unable to connect: " << s.error().message() << "\n";
+ return 1;
+ }
+
+ // Send the request. We specify the "Connection: close" header so that the
+ // server will close the socket after transmitting the response. This will
+ // allow us to treat all data up until the EOF as the content.
+ s << "GET " << argv[2] << " HTTP/1.0\r\n";
+ s << "Host: " << argv[1] << "\r\n";
+ s << "Accept: */*\r\n";
+ s << "Connection: close\r\n\r\n";
+
+ // By default, the stream is tied with itself. This means that the stream
+ // automatically flush the buffered output before attempting a read. It is
+ // not necessary not explicitly flush the stream at this point.
+
+ // Check that response is OK.
+ std::string http_version;
+ s >> http_version;
+ unsigned int status_code;
+ s >> status_code;
+ std::string status_message;
+ std::getline(s, status_message);
+ if (!s || http_version.substr(0, 5) != "HTTP/")
+ {
+ std::cout << "Invalid response\n";
+ return 1;
+ }
+ if (status_code != 200)
+ {
+ std::cout << "Response returned with status code " << status_code << "\n";
+ return 1;
+ }
+
+ // Process the response headers, which are terminated by a blank line.
+ std::string header;
+ while (std::getline(s, header) && header != "\r")
+ std::cout << header << "\n";
+ std::cout << "\n";
+
+ // Write the remaining data to output.
+ std::cout << s.rdbuf();
+ }
+ catch (std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << "\n";
+ }
+
+ return 0;
+}

Modified: trunk/libs/asio/example/local/iostream_client.cpp
==============================================================================
--- trunk/libs/asio/example/local/iostream_client.cpp (original)
+++ trunk/libs/asio/example/local/iostream_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -32,7 +32,7 @@
     stream_protocol::iostream s(ep);
     if (!s)
     {
- std::cerr << "Unable to connect\n";
+ std::cerr << "Unable to connect: " << s.error().message() << std::endl;
       return 1;
     }
 

Modified: trunk/libs/asio/example/nonblocking/third_party_lib.cpp
==============================================================================
--- trunk/libs/asio/example/nonblocking/third_party_lib.cpp (original)
+++ trunk/libs/asio/example/nonblocking/third_party_lib.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -96,8 +96,7 @@
   void start()
   {
     // Put the socket into non-blocking mode.
- tcp::socket::non_blocking_io non_blocking_io(true);
- socket_.io_control(non_blocking_io);
+ socket_.non_blocking(true);
 
     start_operations();
   }
@@ -196,7 +195,7 @@
   void start_accept()
   {
     connection::pointer new_connection =
- connection::create(acceptor_.io_service());
+ connection::create(acceptor_.get_io_service());
 
     acceptor_.async_accept(new_connection->socket(),
         boost::bind(&server::handle_accept, this, new_connection,

Modified: trunk/libs/asio/example/porthopper/protocol.hpp
==============================================================================
--- trunk/libs/asio/example/porthopper/protocol.hpp (original)
+++ trunk/libs/asio/example/porthopper/protocol.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -78,11 +78,12 @@
 
 private:
   // Construct with specified old and new ports.
- control_request(unsigned short old_port, unsigned short new_port)
+ control_request(unsigned short old_port_number,
+ unsigned short new_port_number)
   {
     std::ostrstream os(data_, control_request_size);
- os << std::setw(encoded_port_size) << std::hex << old_port;
- os << std::setw(encoded_port_size) << std::hex << new_port;
+ os << std::setw(encoded_port_size) << std::hex << old_port_number;
+ os << std::setw(encoded_port_size) << std::hex << new_port_number;
   }
 
   // The length in bytes of a control_request and its components.
@@ -109,21 +110,21 @@
   }
 
   // Construct a frame with specified frame number and payload.
- frame(unsigned long number, const std::string& payload)
+ frame(unsigned long frame_number, const std::string& payload_data)
   {
     std::ostrstream os(data_, frame_size);
- os << std::setw(encoded_number_size) << std::hex << number;
+ os << std::setw(encoded_number_size) << std::hex << frame_number;
     os << std::setw(payload_size)
- << std::setfill(' ') << payload.substr(0, payload_size);
+ << std::setfill(' ') << payload_data.substr(0, payload_size);
   }
 
   // Get the frame number.
   unsigned long number() const
   {
     std::istrstream is(data_, encoded_number_size);
- unsigned long number = 0;
- is >> std::setw(encoded_number_size) >> std::hex >> number;
- return number;
+ unsigned long frame_number = 0;
+ is >> std::setw(encoded_number_size) >> std::hex >> frame_number;
+ return frame_number;
   }
 
   // Get the payload data.

Modified: trunk/libs/asio/example/serialization/client.cpp
==============================================================================
--- trunk/libs/asio/example/serialization/client.cpp (original)
+++ trunk/libs/asio/example/serialization/client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -32,17 +32,15 @@
     boost::asio::ip::tcp::resolver::query query(host, service);
     boost::asio::ip::tcp::resolver::iterator endpoint_iterator =
       resolver.resolve(query);
- boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
 
     // Start an asynchronous connect operation.
- connection_.socket().async_connect(endpoint,
+ boost::asio::async_connect(connection_.socket(), endpoint_iterator,
         boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
+ boost::asio::placeholders::error));
   }
 
   /// Handle completion of a connect operation.
- void handle_connect(const boost::system::error_code& e,
- boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+ void handle_connect(const boost::system::error_code& e)
   {
     if (!e)
     {
@@ -53,15 +51,6 @@
           boost::bind(&client::handle_read, this,
             boost::asio::placeholders::error));
     }
- else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
- {
- // Try the next endpoint.
- connection_.socket().close();
- boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
- connection_.socket().async_connect(endpoint,
- boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
- }
     else
     {
       // An error occurred. Log it and return. Since we are not starting a new

Modified: trunk/libs/asio/example/serialization/connection.hpp
==============================================================================
--- trunk/libs/asio/example/serialization/connection.hpp (original)
+++ trunk/libs/asio/example/serialization/connection.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -65,7 +65,7 @@
     {
       // Something went wrong, inform the caller.
       boost::system::error_code error(boost::asio::error::invalid_argument);
- socket_.io_service().post(boost::bind(handler, error));
+ socket_.get_io_service().post(boost::bind(handler, error));
       return;
     }
     outbound_header_ = header_stream.str();

Modified: trunk/libs/asio/example/serialization/server.cpp
==============================================================================
--- trunk/libs/asio/example/serialization/server.cpp (original)
+++ trunk/libs/asio/example/serialization/server.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -55,7 +55,7 @@
     stocks_.push_back(s);
 
     // Start an accept operation for a new connection.
- connection_ptr new_conn(new connection(acceptor_.io_service()));
+ connection_ptr new_conn(new connection(acceptor_.get_io_service()));
     acceptor_.async_accept(new_conn->socket(),
         boost::bind(&server::handle_accept, this,
           boost::asio::placeholders::error, new_conn));
@@ -74,7 +74,7 @@
             boost::asio::placeholders::error, conn));
 
       // Start an accept operation for a new connection.
- connection_ptr new_conn(new connection(acceptor_.io_service()));
+ connection_ptr new_conn(new connection(acceptor_.get_io_service()));
       acceptor_.async_accept(new_conn->socket(),
           boost::bind(&server::handle_accept, this,
             boost::asio::placeholders::error, new_conn));

Modified: trunk/libs/asio/example/services/daytime_client.cpp
==============================================================================
--- trunk/libs/asio/example/services/daytime_client.cpp (original)
+++ trunk/libs/asio/example/services/daytime_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -32,8 +32,7 @@
   }
 }
 
-void connect_handler(const boost::system::error_code& e, debug_stream_socket* s,
- boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+void connect_handler(const boost::system::error_code& e, debug_stream_socket* s)
 {
   if (!e)
   {
@@ -41,14 +40,6 @@
         boost::bind(read_handler, boost::asio::placeholders::error,
           boost::asio::placeholders::bytes_transferred, s));
   }
- else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
- {
- s->close();
- boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
- s->async_connect(endpoint,
- boost::bind(connect_handler,
- boost::asio::placeholders::error, s, ++endpoint_iterator));
- }
   else
   {
     std::cerr << e.message() << std::endl;
@@ -75,13 +66,12 @@
     boost::asio::ip::tcp::resolver resolver(io_service);
     boost::asio::ip::tcp::resolver::query query(argv[1], "daytime");
     boost::asio::ip::tcp::resolver::iterator iterator = resolver.resolve(query);
- boost::asio::ip::tcp::endpoint endpoint = *iterator;
 
     // Start an asynchronous connect.
     debug_stream_socket socket(io_service);
- socket.async_connect(endpoint,
+ boost::asio::async_connect(socket, iterator,
         boost::bind(connect_handler,
- boost::asio::placeholders::error, &socket, ++iterator));
+ boost::asio::placeholders::error, &socket));
 
     // Run the io_service until all operations have finished.
     io_service.run();

Modified: trunk/libs/asio/example/services/logger_service.hpp
==============================================================================
--- trunk/libs/asio/example/services/logger_service.hpp (original)
+++ trunk/libs/asio/example/services/logger_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -34,7 +34,7 @@
   /// The backend implementation of a logger.
   struct logger_impl
   {
- explicit logger_impl(const std::string& id) : identifier(id) {}
+ explicit logger_impl(const std::string& ident) : identifier(ident) {}
     std::string identifier;
   };
 

Modified: trunk/libs/asio/example/services/stream_socket_service.hpp
==============================================================================
--- trunk/libs/asio/example/services/stream_socket_service.hpp (original)
+++ trunk/libs/asio/example/services/stream_socket_service.hpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,7 +41,7 @@
   typedef typename service_impl_type::implementation_type implementation_type;
 
   /// The native type of a stream socket.
- typedef typename service_impl_type::native_type native_type;
+ typedef typename service_impl_type::native_handle_type native_handle_type;
 
   /// Construct a new stream socket service for the specified io_service.
   explicit stream_socket_service(boost::asio::io_service& io_service)
@@ -78,7 +78,7 @@
 
   /// Open a stream socket from an existing native socket.
   boost::system::error_code assign(implementation_type& impl,
- const protocol_type& protocol, const native_type& native_socket,
+ const protocol_type& protocol, const native_handle_type& native_socket,
       boost::system::error_code& ec)
   {
     logger_.log("Assigning from a native socket");

Modified: trunk/libs/asio/example/socks4/sync_client.cpp
==============================================================================
--- trunk/libs/asio/example/socks4/sync_client.cpp (original)
+++ trunk/libs/asio/example/socks4/sync_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -37,19 +37,11 @@
     tcp::resolver resolver(io_service);
     tcp::resolver::query socks_query(argv[1], argv[2]);
     tcp::resolver::iterator endpoint_iterator = resolver.resolve(socks_query);
- tcp::resolver::iterator end;
 
     // Try each endpoint until we successfully establish a connection to the
     // SOCKS 4 server.
     tcp::socket socket(io_service);
- boost::system::error_code error = boost::asio::error::host_not_found;
- while (error && endpoint_iterator != end)
- {
- socket.close();
- socket.connect(*endpoint_iterator++, error);
- }
- if (error)
- throw boost::system::system_error(error);
+ boost::asio::connect(socket, endpoint_iterator);
 
     // Get an endpoint for the Boost website. This will be passed to the SOCKS
     // 4 server. Explicitly specify IPv4 since SOCKS 4 does not support IPv6.
@@ -87,6 +79,7 @@
 
     // Read until EOF, writing data to output as we go.
     boost::array<char, 512> response;
+ boost::system::error_code error;
     while (std::size_t s = socket.read_some(
           boost::asio::buffer(response), error))
       std::cout.write(response.data(), s);

Modified: trunk/libs/asio/example/ssl/client.cpp
==============================================================================
--- trunk/libs/asio/example/ssl/client.cpp (original)
+++ trunk/libs/asio/example/ssl/client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -23,14 +23,12 @@
       boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
     : socket_(io_service, context)
   {
- boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
- socket_.lowest_layer().async_connect(endpoint,
+ boost::asio::async_connect(socket_.lowest_layer(), endpoint_iterator,
         boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
+ boost::asio::placeholders::error));
   }
 
- void handle_connect(const boost::system::error_code& error,
- boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+ void handle_connect(const boost::system::error_code& error)
   {
     if (!error)
     {
@@ -38,14 +36,6 @@
           boost::bind(&client::handle_handshake, this,
             boost::asio::placeholders::error));
     }
- else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator())
- {
- socket_.lowest_layer().close();
- boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
- socket_.lowest_layer().async_connect(endpoint,
- boost::bind(&client::handle_connect, this,
- boost::asio::placeholders::error, ++endpoint_iterator));
- }
     else
     {
       std::cout << "Connect failed: " << error << "\n";

Modified: trunk/libs/asio/example/timeouts/blocking_tcp_client.cpp
==============================================================================
--- trunk/libs/asio/example/timeouts/blocking_tcp_client.cpp (original)
+++ trunk/libs/asio/example/timeouts/blocking_tcp_client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -8,6 +8,7 @@
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //
 
+#include <boost/asio/connect.hpp>
 #include <boost/asio/deadline_timer.hpp>
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/ip/tcp.hpp>
@@ -72,47 +73,36 @@
     tcp::resolver::query query(host, service);
     tcp::resolver::iterator iter = tcp::resolver(io_service_).resolve(query);
 
- // Set a deadline for the asynchronous operation. The host name may resolve
- // to multiple endpoints, and this function tries to connect to each one in
- // turn. Setting the deadline here means it applies to the entire sequence.
+ // Set a deadline for the asynchronous operation. As a host name may
+ // resolve to multiple endpoints, this function uses the composed operation
+ // async_connect. The deadline applies to the entire operation, rather than
+ // individual connection attempts.
     deadline_.expires_from_now(timeout);
 
- boost::system::error_code ec;
+ // Set up the variable that receives the result of the asynchronous
+ // operation. The error code is set to would_block to signal that the
+ // operation is incomplete. Asio guarantees that its asynchronous
+ // operations will never fail with would_block, so any other value in
+ // ec indicates completion.
+ boost::system::error_code ec = boost::asio::error::would_block;
 
- for (; iter != tcp::resolver::iterator(); ++iter)
- {
- // We may have an open socket from a previous connection attempt. This
- // socket cannot be reused, so we must close it before trying to connect
- // again.
- socket_.close();
+ // Start the asynchronous operation itself. The boost::lambda function
+ // object is used as a callback and will update the ec variable when the
+ // operation completes. The blocking_udp_client.cpp example shows how you
+ // can use boost::bind rather than boost::lambda.
+ boost::asio::async_connect(socket_, iter, var(ec) = _1);
 
- // Set up the variable that receives the result of the asynchronous
- // operation. The error code is set to would_block to signal that the
- // operation is incomplete. Asio guarantees that its asynchronous
- // operations will never fail with would_block, so any other value in
- // ec indicates completion.
- ec = boost::asio::error::would_block;
-
- // Start the asynchronous operation itself. The boost::lambda function
- // object is used as a callback and will update the ec variable when the
- // operation completes. The blocking_udp_client.cpp example shows how you
- // can use boost::bind rather than boost::lambda.
- socket_.async_connect(iter->endpoint(), var(ec) = _1);
-
- // Block until the asynchronous operation has completed.
- do io_service_.run_one(); while (ec == boost::asio::error::would_block);
-
- // Determine whether a connection was successfully established. The
- // deadline actor may have had a chance to run and close our socket, even
- // though the connect operation notionally succeeded. Therefore we must
- // check whether the socket is still open before deciding that the we
- // were successful.
- if (!ec && socket_.is_open())
- return;
- }
+ // Block until the asynchronous operation has completed.
+ do io_service_.run_one(); while (ec == boost::asio::error::would_block);
 
- throw boost::system::system_error(
- ec ? ec : boost::asio::error::host_not_found);
+ // Determine whether a connection was successfully established. The
+ // deadline actor may have had a chance to run and close our socket, even
+ // though the connect operation notionally succeeded. Therefore we must
+ // check whether the socket is still open before deciding if we succeeded
+ // or failed.
+ if (ec || !socket_.is_open())
+ throw boost::system::system_error(
+ ec ? ec : boost::asio::error::operation_aborted);
   }
 
   std::string read_line(boost::posix_time::time_duration timeout)

Modified: trunk/libs/asio/example/tutorial/daytime1/client.cpp
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime1/client.cpp (original)
+++ trunk/libs/asio/example/tutorial/daytime1/client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -29,17 +29,9 @@
     tcp::resolver resolver(io_service);
     tcp::resolver::query query(argv[1], "daytime");
     tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
- tcp::resolver::iterator end;
 
     tcp::socket socket(io_service);
- boost::system::error_code error = boost::asio::error::host_not_found;
- while (error && endpoint_iterator != end)
- {
- socket.close();
- socket.connect(*endpoint_iterator++, error);
- }
- if (error)
- throw boost::system::system_error(error);
+ boost::asio::connect(socket, endpoint_iterator);
 
     for (;;)
     {

Modified: trunk/libs/asio/example/tutorial/daytime2/server.cpp
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime2/server.cpp (original)
+++ trunk/libs/asio/example/tutorial/daytime2/server.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -38,8 +38,7 @@
       std::string message = make_daytime_string();
 
       boost::system::error_code ignored_error;
- boost::asio::write(socket, boost::asio::buffer(message),
- boost::asio::transfer_all(), ignored_error);
+ boost::asio::write(socket, boost::asio::buffer(message), ignored_error);
     }
   }
   catch (std::exception& e)

Modified: trunk/libs/asio/example/tutorial/daytime3/server.cpp
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime3/server.cpp (original)
+++ trunk/libs/asio/example/tutorial/daytime3/server.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -79,7 +79,7 @@
   void start_accept()
   {
     tcp_connection::pointer new_connection =
- tcp_connection::create(acceptor_.io_service());
+ tcp_connection::create(acceptor_.get_io_service());
 
     acceptor_.async_accept(new_connection->socket(),
         boost::bind(&tcp_server::handle_accept, this, new_connection,

Modified: trunk/libs/asio/example/tutorial/daytime4/client.cpp
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime4/client.cpp (original)
+++ trunk/libs/asio/example/tutorial/daytime4/client.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -33,7 +33,7 @@
     udp::socket socket(io_service);
     socket.open(udp::v4());
 
- boost::array<char, 1> send_buf = { 0 };
+ boost::array<char, 1> send_buf = {{ 0 }};
     socket.send_to(boost::asio::buffer(send_buf), receiver_endpoint);
 
     boost::array<char, 128> recv_buf;

Modified: trunk/libs/asio/example/tutorial/daytime7/server.cpp
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime7/server.cpp (original)
+++ trunk/libs/asio/example/tutorial/daytime7/server.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -78,7 +78,7 @@
   void start_accept()
   {
     tcp_connection::pointer new_connection =
- tcp_connection::create(acceptor_.io_service());
+ tcp_connection::create(acceptor_.get_io_service());
 
     acceptor_.async_accept(new_connection->socket(),
         boost::bind(&tcp_server::handle_accept, this, new_connection,

Modified: trunk/libs/asio/example/tutorial/daytime_dox.txt
==============================================================================
--- trunk/libs/asio/example/tutorial/daytime_dox.txt (original)
+++ trunk/libs/asio/example/tutorial/daytime_dox.txt 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,17 +41,17 @@
 \until tcp::resolver::query
 
 The list of endpoints is returned using an iterator of type
-boost::asio::ip::tcp::resolver::iterator. A default constructed
-boost::asio::ip::tcp::resolver::iterator object is used as the end iterator.
+boost::asio::ip::tcp::resolver::iterator. (Note that a default constructed
+boost::asio::ip::tcp::resolver::iterator object can be used as an end iterator.)
 
-\until tcp::resolver::iterator end;
+\until tcp::resolver::iterator
 
 Now we create and connect the socket. The list of endpoints obtained above may
 contain both IPv4 and IPv6 endpoints, so we need to try each of them until we
 find one that works. This keeps the client program independent of a specific IP
-version.
+version. The boost::asio::connect() function does this for us automatically.
 
-\until throw
+\until boost::asio::connect
 
 The connection is open. All we need to do now is read the response from the
 daytime service.

Modified: trunk/libs/asio/example/windows/transmit_file.cpp
==============================================================================
--- trunk/libs/asio/example/windows/transmit_file.cpp (original)
+++ trunk/libs/asio/example/windows/transmit_file.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -31,8 +31,8 @@
   overlapped_ptr overlapped(socket.get_io_service(), handler);
 
   // Initiate the TransmitFile operation.
- BOOL ok = ::TransmitFile(socket.native(),
- file.native(), 0, 0, overlapped.get(), 0, 0);
+ BOOL ok = ::TransmitFile(socket.native_handle(),
+ file.native_handle(), 0, 0, overlapped.get(), 0, 0);
   DWORD last_error = ::GetLastError();
 
   // Check if the operation completed immediately.
@@ -119,7 +119,7 @@
   void start_accept()
   {
     connection::pointer new_connection =
- connection::create(acceptor_.io_service(), filename_);
+ connection::create(acceptor_.get_io_service(), filename_);
 
     acceptor_.async_accept(new_connection->socket(),
         boost::bind(&server::handle_accept, this, new_connection,

Modified: trunk/libs/asio/test/Jamfile
==============================================================================
--- trunk/libs/asio/test/Jamfile (original)
+++ trunk/libs/asio/test/Jamfile 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -41,6 +41,8 @@
   :
   [ run basic_datagram_socket.cpp <template>asio_unit_test ]
   [ run basic_deadline_timer.cpp <template>asio_unit_test ]
+ [ run basic_raw_socket.cpp <template>asio_unit_test ]
+ [ run basic_seq_packet_socket.cpp <template>asio_unit_test ]
   [ run basic_socket_acceptor.cpp <template>asio_unit_test ]
   [ run basic_stream_socket.cpp <template>asio_unit_test ]
   [ run buffer.cpp <template>asio_unit_test ]
@@ -49,6 +51,7 @@
   [ run buffered_write_stream.cpp <template>asio_unit_test ]
   [ run buffers_iterator.cpp <template>asio_unit_test ]
   [ run completion_condition.cpp <template>asio_unit_test ]
+ [ run connect.cpp <template>asio_unit_test ]
   [ run datagram_socket_service.cpp <template>asio_unit_test ]
   [ run deadline_timer_service.cpp <template>asio_unit_test ]
   [ run deadline_timer.cpp <template>asio_unit_test ]
@@ -82,9 +85,11 @@
   [ run posix/descriptor_base.cpp <template>asio_unit_test ]
   [ run posix/stream_descriptor.cpp <template>asio_unit_test ]
   [ run posix/stream_descriptor_service.cpp <template>asio_unit_test ]
+ [ run raw_socket_service.cpp <template>asio_unit_test ]
   [ run read.cpp <template>asio_unit_test ]
   [ run read_at.cpp <template>asio_unit_test ]
   [ run read_until.cpp <template>asio_unit_test ]
+ [ run seq_packet_socket_service.cpp <template>asio_unit_test ]
   [ run socket_acceptor_service.cpp <template>asio_unit_test ]
   [ run socket_base.cpp <template>asio_unit_test ]
   [ run strand.cpp <template>asio_unit_test ]

Modified: trunk/libs/asio/test/Jamfile.v2
==============================================================================
--- trunk/libs/asio/test/Jamfile.v2 (original)
+++ trunk/libs/asio/test/Jamfile.v2 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -65,6 +65,10 @@
   [ link basic_datagram_socket.cpp : $(USE_SELECT) : basic_datagram_socket_select ]
   [ link basic_deadline_timer.cpp ]
   [ link basic_deadline_timer.cpp : $(USE_SELECT) : basic_deadline_timer_select ]
+ [ link basic_raw_socket.cpp ]
+ [ link basic_raw_socket.cpp : $(USE_SELECT) : basic_raw_socket_select ]
+ [ link basic_seq_packet_socket.cpp ]
+ [ link basic_seq_packet_socket.cpp : $(USE_SELECT) : basic_seq_packet_socket_select ]
   [ link basic_socket_acceptor.cpp ]
   [ link basic_socket_acceptor.cpp : $(USE_SELECT) : basic_socket_acceptor_select ]
   [ link basic_stream_socket.cpp ]
@@ -81,6 +85,8 @@
   [ run buffers_iterator.cpp : : : $(USE_SELECT) : buffers_iterator_select ]
   [ link completion_condition.cpp ]
   [ link completion_condition.cpp : $(USE_SELECT) : completion_condition_select ]
+ [ link connect.cpp ]
+ [ link connect.cpp : $(USE_SELECT) : connect_select ]
   [ link datagram_socket_service.cpp ]
   [ link datagram_socket_service.cpp : $(USE_SELECT) : datagram_socket_service_select ]
   [ link deadline_timer_service.cpp ]
@@ -147,12 +153,16 @@
   [ link posix/stream_descriptor.cpp : $(USE_SELECT) : posix_stream_descriptor_select ]
   [ link posix/stream_descriptor_service.cpp : : posix_stream_descriptor_service ]
   [ link posix/stream_descriptor_service.cpp : $(USE_SELECT) : posix_stream_descriptor_service_select ]
+ [ link raw_socket_service.cpp ]
+ [ link raw_socket_service.cpp : $(USE_SELECT) : raw_socket_service_select ]
   [ run read.cpp ]
   [ run read.cpp : : : $(USE_SELECT) : read_select ]
   [ run read_at.cpp ]
   [ run read_at.cpp : : : $(USE_SELECT) : read_at_select ]
   [ run read_until.cpp ]
   [ run read_until.cpp : : : $(USE_SELECT) : read_until_select ]
+ [ link seq_packet_socket_service.cpp ]
+ [ link seq_packet_socket_service.cpp : $(USE_SELECT) : seq_packet_socket_service_select ]
   [ link socket_acceptor_service.cpp ]
   [ link socket_acceptor_service.cpp : $(USE_SELECT) : socket_acceptor_service_select ]
   [ run socket_base.cpp ]

Added: trunk/libs/asio/test/basic_raw_socket.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/test/basic_raw_socket.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+//
+// basic_raw_socket.cpp
+// ~~~~~~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+// 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/basic_raw_socket.hpp>
+
+#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;
+}

Added: trunk/libs/asio/test/basic_seq_packet_socket.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/test/basic_seq_packet_socket.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+//
+// basic_seq_packet_socket.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+// 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/basic_seq_packet_socket.hpp>
+
+#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;
+}

Modified: trunk/libs/asio/test/buffer.cpp
==============================================================================
--- trunk/libs/asio/test/buffer.cpp (original)
+++ trunk/libs/asio/test/buffer.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -44,6 +44,8 @@
     std::vector<char> vector_data(1024);
     const std::vector<char>& const_vector_data = vector_data;
     const std::string string_data(1024, ' ');
+ std::vector<mutable_buffer> mutable_buffer_sequence;
+ std::vector<const_buffer> const_buffer_sequence;
 
     // mutable_buffer constructors.
 
@@ -51,13 +53,6 @@
     mutable_buffer mb2(void_ptr_data, 1024);
     mutable_buffer mb3(mb1);
 
- // mutable_buffer functions.
-
- void* ptr1 = buffer_cast<void*>(mb1);
- (void)ptr1;
- std::size_t size1 = buffer_size(mb1);
- (void)size1;
-
     // mutable_buffer operators.
 
     mb1 = mb2 + 128;
@@ -82,13 +77,6 @@
     const_buffer cb3(cb1);
     const_buffer cb4(mb1);
 
- // const_buffer functions.
-
- const void* ptr2 = buffer_cast<const void*>(cb1);
- (void)ptr2;
- std::size_t size2 = buffer_size(cb1);
- (void)size2;
-
     // const_buffer operators.
 
     cb1 = cb2 + 128;
@@ -106,6 +94,28 @@
     const_buffers_1::const_iterator iter4 = cbc1.end();
     (void)iter4;
 
+ // buffer_size function overloads.
+
+ std::size_t size1 = buffer_size(mb1);
+ (void)size1;
+ std::size_t size2 = buffer_size(cb1);
+ (void)size2;
+ std::size_t size3 = buffer_size(mbc1);
+ (void)size3;
+ std::size_t size4 = buffer_size(cbc1);
+ (void)size4;
+ std::size_t size5 = buffer_size(mutable_buffer_sequence);
+ (void)size5;
+ std::size_t size6 = buffer_size(const_buffer_sequence);
+ (void)size6;
+
+ // buffer_cast function overloads.
+
+ void* ptr1 = buffer_cast<void*>(mb1);
+ (void)ptr1;
+ const void* ptr2 = buffer_cast<const void*>(cb1);
+ (void)ptr2;
+
     // buffer function overloads.
 
     mb1 = buffer(mb2);
@@ -130,6 +140,71 @@
     cb1 = buffer(const_vector_data, 1024);
     cb1 = buffer(string_data);
     cb1 = buffer(string_data, 1024);
+
+ // buffer_copy function overloads.
+
+ std::size_t size7 = buffer_copy(mb1, cb2);
+ (void)size7;
+ std::size_t size8 = buffer_copy(mb1, cbc2);
+ (void)size8;
+ std::size_t size9 = buffer_copy(mb1, mb2);
+ (void)size9;
+ std::size_t size10 = buffer_copy(mb1, mbc2);
+ (void)size10;
+ std::size_t size11 = buffer_copy(mb1, const_buffer_sequence);
+ (void)size11;
+ std::size_t size12 = buffer_copy(mbc1, cb2);
+ (void)size12;
+ std::size_t size13 = buffer_copy(mbc1, cbc2);
+ (void)size13;
+ std::size_t size14 = buffer_copy(mbc1, mb2);
+ (void)size14;
+ std::size_t size15 = buffer_copy(mbc1, mbc2);
+ (void)size15;
+ std::size_t size16 = buffer_copy(mbc1, const_buffer_sequence);
+ (void)size16;
+ std::size_t size17 = buffer_copy(mutable_buffer_sequence, cb2);
+ (void)size17;
+ std::size_t size18 = buffer_copy(mutable_buffer_sequence, cbc2);
+ (void)size18;
+ std::size_t size19 = buffer_copy(mutable_buffer_sequence, mb2);
+ (void)size19;
+ std::size_t size20 = buffer_copy(mutable_buffer_sequence, mbc2);
+ (void)size20;
+ std::size_t size21 = buffer_copy(
+ mutable_buffer_sequence, const_buffer_sequence);
+ (void)size21;
+ std::size_t size22 = buffer_copy(mb1, cb2, 128);
+ (void)size22;
+ std::size_t size23 = buffer_copy(mb1, cbc2, 128);
+ (void)size23;
+ std::size_t size24 = buffer_copy(mb1, mb2, 128);
+ (void)size24;
+ std::size_t size25 = buffer_copy(mb1, mbc2, 128);
+ (void)size25;
+ std::size_t size26 = buffer_copy(mb1, const_buffer_sequence, 128);
+ (void)size26;
+ std::size_t size27 = buffer_copy(mbc1, cb2, 128);
+ (void)size27;
+ std::size_t size28 = buffer_copy(mbc1, cbc2, 128);
+ (void)size28;
+ std::size_t size29 = buffer_copy(mbc1, mb2, 128);
+ (void)size29;
+ std::size_t size30 = buffer_copy(mbc1, mbc2, 128);
+ (void)size30;
+ std::size_t size31 = buffer_copy(mbc1, const_buffer_sequence, 128);
+ (void)size31;
+ std::size_t size32 = buffer_copy(mutable_buffer_sequence, cb2, 128);
+ (void)size32;
+ std::size_t size33 = buffer_copy(mutable_buffer_sequence, cbc2, 128);
+ (void)size33;
+ std::size_t size34 = buffer_copy(mutable_buffer_sequence, mb2, 128);
+ (void)size34;
+ std::size_t size35 = buffer_copy(mutable_buffer_sequence, mbc2, 128);
+ (void)size35;
+ std::size_t size36 = buffer_copy(
+ mutable_buffer_sequence, const_buffer_sequence, 128);
+ (void)size36;
   }
   catch (std::exception&)
   {

Added: trunk/libs/asio/test/connect.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/test/connect.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+//
+// connect.cpp
+// ~~~~~~~~~~~
+//
+// 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)
+//
+
+// 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/connect.hpp>
+
+#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;
+}

Modified: trunk/libs/asio/test/deadline_timer.cpp
==============================================================================
--- trunk/libs/asio/test/deadline_timer.cpp (original)
+++ trunk/libs/asio/test/deadline_timer.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -58,6 +58,12 @@
   BOOST_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);
+}
+
 ptime now()
 {
 #if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)
@@ -183,6 +189,31 @@
   end = now();
   expected_end = start + seconds(10);
   BOOST_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::deadline_timer t7(ios, seconds(3));
+ t7.async_wait(boost::bind(increment_if_not_cancelled, &count,
+ boost::asio::placeholders::error));
+ t7.async_wait(boost::bind(increment_if_not_cancelled, &count,
+ boost::asio::placeholders::error));
+ boost::asio::deadline_timer t8(ios, seconds(1));
+ t8.async_wait(boost::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_CHECK(count == 1);
+ end = now();
+ expected_end = start + seconds(3);
+ BOOST_CHECK(expected_end < end || expected_end == end);
 }
 
 void timer_handler(const boost::system::error_code&)

Modified: trunk/libs/asio/test/io_service.cpp
==============================================================================
--- trunk/libs/asio/test/io_service.cpp (original)
+++ trunk/libs/asio/test/io_service.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -93,11 +93,13 @@
   ios.post(boost::bind(increment, &count));
 
   // No handlers can be called until run() is called.
+ BOOST_CHECK(!ios.stopped());
   BOOST_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 1);
 
   count = 0;
@@ -109,20 +111,24 @@
   ios.post(boost::bind(increment, &count));
 
   // No handlers can be called until run() is called.
+ BOOST_CHECK(!ios.stopped());
   BOOST_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_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.run();
 
   // The only operation executed should have been to stop run().
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 0);
 
   ios.reset();
@@ -130,11 +136,13 @@
   delete w;
 
   // No handlers can be called until run() is called.
+ BOOST_CHECK(!ios.stopped());
   BOOST_CHECK(count == 0);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 1);
 
   count = 10;
@@ -142,11 +150,13 @@
   ios.post(boost::bind(decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
+ BOOST_CHECK(!ios.stopped());
   BOOST_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 0);
 
   count = 10;
@@ -154,11 +164,13 @@
   ios.post(boost::bind(nested_decrement_to_zero, &ios, &count));
 
   // No handlers can be called until run() is called.
+ BOOST_CHECK(!ios.stopped());
   BOOST_CHECK(count == 10);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 0);
 
   count = 10;
@@ -167,16 +179,19 @@
 
   // 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);
 
   ios.run();
 
   // The run() call will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_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));
@@ -185,6 +200,7 @@
   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);
 
@@ -192,10 +208,12 @@
   io_service ios2;
   ios.dispatch(ios2.wrap(boost::bind(decrement_to_zero, &ios2, &count)));
   ios.reset();
+ BOOST_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);
 
   ios2.run();
@@ -213,6 +231,7 @@
   ios.post(boost::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);
 
@@ -230,6 +249,7 @@
   }
 
   // The run() calls will not return until all work has finished.
+ BOOST_CHECK(ios.stopped());
   BOOST_CHECK(count == 3);
   BOOST_CHECK(exception_count == 2);
 }

Modified: trunk/libs/asio/test/ip/address.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address.cpp (original)
+++ trunk/libs/asio/test/ip/address.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -18,9 +18,107 @@
 
 #include "../unit_test.hpp"
 
+//------------------------------------------------------------------------------
+
+// ip_address_compile test
+// ~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that all public member functions on the class
+// ip::address compile and link correctly. Runtime failures are ignored.
+
+namespace ip_address_compile {
+
+void test()
+{
+ using namespace boost::asio;
+ namespace ip = boost::asio::ip;
+
+ try
+ {
+ boost::system::error_code ec;
+
+ // address constructors.
+
+ ip::address addr1;
+ const ip::address_v4 const_addr_v4;
+ ip::address addr2(const_addr_v4);
+ const ip::address_v6 const_addr_v6;
+ ip::address addr3(const_addr_v6);
+
+ // address functions.
+
+ bool b = addr1.is_v4();
+ (void)b;
+
+ b = addr1.is_v6();
+ (void)b;
+
+ b = addr1.is_loopback();
+ (void)b;
+
+ b = addr1.is_unspecified();
+ (void)b;
+
+ b = addr1.is_multicast();
+ (void)b;
+
+ ip::address_v4 addr_v4_value = addr1.to_v4();
+ (void)addr_v4_value;
+
+ ip::address_v6 addr_v6_value = addr1.to_v6();
+ (void)addr_v6_value;
+
+ std::string string_value = addr1.to_string();
+ string_value = addr1.to_string(ec);
+
+ // address static functions.
+
+ addr1 = ip::address::from_string("127.0.0.1");
+ addr1 = ip::address::from_string("127.0.0.1", ec);
+ addr1 = ip::address::from_string(string_value);
+ addr1 = ip::address::from_string(string_value, ec);
+
+ // address comparisons.
+
+ b = (addr1 == addr2);
+ (void)b;
+
+ b = (addr1 != addr2);
+ (void)b;
+
+ b = (addr1 < addr2);
+ (void)b;
+
+ b = (addr1 > addr2);
+ (void)b;
+
+ b = (addr1 <= addr2);
+ (void)b;
+
+ b = (addr1 >= addr2);
+ (void)b;
+
+ // address I/O.
+
+ std::ostringstream os;
+ os << addr1;
+
+#if !defined(BOOST_NO_STD_WSTREAMBUF)
+ std::wostringstream wos;
+ wos << addr1;
+#endif // !defined(BOOST_NO_STD_WSTREAMBUF)
+ }
+ catch (std::exception&)
+ {
+ }
+}
+
+} // namespace ip_address_compile
+
+//------------------------------------------------------------------------------
+
 test_suite* init_unit_test_suite(int, char*[])
 {
   test_suite* test = BOOST_TEST_SUITE("ip/address");
- test->add(BOOST_TEST_CASE(&null_test));
+ test->add(BOOST_TEST_CASE(&ip_address_compile::test));
   return test;
 }

Modified: trunk/libs/asio/test/ip/address_v4.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address_v4.cpp (original)
+++ trunk/libs/asio/test/ip/address_v4.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -42,12 +42,18 @@
     ip::address_v4 addr1;
     const ip::address_v4::bytes_type const_bytes_value = { { 127, 0, 0, 1 } };
     ip::address_v4 addr2(const_bytes_value);
- const unsigned long const_ulong_value = 0x7F00001;
+ const unsigned long const_ulong_value = 0x7F000001;
     ip::address_v4 addr3(const_ulong_value);
 
     // address_v4 functions.
 
- bool b = addr1.is_class_a();
+ bool b = addr1.is_loopback();
+ (void)b;
+
+ b = addr1.is_unspecified();
+ (void)b;
+
+ b = addr1.is_class_a();
     (void)b;
 
     b = addr1.is_class_b();
@@ -124,9 +130,140 @@
 
 //------------------------------------------------------------------------------
 
+// ip_address_v4_runtime test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that the various public member functions meet the
+// necessary postconditions.
+
+namespace ip_address_v4_runtime {
+
+void test()
+{
+ 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);
+
+ 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]);
+
+ 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());
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+} // 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;
 }

Modified: trunk/libs/asio/test/ip/address_v6.cpp
==============================================================================
--- trunk/libs/asio/test/ip/address_v6.cpp (original)
+++ trunk/libs/asio/test/ip/address_v6.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -145,9 +145,229 @@
 
 //------------------------------------------------------------------------------
 
+// ip_address_v6_runtime test
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~
+// The following test checks that the various public member functions meet the
+// necessary postconditions.
+
+namespace ip_address_v6_runtime {
+
+void test()
+{
+ using boost::asio::ip::address_v6;
+
+ address_v6 a1;
+ BOOST_CHECK(a1.is_unspecified());
+ BOOST_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);
+
+ address_v6 a3;
+ a3.scope_id(12345);
+ BOOST_CHECK(a3.scope_id() == 12345);
+
+ address_v6 unspecified_address;
+ address_v6::bytes_type loopback_bytes = {{ 0 }};
+ loopback_bytes[15] = 1;
+ address_v6 loopback_address(loopback_bytes);
+ address_v6::bytes_type link_local_bytes = {{ 0xFE, 0x80, 1 }};
+ address_v6 link_local_address(link_local_bytes);
+ address_v6::bytes_type site_local_bytes = {{ 0xFE, 0xC0, 1 }};
+ address_v6 site_local_address(site_local_bytes);
+ address_v6::bytes_type v4_mapped_bytes = {{ 0 }};
+ v4_mapped_bytes[10] = 0xFF, v4_mapped_bytes[11] = 0xFF;
+ v4_mapped_bytes[12] = 1, v4_mapped_bytes[13] = 2;
+ v4_mapped_bytes[14] = 3, v4_mapped_bytes[15] = 4;
+ address_v6 v4_mapped_address(v4_mapped_bytes);
+ address_v6::bytes_type v4_compat_bytes = {{ 0 }};
+ v4_compat_bytes[12] = 1, v4_compat_bytes[13] = 2;
+ v4_compat_bytes[14] = 3, v4_compat_bytes[15] = 4;
+ address_v6 v4_compat_address(v4_compat_bytes);
+ address_v6::bytes_type mcast_global_bytes = {{ 0xFF, 0x0E, 1 }};
+ address_v6 mcast_global_address(mcast_global_bytes);
+ address_v6::bytes_type mcast_link_local_bytes = {{ 0xFF, 0x02, 1 }};
+ address_v6 mcast_link_local_address(mcast_link_local_bytes);
+ address_v6::bytes_type mcast_node_local_bytes = {{ 0xFF, 0x01, 1 }};
+ address_v6 mcast_node_local_address(mcast_node_local_bytes);
+ address_v6::bytes_type mcast_org_local_bytes = {{ 0xFF, 0x08, 1 }};
+ address_v6 mcast_org_local_address(mcast_org_local_bytes);
+ 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_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;
 }

Modified: trunk/libs/asio/test/ip/tcp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/tcp.cpp (original)
+++ trunk/libs/asio/test/ip/tcp.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -171,7 +171,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = socket1.io_service();
+ io_service& ios_ref = socket1.get_io_service();
     (void)ios_ref;
 
     // basic_socket functions.
@@ -203,6 +203,10 @@
     ip::tcp::socket::native_type native_socket4 = socket1.native();
     (void)native_socket4;
 
+ ip::tcp::socket::native_handle_type native_socket5
+ = socket1.native_handle();
+ (void)native_socket5;
+
     socket1.cancel();
     socket1.cancel(ec);
 
@@ -238,6 +242,16 @@
     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::tcp::endpoint endpoint1 = socket1.local_endpoint();
     ip::tcp::endpoint endpoint2 = socket1.local_endpoint(ec);
 
@@ -515,6 +529,9 @@
   ip::tcp::endpoint client_endpoint;
   acceptor.accept(server_side_socket, client_endpoint);
 
+ ip::tcp::acceptor::non_blocking_io command(false);
+ acceptor.io_control(command);
+
   ip::tcp::endpoint client_side_local_endpoint
     = client_side_socket.local_endpoint();
   BOOST_CHECK(client_side_local_endpoint.port() == client_endpoint.port());
@@ -581,7 +598,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = resolver.io_service();
+ io_service& ios_ref = resolver.get_io_service();
     (void)ios_ref;
 
     // basic_resolver functions.

Modified: trunk/libs/asio/test/ip/udp.cpp
==============================================================================
--- trunk/libs/asio/test/ip/udp.cpp (original)
+++ trunk/libs/asio/test/ip/udp.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -71,7 +71,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = socket1.io_service();
+ io_service& ios_ref = socket1.get_io_service();
     (void)ios_ref;
 
     // basic_socket functions.
@@ -103,6 +103,10 @@
     ip::udp::socket::native_type native_socket4 = socket1.native();
     (void)native_socket4;
 
+ ip::udp::socket::native_handle_type native_socket5
+ = socket1.native_handle();
+ (void)native_socket5;
+
     socket1.cancel();
     socket1.cancel(ec);
 
@@ -138,6 +142,16 @@
     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::udp::endpoint endpoint1 = socket1.local_endpoint();
     ip::udp::endpoint endpoint2 = socket1.local_endpoint(ec);
 
@@ -364,7 +378,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = resolver.io_service();
+ io_service& ios_ref = resolver.get_io_service();
     (void)ios_ref;
 
     // basic_resolver functions.

Modified: trunk/libs/asio/test/local/datagram_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/local/datagram_protocol.cpp (original)
+++ trunk/libs/asio/test/local/datagram_protocol.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -70,7 +70,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = socket1.io_service();
+ io_service& ios_ref = socket1.get_io_service();
     (void)ios_ref;
 
     // basic_socket functions.

Modified: trunk/libs/asio/test/local/stream_protocol.cpp
==============================================================================
--- trunk/libs/asio/test/local/stream_protocol.cpp (original)
+++ trunk/libs/asio/test/local/stream_protocol.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -78,7 +78,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = socket1.io_service();
+ io_service& ios_ref = socket1.get_io_service();
     (void)ios_ref;
 
     // basic_socket functions.

Modified: trunk/libs/asio/test/posix/stream_descriptor.cpp
==============================================================================
--- trunk/libs/asio/test/posix/stream_descriptor.cpp (original)
+++ trunk/libs/asio/test/posix/stream_descriptor.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -59,7 +59,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = descriptor1.io_service();
+ io_service& ios_ref = descriptor1.get_io_service();
     (void)ios_ref;
 
     // basic_descriptor functions.
@@ -86,12 +86,30 @@
       = descriptor1.native();
     (void)native_descriptor3;
 
+ posix::stream_descriptor::native_handle_type native_descriptor4
+ = descriptor1.native_handle();
+ (void)native_descriptor4;
+
+ posix::stream_descriptor::native_handle_type native_descriptor5
+ = descriptor1.release();
+ (void)native_descriptor5;
+
     descriptor1.cancel();
     descriptor1.cancel(ec);
 
     descriptor1.io_control(io_control_command);
     descriptor1.io_control(io_control_command, ec);
 
+ bool non_blocking1 = descriptor1.non_blocking();
+ (void)non_blocking1;
+ descriptor1.non_blocking(true);
+ descriptor1.non_blocking(false, ec);
+
+ bool non_blocking2 = descriptor1.native_non_blocking();
+ (void)non_blocking2;
+ descriptor1.native_non_blocking(true);
+ descriptor1.native_non_blocking(false, ec);
+
     // basic_stream_descriptor functions.
 
     descriptor1.write_some(buffer(mutable_char_buffer));

Added: trunk/libs/asio/test/raw_socket_service.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/test/raw_socket_service.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+//
+// raw_socket_service.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+// 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/raw_socket_service.hpp>
+
+#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;
+}

Modified: trunk/libs/asio/test/read.cpp
==============================================================================
--- trunk/libs/asio/test/read.cpp (original)
+++ trunk/libs/asio/test/read.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -88,25 +88,11 @@
   template <typename Mutable_Buffers>
   size_t read_some(const Mutable_Buffers& buffers)
   {
- size_t total_length = 0;
-
- typename Mutable_Buffers::const_iterator iter = buffers.begin();
- typename Mutable_Buffers::const_iterator end = buffers.end();
- for (; iter != end && total_length < next_read_length_; ++iter)
- {
- size_t length = boost::asio::buffer_size(*iter);
- if (length > length_ - position_)
- length = length_ - position_;
-
- if (length > next_read_length_ - total_length)
- length = next_read_length_ - total_length;
-
- memcpy(boost::asio::buffer_cast<void*>(*iter), data_ + position_, length);
- position_ += length;
- total_length += length;
- }
-
- return total_length;
+ size_t n = boost::asio::buffer_copy(buffers,
+ boost::asio::buffer(data_, length_) + position_,
+ next_read_length_);
+ position_ += n;
+ return n;
   }
 
   template <typename Mutable_Buffers>
@@ -236,6 +222,119 @@
   BOOST_CHECK(s.check_buffers(sb.data(), sizeof(read_data)));
 }
 
+void test_3_arg_nothrow_zero_buffers_read()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ std::vector<boost::asio::mutable_buffer> buffers;
+
+ boost::system::error_code error;
+ size_t bytes_transferred = boost::asio::read(s, buffers, error);
+ BOOST_CHECK(bytes_transferred == 0);
+ BOOST_CHECK(!error);
+}
+
+void test_3_arg_nothrow_mutable_buffers_1_read()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(read_buf, sizeof(read_buf));
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_3_arg_nothrow_multi_buffers_read()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::array<boost::asio::mutable_buffer, 2> buffers = { {
+ boost::asio::buffer(read_buf, 32),
+ boost::asio::buffer(read_buf) + 32 } };
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_3_arg_nothrow_streambuf_read()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::streambuf sb(sizeof(read_data));
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+}
+
 bool old_style_transfer_all(const boost::system::error_code& ec,
     size_t /*bytes_transferred*/)
 {
@@ -350,6 +449,75 @@
 
   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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -492,6 +660,75 @@
 
   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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -643,6 +880,84 @@
 
   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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
@@ -814,6 +1129,93 @@
 
   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);
+
+ 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,
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_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,
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_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);
+
+ 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,
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_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,
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_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);
+
+ 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,
+ boost::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_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,
+ boost::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(buffers, 42));
+ BOOST_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));
@@ -877,9 +1279,96 @@
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
- boost::system::error_code error;
- size_t bytes_transferred = boost::asio::read(s, buffers,
- boost::asio::transfer_all(), error);
+ 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);
+
+ 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,
+ boost::asio::transfer_all(), error);
+ BOOST_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_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,
+ boost::asio::transfer_all(), error);
+ BOOST_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_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);
+
+ 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,
+ boost::asio::transfer_at_least(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_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,
+ boost::asio::transfer_at_least(1), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_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);
+
+ 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,
+ boost::asio::transfer_at_least(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_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,
+ boost::asio::transfer_at_least(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
+ BOOST_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);
@@ -889,9 +1378,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_at_least(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -899,18 +1388,18 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_at_least(42), error);
+ BOOST_CHECK(bytes_transferred == 50);
+ BOOST_CHECK(s.check_buffers(buffers, 50));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -918,7 +1407,7 @@
   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::asio::transfer_exactly(1), error);
   BOOST_CHECK(bytes_transferred == 1);
   BOOST_CHECK(s.check_buffers(buffers, 1));
   BOOST_CHECK(!error);
@@ -928,18 +1417,18 @@
   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 == 10);
- BOOST_CHECK(s.check_buffers(buffers, 10));
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -947,7 +1436,7 @@
   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::asio::transfer_exactly(10), error);
   BOOST_CHECK(bytes_transferred == 10);
   BOOST_CHECK(s.check_buffers(buffers, 10));
   BOOST_CHECK(!error);
@@ -957,7 +1446,7 @@
   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::asio::transfer_exactly(10), error);
   BOOST_CHECK(bytes_transferred == 10);
   BOOST_CHECK(s.check_buffers(buffers, 10));
   BOOST_CHECK(!error);
@@ -966,9 +1455,9 @@
   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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -976,7 +1465,7 @@
   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::asio::transfer_exactly(42), error);
   BOOST_CHECK(bytes_transferred == 42);
   BOOST_CHECK(s.check_buffers(buffers, 42));
   BOOST_CHECK(!error);
@@ -986,9 +1475,9 @@
   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 == 50);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ boost::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1181,6 +1670,102 @@
 
   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);
+
+ 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,
+ 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);
+
+ 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,
+ 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);
+
+ 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);
+
+ 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,
+ 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);
+
+ 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,
+ 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);
+
+ 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);
+
+ 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,
+ 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);
+
+ 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,
+ 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);
+
+ 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));
@@ -1492,21 +2077,144 @@
   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::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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_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_at_least(10),
+ 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,
@@ -1520,7 +2228,7 @@
   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::asio::async_read(s, buffers, boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -1533,21 +2241,21 @@
   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::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(read_data)));
+ BOOST_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_at_least(42),
+ 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,
@@ -1561,15 +2269,15 @@
   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::asio::async_read(s, buffers, boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, 50));
+ BOOST_CHECK(s.check_buffers(buffers, 42));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
@@ -1830,6 +2538,129 @@
   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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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,
@@ -2095,6 +2926,138 @@
   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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 42);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 42);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(sb.size() == 42);
+ BOOST_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,
@@ -2188,6 +3151,10 @@
   test->add(BOOST_TEST_CASE(&test_2_arg_mutable_buffers_1_read));
   test->add(BOOST_TEST_CASE(&test_2_arg_multi_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_multi_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_multi_buffers_read));
   test->add(BOOST_TEST_CASE(&test_3_arg_streambuf_read));

Modified: trunk/libs/asio/test/read_at.cpp
==============================================================================
--- trunk/libs/asio/test/read_at.cpp (original)
+++ trunk/libs/asio/test/read_at.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -91,26 +91,9 @@
   template <typename Mutable_Buffers>
   size_t read_some_at(boost::uint64_t offset, const Mutable_Buffers& buffers)
   {
- size_t total_length = 0;
-
- typename Mutable_Buffers::const_iterator iter = buffers.begin();
- typename Mutable_Buffers::const_iterator end = buffers.end();
- for (; iter != end && total_length < next_read_length_; ++iter)
- {
- size_t length = boost::asio::buffer_size(*iter);
- if (length > length_ - offset)
- length = length_ - offset;
-
- if (length > next_read_length_ - total_length)
- length = next_read_length_ - total_length;
-
- memcpy(boost::asio::buffer_cast<void*>(*iter),
- data_ + offset, length);
- offset += length;
- total_length += length;
- }
-
- return total_length;
+ return boost::asio::buffer_copy(buffers,
+ boost::asio::buffer(data_, length_) + offset,
+ next_read_length_);
   }
 
   template <typename Mutable_Buffers>
@@ -293,6 +276,179 @@
   BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 }
 
+void test_4_arg_nothrow_mutable_buffers_1_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(read_buf, sizeof(read_buf));
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_4_arg_nothrow_multi_buffers_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::array<boost::asio::mutable_buffer, 2> buffers = { {
+ boost::asio::buffer(read_buf, 32),
+ boost::asio::buffer(read_buf) + 32 } };
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_4_arg_nothrow_streambuf_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb(sizeof(read_data));
+
+ s.reset(read_data, sizeof(read_data));
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
 bool old_style_transfer_all(const boost::system::error_code& ec,
     size_t /*bytes_transferred*/)
 {
@@ -500,137 +656,275 @@
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
-}
-
-void test_4_arg_multi_buffers_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- char read_buf[sizeof(read_data)];
- boost::array<boost::asio::mutable_buffer, 2> buffers = { {
- boost::asio::buffer(read_buf, 32),
- boost::asio::buffer(read_buf) + 32 } };
+ 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));
 
   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::asio::transfer_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ 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));
 
   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::transfer_exactly(42));
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_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_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(42));
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_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_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(42));
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_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_all());
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
-
+ boost::asio::transfer_exactly(42));
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_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));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+}
+
+void test_4_arg_multi_buffers_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::array<boost::asio::mutable_buffer, 2> buffers = { {
+ boost::asio::buffer(read_buf, 32),
+ boost::asio::buffer(read_buf) + 32 } };
+
+ 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::asio::transfer_all());
+ BOOST_CHECK(bytes_transferred == sizeof(read_data));
+ BOOST_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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   memset(read_buf, 0, sizeof(read_buf));
@@ -780,132 +1074,270 @@
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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,
- old_style_transfer_all);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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, short_transfer);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
-}
-
-void test_4_arg_streambuf_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::streambuf sb(sizeof(read_data));
+ 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));
 
   s.reset(read_data, sizeof(read_data));
- 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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
-
- 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));
+
+ 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));
+
+ 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));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+}
+
+void test_4_arg_streambuf_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb(sizeof(read_data));
+
+ s.reset(read_data, sizeof(read_data));
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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());
@@ -1081,115 +1513,271 @@
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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,
- 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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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,
- 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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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,
- 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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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,
- 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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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,
- 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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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, 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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
+ 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));
 
   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)));
-}
+ 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));
 
-void test_5_arg_mutable_buffers_1_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- char read_buf[sizeof(read_data)];
- boost::asio::mutable_buffers_1 buffers
- = boost::asio::buffer(read_buf, sizeof(read_buf));
+ 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));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
- boost::system::error_code error;
- size_t bytes_transferred = boost::asio::read_at(s, 0, buffers,
- boost::asio::transfer_all(), error);
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+}
+
+void test_5_arg_mutable_buffers_1_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(read_buf, sizeof(read_buf));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ 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);
@@ -1418,18 +2006,20 @@
 
   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,
- old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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,
- old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1437,9 +2027,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1447,9 +2037,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1457,9 +2047,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1467,25 +2057,27 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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,
- short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_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,
- short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1493,9 +2085,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1503,9 +2095,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1513,9 +2105,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1523,36 +2115,27 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
-}
-
-void test_5_arg_multi_buffers_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- char read_buf[sizeof(read_data)];
- boost::array<boost::asio::mutable_buffer, 2> buffers = { {
- boost::asio::buffer(read_buf, 32),
- boost::asio::buffer(read_buf) + 32 } };
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
- 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)));
+ 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);
 
   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_all(), error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1560,9 +2143,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1570,9 +2153,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1580,9 +2163,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1590,8 +2173,187 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+}
+
+void test_5_arg_multi_buffers_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::array<boost::asio::mutable_buffer, 2> buffers = { {
+ boost::asio::buffer(read_buf, 32),
+ boost::asio::buffer(read_buf) + 32 } };
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
 
@@ -1771,18 +2533,20 @@
 
   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,
- old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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,
- old_style_transfer_all, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1790,9 +2554,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1800,9 +2564,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1810,9 +2574,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1820,25 +2584,27 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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,
- short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_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,
- short_transfer, error);
- BOOST_CHECK(bytes_transferred == sizeof(read_data));
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ boost::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1846,9 +2612,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1856,9 +2622,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1866,9 +2632,9 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset(read_data, sizeof(read_data));
@@ -1876,24 +2642,194 @@
   memset(read_buf, 0, sizeof(read_buf));
   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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
-}
-
-void test_5_arg_streambuf_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::streambuf sb(sizeof(read_data));
 
   s.reset(read_data, sizeof(read_data));
- sb.consume(sb.size());
- 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));
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+}
+
+void test_5_arg_streambuf_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb(sizeof(read_data));
+
+ s.reset(read_data, sizeof(read_data));
+ sb.consume(sb.size());
+ 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);
@@ -2145,20 +3081,22 @@
 
   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,
- 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::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);
 
   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,
- 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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2166,10 +3104,10 @@
   sb.consume(sb.size());
   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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2177,10 +3115,10 @@
   sb.consume(sb.size());
   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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2188,10 +3126,10 @@
   sb.consume(sb.size());
   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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2199,28 +3137,30 @@
   sb.consume(sb.size());
   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::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);
 
   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,
- 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::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);
 
   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,
- 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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2228,10 +3168,10 @@
   sb.consume(sb.size());
   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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2239,10 +3179,10 @@
   sb.consume(sb.size());
   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::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);
 
   s.reset(read_data, sizeof(read_data));
@@ -2250,12 +3190,200 @@
   sb.consume(sb.size());
   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::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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
+ 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);
+
+ 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);
+
+ 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_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);
+
+ 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_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);
+
+ 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_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);
+
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
   sb.consume(sb.size());
@@ -2520,14 +3648,805 @@
   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_CHECK(sb.size() == sizeof(read_data));
+ BOOST_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));
+ 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)));
+
+ 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));
+ 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)));
+}
+
+void test_5_arg_mutable_buffers_1_async_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ char read_buf[sizeof(read_data)];
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(read_buf, sizeof(read_buf));
+
+ s.reset(read_data, sizeof(read_data));
+ memset(read_buf, 0, sizeof(read_buf));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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::asio::transfer_all(),
+ 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(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::asio::transfer_all(),
+ 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(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::asio::transfer_all(),
+ 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(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::asio::transfer_all(),
+ 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(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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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::asio::transfer_at_least(1),
+ boost::bind(async_read_handler,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred,
+ 1, &called));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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::asio::transfer_at_least(10),
+ boost::bind(async_read_handler,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred,
+ 10, &called));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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::asio::transfer_at_least(42),
+ boost::bind(async_read_handler,
+ boost::asio::placeholders::error,
+ boost::asio::placeholders::bytes_transferred,
+ 42, &called));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- sb.consume(sb.size());
+ memset(read_buf, 0, sizeof(read_buf));
   called = false;
- boost::asio::async_read_at(s, 0, sb,
+ boost::asio::async_read_at(s, 0, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2535,14 +4454,13 @@
   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_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- sb.consume(sb.size());
+ memset(read_buf, 0, sizeof(read_buf));
   called = false;
- boost::asio::async_read_at(s, 1234, sb,
+ boost::asio::async_read_at(s, 1234, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2550,17 +4468,17 @@
   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_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
 }
 
-void test_5_arg_mutable_buffers_1_async_read_at()
+void test_5_arg_multi_buffers_async_read_at()
 {
   boost::asio::io_service ios;
   test_random_access_device s(ios);
   char read_buf[sizeof(read_data)];
- boost::asio::mutable_buffers_1 buffers
- = boost::asio::buffer(read_buf, sizeof(read_buf));
+ boost::array<boost::asio::mutable_buffer, 2> buffers = { {
+ boost::asio::buffer(read_buf, 32),
+ boost::asio::buffer(read_buf) + 32 } };
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
@@ -2917,270 +4835,271 @@
   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::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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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, old_style_transfer_all,
+ 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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
+ 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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
+ 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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
+ 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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
+ 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,
- sizeof(read_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 0, buffers, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 0, buffers, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, short_transfer,
+ 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,
- sizeof(read_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
-}
-
-void test_5_arg_multi_buffers_async_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- char read_buf[sizeof(read_data)];
- boost::array<boost::asio::mutable_buffer, 2> buffers = { {
- boost::asio::buffer(read_buf, 32),
- boost::asio::buffer(read_buf) + 32 } };
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset(read_data, sizeof(read_data));
   memset(read_buf, 0, sizeof(read_buf));
- bool called = false;
+ called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
   boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_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));
   called = false;
   boost::asio::async_read_at(s, 1234, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_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,
- boost::asio::transfer_at_least(1),
+ 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,
@@ -3193,8 +5112,7 @@
   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::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,
@@ -3208,67 +5126,62 @@
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
- boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_at_least(1),
+ 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,
- 1, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_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::asio::transfer_at_least(1),
+ 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,
- 1, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_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::asio::transfer_at_least(1),
+ 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,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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::asio::transfer_at_least(1),
+ 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,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_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(10),
+ boost::asio::async_read_at(s, 0, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3281,8 +5194,7 @@
   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::asio::async_read_at(s, 1234, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3296,67 +5208,70 @@
   s.next_read_length(1);
   memset(read_buf, 0, sizeof(read_buf));
   called = false;
- boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::async_read_at(s, 0, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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::asio::transfer_at_least(10),
+ boost::asio::async_read_at(s, 1234, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_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::asio::transfer_at_least(10),
+ boost::asio::async_read_at(s, 0, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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::asio::transfer_at_least(10),
+ boost::asio::async_read_at(s, 1234, buffers, short_transfer,
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+}
+
+void test_5_arg_streambuf_async_read_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::streambuf sb(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(42),
+ sb.consume(sb.size());
+ 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,
@@ -3364,13 +5279,14 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers,
- boost::asio::transfer_at_least(42),
+ 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,
@@ -3378,72 +5294,78 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_at_least(42),
+ 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,
- 42, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers,
- boost::asio::transfer_at_least(42),
+ 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,
- 42, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers,
- boost::asio::transfer_at_least(42),
+ 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,
- 50, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers,
- boost::asio::transfer_at_least(42),
+ 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,
- 50, &called));
+ sizeof(read_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
+ 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,
@@ -3451,12 +5373,14 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
+ 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,
@@ -3464,68 +5388,78 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
+ 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));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_CHECK(s.check_buffers(0, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
+ 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));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), 1));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, old_style_transfer_all,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, old_style_transfer_all,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, short_transfer,
+ 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,
@@ -3533,12 +5467,14 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(0, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, short_transfer,
+ 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,
@@ -3546,76 +5482,78 @@
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == sizeof(read_data));
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), sizeof(read_data)));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(1);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 0, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(read_data)));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   s.next_read_length(10);
- memset(read_buf, 0, sizeof(read_buf));
+ sb.consume(sb.size());
   called = false;
- boost::asio::async_read_at(s, 1234, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(read_data)));
-}
-
-void test_5_arg_streambuf_async_read_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::streambuf sb(sizeof(read_data));
+ BOOST_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
- bool called = false;
+ called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3630,7 +5568,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3646,101 +5584,101 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &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_CHECK(sb.size() == 42);
+ BOOST_CHECK(s.check_buffers(0, 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_at(s, 1234, sb,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &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_CHECK(sb.size() == 42);
+ BOOST_CHECK(s.check_buffers(1234, 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_at(s, 0, sb,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 50, &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_CHECK(sb.size() == 50);
+ BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
 
   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::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 50, &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_CHECK(sb.size() == 50);
+ BOOST_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_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 1, &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_CHECK(sb.size() == 1);
+ BOOST_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_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 1, &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_CHECK(sb.size() == 1);
+ BOOST_CHECK(s.check_buffers(1234, 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_at(s, 0, sb,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3756,7 +5694,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3772,69 +5710,69 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 10));
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_CHECK(s.check_buffers(0, 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_at(s, 1234, sb,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 10);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 10));
+ BOOST_CHECK(sb.size() == 1);
+ BOOST_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_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 10, &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_CHECK(sb.size() == 10);
+ BOOST_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_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 10, &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_CHECK(sb.size() == 10);
+ BOOST_CHECK(s.check_buffers(1234, 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_at(s, 0, sb,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3850,7 +5788,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3866,7 +5804,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3882,7 +5820,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3897,38 +5835,38 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &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_CHECK(sb.size() == 42);
+ BOOST_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_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(read_data), &called));
+ 42, &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_CHECK(sb.size() == 42);
+ BOOST_CHECK(s.check_buffers(1234, 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_at(s, 0, sb,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3944,7 +5882,7 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 1234, sb,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3960,32 +5898,32 @@
   sb.consume(sb.size());
   called = false;
   boost::asio::async_read_at(s, 0, sb,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(0, sb.data(), 50));
+ BOOST_CHECK(sb.size() == 42);
+ BOOST_CHECK(s.check_buffers(0, 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_at(s, 1234, sb,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_read_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(sb.size() == 50);
- BOOST_CHECK(s.check_buffers(1234, sb.data(), 50));
+ BOOST_CHECK(sb.size() == 42);
+ BOOST_CHECK(s.check_buffers(1234, sb.data(), 42));
 
   s.reset(read_data, sizeof(read_data));
   sb.consume(sb.size());
@@ -4170,6 +6108,9 @@
   test->add(BOOST_TEST_CASE(&test_3_arg_mutable_buffers_1_read_at));
   test->add(BOOST_TEST_CASE(&test_3_arg_multi_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_multi_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_multi_buffers_read_at));
   test->add(BOOST_TEST_CASE(&test_4_arg_streambuf_read_at));

Modified: trunk/libs/asio/test/read_until.cpp
==============================================================================
--- trunk/libs/asio/test/read_until.cpp (original)
+++ trunk/libs/asio/test/read_until.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -63,27 +63,11 @@
   template <typename Mutable_Buffers>
   size_t read_some(const Mutable_Buffers& buffers)
   {
- using namespace std; // For memcpy.
-
- size_t total_length = 0;
-
- typename Mutable_Buffers::const_iterator iter = buffers.begin();
- typename Mutable_Buffers::const_iterator end = buffers.end();
- for (; iter != end && total_length < next_read_length_; ++iter)
- {
- size_t length = boost::asio::buffer_size(*iter);
- if (length > length_ - position_)
- length = length_ - position_;
-
- if (length > next_read_length_ - total_length)
- length = next_read_length_ - total_length;
-
- memcpy(boost::asio::buffer_cast<void*>(*iter), data_ + position_, length);
- position_ += length;
- total_length += length;
- }
-
- return total_length;
+ size_t n = boost::asio::buffer_copy(buffers,
+ boost::asio::buffer(data_, length_) + position_,
+ next_read_length_);
+ position_ += n;
+ return n;
   }
 
   template <typename Mutable_Buffers>

Added: trunk/libs/asio/test/seq_packet_socket_service.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/asio/test/seq_packet_socket_service.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,26 @@
+//
+// seq_packet_socket_service.cpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// 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)
+//
+
+// 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/seq_packet_socket_service.hpp>
+
+#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;
+}

Modified: trunk/libs/asio/test/serial_port.cpp
==============================================================================
--- trunk/libs/asio/test/serial_port.cpp (original)
+++ trunk/libs/asio/test/serial_port.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -54,12 +54,12 @@
 
     serial_port port1(ios);
     serial_port port2(ios, "null");
- serial_port::native_type native_port1 = port1.native();
+ serial_port::native_handle_type native_port1 = port1.native_handle();
     serial_port port3(ios, native_port1);
 
     // basic_io_object functions.
 
- io_service& ios_ref = port1.io_service();
+ io_service& ios_ref = port1.get_io_service();
     (void)ios_ref;
 
     // basic_serial_port functions.
@@ -74,9 +74,9 @@
     port1.open("null");
     port1.open("null", ec);
 
- serial_port::native_type native_port2 = port1.native();
+ serial_port::native_handle_type native_port2 = port1.native_handle();
     port1.assign(native_port2);
- serial_port::native_type native_port3 = port1.native();
+ serial_port::native_handle_type native_port3 = port1.native_handle();
     port1.assign(native_port3, ec);
 
     bool is_open = port1.is_open();
@@ -88,6 +88,9 @@
     serial_port::native_type native_port4 = port1.native();
     (void)native_port4;
 
+ serial_port::native_handle_type native_port5 = port1.native_handle();
+ (void)native_port5;
+
     port1.cancel();
     port1.cancel(ec);
 

Modified: trunk/libs/asio/test/ssl/stream.cpp
==============================================================================
--- trunk/libs/asio/test/ssl/stream.cpp (original)
+++ trunk/libs/asio/test/ssl/stream.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -66,7 +66,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = stream1.io_service();
+ io_service& ios_ref = stream1.get_io_service();
     (void)ios_ref;
 
     // ssl::stream functions.

Modified: trunk/libs/asio/test/windows/random_access_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/random_access_handle.cpp (original)
+++ trunk/libs/asio/test/windows/random_access_handle.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -59,7 +59,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = handle1.io_service();
+ io_service& ios_ref = handle1.get_io_service();
     (void)ios_ref;
 
     // basic_handle functions.
@@ -85,6 +85,10 @@
     win::random_access_handle::native_type native_handle3 = handle1.native();
     (void)native_handle3;
 
+ win::random_access_handle::native_handle_type native_handle4
+ = handle1.native_handle();
+ (void)native_handle4;
+
     handle1.cancel();
     handle1.cancel(ec);
 

Modified: trunk/libs/asio/test/windows/stream_handle.cpp
==============================================================================
--- trunk/libs/asio/test/windows/stream_handle.cpp (original)
+++ trunk/libs/asio/test/windows/stream_handle.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -58,7 +58,7 @@
 
     // basic_io_object functions.
 
- io_service& ios_ref = handle1.io_service();
+ io_service& ios_ref = handle1.get_io_service();
     (void)ios_ref;
 
     // basic_handle functions.
@@ -84,6 +84,10 @@
     win::stream_handle::native_type native_handle3 = handle1.native();
     (void)native_handle3;
 
+ win::stream_handle::native_handle_type native_handle4
+ = handle1.native_handle();
+ (void)native_handle4;
+
     handle1.cancel();
     handle1.cancel(ec);
 

Modified: trunk/libs/asio/test/write.cpp
==============================================================================
--- trunk/libs/asio/test/write.cpp (original)
+++ trunk/libs/asio/test/write.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -88,26 +88,11 @@
   template <typename Const_Buffers>
   size_t write_some(const Const_Buffers& buffers)
   {
- size_t total_length = 0;
-
- typename Const_Buffers::const_iterator iter = buffers.begin();
- typename Const_Buffers::const_iterator end = buffers.end();
- for (; iter != end && total_length < next_write_length_; ++iter)
- {
- size_t length = boost::asio::buffer_size(*iter);
- if (length > length_ - position_)
- length = length_ - position_;
-
- if (length > next_write_length_ - total_length)
- length = next_write_length_ - total_length;
-
- memcpy(data_ + position_,
- boost::asio::buffer_cast<const void*>(*iter), length);
- position_ += length;
- total_length += length;
- }
-
- return total_length;
+ size_t n = boost::asio::buffer_copy(
+ boost::asio::buffer(data_, length_) + position_,
+ buffers, next_write_length_);
+ position_ += n;
+ return n;
   }
 
   template <typename Const_Buffers>
@@ -225,6 +210,106 @@
   BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
 }
 
+void test_3_arg_nothrow_zero_buffers_write()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ std::vector<boost::asio::const_buffer> buffers;
+
+ boost::system::error_code error;
+ size_t bytes_transferred = boost::asio::write(s, buffers, error);
+ BOOST_CHECK(bytes_transferred == 0);
+ BOOST_CHECK(!error);
+}
+
+void test_3_arg_nothrow_const_buffers_1_write()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_3_arg_nothrow_mutable_buffers_1_write()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_3_arg_nothrow_multi_buffers_write()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::array<boost::asio::const_buffer, 2> buffers = { {
+ boost::asio::buffer(write_data, 32),
+ boost::asio::buffer(write_data) + 32 } };
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
 bool old_style_transfer_all(const boost::system::error_code& ec,
     size_t /*bytes_transferred*/)
 {
@@ -325,6 +410,66 @@
   BOOST_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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -447,6 +592,66 @@
   BOOST_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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -570,6 +775,66 @@
   BOOST_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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -716,29 +981,107 @@
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
   BOOST_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::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(buffers, 1));
+ BOOST_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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
 
   s.reset();
   bytes_transferred = boost::asio::write(s, buffers, short_transfer, error);
@@ -875,6 +1218,84 @@
   BOOST_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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
   BOOST_CHECK(bytes_transferred == sizeof(mutable_write_data));
@@ -1035,6 +1456,84 @@
   BOOST_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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ s.reset();
   bytes_transferred = boost::asio::write(s, buffers,
       old_style_transfer_all, error);
   BOOST_CHECK(bytes_transferred == sizeof(write_data));
@@ -1390,99 +1889,213 @@
 
   s.reset();
   called = false;
- boost::asio::async_write(s, buffers, old_style_transfer_all,
+ 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,
- sizeof(write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write(s, buffers, old_style_transfer_all,
+ 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,
- sizeof(write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write(s, buffers, old_style_transfer_all,
+ 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,
- sizeof(write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(buffers, 1));
 
   s.reset();
   called = false;
- boost::asio::async_write(s, buffers, short_transfer,
+ 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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write(s, buffers, short_transfer,
+ 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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write(s, buffers, short_transfer,
+ 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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(write_data)));
-}
-
-void test_4_arg_mutable_buffers_1_async_write()
-{
- boost::asio::io_service ios;
- test_stream s(ios);
- boost::asio::mutable_buffers_1 buffers
- = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+ BOOST_CHECK(s.check_buffers(buffers, 10));
 
   s.reset();
- bool called = false;
- boost::asio::async_write(s, buffers, boost::asio::transfer_all(),
+ 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,
- sizeof(mutable_write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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)));
+}
+
+void test_4_arg_mutable_buffers_1_async_write()
+{
+ boost::asio::io_service ios;
+ test_stream s(ios);
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(buffers, sizeof(mutable_write_data)));
 
   s.reset();
   s.next_write_length(1);
@@ -1626,6 +2239,120 @@
 
   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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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,
@@ -1863,6 +2590,120 @@
 
   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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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,
@@ -1945,6 +2786,10 @@
   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_multi_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_multi_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_multi_buffers_write));

Modified: trunk/libs/asio/test/write_at.cpp
==============================================================================
--- trunk/libs/asio/test/write_at.cpp (original)
+++ trunk/libs/asio/test/write_at.cpp 2011-02-22 20:04:16 EST (Tue, 22 Feb 2011)
@@ -83,26 +83,9 @@
   template <typename Const_Buffers>
   size_t write_some_at(boost::uint64_t offset, const Const_Buffers& buffers)
   {
- size_t total_length = 0;
-
- typename Const_Buffers::const_iterator iter = buffers.begin();
- typename Const_Buffers::const_iterator end = buffers.end();
- for (; iter != end && total_length < next_write_length_; ++iter)
- {
- size_t length = boost::asio::buffer_size(*iter);
- if (length > length_ - offset)
- length = length_ - offset;
-
- if (length > next_write_length_ - total_length)
- length = next_write_length_ - total_length;
-
- memcpy(data_ + offset,
- boost::asio::buffer_cast<const void*>(*iter), length);
- offset += length;
- total_length += length;
- }
-
- return total_length;
+ return boost::asio::buffer_copy(
+ boost::asio::buffer(data_, length_) + offset,
+ buffers, next_write_length_);
   }
 
   template <typename Const_Buffers>
@@ -262,6 +245,154 @@
   BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 }
 
+void test_4_arg_nothrow_const_buffers_1_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_4_arg_nothrow_mutable_buffers_1_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_4_arg_nothrow_multi_buffers_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::array<boost::asio::const_buffer, 2> buffers = { {
+ boost::asio::buffer(write_data, 32),
+ boost::asio::buffer(write_data) + 32 } };
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
 bool old_style_transfer_all(const boost::system::error_code& ec,
     size_t /*bytes_transferred*/)
 {
@@ -443,6 +574,126 @@
 
   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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -685,36 +936,156 @@
 
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
 
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
 
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
 
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
 
   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::transfer_exactly(1));
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
+
+ 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)));
 
   s.reset();
   s.next_write_length(10);
@@ -928,6 +1299,126 @@
 
   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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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));
+
+ 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)));
@@ -1216,76 +1707,232 @@
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
 
   s.reset();
@@ -1531,170 +2178,326 @@
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_CHECK(!error);
-}
-
-void test_5_arg_multi_buffers_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::array<boost::asio::const_buffer, 2> buffers = { {
- boost::asio::buffer(write_data, 32),
- boost::asio::buffer(write_data) + 32 } };
 
   s.reset();
- 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)));
+ 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);
 
   s.reset();
+ 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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
   BOOST_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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
   BOOST_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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
   BOOST_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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
   BOOST_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::asio::transfer_exactly(42), error);
+ BOOST_CHECK(bytes_transferred == 42);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
   BOOST_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));
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+void test_5_arg_multi_buffers_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::array<boost::asio::const_buffer, 2> buffers = { {
+ boost::asio::buffer(write_data, 32),
+ boost::asio::buffer(write_data) + 32 } };
+
+ s.reset();
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
 
@@ -1847,124 +2650,734 @@
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
   BOOST_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::asio::transfer_exactly(1), error);
+ BOOST_CHECK(bytes_transferred == 1);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_CHECK(!error);
 
   s.reset();
+ 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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
   BOOST_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::asio::transfer_exactly(10), error);
+ BOOST_CHECK(bytes_transferred == 10);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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);
+
+ 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);
+
+ 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);
+
+ 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);
 
   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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+}
+
+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);
+}
+
+void test_4_arg_const_buffers_1_async_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+}
+
+void test_4_arg_mutable_buffers_1_async_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+}
+
+void test_4_arg_multi_buffers_async_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::array<boost::asio::const_buffer, 2> buffers = { {
+ boost::asio::buffer(write_data, 32),
+ boost::asio::buffer(write_data) + 32 } };
+
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+}
+
+void test_5_arg_const_buffers_1_async_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::const_buffers_1 buffers
+ = boost::asio::buffer(write_data, sizeof(write_data));
+
+ s.reset();
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+
+ 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);
-}
-
-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);
-}
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
-void test_4_arg_const_buffers_1_async_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::const_buffers_1 buffers
- = boost::asio::buffer(write_data, sizeof(write_data));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
- bool called = false;
+ 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,
@@ -1977,6 +3390,7 @@
   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,
@@ -1990,57 +3404,62 @@
   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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2049,294 +3468,325 @@
   ios.run();
   BOOST_CHECK(called);
   BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
-}
 
-void test_4_arg_mutable_buffers_1_async_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::mutable_buffers_1 buffers
- = boost::asio::buffer(mutable_write_data, 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(write_data), &called));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
 
   s.reset();
- bool called = false;
+ 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,
- sizeof(mutable_write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_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,
- sizeof(mutable_write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
- s.next_write_length(1);
+ 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,
- sizeof(mutable_write_data), &called));
+ 50, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 50));
 
   s.reset();
- s.next_write_length(1);
+ 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,
- sizeof(mutable_write_data), &called));
+ 50, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 50));
 
   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,
- sizeof(mutable_write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_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,
- sizeof(mutable_write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+
   s.reset();
- s.next_write_length(10);
+ 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,
- sizeof(mutable_write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
-}
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
 
-void test_4_arg_multi_buffers_async_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::array<boost::asio::const_buffer, 2> buffers = { {
- boost::asio::buffer(write_data, 32),
- boost::asio::buffer(write_data) + 32 } };
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
- bool called = false;
+ 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,
- sizeof(write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
- s.next_write_length(10);
+ 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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
- s.next_write_length(10);
+ 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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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,
- sizeof(write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
-}
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
-void test_5_arg_const_buffers_1_async_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::const_buffers_1 buffers
- = boost::asio::buffer(write_data, sizeof(write_data));
+ 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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
- bool called = false;
+ called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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_all(),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
- boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(1),
+ 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,
@@ -2348,8 +3798,7 @@
 
   s.reset();
   called = false;
- boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(1),
+ 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,
@@ -2362,63 +3811,58 @@
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(1),
+ 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,
- 1, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 1));
+ BOOST_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_at_least(1),
+ 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,
- 1, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 1));
+ BOOST_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_at_least(1),
+ 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,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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_at_least(1),
+ 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,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_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(10),
+ boost::asio::async_write_at(s, 0, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2430,8 +3874,7 @@
 
   s.reset();
   called = false;
- boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::async_write_at(s, 1234, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2444,305 +3887,313 @@
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::async_write_at(s, 0, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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_at_least(10),
+ boost::asio::async_write_at(s, 1234, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_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_at_least(10),
+ boost::asio::async_write_at(s, 0, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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_at_least(10),
+ boost::asio::async_write_at(s, 1234, buffers, short_transfer,
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ sizeof(write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+}
+
+void test_5_arg_mutable_buffers_1_async_write_at()
+{
+ boost::asio::io_service ios;
+ test_random_access_device s(ios);
+ boost::asio::mutable_buffers_1 buffers
+ = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
 
   s.reset();
- called = false;
+ bool called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(write_data), &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 42));
+ BOOST_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_at_least(42),
+ boost::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 42, &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 42));
+ BOOST_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_at_least(42),
+ boost::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_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_at_least(42),
+ boost::asio::transfer_all(),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
 
   s.reset();
   called = false;
- boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
+ 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));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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::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));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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::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));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
+ 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));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write_at(s, 0, buffers, old_style_transfer_all,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write_at(s, 1234, buffers, old_style_transfer_all,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   called = false;
- boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ 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));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_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::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));
+ sizeof(mutable_write_data), &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_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::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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(1);
   called = false;
- boost::asio::async_write_at(s, 1234, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write_at(s, 0, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   s.next_write_length(10);
   called = false;
- boost::asio::async_write_at(s, 1234, buffers, short_transfer,
+ 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));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(write_data)));
-}
-
-void test_5_arg_mutable_buffers_1_async_write_at()
-{
- boost::asio::io_service ios;
- test_random_access_device s(ios);
- boost::asio::mutable_buffers_1 buffers
- = boost::asio::buffer(mutable_write_data, sizeof(mutable_write_data));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 10));
 
   s.reset();
- bool called = false;
+ called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2755,7 +4206,7 @@
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_all(),
+ boost::asio::transfer_at_least(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2769,89 +4220,89 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_all(),
+ 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));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_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_all(),
+ 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));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_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_all(),
+ 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));
+ 50, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_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_all(),
+ 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));
+ 50, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 50));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_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_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2865,7 +4316,7 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2879,61 +4330,61 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 10));
+ BOOST_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_at_least(1),
+ boost::asio::transfer_exactly(1),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 10, &called));
+ 1, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 10));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 1));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 10));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 10, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_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_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2947,7 +4398,7 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2961,7 +4412,7 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2975,7 +4426,7 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(10),
+ boost::asio::transfer_exactly(10),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -2988,34 +4439,34 @@
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, sizeof(mutable_write_data)));
+ BOOST_CHECK(s.check_buffers(0, buffers, 42));
 
   s.reset();
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- sizeof(mutable_write_data), &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, sizeof(mutable_write_data)));
+ BOOST_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_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3029,7 +4480,7 @@
   s.next_write_length(1);
   called = false;
   boost::asio::async_write_at(s, 1234, buffers,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
@@ -3043,29 +4494,29 @@
   s.next_write_length(10);
   called = false;
   boost::asio::async_write_at(s, 0, buffers,
- boost::asio::transfer_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(0, buffers, 50));
+ BOOST_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_at_least(42),
+ boost::asio::transfer_exactly(42),
       boost::bind(async_write_handler,
         boost::asio::placeholders::error,
         boost::asio::placeholders::bytes_transferred,
- 50, &called));
+ 42, &called));
   ios.reset();
   ios.run();
   BOOST_CHECK(called);
- BOOST_CHECK(s.check_buffers(1234, buffers, 50));
+ BOOST_CHECK(s.check_buffers(1234, buffers, 42));
 
   s.reset();
   called = false;
@@ -3558,6 +5009,252 @@
 
   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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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));
+ ios.reset();
+ ios.run();
+ BOOST_CHECK(called);
+ BOOST_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,
@@ -3715,6 +5412,9 @@
   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_multi_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_multi_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_multi_buffers_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