|
Boost-Commit : |
From: troy_at_[hidden]
Date: 2008-07-03 10:40:35
Author: troy
Date: 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
New Revision: 47042
URL: http://svn.boost.org/trac/boost/changeset/47042
Log:
Merged revisions 47038 via svnmerge from
https://svn.boost.org/svn/boost/branches/release
................
r47038 | chris_kohlhoff | 2008-07-03 09:05:33 -0400 (Thu, 03 Jul 2008) | 50 lines
Merge bug and doc fixes from trunk.
........
r46535 | chris_kohlhoff | 2008-06-20 10:25:50 +1000 (Fri, 20 Jun 2008) | 2 lines
One more check needed for BSD serial port extensions.
........
r46766 | chris_kohlhoff | 2008-06-27 15:38:16 +1000 (Fri, 27 Jun 2008) | 2 lines
Add missing copyright notices.
........
r46876 | chris_kohlhoff | 2008-06-30 10:24:44 +1000 (Mon, 30 Jun 2008) | 2 lines
Some linux configurations do not automatically define _XOPEN_SOURCE.
........
r46944 | chris_kohlhoff | 2008-07-01 21:52:54 +1000 (Tue, 01 Jul 2008) | 2 lines
Fix documentation on behaviour when a connect operation fails.
........
r46945 | chris_kohlhoff | 2008-07-01 21:53:54 +1000 (Tue, 01 Jul 2008) | 2 lines
Fix name of parameter as referred to in documentation.
........
r46946 | chris_kohlhoff | 2008-07-01 21:58:39 +1000 (Tue, 01 Jul 2008) | 2 lines
Fix typos.
........
r46947 | chris_kohlhoff | 2008-07-01 21:59:25 +1000 (Tue, 01 Jul 2008) | 2 lines
Merge in new reference index page.
........
r46948 | chris_kohlhoff | 2008-07-01 22:06:49 +1000 (Tue, 01 Jul 2008) | 2 lines
Documentation generation enhancements.
........
r46949 | chris_kohlhoff | 2008-07-01 22:13:51 +1000 (Tue, 01 Jul 2008) | 2 lines
Improve buffer() documentation. Fix vector overloads to match TR2 proposal.
........
r46950 | chris_kohlhoff | 2008-07-01 22:14:57 +1000 (Tue, 01 Jul 2008) | 4 lines
Clarify behaviour of read_until/async_read_until with respect to leftover
data in the streambuf. Use separate brief descriptions for function groups.
Add some extra notes to the io_service documentation.
........
r47013 | chris_kohlhoff | 2008-07-03 08:50:50 +1000 (Thu, 03 Jul 2008) | 2 lines
Regenerate documentation.
........
................
Properties modified:
branches/CMake/release/ (props changed)
Text files modified:
branches/CMake/release/boost/asio/basic_socket.hpp | 6
branches/CMake/release/boost/asio/buffer.hpp | 232
branches/CMake/release/boost/asio/handler_alloc_hook.hpp | 2
branches/CMake/release/boost/asio/impl/serial_port_base.ipp | 2
branches/CMake/release/boost/asio/io_service.hpp | 32
branches/CMake/release/boost/asio/read.hpp | 6
branches/CMake/release/boost/asio/read_at.hpp | 6
branches/CMake/release/boost/asio/read_until.hpp | 127
branches/CMake/release/boost/asio/write.hpp | 5
branches/CMake/release/boost/asio/write_at.hpp | 5
branches/CMake/release/libs/asio/doc/asio.qbk | 2
branches/CMake/release/libs/asio/doc/quickref.xml | 524
branches/CMake/release/libs/asio/doc/reference.qbk | 51521 ++++++++++++++++++++++++++++-----------
branches/CMake/release/libs/asio/doc/reference.xsl | 79
branches/CMake/release/libs/asio/test/Jamfile.v2 | 2
15 files changed, 37484 insertions(+), 15067 deletions(-)
Modified: branches/CMake/release/boost/asio/basic_socket.hpp
==============================================================================
--- branches/CMake/release/boost/asio/basic_socket.hpp (original)
+++ branches/CMake/release/boost/asio/basic_socket.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -515,7 +515,7 @@
*
* The socket is automatically opened if it is not already open. If the
* connect fails, and the socket was automatically opened, the socket is
- * returned to the closed state.
+ * not returned to the closed state.
*
* @param peer_endpoint The remote endpoint to which the socket will be
* connected.
@@ -550,7 +550,7 @@
*
* The socket is automatically opened if it is not already open. If the
* connect fails, and the socket was automatically opened, the socket is
- * returned to the closed state.
+ * not returned to the closed state.
*
* @param peer_endpoint The remote endpoint to which the socket will be
* connected.
@@ -592,7 +592,7 @@
*
* The socket is automatically opened if it is not already open. If the
* connect fails, and the socket was automatically opened, the socket is
- * returned to the closed state.
+ * not returned to the closed state.
*
* @param peer_endpoint The remote endpoint to which the socket will be
* connected. Copies will be made of the endpoint object as required.
Modified: branches/CMake/release/boost/asio/buffer.hpp
==============================================================================
--- branches/CMake/release/boost/asio/buffer.hpp (original)
+++ branches/CMake/release/boost/asio/buffer.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -196,6 +196,12 @@
/// A random-access iterator type that may be used to read elements.
typedef const mutable_buffer* const_iterator;
+ /// Construct to represent a given memory range.
+ mutable_buffers_1(void* data, std::size_t size)
+ : mutable_buffer(data, size)
+ {
+ }
+
/// Construct to represent a single modifiable buffer.
explicit mutable_buffers_1(const mutable_buffer& b)
: mutable_buffer(b)
@@ -360,6 +366,12 @@
/// A random-access iterator type that may be used to read elements.
typedef const const_buffer* const_iterator;
+ /// Construct to represent a given memory range.
+ const_buffers_1(const void* data, std::size_t size)
+ : const_buffer(data, size)
+ {
+ }
+
/// Construct to represent a single non-modifiable buffer.
explicit const_buffers_1(const const_buffer& b)
: const_buffer(b)
@@ -443,12 +455,22 @@
/** @defgroup buffer boost::asio::buffer
*
* @brief The boost::asio::buffer function is used to create a buffer object to
- * represent raw memory, an array of POD elements, or a vector of POD elements.
+ * represent raw memory, an array of POD elements, a vector of POD elements,
+ * or a std::string.
+ *
+ * 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 <tt>{void*,
+ * size_t}</tt> specifies a mutable (modifiable) region of memory. Similarly, a
+ * tuple of the form <tt>{const void*, size_t}</tt> specifies a const
+ * (non-modifiable) region of memory. These two forms correspond to the classes
+ * mutable_buffer and const_buffer, respectively. To mirror C++'s conversion
+ * rules, a mutable_buffer is implicitly convertible to a const_buffer, and the
+ * opposite conversion is not permitted.
*
* The simplest use case involves reading or writing a single buffer of a
* specified size:
*
- * @code sock.write(boost::asio::buffer(data, size)); @endcode
+ * @code sock.send(boost::asio::buffer(data, size)); @endcode
*
* In the above example, the return value of boost::asio::buffer meets the
* requirements of the ConstBufferSequence concept so that it may be directly
@@ -460,13 +482,90 @@
* automatically determining the size of the buffer:
*
* @code char d1[128];
- * size_t bytes_transferred = sock.read(boost::asio::buffer(d1));
+ * size_t bytes_transferred = sock.receive(boost::asio::buffer(d1));
*
* std::vector<char> d2(128);
- * bytes_transferred = sock.read(boost::asio::buffer(d2));
+ * bytes_transferred = sock.receive(boost::asio::buffer(d2));
*
* boost::array<char, 128> d3;
- * bytes_transferred = sock.read(boost::asio::buffer(d3)); @endcode
+ * bytes_transferred = sock.receive(boost::asio::buffer(d3)); @endcode
+ *
+ * In all three cases above, the buffers created are exactly 128 bytes long.
+ * Note that a vector is @e never automatically resized when creating or using
+ * a buffer. The buffer size is determined using the vector's <tt>size()</tt>
+ * member function, and not its capacity.
+ *
+ * @par Accessing Buffer Contents
+ *
+ * The contents of a buffer may be accessed using the boost::asio::buffer_size
+ * and boost::asio::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);
+ *
+ * boost::asio::const_buffer b2 = ...;
+ * std::size_t s2 = boost::asio::buffer_size(b2);
+ * const void* p2 = boost::asio::buffer_cast<const void*>(b2); @endcode
+ *
+ * The boost::asio::buffer_cast function permits violations of type safety, so
+ * uses of it in application code should be carefully considered.
+ *
+ * @par Buffer Invalidation
+ *
+ * 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)
+ *
+ * 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).
+ *
+ * @par Buffer Arithmetic
+ *
+ * Buffer objects may be manipulated using simple arithmetic in a safe way
+ * which helps prevent buffer overruns. Consider an array initialised as
+ * follows:
+ *
+ * @code boost::array<char, 6> a = { 'a', 'b', 'c', 'd', 'e' }; @endcode
+ *
+ * A buffer object @c b1 created using:
+ *
+ * @code b1 = boost::asio::buffer(a); @endcode
+ *
+ * represents the entire array, <tt>{ 'a', 'b', 'c', 'd', 'e' }</tt>. An
+ * optional second argument to the boost::asio::buffer function may be used to
+ * limit the size, in bytes, of the buffer:
+ *
+ * @code b2 = boost::asio::buffer(a, 3); @endcode
+ *
+ * such that @c b2 represents the data <tt>{ 'a', 'b', 'c' }</tt>. 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:
+ *
+ * @code b3 = b1 + 2; @endcode
+ *
+ * where @c b3 will set to represent <tt>{ 'c', 'd', 'e' }</tt>. If the offset
+ * exceeds the size of the existing buffer, the newly created buffer will be
+ * empty.
+ *
+ * Both an offset and size may be specified to create a buffer that corresponds
+ * to a specific range of bytes within an existing buffer:
+ *
+ * @code b4 = boost::asio::buffer(b1 + 1, 3); @endcode
+ *
+ * so that @c b4 will refer to the bytes <tt>{ 'b', 'c', 'd' }</tt>.
+ *
+ * @par Buffers and Scatter-Gather I/O
*
* 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
@@ -481,23 +580,32 @@
* boost::asio::buffer(d1),
* boost::asio::buffer(d2),
* boost::asio::buffer(d3) };
- * bytes_transferred = sock.read(bufs1);
+ * 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.write(bufs2); @endcode
+ * bytes_transferred = sock.send(bufs2); @endcode
*/
/*@{*/
/// Create a new modifiable buffer from an existing buffer.
+/**
+ * @returns <tt>mutable_buffers_1(b)</tt>.
+ */
inline mutable_buffers_1 buffer(const mutable_buffer& b)
{
return mutable_buffers_1(b);
}
/// Create a new modifiable buffer from an existing buffer.
+/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * buffer_cast<void*>(b),
+ * min(buffer_size(b), max_size_in_bytes)); @endcode
+ */
inline mutable_buffers_1 buffer(const mutable_buffer& b,
std::size_t max_size_in_bytes)
{
@@ -512,12 +620,21 @@
}
/// Create a new non-modifiable buffer from an existing buffer.
+/**
+ * @returns <tt>const_buffers_1(b)</tt>.
+ */
inline const_buffers_1 buffer(const const_buffer& b)
{
return const_buffers_1(b);
}
/// Create a new non-modifiable buffer from an existing buffer.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * buffer_cast<const void*>(b),
+ * min(buffer_size(b), max_size_in_bytes)); @endcode
+ */
inline const_buffers_1 buffer(const const_buffer& b,
std::size_t max_size_in_bytes)
{
@@ -532,12 +649,18 @@
}
/// Create a new modifiable buffer that represents the given memory range.
+/**
+ * @returns <tt>mutable_buffers_1(data, size_in_bytes)</tt>.
+ */
inline mutable_buffers_1 buffer(void* data, std::size_t size_in_bytes)
{
return mutable_buffers_1(mutable_buffer(data, size_in_bytes));
}
/// Create a new non-modifiable buffer that represents the given memory range.
+/**
+ * @returns <tt>const_buffers_1(data, size_in_bytes)</tt>.
+ */
inline const_buffers_1 buffer(const void* data,
std::size_t size_in_bytes)
{
@@ -545,6 +668,12 @@
}
/// Create a new modifiable buffer that represents the given POD array.
+/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * static_cast<void*>(data),
+ * N * sizeof(PodType)); @endcode
+ */
template <typename PodType, std::size_t N>
inline mutable_buffers_1 buffer(PodType (&data)[N])
{
@@ -552,6 +681,12 @@
}
/// Create a new modifiable buffer that represents the given POD array.
+/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * static_cast<void*>(data),
+ * min(N * sizeof(PodType), max_size_in_bytes)); @endcode
+ */
template <typename PodType, std::size_t N>
inline mutable_buffers_1 buffer(PodType (&data)[N],
std::size_t max_size_in_bytes)
@@ -563,6 +698,12 @@
}
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * static_cast<const void*>(data),
+ * N * sizeof(PodType)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(const PodType (&data)[N])
{
@@ -570,6 +711,12 @@
}
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * static_cast<const void*>(data),
+ * min(N * sizeof(PodType), max_size_in_bytes)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(const PodType (&data)[N],
std::size_t max_size_in_bytes)
@@ -652,6 +799,12 @@
// || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
/// Create a new modifiable buffer that represents the given POD array.
+/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * data.data(),
+ * data.size() * sizeof(PodType)); @endcode
+ */
template <typename PodType, std::size_t N>
inline mutable_buffers_1 buffer(boost::array<PodType, N>& data)
{
@@ -660,6 +813,12 @@
}
/// Create a new modifiable buffer that represents the given POD array.
+/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * data.data(),
+ * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
+ */
template <typename PodType, std::size_t N>
inline mutable_buffers_1 buffer(boost::array<PodType, N>& data,
std::size_t max_size_in_bytes)
@@ -671,6 +830,12 @@
}
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.data(),
+ * data.size() * sizeof(PodType)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(boost::array<const PodType, N>& data)
{
@@ -679,6 +844,12 @@
}
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.data(),
+ * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(boost::array<const PodType, N>& data,
std::size_t max_size_in_bytes)
@@ -693,6 +864,12 @@
// || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.data(),
+ * data.size() * sizeof(PodType)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(const boost::array<PodType, N>& data)
{
@@ -701,6 +878,12 @@
}
/// Create a new non-modifiable buffer that represents the given POD array.
+/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.data(),
+ * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
+ */
template <typename PodType, std::size_t N>
inline const_buffers_1 buffer(const boost::array<PodType, N>& data,
std::size_t max_size_in_bytes)
@@ -713,6 +896,11 @@
/// Create a new modifiable buffer that represents the given POD vector.
/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * data.size() ? &data[0] : 0,
+ * data.size() * sizeof(PodType)); @endcode
+ *
* @note The buffer is invalidated by any vector operation that would also
* invalidate iterators.
*/
@@ -720,7 +908,7 @@
inline mutable_buffers_1 buffer(std::vector<PodType, Allocator>& data)
{
return mutable_buffers_1(
- mutable_buffer(&data[0], data.size() * sizeof(PodType)
+ mutable_buffer(data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
, detail::buffer_debug_check<
typename std::vector<PodType, Allocator>::iterator
@@ -731,6 +919,11 @@
/// Create a new modifiable buffer that represents the given POD vector.
/**
+ * @returns A mutable_buffers_1 value equivalent to:
+ * @code mutable_buffers_1(
+ * data.size() ? &data[0] : 0,
+ * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
+ *
* @note The buffer is invalidated by any vector operation that would also
* invalidate iterators.
*/
@@ -739,7 +932,7 @@
std::size_t max_size_in_bytes)
{
return mutable_buffers_1(
- mutable_buffer(&data[0],
+ mutable_buffer(data.size() ? &data[0] : 0,
data.size() * sizeof(PodType) < max_size_in_bytes
? data.size() * sizeof(PodType) : max_size_in_bytes
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -752,6 +945,11 @@
/// Create a new non-modifiable buffer that represents the given POD vector.
/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.size() ? &data[0] : 0,
+ * data.size() * sizeof(PodType)); @endcode
+ *
* @note The buffer is invalidated by any vector operation that would also
* invalidate iterators.
*/
@@ -760,7 +958,7 @@
const std::vector<PodType, Allocator>& data)
{
return const_buffers_1(
- const_buffer(&data[0], data.size() * sizeof(PodType)
+ const_buffer(data.size() ? &data[0] : 0, data.size() * sizeof(PodType)
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
, detail::buffer_debug_check<
typename std::vector<PodType, Allocator>::const_iterator
@@ -771,6 +969,11 @@
/// Create a new non-modifiable buffer that represents the given POD vector.
/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.size() ? &data[0] : 0,
+ * min(data.size() * sizeof(PodType), max_size_in_bytes)); @endcode
+ *
* @note The buffer is invalidated by any vector operation that would also
* invalidate iterators.
*/
@@ -779,7 +982,7 @@
const std::vector<PodType, Allocator>& data, std::size_t max_size_in_bytes)
{
return const_buffers_1(
- const_buffer(&data[0],
+ const_buffer(data.size() ? &data[0] : 0,
data.size() * sizeof(PodType) < max_size_in_bytes
? data.size() * sizeof(PodType) : max_size_in_bytes
#if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
@@ -792,6 +995,8 @@
/// Create a new non-modifiable buffer that represents the given string.
/**
+ * @returns <tt>const_buffers_1(data.data(), data.size())</tt>.
+ *
* @note The buffer is invalidated by any non-const operation called on the
* given string object.
*/
@@ -806,6 +1011,11 @@
/// Create a new non-modifiable buffer that represents the given string.
/**
+ * @returns A const_buffers_1 value equivalent to:
+ * @code const_buffers_1(
+ * data.data(),
+ * min(data.size(), max_size_in_bytes)); @endcode
+ *
* @note The buffer is invalidated by any non-const operation called on the
* given string object.
*/
Modified: branches/CMake/release/boost/asio/handler_alloc_hook.hpp
==============================================================================
--- branches/CMake/release/boost/asio/handler_alloc_hook.hpp (original)
+++ branches/CMake/release/boost/asio/handler_alloc_hook.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -36,7 +36,7 @@
*
* This default implementation is simply:
* @code
- * return ::operator new(bytes);
+ * return ::operator new(size);
* @endcode
*
* @note All temporary objects associated with a handler will be deallocated
Modified: branches/CMake/release/boost/asio/impl/serial_port_base.ipp
==============================================================================
--- branches/CMake/release/boost/asio/impl/serial_port_base.ipp (original)
+++ branches/CMake/release/boost/asio/impl/serial_port_base.ipp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -295,10 +295,12 @@
{
value_ = software;
}
+# if defined(_BSD_SOURCE)
else if (storage.c_cflag & CRTSCTS)
{
value_ = hardware;
}
+# endif
else
{
value_ = none;
Modified: branches/CMake/release/boost/asio/io_service.hpp
==============================================================================
--- branches/CMake/release/boost/asio/io_service.hpp (original)
+++ branches/CMake/release/boost/asio/io_service.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -101,6 +101,32 @@
* }
* }
* @endcode
+ *
+ * @par Stopping the io_service from running out of work
+ *
+ * Some applications may need to prevent an io_service's run() call from
+ * returning when there is no more work to do. For example, the 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 boost::asio::io_service::work:
+ *
+ * @code boost::asio::io_service io_service;
+ * boost::asio::io_service::work work(io_service);
+ * ... @endcode
+ *
+ * To effect a shutdown, the application will then need to call the io_service's
+ * stop() member function. This will cause the 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.
+ *
+ * @code 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. @endcode
*/
class io_service
: private noncopyable
@@ -160,6 +186,9 @@
* @return The number of handlers that were executed.
*
* @throws boost::system::system_error Thrown on failure.
+ *
+ * @note The poll() function may also be used to dispatch ready handlers,
+ * but without blocking.
*/
std::size_t run();
@@ -179,6 +208,9 @@
* @param ec Set to indicate what error occurred, if any.
*
* @return The number of handlers that were executed.
+ *
+ * @note The poll() function may also be used to dispatch ready handlers,
+ * but without blocking.
*/
std::size_t run(boost::system::error_code& ec);
Modified: branches/CMake/release/boost/asio/read.hpp
==============================================================================
--- branches/CMake/release/boost/asio/read.hpp (original)
+++ branches/CMake/release/boost/asio/read.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -30,6 +30,9 @@
/**
* @defgroup read boost::asio::read
+ *
+ * @brief Attempt to read a certain amount of data from a stream before
+ * returning.
*/
/*@{*/
@@ -270,6 +273,9 @@
/*@}*/
/**
* @defgroup async_read boost::asio::async_read
+ *
+ * @brief Start an asynchronous operation to read a certain amount of data from
+ * a stream.
*/
/*@{*/
Modified: branches/CMake/release/boost/asio/read_at.hpp
==============================================================================
--- branches/CMake/release/boost/asio/read_at.hpp (original)
+++ branches/CMake/release/boost/asio/read_at.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -31,6 +31,9 @@
/**
* @defgroup read_at boost::asio::read_at
+ *
+ * @brief Attempt to read a certain amount of data at the specified offset
+ * before returning.
*/
/*@{*/
@@ -305,6 +308,9 @@
/*@}*/
/**
* @defgroup async_read_at boost::asio::async_read_at
+ *
+ * @brief Start an asynchronous operation to read a certain amount of data at
+ * the specified offset.
*/
/*@{*/
Modified: branches/CMake/release/boost/asio/read_until.hpp
==============================================================================
--- branches/CMake/release/boost/asio/read_until.hpp (original)
+++ branches/CMake/release/boost/asio/read_until.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -65,10 +65,13 @@
/**
* @defgroup read_until boost::asio::read_until
+ *
+ * @brief Read data into a streambuf until it contains a delimiter, matches a
+ * regular expression, or a function object indicates a match.
*/
/*@{*/
-/// Read data into a streambuf until a delimiter is encountered.
+/// Read data into a streambuf until it contains a specified delimiter.
/**
* 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
@@ -94,6 +97,10 @@
*
* @throws boost::system::system_error Thrown on failure.
*
+ * @note 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.
+ *
* @par Example
* To read data into a streambuf until a newline is encountered:
* @code boost::asio::streambuf b;
@@ -106,7 +113,7 @@
std::size_t read_until(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, char delim);
-/// Read data into a streambuf until a delimiter is encountered.
+/// Read data into a streambuf until it contains a specified delimiter.
/**
* 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
@@ -131,13 +138,17 @@
*
* @returns The number of bytes in the streambuf's get area up to and including
* the delimiter. Returns 0 if an error occurred.
+ *
+ * @note 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.
*/
template <typename SyncReadStream, typename Allocator>
std::size_t read_until(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, char delim,
boost::system::error_code& ec);
-/// Read data into a streambuf until a delimiter is encountered.
+/// Read data into a streambuf until it contains a specified delimiter.
/**
* 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
@@ -163,6 +174,10 @@
*
* @throws boost::system::system_error Thrown on failure.
*
+ * @note 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.
+ *
* @par Example
* To read data into a streambuf until a newline is encountered:
* @code boost::asio::streambuf b;
@@ -175,7 +190,7 @@
std::size_t read_until(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, const std::string& delim);
-/// Read data into a streambuf until a delimiter is encountered.
+/// Read data into a streambuf until it contains a specified delimiter.
/**
* 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
@@ -200,13 +215,18 @@
*
* @returns The number of bytes in the streambuf's get area up to and including
* the delimiter. Returns 0 if an error occurred.
+ *
+ * @note 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.
*/
template <typename 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);
-/// Read data into a streambuf until a regular expression is located.
+/// Read data into a streambuf until some part of the data it contains matches
+/// a regular expression.
/**
* 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.
@@ -232,6 +252,11 @@
*
* @throws boost::system::system_error Thrown on failure.
*
+ * @note 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.
+ *
* @par Example
* To read data into a streambuf until a CR-LF sequence is encountered:
* @code boost::asio::streambuf b;
@@ -244,7 +269,8 @@
std::size_t read_until(SyncReadStream& s,
boost::asio::basic_streambuf<Allocator>& b, const boost::regex& expr);
-/// Read data into a streambuf until a regular expression is located.
+/// Read data into a streambuf until some part of the data it contains matches
+/// a regular expression.
/**
* 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.
@@ -270,6 +296,11 @@
* @returns 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.
+ *
+ * @note 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.
*/
template <typename SyncReadStream, typename Allocator>
std::size_t read_until(SyncReadStream& s,
@@ -317,6 +348,10 @@
*
* @throws boost::system::system_error Thrown on failure.
*
+ * @note 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
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
@@ -417,6 +452,10 @@
* @returns 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.
*
+ * @note 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
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
@@ -430,12 +469,16 @@
/*@}*/
/**
-* @defgroup async_read_until boost::asio::async_read_until
-*/
+ * @defgroup async_read_until boost::asio::async_read_until
+ *
+ * @brief Start an asynchronous operation to read data into a streambuf until it
+ * contains a delimiter, matches a regular expression, or a function object
+ * indicates a match.
+ */
/*@{*/
-/// Start an asynchronous operation to read data into a streambuf until a
-/// delimiter is encountered.
+/// Start an asynchronous operation to read data into a streambuf until it
+/// contains a specified delimiter.
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains the specified delimiter.
@@ -463,18 +506,24 @@
* 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.
+ * // Result of operation.
+ * const boost::system::error_code& error,
*
- * std::size_t bytes_transferred // The number of bytes in the
- * // streambuf's get area up to
- * // and including the delimiter.
- * // 0 if an error occurred.
+ * // The number of bytes in the streambuf's get
+ * // area up to and including the delimiter.
+ * // 0 if an error occurred.
+ * std::size_t bytes_transferred
* ); @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 After a successful async_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 async_read_until operation
+ * to examine.
+ *
* @par Example
* To asynchronously read data into a streambuf until a newline is encountered:
* @code boost::asio::streambuf b;
@@ -497,8 +546,8 @@
boost::asio::basic_streambuf<Allocator>& b,
char delim, ReadHandler handler);
-/// Start an asynchronous operation to read data into a streambuf until a
-/// delimiter is encountered.
+/// Start an asynchronous operation to read data into a streambuf until it
+/// contains a specified delimiter.
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains the specified delimiter.
@@ -526,18 +575,24 @@
* 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.
+ * // Result of operation.
+ * const boost::system::error_code& error,
*
- * std::size_t bytes_transferred // The number of bytes in the
- * // streambuf's get area up to
- * // and including the delimiter.
- * // 0 if an error occurred.
+ * // The number of bytes in the streambuf's get
+ * // area up to and including the delimiter.
+ * // 0 if an error occurred.
+ * std::size_t bytes_transferred
* ); @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 After a successful async_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 async_read_until operation
+ * to examine.
+ *
* @par Example
* To asynchronously read data into a streambuf until a newline is encountered:
* @code boost::asio::streambuf b;
@@ -560,8 +615,8 @@
boost::asio::basic_streambuf<Allocator>& b, const std::string& delim,
ReadHandler handler);
-/// Start an asynchronous operation to read data into a streambuf until a
-/// regular expression is located.
+/// Start an asynchronous operation to read data into a streambuf until some
+/// part of its data matches a regular expression.
/**
* This function is used to asynchronously read data into the specified
* streambuf until the streambuf's get area contains some data that matches a
@@ -590,20 +645,25 @@
* 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.
+ * // Result of operation.
+ * const boost::system::error_code& error,
*
- * std::size_t bytes_transferred // The number of bytes in the
- * // streambuf's get area up to
- * // and including the substring
- * // that matches the regular.
- * // expression. 0 if an error
- * // occurred.
+ * // The number of bytes in the streambuf's get
+ * // area up to and including the substring
+ * // that matches the regular. expression.
+ * // 0 if an error occurred.
+ * std::size_t bytes_transferred
* ); @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 After a successful async_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
+ * async_read_until operation to examine.
+ *
* @par Example
* To asynchronously read data into a streambuf until a CR-LF sequence is
* encountered:
@@ -682,6 +742,11 @@
* the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
+ * @note After a successful async_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
+ * async_read_until operation to examine.
+ *
* @note The default implementation of the @c is_match_condition type trait
* evaluates to true for function pointers and function objects with a
* @c result_type typedef. It must be specialised for other user-defined
Modified: branches/CMake/release/boost/asio/write.hpp
==============================================================================
--- branches/CMake/release/boost/asio/write.hpp (original)
+++ branches/CMake/release/boost/asio/write.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -30,6 +30,8 @@
/**
* @defgroup write boost::asio::write
+ *
+ * @brief Write a certain amount of data to a stream before returning.
*/
/*@{*/
@@ -280,6 +282,9 @@
/*@}*/
/**
* @defgroup async_write boost::asio::async_write
+ *
+ * @brief Start an asynchronous operation to write a certain amount of data to a
+ * stream.
*/
/*@{*/
Modified: branches/CMake/release/boost/asio/write_at.hpp
==============================================================================
--- branches/CMake/release/boost/asio/write_at.hpp (original)
+++ branches/CMake/release/boost/asio/write_at.hpp 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -31,6 +31,8 @@
/**
* @defgroup write_at boost::asio::write_at
+ *
+ * @brief Write a certain amount of data at a specified offset before returning.
*/
/*@{*/
@@ -304,6 +306,9 @@
/*@}*/
/**
* @defgroup async_write_at boost::asio::async_write_at
+ *
+ * @brief Start an asynchronous operation to write a certain amount of data at
+ * the specified offset.
*/
/*@{*/
Modified: branches/CMake/release/libs/asio/doc/asio.qbk
==============================================================================
--- branches/CMake/release/libs/asio/doc/asio.qbk (original)
+++ branches/CMake/release/libs/asio/doc/asio.qbk 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -20,6 +20,8 @@
]
[template mdash[] '''— ''']
+[template indexterm1[term1] '''<indexterm><primary>'''[term1]'''</primary></indexterm>''']
+[template indexterm2[term1 term2] '''<indexterm><primary>'''[term1]'''</primary><secondary>'''[term2]'''</secondary></indexterm>''']
[def __POSIX__ /POSIX/]
[def __Windows__ /Windows/]
[def __accept__ [@http://www.opengroup.org/onlinepubs/000095399/functions/accept.html `accept()`]]
Modified: branches/CMake/release/libs/asio/doc/quickref.xml
==============================================================================
--- branches/CMake/release/libs/asio/doc/quickref.xml (original)
+++ branches/CMake/release/libs/asio/doc/quickref.xml 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -10,151 +10,409 @@
<informaltable frame="all">
<tgroup cols="4">
+ <colspec colname="a"/>
+ <colspec colname="b"/>
+ <colspec colname="c"/>
+ <colspec colname="d"/>
+ <thead>
+ <row>
+ <entry valign="center" namest="a" nameend="d">
+ <bridgehead renderas="sect2">Core</bridgehead>
+ </entry>
+ </row>
+ </thead>
<tbody>
<row>
<entry valign="top">
<bridgehead renderas="sect3">Classes</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.const_buffer">const_buffer</link></listitem>
- <listitem><link linkend="boost_asio.reference.const_buffers_1">const_buffers_1</link></listitem>
- <listitem><link linkend="boost_asio.reference.deadline_timer">deadline_timer</link></listitem>
- <listitem><link linkend="boost_asio.reference.io_service">io_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.io_service__id">io_service::id</link></listitem>
- <listitem><link linkend="boost_asio.reference.io_service__service">io_service::service</link></listitem>
- <listitem><link linkend="boost_asio.reference.io_service__strand">io_service::strand</link></listitem>
- <listitem><link linkend="boost_asio.reference.io_service__work">io_service::work</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__address">ip::address</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__address_v4">ip::address_v4</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__address_v6">ip::address_v6</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__resolver_query_base">ip::resolver_query_base</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp">ip::tcp</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp.acceptor">ip::tcp::acceptor</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp.endpoint">ip::tcp::endpoint</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp.iostream">ip::tcp::iostream</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp.resolver">ip::tcp::resolver</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__tcp.socket">ip::tcp::socket</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__udp">ip::udp</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__udp.endpoint">ip::udp::endpoint</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__udp.resolver">ip::udp::resolver</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__udp.socket">ip::udp::socket</link></listitem>
- <listitem><link linkend="boost_asio.reference.mutable_buffer">mutable_buffer</link></listitem>
- <listitem><link linkend="boost_asio.reference.mutable_buffers_1">mutable_buffers_1</link></listitem>
- <listitem><link linkend="boost_asio.reference.socket_base">socket_base</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__context">ssl::context</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__context_base">ssl::context_base</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__stream_base">ssl::stream_base</link></listitem>
- <listitem><link linkend="boost_asio.reference.streambuf">streambuf</link></listitem>
- </itemizedlist>
- </entry>
- <entry valign="top">
- <bridgehead renderas="sect3">Class Templates</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.basic_datagram_socket">basic_datagram_socket</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_deadline_timer">basic_deadline_timer</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_io_object">basic_io_object</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_socket">basic_socket</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_socket_acceptor">basic_socket_acceptor</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_socket_iostream">basic_socket_iostream</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_socket_streambuf">basic_socket_streambuf</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_stream_socket">basic_stream_socket</link></listitem>
- <listitem><link linkend="boost_asio.reference.basic_streambuf">basic_streambuf</link></listitem>
- <listitem><link linkend="boost_asio.reference.buffered_read_stream">buffered_read_stream</link></listitem>
- <listitem><link linkend="boost_asio.reference.buffered_stream">buffered_stream</link></listitem>
- <listitem><link linkend="boost_asio.reference.buffered_write_stream">buffered_write_stream</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__basic_endpoint">ip::basic_endpoint</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__basic_resolver">ip::basic_resolver</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__basic_resolver_entry">ip::basic_resolver_entry</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__basic_resolver_iterator">ip::basic_resolver_iterator</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__basic_resolver_query">ip::basic_resolver_query</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__basic_context">ssl::basic_context</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__stream">ssl::stream</link></listitem>
- </itemizedlist>
- <bridgehead renderas="sect3">Services</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.datagram_socket_service">datagram_socket_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.deadline_timer_service">deadline_timer_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__resolver_service">ip::resolver_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.socket_acceptor_service">socket_acceptor_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__context_service">ssl::context_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.ssl__stream_service">ssl::stream_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.stream_socket_service">stream_socket_service</link></listitem>
- </itemizedlist>
- <bridgehead renderas="sect3">Placeholders</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.placeholders__bytes_transferred">placeholders::bytes_transferred</link></listitem>
- <listitem><link linkend="boost_asio.reference.placeholders__error">placeholders::error</link></listitem>
- <listitem><link linkend="boost_asio.reference.placeholders__iterator">placeholders::iterator</link></listitem>
- </itemizedlist>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.const_buffer">const_buffer</link></member>
+ <member><link linkend="boost_asio.reference.const_buffers_1">const_buffers_1</link></member>
+ <member><link linkend="boost_asio.reference.invalid_service_owner">invalid_service_owner</link></member>
+ <member><link linkend="boost_asio.reference.io_service">io_service</link></member>
+ <member><link linkend="boost_asio.reference.io_service__id">io_service::id</link></member>
+ <member><link linkend="boost_asio.reference.io_service__service">io_service::service</link></member>
+ <member><link linkend="boost_asio.reference.io_service__strand">io_service::strand</link></member>
+ <member><link linkend="boost_asio.reference.io_service__work">io_service::work</link></member>
+ <member><link linkend="boost_asio.reference.mutable_buffer">mutable_buffer</link></member>
+ <member><link linkend="boost_asio.reference.mutable_buffers_1">mutable_buffers_1</link></member>
+ <member><link linkend="boost_asio.reference.null_buffers">null_buffers</link></member>
+ <member><link linkend="boost_asio.reference.service_already_exists">service_already_exists</link></member>
+ <member><link linkend="boost_asio.reference.streambuf">streambuf</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.basic_io_object">basic_io_object</link></member>
+ <member><link linkend="boost_asio.reference.basic_streambuf">basic_streambuf</link></member>
+ <member><link linkend="boost_asio.reference.buffered_read_stream">buffered_read_stream</link></member>
+ <member><link linkend="boost_asio.reference.buffered_stream">buffered_stream</link></member>
+ <member><link linkend="boost_asio.reference.buffered_write_stream">buffered_write_stream</link></member>
+ <member><link linkend="boost_asio.reference.buffers_iterator">buffers_iterator</link></member>
+ </simplelist>
</entry>
<entry valign="top">
<bridgehead renderas="sect3">Free Functions</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.add_service">add_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.asio_handler_allocate">asio_handler_allocate</link></listitem>
- <listitem><link linkend="boost_asio.reference.asio_handler_deallocate">asio_handler_deallocate</link></listitem>
- <listitem><link linkend="boost_asio.reference.asio_handler_invoke">asio_handler_invoke</link></listitem>
- <listitem><link linkend="boost_asio.reference.async_read">async_read</link></listitem>
- <listitem><link linkend="boost_asio.reference.async_read_until">async_read_until</link></listitem>
- <listitem><link linkend="boost_asio.reference.async_write">async_write</link></listitem>
- <listitem><link linkend="boost_asio.reference.buffer">buffer</link></listitem>
- <listitem><link linkend="boost_asio.reference.has_service">has_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.ip__host_name">ip::host_name</link></listitem>
- <listitem><link linkend="boost_asio.reference.read">read</link></listitem>
- <listitem><link linkend="boost_asio.reference.read_until">read_until</link></listitem>
- <listitem><link linkend="boost_asio.reference.transfer_all">transfer_all</link></listitem>
- <listitem><link linkend="boost_asio.reference.transfer_at_least">transfer_at_least</link></listitem>
- <listitem><link linkend="boost_asio.reference.use_service">use_service</link></listitem>
- <listitem><link linkend="boost_asio.reference.write">write</link></listitem>
- </itemizedlist>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.add_service">add_service</link></member>
+ <member><link linkend="boost_asio.reference.asio_handler_allocate">asio_handler_allocate</link></member>
+ <member><link linkend="boost_asio.reference.asio_handler_deallocate">asio_handler_deallocate</link></member>
+ <member><link linkend="boost_asio.reference.asio_handler_invoke">asio_handler_invoke</link></member>
+ <member><link linkend="boost_asio.reference.async_read">async_read</link></member>
+ <member><link linkend="boost_asio.reference.async_read_at">async_read_at</link></member>
+ <member><link linkend="boost_asio.reference.async_read_until">async_read_until</link></member>
+ <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.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>
+ <member><link linkend="boost_asio.reference.read">read</link></member>
+ <member><link linkend="boost_asio.reference.read_at">read_at</link></member>
+ <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.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>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Placeholders</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.placeholders__bytes_transferred">placeholders::bytes_transferred</link></member>
+ <member><link linkend="boost_asio.reference.placeholders__error">placeholders::error</link></member>
+ <member><link linkend="boost_asio.reference.placeholders__iterator">placeholders::iterator</link></member>
+ </simplelist>
<bridgehead renderas="sect3">Error Codes</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.error__basic_errors">error::basic_errors</link></listitem>
- <listitem><link linkend="boost_asio.reference.error__netdb_errors">error::netdb_errors</link></listitem>
- <listitem><link linkend="boost_asio.reference.error__addrinfo_errors">error::addrinfo_errors</link></listitem>
- <listitem><link linkend="boost_asio.reference.error__misc_errors">error::misc_errors</link></listitem>
- </itemizedlist>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.error__basic_errors">error::basic_errors</link></member>
+ <member><link linkend="boost_asio.reference.error__netdb_errors">error::netdb_errors</link></member>
+ <member><link linkend="boost_asio.reference.error__addrinfo_errors">error::addrinfo_errors</link></member>
+ <member><link linkend="boost_asio.reference.error__misc_errors">error::misc_errors</link></member>
+ </simplelist>
<bridgehead renderas="sect3">Type Traits</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.is_read_buffered">is_read_buffered</link></listitem>
- <listitem><link linkend="boost_asio.reference.is_write_buffered">is_write_buffered</link></listitem>
- </itemizedlist>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.is_match_condition">is_match_condition</link></member>
+ <member><link linkend="boost_asio.reference.is_read_buffered">is_read_buffered</link></member>
+ <member><link linkend="boost_asio.reference.is_write_buffered">is_write_buffered</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Type Requirements</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.asynchronous_operations">Asynchronous operations</link></member>
+ <member><link linkend="boost_asio.reference.AsyncRandomAccessReadDevice">AsyncRandomAccessReadDevice</link></member>
+ <member><link linkend="boost_asio.reference.AsyncRandomAccessWriteDevice">AsyncRandomAccessWriteDevice</link></member>
+ <member><link linkend="boost_asio.reference.AsyncReadStream">AsyncReadStream</link></member>
+ <member><link linkend="boost_asio.reference.AsyncWriteStream">AsyncWriteStream</link></member>
+ <member><link linkend="boost_asio.reference.CompletionHandler">CompletionHandler</link></member>
+ <member><link linkend="boost_asio.reference.ConstBufferSequence">ConstBufferSequence</link></member>
+ <member><link linkend="boost_asio.reference.ConvertibleToConstBuffer">ConvertibleToConstBuffer</link></member>
+ <member><link linkend="boost_asio.reference.ConvertibleToMutableBuffer">ConvertibleToMutableBuffer</link></member>
+ <member><link linkend="boost_asio.reference.Handler">Handler</link></member>
+ <member><link linkend="boost_asio.reference.IoObjectService">IoObjectService</link></member>
+ <member><link linkend="boost_asio.reference.MutableBufferSequence">MutableBufferSequence</link></member>
+ <member><link linkend="boost_asio.reference.ReadHandler">ReadHandler</link></member>
+ <member><link linkend="boost_asio.reference.Service">Service</link></member>
+ <member><link linkend="boost_asio.reference.SyncRandomAccessReadDevice">SyncRandomAccessReadDevice</link></member>
+ <member><link linkend="boost_asio.reference.SyncRandomAccessWriteDevice">SyncRandomAccessWriteDevice</link></member>
+ <member><link linkend="boost_asio.reference.SyncReadStream">SyncReadStream</link></member>
+ <member><link linkend="boost_asio.reference.SyncWriteStream">SyncWriteStream</link></member>
+ <member><link linkend="boost_asio.reference.WriteHandler">WriteHandler</link></member>
+ </simplelist>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ <tgroup cols="4">
+ <colspec colname="a"/>
+ <colspec colname="b"/>
+ <colspec colname="c"/>
+ <colspec colname="d"/>
+ <thead>
+ <row>
+ <entry valign="center" namest="a" nameend="d">
+ <bridgehead renderas="sect2">Networking</bridgehead>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ip__address">ip::address</link></member>
+ <member><link linkend="boost_asio.reference.ip__address_v4">ip::address_v4</link></member>
+ <member><link linkend="boost_asio.reference.ip__address_v6">ip::address_v6</link></member>
+ <member><link linkend="boost_asio.reference.ip__icmp">ip::icmp</link></member>
+ <member><link linkend="boost_asio.reference.ip__icmp.endpoint">ip::icmp::endpoint</link></member>
+ <member><link linkend="boost_asio.reference.ip__icmp.resolver">ip::icmp::resolver</link></member>
+ <member><link linkend="boost_asio.reference.ip__icmp.socket">ip::icmp::socket</link></member>
+ <member><link linkend="boost_asio.reference.ip__resolver_query_base">ip::resolver_query_base</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp">ip::tcp</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.acceptor">ip::tcp::acceptor</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.endpoint">ip::tcp::endpoint</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.iostream">ip::tcp::iostream</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.resolver">ip::tcp::resolver</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.socket">ip::tcp::socket</link></member>
+ <member><link linkend="boost_asio.reference.ip__udp">ip::udp</link></member>
+ <member><link linkend="boost_asio.reference.ip__udp.endpoint">ip::udp::endpoint</link></member>
+ <member><link linkend="boost_asio.reference.ip__udp.resolver">ip::udp::resolver</link></member>
+ <member><link linkend="boost_asio.reference.ip__udp.socket">ip::udp::socket</link></member>
+ <member><link linkend="boost_asio.reference.socket_base">socket_base</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Free Functions</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ip__host_name">ip::host_name</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <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_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>
+ <member><link linkend="boost_asio.reference.basic_stream_socket">basic_stream_socket</link></member>
+ <member><link linkend="boost_asio.reference.ip__basic_endpoint">ip::basic_endpoint</link></member>
+ <member><link linkend="boost_asio.reference.ip__basic_resolver">ip::basic_resolver</link></member>
+ <member><link linkend="boost_asio.reference.ip__basic_resolver_entry">ip::basic_resolver_entry</link></member>
+ <member><link linkend="boost_asio.reference.ip__basic_resolver_iterator">ip::basic_resolver_iterator</link></member>
+ <member><link linkend="boost_asio.reference.ip__basic_resolver_query">ip::basic_resolver_query</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <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.socket_acceptor_service">socket_acceptor_service</link></member>
+ <member><link linkend="boost_asio.reference.stream_socket_service">stream_socket_service</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Socket Options</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ip__multicast__enable_loopback">ip::multicast::enable_loopback</link></member>
+ <member><link linkend="boost_asio.reference.ip__multicast__hops">ip::multicast::hops</link></member>
+ <member><link linkend="boost_asio.reference.ip__multicast__join_group">ip::multicast::join_group</link></member>
+ <member><link linkend="boost_asio.reference.ip__multicast__leave_group">ip::multicast::leave_group</link></member>
+ <member><link linkend="boost_asio.reference.ip__multicast__outbound_interface">ip::multicast::outbound_interface</link></member>
+ <member><link linkend="boost_asio.reference.ip__tcp.no_delay">ip::tcp::no_delay</link></member>
+ <member><link linkend="boost_asio.reference.ip__unicast__hops">ip::unicast::hops</link></member>
+ <member><link linkend="boost_asio.reference.ip__v6_only">ip::v6_only</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.broadcast">socket_base::broadcast</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.debug">socket_base::debug</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.do_not_route">socket_base::do_not_route</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.enable_connection_aborted">socket_base::enable_connection_aborted</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.keep_alive">socket_base::keep_alive</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.linger">socket_base::linger</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.receive_buffer_size">socket_base::receive_buffer_size</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.receive_low_watermark">socket_base::receive_low_watermark</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.reuse_address">socket_base::reuse_address</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.send_buffer_size">socket_base::send_buffer_size</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.send_low_watermark">socket_base::send_low_watermark</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">I/O Control Commands</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.socket_base.bytes_readable">socket_base::bytes_readable</link></member>
+ <member><link linkend="boost_asio.reference.socket_base.non_blocking_io">socket_base::non_blocking_io</link></member>
+ </simplelist>
+ <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.ConnectHandler">ConnectHandler</link></member>
+ <member><link linkend="boost_asio.reference.DatagramSocketService">DatagramSocketService</link></member>
+ <member><link linkend="boost_asio.reference.Endpoint">Endpoint</link></member>
+ <member><link linkend="boost_asio.reference.GettableSocketOption">GettableSocketOption</link></member>
+ <member><link linkend="boost_asio.reference.InternetProtocol">InternetProtocol</link></member>
+ <member><link linkend="boost_asio.reference.IoControlCommand">IoControlCommand</link></member>
+ <member><link linkend="boost_asio.reference.Protocol">Protocol</link></member>
+ <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.SettableSocketOption">SettableSocketOption</link></member>
+ <member><link linkend="boost_asio.reference.SocketAcceptorService">SocketAcceptorService</link></member>
+ <member><link linkend="boost_asio.reference.SocketService">SocketService</link></member>
+ <member><link linkend="boost_asio.reference.StreamSocketService">StreamSocketService</link></member>
+ </simplelist>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ <tgroup cols="4">
+ <colspec colname="a"/>
+ <colspec colname="b"/>
+ <colspec colname="c"/>
+ <colspec colname="d"/>
+ <thead>
+ <row>
+ <entry valign="center" namest="a" nameend="a">
+ <bridgehead renderas="sect2">Timers</bridgehead>
+ </entry>
+ <entry valign="center" namest="b" nameend="b">
+ <bridgehead renderas="sect2">SSL</bridgehead>
+ </entry>
+ <entry valign="center" namest="c" nameend="d">
+ <bridgehead renderas="sect2">Serial Ports</bridgehead>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.deadline_timer">deadline_timer</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.basic_deadline_timer">basic_deadline_timer</link></member>
+ <member><link linkend="boost_asio.reference.time_traits_lt__ptime__gt_">time_traits</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.deadline_timer_service">deadline_timer_service</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Type Requirements</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.TimerService">TimerService</link></member>
+ <member><link linkend="boost_asio.reference.TimeTraits">TimeTraits</link></member>
+ <member><link linkend="boost_asio.reference.WaitHandler">WaitHandler</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ssl__context">ssl::context</link></member>
+ <member><link linkend="boost_asio.reference.ssl__context_base">ssl::context_base</link></member>
+ <member><link linkend="boost_asio.reference.ssl__stream_base">ssl::stream_base</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ssl__basic_context">ssl::basic_context</link></member>
+ <member><link linkend="boost_asio.reference.ssl__stream">ssl::stream</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.ssl__context_service">ssl::context_service</link></member>
+ <member><link linkend="boost_asio.reference.ssl__stream_service">ssl::stream_service</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.serial_port">serial_port</link></member>
+ <member><link linkend="boost_asio.reference.serial_port_base">serial_port_base</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.basic_serial_port">basic_serial_port</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.serial_port_service">serial_port_service</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Serial Port Options</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.serial_port_base__baud_rate">serial_port_base::baud_rate</link></member>
+ <member><link linkend="boost_asio.reference.serial_port_base__flow_control">serial_port_base::flow_control</link></member>
+ <member><link linkend="boost_asio.reference.serial_port_base__parity">serial_port_base::parity</link></member>
+ <member><link linkend="boost_asio.reference.serial_port_base__stop_bits">serial_port_base::stop_bits</link></member>
+ <member><link linkend="boost_asio.reference.serial_port_base__character_size">serial_port_base::character_size</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Type Requirements</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.GettableSerialPortOption">GettableSerialPortOption</link></member>
+ <member><link linkend="boost_asio.reference.SerialPortService">SerialPortService</link></member>
+ <member><link linkend="boost_asio.reference.SettableSerialPortOption">SettableSerialPortOption</link></member>
+ </simplelist>
</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ <tgroup cols="4">
+ <colspec colname="a"/>
+ <colspec colname="b"/>
+ <colspec colname="c"/>
+ <colspec colname="d"/>
+ <thead>
+ <row>
+ <entry valign="center" namest="a" nameend="b">
+ <bridgehead renderas="sect2">POSIX-specific</bridgehead>
+ </entry>
+ <entry valign="center" namest="c" nameend="d">
+ <bridgehead renderas="sect2">Windows-specific</bridgehead>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
<entry valign="top">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.local__stream_protocol">local::stream_protocol</link></member>
+ <member><link linkend="boost_asio.reference.local__stream_protocol.acceptor">local::stream_protocol::acceptor</link></member>
+ <member><link linkend="boost_asio.reference.local__stream_protocol.endpoint">local::stream_protocol::endpoint</link></member>
+ <member><link linkend="boost_asio.reference.local__stream_protocol.iostream">local::stream_protocol::iostream</link></member>
+ <member><link linkend="boost_asio.reference.local__stream_protocol.socket">local::stream_protocol::socket</link></member>
+ <member><link linkend="boost_asio.reference.local__datagram_protocol">local::datagram_protocol</link></member>
+ <member><link linkend="boost_asio.reference.local__datagram_protocol.endpoint">local::datagram_protocol::endpoint</link></member>
+ <member><link linkend="boost_asio.reference.local__datagram_protocol.socket">local::datagram_protocol::socket</link></member>
+ <member><link linkend="boost_asio.reference.posix__descriptor_base">posix::descriptor_base</link></member>
+ <member><link linkend="boost_asio.reference.posix__stream_descriptor">posix::stream_descriptor</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Free Functions</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.local__connect_pair">local::connect_pair</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.local__basic_endpoint">local::basic_endpoint</link></member>
+ <member><link linkend="boost_asio.reference.posix__basic_descriptor">posix::basic_descriptor</link></member>
+ <member><link linkend="boost_asio.reference.posix__basic_stream_descriptor">posix::basic_stream_descriptor</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.posix__stream_descriptor_service">posix::stream_descriptor_service</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Type Requirements</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.DescriptorService">DescriptorService</link></member>
+ <member><link linkend="boost_asio.reference.StreamDescriptorService">StreamDescriptorService</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top" namest="c" nameend="d">
+ <bridgehead renderas="sect3">Classes</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.windows__random_access_handle">windows::random_access_handle</link></member>
+ <member><link linkend="boost_asio.reference.windows__stream_handle">windows::stream_handle</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Class Templates</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.windows__basic_handle">windows::basic_handle</link></member>
+ <member><link linkend="boost_asio.reference.windows__basic_random_access_handle">windows::basic_random_access_handle</link></member>
+ <member><link linkend="boost_asio.reference.windows__basic_stream_handle">windows::basic_stream_handle</link></member>
+ </simplelist>
+ <bridgehead renderas="sect3">Services</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.windows__random_access_handle_service">windows::random_access_handle_service</link></member>
+ <member><link linkend="boost_asio.reference.windows__stream_handle_service">windows::stream_handle_service</link></member>
+ </simplelist>
<bridgehead renderas="sect3">Type Requirements</bridgehead>
- <itemizedlist>
- <listitem><link linkend="boost_asio.reference.asynchronous_operations">Asynchronous operations</link></listitem>
- <listitem><link linkend="boost_asio.reference.AcceptHandler">AcceptHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.AsyncReadStream">AsyncReadStream</link></listitem>
- <listitem><link linkend="boost_asio.reference.AsyncWriteStream">AsyncWriteStream</link></listitem>
- <listitem><link linkend="boost_asio.reference.CompletionHandler">CompletionHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.ConnectHandler">ConnectHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.ConstBufferSequence">ConstBufferSequence</link></listitem>
- <listitem><link linkend="boost_asio.reference.ConvertibleToConstBuffer">ConvertibleToConstBuffer</link></listitem>
- <listitem><link linkend="boost_asio.reference.ConvertibleToMutableBuffer">ConvertibleToMutableBuffer</link></listitem>
- <listitem><link linkend="boost_asio.reference.DatagramSocketService">DatagramSocketService</link></listitem>
- <listitem><link linkend="boost_asio.reference.Endpoint">Endpoint</link></listitem>
- <listitem><link linkend="boost_asio.reference.GettableSocketOption">GettableSocketOption</link></listitem>
- <listitem><link linkend="boost_asio.reference.Handler">Handler</link></listitem>
- <listitem><link linkend="boost_asio.reference.InternetProtocol">InternetProtocol</link></listitem>
- <listitem><link linkend="boost_asio.reference.IoControlCommand">IoControlCommand</link></listitem>
- <listitem><link linkend="boost_asio.reference.IoObjectService">IoObjectService</link></listitem>
- <listitem><link linkend="boost_asio.reference.MutableBufferSequence">MutableBufferSequence</link></listitem>
- <listitem><link linkend="boost_asio.reference.Protocol">Protocol</link></listitem>
- <listitem><link linkend="boost_asio.reference.ReadHandler">ReadHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.ResolveHandler">ResolveHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.ResolverService">ResolverService</link></listitem>
- <listitem><link linkend="boost_asio.reference.Service">Service</link></listitem>
- <listitem><link linkend="boost_asio.reference.SettableSocketOption">SettableSocketOption</link></listitem>
- <listitem><link linkend="boost_asio.reference.SocketAcceptorService">SocketAcceptorService</link></listitem>
- <listitem><link linkend="boost_asio.reference.SocketService">SocketService</link></listitem>
- <listitem><link linkend="boost_asio.reference.StreamSocketService">StreamSocketService</link></listitem>
- <listitem><link linkend="boost_asio.reference.SyncReadStream">SyncReadStream</link></listitem>
- <listitem><link linkend="boost_asio.reference.SyncWriteStream">SyncWriteStream</link></listitem>
- <listitem><link linkend="boost_asio.reference.TimerService">TimerService</link></listitem>
- <listitem><link linkend="boost_asio.reference.TimeTraits">TimeTraits</link></listitem>
- <listitem><link linkend="boost_asio.reference.WaitHandler">WaitHandler</link></listitem>
- <listitem><link linkend="boost_asio.reference.WriteHandler">WriteHandler</link></listitem>
- </itemizedlist>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="boost_asio.reference.HandleService">HandleService</link></member>
+ <member><link linkend="boost_asio.reference.RandomAccessHandleService">RandomAccessHandleService</link></member>
+ <member><link linkend="boost_asio.reference.StreamHandleService">StreamHandleService</link></member>
+ </simplelist>
</entry>
</row>
</tbody>
Modified: branches/CMake/release/libs/asio/doc/reference.qbk
==============================================================================
--- branches/CMake/release/libs/asio/doc/reference.qbk (original)
+++ branches/CMake/release/libs/asio/doc/reference.qbk 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -19,9 +19,11 @@
[include requirements/ConvertibleToConstBuffer.qbk]
[include requirements/ConvertibleToMutableBuffer.qbk]
[include requirements/DatagramSocketService.qbk]
+[include requirements/DescriptorService.qbk]
[include requirements/Endpoint.qbk]
[include requirements/GettableSocketOption.qbk]
[include requirements/Handler.qbk]
+[include requirements/HandleService.qbk]
[include requirements/InternetProtocol.qbk]
[include requirements/IoControlCommand.qbk]
[include requirements/IoObjectService.qbk]
@@ -34,6 +36,8 @@
[include requirements/SettableSocketOption.qbk]
[include requirements/SocketAcceptorService.qbk]
[include requirements/SocketService.qbk]
+[include requirements/StreamDescriptorService.qbk]
+[include requirements/StreamHandleService.qbk]
[include requirements/StreamSocketService.qbk]
[include requirements/SyncReadStream.qbk]
[include requirements/SyncWriteStream.qbk]
@@ -46,7 +50,7 @@
[section:add_service add_service]
-
+[indexterm1 add_service]
template<
typename ``[link boost_asio.reference.Service Service]``>
@@ -68,7 +72,6 @@
[[svc][The service object. On success, ownership of the service object is transferred to the io\_service. When the io\_service object is destroyed, it will destroy the service object by performing:
``
delete static_cast<io_service::service*>(svc)
-
``
]]
@@ -93,7 +96,7 @@
[section:asio_handler_allocate asio_handler_allocate]
-Default allocation function for handlers.
+[indexterm1 asio_handler_allocate] Default allocation function for handlers.
void * asio_handler_allocate(
std::size_t size,
@@ -106,7 +109,7 @@
This default implementation is simply:
- return ::operator new(bytes);
+ return ::operator new(size);
@@ -144,7 +147,7 @@
[section:asio_handler_deallocate asio_handler_deallocate]
-Default deallocation function for handlers.
+[indexterm1 asio_handler_deallocate] Default deallocation function for handlers.
void asio_handler_deallocate(
void * pointer,
@@ -170,7 +173,7 @@
[section:asio_handler_invoke asio_handler_invoke]
-Default invoke function for handlers.
+[indexterm1 asio_handler_invoke] Default invoke function for handlers.
template<
typename Function>
@@ -215,8 +218,8 @@
[section:async_read async_read]
-Start an asynchronous operation to read a certain amount of data from a stream.
-
+[indexterm1 async_read] Start an asynchronous operation to read a certain amount of data from a stream.
+
template<
typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
@@ -302,7 +305,6 @@
// bytes successfully transferred
// prior to the error.
);
-
``
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().]]
@@ -378,7 +380,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's async\_read\_some function are required.]]
@@ -393,7 +394,6 @@
// bytes successfully transferred
// prior to the error.
);
-
``
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().]]
@@ -461,7 +461,6 @@
// bytes successfully transferred
// prior to the error.
);
-
``
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().]]
@@ -527,7 +526,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's async\_read\_some function are required.]]
@@ -542,7 +540,358 @@
// bytes successfully transferred
// prior to the error.
);
+``
+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]
+
+
+[endsect]
+
+[section:async_read_at async_read_at]
+
+[indexterm1 async_read_at] Start an asynchronous operation to read a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.async_read_at.overload1 async_read_at]``(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.async_read_at.overload2 async_read_at]``(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ ReadHandler handler);
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.async_read_at.overload3 async_read_at]``(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ ReadHandler handler);
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.async_read_at.overload4 async_read_at]``(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ ReadHandler handler);
+
+
+[section:overload1 async_read_at (1 of 4 overloads)]
+
+Start an asynchronous operation to read a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_at(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+
+
+This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. The function call always returns immediately. The asynchronous operation will continue 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.
+
+* An error occurred.
+
+This operation is implemented in terms of one or more calls to the device's async\_read\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the AsyncRandomAccessReadDevice 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. 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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes copied into the buffers. If an error
+ // occurred, this will be the number of bytes successfully
+ // transferred prior to the error.
+ std::size_t bytes_transferred
+ );
+``
+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 read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ boost::asio::async_read_at(d, 42, 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.
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::async_read_at(
+ d, 42, buffers,
+ boost::asio::transfer_all(),
+ handler);
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 async_read_at (2 of 4 overloads)]
+
+Start an asynchronous operation to read a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_at(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ ReadHandler handler);
+
+
+This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. The function call always returns immediately. The asynchronous operation will continue 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 true.
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the AsyncRandomAccessReadDevice 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. 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.]]
+
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ bool 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 true indicates that the read operation is complete. False indicates that further calls to the device's async\_read\_some\_at function are 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:
+``
+ void handler(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes copied into the buffers. If an error
+ // occurred, this will be the number of bytes successfully
+ // transferred prior to the error.
+ std::size_t bytes_transferred
+ );
+``
+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 read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ boost::asio::async_read_at(d, 42,
+ boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32),
+ 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:overload3 async_read_at (3 of 4 overloads)]
+
+Start an asynchronous operation to read a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_at(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ ReadHandler handler);
+
+
+This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
+
+
+* An error occurred.
+
+This operation is implemented in terms of one or more calls to the device's async\_read\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the AsyncRandomAccessReadDevice concept.]]
+
+[[offset][The offset at which the data will be read.]]
+
+[[b][A basic\_streambuf object into which the data will be read. Ownership of the streambuf is retained by the caller, which must guarantee that it remains 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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes copied into the buffers. If an error
+ // occurred, this will be the number of bytes successfully
+ // transferred prior to the error.
+ std::size_t bytes_transferred
+ );
+``
+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 is equivalent to calling:
+
+ boost::asio::async_read_at(
+ d, 42, b,
+ boost::asio::transfer_all(),
+ handler);
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload4 async_read_at (4 of 4 overloads)]
+
+Start an asynchronous operation to read a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessReadDevice AsyncRandomAccessReadDevice]``,
+ typename Allocator,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_at(
+ AsyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ ReadHandler handler);
+
+
+This function is used to asynchronously read a certain number of bytes of data from a random access device at the specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
+
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one or more calls to the device's async\_read\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the AsyncRandomAccessReadDevice concept.]]
+
+[[offset][The offset at which the data will be read.]]
+
+[[b][A basic\_streambuf object into which the data will be read. Ownership of the streambuf is retained by the caller, which must guarantee that it remains valid until the handler is called.]]
+
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ bool 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 true indicates that the read operation is complete. False indicates that further calls to the device's async\_read\_some\_at function are 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:
+``
+ void handler(
+ // Result of operation.
+ const boost::system::error_code& error,
+ // Number of bytes copied into the buffers. If an error
+ // occurred, this will be the number of bytes successfully
+ // transferred prior to the error.
+ std::size_t bytes_transferred
+ );
``
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(). ]]
@@ -557,8 +906,8 @@
[section:async_read_until async_read_until]
-Start an asynchronous operation to read data into a streambuf until a delimiter is encountered.
-
+[indexterm1 async_read_until] Start an asynchronous operation to 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.AsyncReadStream AsyncReadStream]``,
typename Allocator,
@@ -589,10 +938,22 @@
const boost::regex & expr,
ReadHandler handler);
+ template<
+ typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
+ typename Allocator,
+ typename MatchCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.async_read_until.overload4 async_read_until]``(
+ AsyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ MatchCondition match_condition,
+ ReadHandler handler,
+ typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
-[section:overload1 async_read_until (1 of 3 overloads)]
-Start an asynchronous operation to read data into a streambuf until a delimiter is encountered.
+[section:overload1 async_read_until (1 of 4 overloads)]
+
+Start an asynchronous operation to read data into a streambuf until it contains a specified delimiter.
template<
typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
@@ -629,19 +990,23 @@
[[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.
+ // Result of operation.
+ const boost::system::error_code& error,
- std::size_t bytes_transferred // The number of bytes in the
- // streambuf's get area up to
- // and including the delimiter.
- // 0 if an error occurred.
+ // The number of bytes in the streambuf's get
+ // area up to and including the delimiter.
+ // 0 if an error occurred.
+ std::size_t bytes_transferred
);
-
``
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]
+
+After a successful async\_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 async\_read\_until operation to examine.
+
[heading Example]
To asynchronously read data into a streambuf until a newline is encountered:
@@ -670,9 +1035,9 @@
-[section:overload2 async_read_until (2 of 3 overloads)]
+[section:overload2 async_read_until (2 of 4 overloads)]
-Start an asynchronous operation to read data into a streambuf until a delimiter is encountered.
+Start an asynchronous operation to read data into a streambuf until it contains a specified delimiter.
template<
typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
@@ -709,19 +1074,23 @@
[[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.
+ // Result of operation.
+ const boost::system::error_code& error,
- std::size_t bytes_transferred // The number of bytes in the
- // streambuf's get area up to
- // and including the delimiter.
- // 0 if an error occurred.
+ // The number of bytes in the streambuf's get
+ // area up to and including the delimiter.
+ // 0 if an error occurred.
+ std::size_t bytes_transferred
);
-
``
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]
+
+After a successful async\_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 async\_read\_until operation to examine.
+
[heading Example]
To asynchronously read data into a streambuf until a newline is encountered:
@@ -750,9 +1119,9 @@
-[section:overload3 async_read_until (3 of 3 overloads)]
+[section:overload3 async_read_until (3 of 4 overloads)]
-Start an asynchronous operation to read data into a streambuf until a regular expression is located.
+Start an asynchronous operation to read data into a streambuf until some part of its data matches a regular expression.
template<
typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
@@ -789,21 +1158,24 @@
[[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.
+ // Result of operation.
+ const boost::system::error_code& error,
- std::size_t bytes_transferred // The number of bytes in the
- // streambuf's get area up to
- // and including the substring
- // that matches the regular.
- // expression. 0 if an error
- // occurred.
+ // The number of bytes in the streambuf's get
+ // area up to and including the substring
+ // that matches the regular. expression.
+ // 0 if an error occurred.
+ std::size_t bytes_transferred
);
-
``
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]
+
+After a successful async\_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 async\_read\_until operation to examine.
+
[heading Example]
To asynchronously read data into a streambuf until a CR-LF sequence is encountered:
@@ -831,12 +1203,145 @@
[endsect]
+
+[section:overload4 async_read_until (4 of 4 overloads)]
+
+Start an asynchronous operation to read data into a streambuf until a function object indicates a match.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
+ typename Allocator,
+ typename MatchCondition,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_until(
+ AsyncReadStream & s,
+ boost::asio::basic_streambuf< Allocator > & b,
+ MatchCondition match_condition,
+ ReadHandler handler,
+ typename boost::enable_if< is_match_condition< MatchCondition > >::type * = 0);
+
+
+This function is used to asynchronously 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 function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
+
+
+* The match condition function object returns a std::pair where the second element evaluates to true.
+
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's async\_read\_some function. If the match condition function object already indicates a match, the operation completes immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the AsyncReadStream 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.]]
+
+[[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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // The number of bytes in the streambuf's get
+ // area that have been fully consumed by the
+ // match function. O if an error occurred.
+ std::size_t bytes_transferred
+ );
+``
+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]
+
+After a successful async\_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 async\_read\_until operation to examine.
+
+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 asynchronously read data into a streambuf until whitespace is encountered:
+
+ 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);
+ }
+ ...
+ void handler(const boost::system::error_code& e, std::size_t size);
+ ...
+ boost::asio::streambuf b;
+ boost::asio::async_read_until(s, b, match_whitespace, handler);
+
+
+
+
+To asynchronously read data into a streambuf until a matching character is found:
+
+ 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_;
+ };
+
+ namespace asio {
+ template <> struct is_match_condition<match_char>
+ : public boost::true_type {};
+ } // namespace asio
+ ...
+ void handler(const boost::system::error_code& e, std::size_t size);
+ ...
+ boost::asio::streambuf b;
+ boost::asio::async_read_until(s, b, match_char('a'), handler);
+
+
+
+
+
+[endsect]
+
+
[endsect]
[section:async_write async_write]
-Start an asynchronous operation to write of all of the supplied data to a stream.
-
+[indexterm1 async_write] Start an asynchronous operation to write a certain amount of data to a stream.
+
template<
typename ``[link boost_asio.reference.AsyncWriteStream AsyncWriteStream]``,
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
@@ -880,7 +1385,7 @@
[section:overload1 async_write (1 of 4 overloads)]
-Start an asynchronous operation to write of all of the supplied data to a stream.
+Start an asynchronous operation to write all of the supplied data to a stream.
template<
typename ``[link boost_asio.reference.AsyncWriteStream AsyncWriteStream]``,
@@ -921,7 +1426,6 @@
// this will be less than the sum
// of the buffer sizes.
);
-
``
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().]]
@@ -988,7 +1492,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's async\_write\_some function are required.]]
@@ -1002,7 +1505,6 @@
// this will be less than the sum
// of the buffer sizes.
);
-
``
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().]]
@@ -1030,7 +1532,7 @@
[section:overload3 async_write (3 of 4 overloads)]
-Start an asynchronous operation to write a certain amount of data to a stream.
+Start an asynchronous operation to write all of the supplied data to a stream.
template<
typename ``[link boost_asio.reference.AsyncWriteStream AsyncWriteStream]``,
@@ -1071,7 +1573,6 @@
// this will be less than the sum
// of the buffer sizes.
);
-
``
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(). ]]
@@ -1127,7 +1628,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's async\_write\_some function are required.]]
@@ -1141,7 +1641,6 @@
// this will be less than the sum
// of the buffer sizes.
);
-
``
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(). ]]
@@ -1154,132 +1653,463 @@
[endsect]
-[section:basic_datagram_socket basic_datagram_socket]
+[section:async_write_at async_write_at]
-Provides datagram-oriented socket functionality.
+[indexterm1 async_write_at] Start an asynchronous operation to write a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.async_write_at.overload1 async_write_at]``(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.DatagramSocketService DatagramSocketService]`` = datagram_socket_service<Protocol>>
- class basic_datagram_socket :
- public basic_socket< Protocol, DatagramSocketService >
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.async_write_at.overload2 async_write_at]``(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ WriteHandler handler);
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.async_write_at.overload3 async_write_at]``(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ WriteHandler handler);
-[heading Types]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.async_write_at.overload4 async_write_at]``(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ WriteHandler handler);
- [
- [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+[section:overload1 async_write_at (1 of 4 overloads)]
- [
+Start an asynchronous operation to write all of the supplied data at the specified offset.
- [[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. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_at(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
- [
- [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
- [
- [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+* 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.
- [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+This operation is implemented in terms of one or more calls to the device's async\_write\_some\_at function.
- [
- [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[d][The device to which the data is to be written. The type must support the AsyncRandomAccessWriteDevice concept.]]
- [
+[[offset][The offset at which the data will be written.]]
- [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[[buffers][One or more buffers containing the data to be written. 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(
+ // Result of operation.
+ const boost::system::error_code& error,
- [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+ // Number of bytes written from the buffers. If an error
+ // occurred, this will be less than the sum of the buffer sizes.
+ std::size_t bytes_transferred
+ );
+``
+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().]]
- [
+]
- [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+[heading Example]
- ]
+To write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
- [
+ boost::asio::async_write_at(d, 42, boost::asio::buffer(data, size), handler);
- [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always 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.
- [[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_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
- [
+[section:overload2 async_write_at (2 of 4 overloads)]
- [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+Start an asynchronous operation to write a certain amount of data at the specified offset.
- [
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_at(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ WriteHandler handler);
- [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
- [
+This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
- [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+
+* 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.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one or more calls to the device's async\_write\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device to which the data is to be written. The type must support the AsyncRandomAccessWriteDevice concept.]]
+
+[[offset][The offset at which the data will be written.]]
+
+[[buffers][One or more buffers containing the data to be written. 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.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's async\_write\_some\_at function are required.]]
+
+[[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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes written from the buffers. If an error
+ // occurred, this will be less than the sum of the buffer sizes.
+ std::size_t bytes_transferred
+ );
+``
+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 write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ boost::asio::async_write_at(d, 42,
+ boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32),
+ 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:overload3 async_write_at (3 of 4 overloads)]
+
+Start an asynchronous operation to write all of the supplied data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_at(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ WriteHandler handler);
+
+
+This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
+
+
+* All of the data in the supplied basic_streambuf has been written.
+
+* An error occurred.
+
+This operation is implemented in terms of one or more calls to the device's async\_write\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device to which the data is to be written. The type must support the AsyncRandomAccessWriteDevice concept.]]
+
+[[offset][The offset at which the data will be written.]]
+
+[[b][A basic\_streambuf object from which data will be written. Ownership of the streambuf is retained by the caller, which must guarantee that it remains 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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes written from the buffers. If an error
+ // occurred, this will be less than the sum of the buffer sizes.
+ std::size_t bytes_transferred
+ );
+``
+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]
+
+
+
+[section:overload4 async_write_at (4 of 4 overloads)]
+
+Start an asynchronous operation to write a certain amount of data at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.AsyncRandomAccessWriteDevice AsyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_at(
+ AsyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ WriteHandler handler);
+
+
+This function is used to asynchronously write a certain number of bytes of data to a random access device at a specified offset. The function call always returns immediately. The asynchronous operation will continue until one of the following conditions is true:
+
+
+* All of the data in the supplied basic_streambuf has been written.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one or more calls to the device's async\_write\_some\_at function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[d][The device to which the data is to be written. The type must support the AsyncRandomAccessWriteDevice concept.]]
+
+[[offset][The offset at which the data will be written.]]
+
+[[b][A basic\_streambuf object from which data will be written. Ownership of the streambuf is retained by the caller, which must guarantee that it remains valid until the handler is called.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest async_write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's async\_write\_some\_at function are required.]]
+
+[[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(
+ // Result of operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes written from the buffers. If an error
+ // occurred, this will be less than the sum of the buffer sizes.
+ std::size_t bytes_transferred
+ );
+``
+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]
+
+
+[endsect]
+
+[section:basic_datagram_socket basic_datagram_socket]
+
+Provides datagram-oriented socket functionality.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.DatagramSocketService DatagramSocketService]`` = datagram_socket_service<Protocol>>
+ class basic_datagram_socket :
+ public basic_socket< Protocol, DatagramSocketService >
+
+
+[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_type [*native_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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
[
@@ -1495,6 +2325,22 @@
]
+[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 basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
@@ -1507,7 +2353,7 @@
[section:assign basic_datagram_socket::assign]
-Assign an existing native socket to the socket.
+[indexterm2 assign..basic_datagram_socket] Assign an existing native socket to the socket.
void ``[link boost_asio.reference.basic_datagram_socket.assign.overload1 assign]``(
const protocol_type & protocol,
@@ -1561,7 +2407,7 @@
['Inherited from basic_socket.]
-Start an asynchronous connect.
+[indexterm2 async_connect..basic_datagram_socket] Start an asynchronous connect.
void async_connect(
const endpoint_type & peer_endpoint,
@@ -1570,7 +2416,7 @@
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 returned to the closed state.
+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]
@@ -1585,7 +2431,6 @@
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().]]
@@ -1620,7 +2465,7 @@
[section:async_receive basic_datagram_socket::async_receive]
-Start an asynchronous receive on a connected socket.
+[indexterm2 async_receive..basic_datagram_socket] Start an asynchronous receive on a connected socket.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
@@ -1666,7 +2511,6 @@
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().]]
@@ -1724,7 +2568,6 @@
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().]]
@@ -1743,7 +2586,7 @@
[section:async_receive_from basic_datagram_socket::async_receive_from]
-Start an asynchronous receive.
+[indexterm2 async_receive_from..basic_datagram_socket] Start an asynchronous receive.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
@@ -1794,7 +2637,6 @@
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().]]
@@ -1852,7 +2694,6 @@
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(). ]]
@@ -1867,7 +2708,7 @@
[section:async_send basic_datagram_socket::async_send]
-Start an asynchronous send on a connected socket.
+[indexterm2 async_send..basic_datagram_socket] Start an asynchronous send on a connected socket.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
@@ -1913,7 +2754,6 @@
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().]]
@@ -1971,7 +2811,6 @@
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().]]
@@ -1990,7 +2829,7 @@
[section:async_send_to basic_datagram_socket::async_send_to]
-Start an asynchronous send.
+[indexterm2 async_send_to..basic_datagram_socket] Start an asynchronous send.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
@@ -2041,7 +2880,6 @@
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().]]
@@ -2101,7 +2939,6 @@
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(). ]]
@@ -2116,7 +2953,7 @@
[section:at_mark basic_datagram_socket::at_mark]
-Determine whether the socket is at the out-of-band data mark.
+[indexterm2 at_mark..basic_datagram_socket] Determine whether the socket is at the out-of-band data mark.
bool ``[link boost_asio.reference.basic_datagram_socket.at_mark.overload1 at_mark]``() const;
@@ -2192,7 +3029,7 @@
[section:available basic_datagram_socket::available]
-Determine the number of bytes available for reading.
+[indexterm2 available..basic_datagram_socket] Determine the number of bytes available for reading.
std::size_t ``[link boost_asio.reference.basic_datagram_socket.available.overload1 available]``() const;
@@ -2268,7 +3105,7 @@
[section:basic_datagram_socket basic_datagram_socket::basic_datagram_socket]
-Construct a basic_datagram_socket without opening it.
+[indexterm2 basic_datagram_socket..basic_datagram_socket] Construct a basic_datagram_socket without opening it.
``[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket.overload1 basic_datagram_socket]``(
boost::asio::io_service & io_service);
@@ -2433,7 +3270,7 @@
[section:bind basic_datagram_socket::bind]
-Bind the socket to the given local endpoint.
+[indexterm2 bind..basic_datagram_socket] Bind the socket to the given local endpoint.
void ``[link boost_asio.reference.basic_datagram_socket.bind.overload1 bind]``(
const endpoint_type & endpoint);
@@ -2549,7 +3386,7 @@
['Inherited from socket_base.]
-Socket option to permit sending of broadcast messages.
+[indexterm2 broadcast..basic_datagram_socket] Socket option to permit sending of broadcast messages.
typedef implementation_defined broadcast;
@@ -2592,7 +3429,7 @@
['Inherited from socket_base.]
-IO control command to get the amount of data that can be read without blocking.
+[indexterm2 bytes_readable..basic_datagram_socket] IO control command to get the amount of data that can be read without blocking.
typedef implementation_defined bytes_readable;
@@ -2621,7 +3458,7 @@
[section:cancel basic_datagram_socket::cancel]
-Cancel all asynchronous operations associated with the socket.
+[indexterm2 cancel..basic_datagram_socket] Cancel all asynchronous operations associated with the socket.
void ``[link boost_asio.reference.basic_datagram_socket.cancel.overload1 cancel]``();
@@ -2721,7 +3558,7 @@
[section:close basic_datagram_socket::close]
-Close the socket.
+[indexterm2 close..basic_datagram_socket] Close the socket.
void ``[link boost_asio.reference.basic_datagram_socket.close.overload1 close]``();
@@ -2813,7 +3650,7 @@
[section:connect basic_datagram_socket::connect]
-Connect the socket to the specified endpoint.
+[indexterm2 connect..basic_datagram_socket] Connect the socket to the specified endpoint.
void ``[link boost_asio.reference.basic_datagram_socket.connect.overload1 connect]``(
const endpoint_type & peer_endpoint);
@@ -2836,7 +3673,7 @@
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 returned to the closed state.
+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]
@@ -2889,7 +3726,7 @@
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 returned to the closed state.
+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]
@@ -2933,7 +3770,7 @@
['Inherited from socket_base.]
-Socket option to enable socket-level debugging.
+[indexterm2 debug..basic_datagram_socket] Socket option to enable socket-level debugging.
typedef implementation_defined debug;
@@ -2976,7 +3813,7 @@
['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
+[indexterm2 do_not_route..basic_datagram_socket] Socket option to prevent routing, use local interfaces only.
typedef implementation_defined do_not_route;
@@ -3019,7 +3856,7 @@
['Inherited from socket_base.]
-Socket option to report aborted connections on accept.
+[indexterm2 enable_connection_aborted..basic_datagram_socket] Socket option to report aborted connections on accept.
typedef implementation_defined enable_connection_aborted;
@@ -3059,7 +3896,7 @@
[section:endpoint_type basic_datagram_socket::endpoint_type]
-The endpoint type.
+[indexterm2 endpoint_type..basic_datagram_socket] The endpoint type.
typedef Protocol::endpoint endpoint_type;
@@ -3075,7 +3912,7 @@
['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_datagram_socket] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -3094,7 +3931,7 @@
[section:get_option basic_datagram_socket::get_option]
-Get an option from the socket.
+[indexterm2 get_option..basic_datagram_socket] Get an option from the socket.
void ``[link boost_asio.reference.basic_datagram_socket.get_option.overload1 get_option]``(
GettableSocketOption & option) const;
@@ -3207,12 +4044,27 @@
[endsect]
+[section:implementation basic_datagram_socket::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_datagram_socket] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
[section:implementation_type basic_datagram_socket::implementation_type]
['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_datagram_socket] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -3224,7 +4076,7 @@
[section:io_control basic_datagram_socket::io_control]
-Perform an IO control command on the socket.
+[indexterm2 io_control..basic_datagram_socket] Perform an IO control command on the socket.
void ``[link boost_asio.reference.basic_datagram_socket.io_control.overload1 io_control]``(
IoControlCommand & command);
@@ -3342,7 +4194,7 @@
['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_datagram_socket] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -3365,7 +4217,7 @@
['Inherited from basic_socket.]
-Determine whether the socket is open.
+[indexterm2 is_open..basic_datagram_socket] Determine whether the socket is open.
bool is_open() const;
@@ -3380,7 +4232,7 @@
['Inherited from socket_base.]
-Socket option to send keep-alives.
+[indexterm2 keep_alive..basic_datagram_socket] Socket option to send keep-alives.
typedef implementation_defined keep_alive;
@@ -3423,7 +4275,7 @@
['Inherited from socket_base.]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[indexterm2 linger..basic_datagram_socket] Socket option to specify whether the socket lingers on close if unsent data is present.
typedef implementation_defined linger;
@@ -3463,7 +4315,7 @@
[section:local_endpoint basic_datagram_socket::local_endpoint]
-Get the local endpoint of the socket.
+[indexterm2 local_endpoint..basic_datagram_socket] Get the local endpoint of the socket.
endpoint_type ``[link boost_asio.reference.basic_datagram_socket.local_endpoint.overload1 local_endpoint]``() const;
@@ -3570,7 +4422,7 @@
['Inherited from basic_socket.]
-Get a reference to the lowest layer.
+[indexterm2 lowest_layer..basic_datagram_socket] Get a reference to the lowest layer.
lowest_layer_type & lowest_layer();
@@ -3593,7 +4445,7 @@
['Inherited from basic_socket.]
-A basic_socket is always the lowest layer.
+[indexterm2 lowest_layer_type..basic_datagram_socket] A basic_socket is always the lowest layer.
typedef basic_socket< Protocol, DatagramSocketService > lowest_layer_type;
@@ -3862,6 +4714,17 @@
]
+[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]]
@@ -3888,6 +4751,22 @@
]
+[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 basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
@@ -3909,7 +4788,7 @@
['Inherited from socket_base.]
-The maximum length of the queue of pending incoming connections.
+[indexterm2 max_connections..basic_datagram_socket] The maximum length of the queue of pending incoming connections.
static const int max_connections = implementation_defined;
@@ -3924,7 +4803,7 @@
['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
+[indexterm2 message_do_not_route..basic_datagram_socket] Specify that the data should not be subject to routing.
static const int message_do_not_route = implementation_defined;
@@ -3939,7 +4818,7 @@
['Inherited from socket_base.]
-Bitmask type for flags that can be passed to send and receive operations.
+[indexterm2 message_flags..basic_datagram_socket] Bitmask type for flags that can be passed to send and receive operations.
typedef int message_flags;
@@ -3955,7 +4834,7 @@
['Inherited from socket_base.]
-Process out-of-band data.
+[indexterm2 message_out_of_band..basic_datagram_socket] Process out-of-band data.
static const int message_out_of_band = implementation_defined;
@@ -3970,7 +4849,7 @@
['Inherited from socket_base.]
-Peek at incoming data without removing it from the input queue.
+[indexterm2 message_peek..basic_datagram_socket] Peek at incoming data without removing it from the input queue.
static const int message_peek = implementation_defined;
@@ -3985,7 +4864,7 @@
['Inherited from basic_socket.]
-Get the native socket representation.
+[indexterm2 native..basic_datagram_socket] Get the native socket representation.
native_type native();
@@ -3999,7 +4878,7 @@
[section:native_type basic_datagram_socket::native_type]
-The native representation of a socket.
+[indexterm2 native_type..basic_datagram_socket] The native representation of a socket.
typedef DatagramSocketService::native_type native_type;
@@ -4015,7 +4894,7 @@
['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+[indexterm2 non_blocking_io..basic_datagram_socket] IO control command to set the blocking mode of the socket.
typedef implementation_defined non_blocking_io;
@@ -4043,7 +4922,7 @@
[section:open basic_datagram_socket::open]
-Open the socket using the specified protocol.
+[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());
@@ -4152,7 +5031,7 @@
[section:protocol_type basic_datagram_socket::protocol_type]
-The protocol type.
+[indexterm2 protocol_type..basic_datagram_socket] The protocol type.
typedef Protocol protocol_type;
@@ -4164,7 +5043,7 @@
[section:receive basic_datagram_socket::receive]
-Receive some data on a connected socket.
+[indexterm2 receive..basic_datagram_socket] Receive some data on a connected socket.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
@@ -4338,7 +5217,7 @@
['Inherited from socket_base.]
-Socket option for the receive buffer size of a socket.
+[indexterm2 receive_buffer_size..basic_datagram_socket] Socket option for the receive buffer size of a socket.
typedef implementation_defined receive_buffer_size;
@@ -4377,7 +5256,7 @@
[section:receive_from basic_datagram_socket::receive_from]
-Receive a datagram with the endpoint of the sender.
+[indexterm2 receive_from..basic_datagram_socket] Receive a datagram with the endpoint of the sender.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
@@ -4553,7 +5432,7 @@
['Inherited from socket_base.]
-Socket option for the receive low watermark.
+[indexterm2 receive_low_watermark..basic_datagram_socket] Socket option for the receive low watermark.
typedef implementation_defined receive_low_watermark;
@@ -4592,7 +5471,7 @@
[section:remote_endpoint basic_datagram_socket::remote_endpoint]
-Get the remote endpoint of the socket.
+[indexterm2 remote_endpoint..basic_datagram_socket] Get the remote endpoint of the socket.
endpoint_type ``[link boost_asio.reference.basic_datagram_socket.remote_endpoint.overload1 remote_endpoint]``() const;
@@ -4699,7 +5578,7 @@
['Inherited from socket_base.]
-Socket option to allow the socket to be bound to an address that is already in use.
+[indexterm2 reuse_address..basic_datagram_socket] Socket option to allow the socket to be bound to an address that is already in use.
typedef implementation_defined reuse_address;
@@ -4738,7 +5617,7 @@
[section:send basic_datagram_socket::send]
-Send some data on a connected socket.
+[indexterm2 send..basic_datagram_socket] Send some data on a connected socket.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
@@ -4912,7 +5791,7 @@
['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+[indexterm2 send_buffer_size..basic_datagram_socket] Socket option for the send buffer size of a socket.
typedef implementation_defined send_buffer_size;
@@ -4955,7 +5834,7 @@
['Inherited from socket_base.]
-Socket option for the send low watermark.
+[indexterm2 send_low_watermark..basic_datagram_socket] Socket option for the send low watermark.
typedef implementation_defined send_low_watermark;
@@ -4994,7 +5873,7 @@
[section:send_to basic_datagram_socket::send_to]
-Send a datagram to the specified endpoint.
+[indexterm2 send_to..basic_datagram_socket] Send a datagram to the specified endpoint.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
@@ -5165,12 +6044,27 @@
[endsect]
+[section:service basic_datagram_socket::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_datagram_socket] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
[section:service_type basic_datagram_socket::service_type]
['Inherited from basic_io_object.]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 service_type..basic_datagram_socket] The type of the service that will be used to provide I/O operations.
typedef DatagramSocketService service_type;
@@ -5182,7 +6076,7 @@
[section:set_option basic_datagram_socket::set_option]
-Set an option on the socket.
+[indexterm2 set_option..basic_datagram_socket] Set an option on the socket.
void ``[link boost_asio.reference.basic_datagram_socket.set_option.overload1 set_option]``(
const SettableSocketOption & option);
@@ -5294,7 +6188,7 @@
[section:shutdown basic_datagram_socket::shutdown]
-Disable sends or receives on the socket.
+[indexterm2 shutdown..basic_datagram_socket] Disable sends or receives on the socket.
void ``[link boost_asio.reference.basic_datagram_socket.shutdown.overload1 shutdown]``(
shutdown_type what);
@@ -5408,7 +6302,7 @@
['Inherited from socket_base.]
-Different ways a socket may be shutdown.
+[indexterm2 shutdown_type..basic_datagram_socket] Different ways a socket may be shutdown.
enum shutdown_type
@@ -5539,6 +6433,22 @@
]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[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 basic_deadline_timer class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
Most applications will use the boost::asio::deadline\_timer typedef.
@@ -5629,7 +6539,7 @@
[section:async_wait basic_deadline_timer::async_wait]
-Start an asynchronous wait on the timer.
+[indexterm2 async_wait..basic_deadline_timer] Start an asynchronous wait on the timer.
template<
typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
@@ -5656,7 +6566,6 @@
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(). ]]
@@ -5669,7 +6578,7 @@
[section:basic_deadline_timer basic_deadline_timer::basic_deadline_timer]
-Constructor.
+[indexterm2 basic_deadline_timer..basic_deadline_timer] Constructor.
``[link boost_asio.reference.basic_deadline_timer.basic_deadline_timer.overload1 basic_deadline_timer]``(
boost::asio::io_service & io_service);
@@ -5770,7 +6679,7 @@
[section:cancel basic_deadline_timer::cancel]
-Cancel any asynchronous operations that are waiting on the timer.
+[indexterm2 cancel..basic_deadline_timer] Cancel any asynchronous operations that are waiting on the timer.
std::size_t ``[link boost_asio.reference.basic_deadline_timer.cancel.overload1 cancel]``();
@@ -5845,7 +6754,7 @@
[section:duration_type basic_deadline_timer::duration_type]
-The duration type.
+[indexterm2 duration_type..basic_deadline_timer] The duration type.
typedef traits_type::duration_type duration_type;
@@ -5857,7 +6766,7 @@
[section:expires_at basic_deadline_timer::expires_at]
-Get the timer's expiry time as an absolute time.
+[indexterm2 expires_at..basic_deadline_timer] Get the timer's expiry time as an absolute time.
time_type ``[link boost_asio.reference.basic_deadline_timer.expires_at.overload1 expires_at]``() const;
@@ -5958,7 +6867,7 @@
[section:expires_from_now basic_deadline_timer::expires_from_now]
-Get the timer's expiry time relative to now.
+[indexterm2 expires_from_now..basic_deadline_timer] Get the timer's expiry time relative to now.
duration_type ``[link boost_asio.reference.basic_deadline_timer.expires_from_now.overload1 expires_from_now]``() const;
@@ -6063,7 +6972,7 @@
['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_deadline_timer] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -6081,12 +6990,27 @@
+[section:implementation basic_deadline_timer::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_deadline_timer] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
[section:implementation_type basic_deadline_timer::implementation_type]
['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_deadline_timer] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -6102,7 +7026,7 @@
['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_deadline_timer] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -6120,12 +7044,27 @@
+[section:service basic_deadline_timer::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_deadline_timer] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
[section:service_type basic_deadline_timer::service_type]
['Inherited from basic_io_object.]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 service_type..basic_deadline_timer] The type of the service that will be used to provide I/O operations.
typedef TimerService service_type;
@@ -6138,7 +7077,7 @@
[section:time_type basic_deadline_timer::time_type]
-The time type.
+[indexterm2 time_type..basic_deadline_timer] The time type.
typedef traits_type::time_type time_type;
@@ -6151,7 +7090,7 @@
[section:traits_type basic_deadline_timer::traits_type]
-The time traits type.
+[indexterm2 traits_type..basic_deadline_timer] The time traits type.
typedef TimeTraits traits_type;
@@ -6163,7 +7102,7 @@
[section:wait basic_deadline_timer::wait]
-Perform a blocking wait on the timer.
+[indexterm2 wait..basic_deadline_timer] Perform a blocking wait on the timer.
void ``[link boost_asio.reference.basic_deadline_timer.wait.overload1 wait]``();
@@ -6272,10 +7211,62 @@
]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_io_object.basic_io_object [*basic_io_object]]]
+ [Construct a basic_io_object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_io_object._basic_io_object [*~basic_io_object]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_io_object.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_io_object.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+
+[section:basic_io_object basic_io_object::basic_io_object]
+
+[indexterm2 basic_io_object..basic_io_object] Construct a basic_io_object.
+
+ basic_io_object(
+ boost::asio::io_service & io_service);
+
+
+Performs:
+
+ service.construct(implementation);
+
+
+
+
+
+[endsect]
+
+
[section:get_io_service basic_io_object::get_io_service]
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_io_object] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -6293,9 +7284,21 @@
+[section:implementation basic_io_object::implementation]
+
+[indexterm2 implementation..basic_io_object] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
[section:implementation_type basic_io_object::implementation_type]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_io_object] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -6308,7 +7311,7 @@
[section:io_service basic_io_object::io_service]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_io_object] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -6326,9 +7329,21 @@
+[section:service basic_io_object::service]
+
+[indexterm2 service..basic_io_object] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
[section:service_type basic_io_object::service_type]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 service_type..basic_io_object] The type of the service that will be used to provide I/O operations.
typedef IoObjectService service_type;
@@ -6339,18 +7354,36 @@
+[section:_basic_io_object basic_io_object::~basic_io_object]
+
+[indexterm2 ~basic_io_object..basic_io_object] Protected destructor to prevent deletion through this type.
+
+ ~basic_io_object();
+
+
+Performs:
+
+ service.destroy(implementation);
+
+
+
+
+
+[endsect]
+
+
+
[endsect]
-[section:basic_socket basic_socket]
+[section:basic_raw_socket basic_raw_socket]
-Provides socket functionality.
+Provides raw-oriented socket functionality.
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
+ typename ``[link boost_asio.reference.RawSocketService RawSocketService]`` = raw_socket_service<Protocol>>
+ class basic_raw_socket :
+ public basic_socket< Protocol, RawSocketService >
[heading Types]
@@ -6359,147 +7392,147 @@
[
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [[link boost_asio.reference.basic_raw_socket.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_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_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_raw_socket.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_raw_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]]]
+ [[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_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_raw_socket.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_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_socket.keep_alive [*keep_alive]]]
+ [[link boost_asio.reference.basic_raw_socket.keep_alive [*keep_alive]]]
[Socket option to send keep-alives. ]
]
[
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [[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_socket.lowest_layer_type [*lowest_layer_type]]]
+ [[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_socket.message_flags [*message_flags]]]
+ [[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_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
[The native representation of a socket. ]
]
[
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [[link boost_asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]]
[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_raw_socket.protocol_type [*protocol_type]]]
[The protocol type. ]
]
[
- [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [[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_socket.receive_low_watermark [*receive_low_watermark]]]
+ [[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_socket.reuse_address [*reuse_address]]]
+ [[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_socket.send_buffer_size [*send_buffer_size]]]
+ [[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_socket.send_low_watermark [*send_low_watermark]]]
+ [[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_socket.service_type [*service_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.basic_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_raw_socket.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
@@ -6511,107 +7544,147 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [[link boost_asio.reference.basic_raw_socket.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_raw_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_raw_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.basic_raw_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it. ]
+ [[link boost_asio.reference.basic_raw_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.basic_raw_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[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_socket.close [*close]]]
+ [[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. ]
+ ]
+
+ [
+ [[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_socket.connect [*connect]]]
+ [[link boost_asio.reference.basic_raw_socket.connect [*connect]]]
[Connect the socket to the specified endpoint. ]
]
[
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [[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_socket.get_option [*get_option]]]
+ [[link boost_asio.reference.basic_raw_socket.get_option [*get_option]]]
[Get an option from the socket. ]
]
[
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [[link boost_asio.reference.basic_raw_socket.io_control [*io_control]]]
[Perform an IO control command on the socket. ]
]
[
- [[link boost_asio.reference.basic_socket.io_service [*io_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.basic_socket.is_open [*is_open]]]
+ [[link boost_asio.reference.basic_raw_socket.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_raw_socket.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_raw_socket.lowest_layer [*lowest_layer]]]
[Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_socket.native [*native]]]
+ [[link boost_asio.reference.basic_raw_socket.native [*native]]]
[Get the native socket representation. ]
]
[
- [[link boost_asio.reference.basic_socket.open [*open]]]
+ [[link boost_asio.reference.basic_raw_socket.open [*open]]]
[Open the socket using the specified protocol. ]
]
[
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
+ [[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_socket.set_option [*set_option]]]
+ [[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_socket.shutdown [*shutdown]]]
+ [[link boost_asio.reference.basic_raw_socket.shutdown [*shutdown]]]
[Disable sends or receives on the socket. ]
]
@@ -6622,28 +7695,44 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
+ [[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_socket.message_do_not_route [*message_do_not_route]]]
+ [[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_socket.message_out_of_band [*message_out_of_band]]]
+ [[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_socket.message_peek [*message_peek]]]
+ [[link boost_asio.reference.basic_raw_socket.message_peek [*message_peek]]]
[Peek at incoming data without removing it from the input queue. ]
]
]
-The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+[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 basic_raw_socket class template provides asynchronous and blocking raw-oriented socket functionality.
[heading Thread Safety]
@@ -6653,21 +7742,24 @@
[*Shared] [*objects:] Unsafe.
-[section:assign basic_socket::assign]
+[section:assign basic_raw_socket::assign]
-Assign an existing native socket to the socket.
+[indexterm2 assign..basic_raw_socket] Assign an existing native socket to the socket.
- void ``[link boost_asio.reference.basic_socket.assign.overload1 assign]``(
+ void ``[link boost_asio.reference.basic_raw_socket.assign.overload1 assign]``(
const protocol_type & protocol,
const native_type & native_socket);
- boost::system::error_code ``[link boost_asio.reference.basic_socket.assign.overload2 assign]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.assign.overload2 assign]``(
const protocol_type & protocol,
const native_type & native_socket,
boost::system::error_code & ec);
-[section:overload1 basic_socket::assign (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::assign (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Assign an existing native socket to the socket.
@@ -6681,7 +7773,10 @@
-[section:overload2 basic_socket::assign (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::assign (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Assign an existing native socket to the socket.
@@ -6698,12 +7793,13 @@
[endsect]
-[section:async_connect basic_socket::async_connect]
+[section:async_connect basic_raw_socket::async_connect]
-Start an asynchronous connect.
- template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+['Inherited from basic_socket.]
+
+[indexterm2 async_connect..basic_raw_socket] Start an asynchronous connect.
+
void async_connect(
const endpoint_type & peer_endpoint,
ConnectHandler handler);
@@ -6711,7 +7807,7 @@
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 returned to the closed state.
+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]
@@ -6726,7 +7822,6 @@
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().]]
@@ -6759,54 +7854,94 @@
[endsect]
-[section:at_mark basic_socket::at_mark]
-
-Determine whether the socket is at the out-of-band data mark.
+[section:async_receive basic_raw_socket::async_receive]
- bool ``[link boost_asio.reference.basic_socket.at_mark.overload1 at_mark]``() const;
+[indexterm2 async_receive..basic_raw_socket] Start an asynchronous receive on a connected socket.
- bool ``[link boost_asio.reference.basic_socket.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_receive.overload1 async_receive]``(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_receive.overload2 async_receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ ReadHandler handler);
-[section:overload1 basic_socket::at_mark (1 of 2 overloads)]
-Determine whether the socket is at the out-of-band data mark.
+[section:overload1 basic_raw_socket::async_receive (1 of 2 overloads)]
- bool at_mark() const;
+Start an asynchronous receive on a connected socket.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+This function is used to asynchronously receive data from the raw socket. The function call always returns immediately.
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[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().]]
]
+[heading Remarks]
+
+The async\_receive operation can only be used with a connected socket. Use the async\_receive\_from function to receive data on an unconnected raw socket.
+
+[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);
+
+
+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:overload2 basic_socket::at_mark (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::async_receive (2 of 2 overloads)]
-Determine whether the socket is at the out-of-band data mark.
+Start an asynchronous receive on a connected socket.
- bool at_mark(
- boost::system::error_code & ec) const;
+ 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);
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+This function is used to asynchronously receive data from the raw socket. The function call always returns immediately.
[heading Parameters]
@@ -6814,13 +7949,24 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[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().]]
]
-[heading Return Value]
+[heading Remarks]
-A bool indicating whether the socket is at the out-of-band data mark.
+The async\_receive operation can only be used with a connected socket. Use the async\_receive\_from function to receive data on an unconnected raw socket.
@@ -6829,54 +7975,97 @@
[endsect]
-[section:available basic_socket::available]
-
-Determine the number of bytes available for reading.
+[section:async_receive_from basic_raw_socket::async_receive_from]
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
+[indexterm2 async_receive_from..basic_raw_socket] Start an asynchronous receive.
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_receive_from.overload1 async_receive_from]``(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ ReadHandler handler);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_receive_from.overload2 async_receive_from]``(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ ReadHandler handler);
-[section:overload1 basic_socket::available (1 of 2 overloads)]
-Determine the number of bytes available for reading.
+[section:overload1 basic_raw_socket::async_receive_from (1 of 2 overloads)]
- std::size_t available() const;
+Start an asynchronous receive.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive_from(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ ReadHandler handler);
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to asynchronously receive raw data. The function call always returns immediately.
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[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.]]
+
+[[sender_endpoint][An endpoint object that receives the endpoint of the remote sender of the data. Ownership of the sender\_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 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().]]
]
+[heading Example]
+
+To receive into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ socket.async_receive_from(
+ boost::asio::buffer(data, size), 0, sender_endpoint, 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.
+
[endsect]
-[section:overload2 basic_socket::available (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::async_receive_from (2 of 2 overloads)]
-Determine the number of bytes available for reading.
+Start an asynchronous receive.
- std::size_t available(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_receive_from(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ ReadHandler handler);
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to asynchronously receive raw data. The function call always returns immediately.
[heading Parameters]
@@ -6884,51 +8073,63 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[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.]]
-]
+[[sender_endpoint][An endpoint object that receives the endpoint of the remote sender of the data. Ownership of the sender\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+[[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(). ]]
+]
-[endsect]
[endsect]
-[section:basic_socket basic_socket::basic_socket]
-Construct a basic_socket without opening it.
+[endsect]
- ``[link boost_asio.reference.basic_socket.basic_socket.overload1 basic_socket]``(
- boost::asio::io_service & io_service);
+[section:async_send basic_raw_socket::async_send]
- ``[link boost_asio.reference.basic_socket.basic_socket.overload2 basic_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
+[indexterm2 async_send..basic_raw_socket] Start an asynchronous send on a connected socket.
- ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_send.overload1 async_send]``(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
- ``[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);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_send.overload2 async_send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ WriteHandler handler);
-[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
+[section:overload1 basic_raw_socket::async_send (1 of 2 overloads)]
-Construct a basic_socket without opening it.
+Start an asynchronous send on a connected socket.
- basic_socket(
- 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,
+ WriteHandler handler);
-This constructor creates a socket without opening it.
+This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.
[heading Parameters]
@@ -6936,26 +8137,54 @@
[variablelist
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
+[[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().]]
]
+[heading Remarks]
+
+The async\_send operation can only be used with a connected socket. Use the async\_send\_to function to send data on an unconnected raw socket.
+
+[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);
+
+
+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:overload2 basic_socket::basic_socket (2 of 4 overloads)]
+[section:overload2 basic_raw_socket::async_send (2 of 2 overloads)]
-Construct and open a basic_socket.
+Start an asynchronous send on a connected socket.
- basic_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
+ 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 socket.
+This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.
[heading Parameters]
@@ -6963,37 +8192,68 @@
[variablelist
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+[[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.]]
-[[protocol][An object specifying protocol parameters to be used.]]
+[[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 Exceptions]
-
+[heading Remarks]
+
+The async\_send operation can only be used with a connected socket. Use the async\_send\_to function to send data on an unconnected raw socket.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+[endsect]
[endsect]
+[section:async_send_to basic_raw_socket::async_send_to]
+[indexterm2 async_send_to..basic_raw_socket] Start an asynchronous send.
-[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_send_to.overload1 async_send_to]``(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ WriteHandler handler);
-Construct a basic_socket, opening it and binding it to the given local endpoint.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void ``[link boost_asio.reference.basic_raw_socket.async_send_to.overload2 async_send_to]``(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
+ WriteHandler handler);
- basic_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+[section:overload1 basic_raw_socket::async_send_to (1 of 2 overloads)]
+
+Start an asynchronous send.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send_to(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ WriteHandler handler);
-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.
+
+This function is used to asynchronously send raw data to the specified remote endpoint. The function call always returns immediately.
[heading Parameters]
@@ -7001,20 +8261,34 @@
[variablelist
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+[[buffers][One or more data buffers to be sent to the remote endpoint. 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.]]
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[destination][The remote endpoint to which the data will be sent. Copies will be made of the endpoint as required.]]
-]
+[[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 Exceptions]
-
+]
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure. ]]
+To send a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ boost::asio::ip::udp::endpoint destination(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_send_to(
+ boost::asio::buffer(data, size), destination, 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.
@@ -7022,17 +8296,21 @@
-[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
+[section:overload2 basic_raw_socket::async_send_to (2 of 2 overloads)]
-Construct a basic_socket on an existing native socket.
+Start an asynchronous send.
- basic_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_send_to(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
+ WriteHandler handler);
-This constructor creates a socket object to hold an existing native socket.
+This function is used to asynchronously send raw data to the specified remote endpoint. The function call always returns immediately.
[heading Parameters]
@@ -7040,20 +8318,20 @@
[variablelist
-[[io_service][The 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.]]
+[[buffers][One or more data buffers to be sent to the remote endpoint. 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.]]
-[heading Exceptions]
-
+[[destination][The remote endpoint to which the data will be sent. Copies will be made of the endpoint as required.]]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[[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(). ]]
]
@@ -7064,75 +8342,60 @@
[endsect]
-[section:bind basic_socket::bind]
+[section:at_mark basic_raw_socket::at_mark]
-Bind the socket to the given local endpoint.
+[indexterm2 at_mark..basic_raw_socket] Determine whether the socket is at the out-of-band data mark.
- void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+ bool ``[link boost_asio.reference.basic_raw_socket.at_mark.overload1 at_mark]``() const;
- boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ bool ``[link boost_asio.reference.basic_raw_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
-[section:overload1 basic_socket::bind (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::at_mark (1 of 2 overloads)]
-Bind the socket to the given local endpoint.
- void bind(
- const endpoint_type & endpoint);
+['Inherited from basic_socket.]
+Determine whether the socket is at the out-of-band data mark.
-This function binds the socket to the specified endpoint on the local machine.
+ bool at_mark() const;
-[heading Parameters]
-
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
[heading Exceptions]
[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);
- socket.open(boost::asio::ip::tcp::v4());
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345));
-
-
+[endsect]
-[endsect]
+[section:overload2 basic_raw_socket::at_mark (2 of 2 overloads)]
-[section:overload2 basic_socket::bind (2 of 2 overloads)]
+['Inherited from basic_socket.]
-Bind the socket to the given local endpoint.
+Determine whether the socket is at the out-of-band data mark.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ bool at_mark(
+ boost::system::error_code & ec) const;
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
[heading Parameters]
@@ -7140,17 +8403,355 @@
[variablelist
-[[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]
-
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
- boost::asio::ip::tcp::socket socket(io_service);
+
+[endsect]
+
+
+[endsect]
+
+[section:available basic_raw_socket::available]
+
+[indexterm2 available..basic_raw_socket] Determine the number of bytes available for reading.
+
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.available.overload1 available]``() const;
+
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_raw_socket::available (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Determine the number of bytes available for reading.
+
+ std::size_t available() const;
+
+
+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]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_raw_socket::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]
+
+
+[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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_raw_socket basic_raw_socket::basic_raw_socket]
+
+[indexterm2 basic_raw_socket..basic_raw_socket] Construct a basic_raw_socket without opening it.
+
+ ``[link boost_asio.reference.basic_raw_socket.basic_raw_socket.overload1 basic_raw_socket]``(
+ boost::asio::io_service & io_service);
+
+ ``[link boost_asio.reference.basic_raw_socket.basic_raw_socket.overload2 basic_raw_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+
+ ``[link boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3 basic_raw_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+
+ ``[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);
+
+
+[section:overload1 basic_raw_socket::basic_raw_socket (1 of 4 overloads)]
+
+Construct a basic_raw_socket without opening it.
+
+ basic_raw_socket(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a raw socket without opening it. The open() function must be called before data can be sent or received on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_raw_socket::basic_raw_socket (2 of 4 overloads)]
+
+Construct and open a basic_raw_socket.
+
+ basic_raw_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+
+
+This constructor creates and opens a raw socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+
+[[protocol][An object specifying protocol parameters to be used.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload3 basic_raw_socket::basic_raw_socket (3 of 4 overloads)]
+
+Construct a basic_raw_socket, opening it and binding it to the given local endpoint.
+
+ basic_raw_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+
+
+This constructor creates a raw 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]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+
+[[endpoint][An endpoint on the local machine to which the raw socket will be bound.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload4 basic_raw_socket::basic_raw_socket (4 of 4 overloads)]
+
+Construct a basic_raw_socket on an existing native socket.
+
+ basic_raw_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_socket);
+
+
+This constructor creates a raw socket object to hold an existing native socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the raw 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:bind basic_raw_socket::bind]
+
+[indexterm2 bind..basic_raw_socket] Bind the socket to the given local endpoint.
+
+ void ``[link boost_asio.reference.basic_raw_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_raw_socket::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.]]
+
+]
+
+[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());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_raw_socket::bind (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Bind the socket to the given local endpoint.
+
+ 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 Parameters]
+
+
+[variablelist
+
+[[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]
+
+
+
+ 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(
@@ -7171,12 +8772,12 @@
[endsect]
-[section:broadcast basic_socket::broadcast]
+[section:broadcast basic_raw_socket::broadcast]
['Inherited from socket_base.]
-Socket option to permit sending of broadcast messages.
+[indexterm2 broadcast..basic_raw_socket] Socket option to permit sending of broadcast messages.
typedef implementation_defined broadcast;
@@ -7214,12 +8815,12 @@
-[section:bytes_readable basic_socket::bytes_readable]
+[section:bytes_readable basic_raw_socket::bytes_readable]
['Inherited from socket_base.]
-IO control command to get the amount of data that can be read without blocking.
+[indexterm2 bytes_readable..basic_raw_socket] IO control command to get the amount of data that can be read without blocking.
typedef implementation_defined bytes_readable;
@@ -7246,17 +8847,20 @@
[endsect]
-[section:cancel basic_socket::cancel]
+[section:cancel basic_raw_socket::cancel]
-Cancel all asynchronous operations associated with the socket.
+[indexterm2 cancel..basic_raw_socket] Cancel all asynchronous operations associated with the socket.
- void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
+ void ``[link boost_asio.reference.basic_raw_socket.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.cancel.overload2 cancel]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket::cancel (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::cancel (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Cancel all asynchronous operations associated with the socket.
@@ -7297,7 +8901,10 @@
-[section:overload2 basic_socket::cancel (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::cancel (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Cancel all asynchronous operations associated with the socket.
@@ -7340,17 +8947,20 @@
[endsect]
-[section:close basic_socket::close]
+[section:close basic_raw_socket::close]
-Close the socket.
+[indexterm2 close..basic_raw_socket] Close the socket.
- void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
+ void ``[link boost_asio.reference.basic_raw_socket.close.overload1 close]``();
- boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket::close (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::close (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Close the socket.
@@ -7379,7 +8989,10 @@
-[section:overload2 basic_socket::close (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::close (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Close the socket.
@@ -7426,19 +9039,22 @@
[endsect]
-[section:connect basic_socket::connect]
+[section:connect basic_raw_socket::connect]
-Connect the socket to the specified endpoint.
+[indexterm2 connect..basic_raw_socket] Connect the socket to the specified endpoint.
- void ``[link boost_asio.reference.basic_socket.connect.overload1 connect]``(
+ void ``[link boost_asio.reference.basic_raw_socket.connect.overload1 connect]``(
const endpoint_type & peer_endpoint);
- boost::system::error_code ``[link boost_asio.reference.basic_socket.connect.overload2 connect]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.connect.overload2 connect]``(
const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-[section:overload1 basic_socket::connect (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::connect (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Connect the socket to the specified endpoint.
@@ -7448,7 +9064,7 @@
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 returned to the closed state.
+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]
@@ -7487,7 +9103,10 @@
-[section:overload2 basic_socket::connect (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::connect (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Connect the socket to the specified endpoint.
@@ -7498,7 +9117,7 @@
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 returned to the closed state.
+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]
@@ -7537,12 +9156,12 @@
[endsect]
-[section:debug basic_socket::debug]
+[section:debug basic_raw_socket::debug]
['Inherited from socket_base.]
-Socket option to enable socket-level debugging.
+[indexterm2 debug..basic_raw_socket] Socket option to enable socket-level debugging.
typedef implementation_defined debug;
@@ -7580,12 +9199,12 @@
-[section:do_not_route basic_socket::do_not_route]
+[section:do_not_route basic_raw_socket::do_not_route]
['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
+[indexterm2 do_not_route..basic_raw_socket] Socket option to prevent routing, use local interfaces only.
typedef implementation_defined do_not_route;
@@ -7623,12 +9242,12 @@
-[section:enable_connection_aborted basic_socket::enable_connection_aborted]
+[section:enable_connection_aborted basic_raw_socket::enable_connection_aborted]
['Inherited from socket_base.]
-Socket option to report aborted connections on accept.
+[indexterm2 enable_connection_aborted..basic_raw_socket] Socket option to report aborted connections on accept.
typedef implementation_defined enable_connection_aborted;
@@ -7666,9 +9285,9 @@
-[section:endpoint_type basic_socket::endpoint_type]
+[section:endpoint_type basic_raw_socket::endpoint_type]
-The endpoint type.
+[indexterm2 endpoint_type..basic_raw_socket] The endpoint type.
typedef Protocol::endpoint endpoint_type;
@@ -7679,12 +9298,12 @@
-[section:get_io_service basic_socket::get_io_service]
+[section:get_io_service basic_raw_socket::get_io_service]
['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_raw_socket] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -7701,28 +9320,25 @@
[endsect]
-[section:get_option basic_socket::get_option]
+[section:get_option basic_raw_socket::get_option]
-Get an option from the socket.
+[indexterm2 get_option..basic_raw_socket] Get an option from the socket.
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
+ void ``[link boost_asio.reference.basic_raw_socket.get_option.overload1 get_option]``(
GettableSocketOption & option) const;
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.get_option.overload2 get_option]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.get_option.overload2 get_option]``(
GettableSocketOption & option,
boost::system::error_code & ec) const;
-[section:overload1 basic_socket::get_option (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::get_option (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Get an option from the socket.
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
void get_option(
GettableSocketOption & option) const;
@@ -7767,12 +9383,13 @@
-[section:overload2 basic_socket::get_option (2 of 2 overloads)]
+[section:overload2 basic_raw_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;
@@ -7818,12 +9435,27 @@
[endsect]
-[section:implementation_type basic_socket::implementation_type]
+[section:implementation basic_raw_socket::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_raw_socket] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type basic_raw_socket::implementation_type]
['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_raw_socket] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -7833,28 +9465,25 @@
[endsect]
-[section:io_control basic_socket::io_control]
+[section:io_control basic_raw_socket::io_control]
-Perform an IO control command on the socket.
+[indexterm2 io_control..basic_raw_socket] Perform an IO control command on the socket.
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void ``[link boost_asio.reference.basic_socket.io_control.overload1 io_control]``(
+ void ``[link boost_asio.reference.basic_raw_socket.io_control.overload1 io_control]``(
IoControlCommand & command);
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.io_control.overload2 io_control]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.io_control.overload2 io_control]``(
IoControlCommand & command,
boost::system::error_code & ec);
-[section:overload1 basic_socket::io_control (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::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);
@@ -7899,12 +9528,13 @@
-[section:overload2 basic_socket::io_control (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::io_control (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Perform an IO control command on the socket.
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
boost::system::error_code io_control(
IoControlCommand & command,
boost::system::error_code & ec);
@@ -7950,12 +9580,12 @@
[endsect]
-[section:io_service basic_socket::io_service]
+[section:io_service basic_raw_socket::io_service]
['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_raw_socket] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -7973,9 +9603,12 @@
-[section:is_open basic_socket::is_open]
+[section:is_open basic_raw_socket::is_open]
+
-Determine whether the socket is open.
+['Inherited from basic_socket.]
+
+[indexterm2 is_open..basic_raw_socket] Determine whether the socket is open.
bool is_open() const;
@@ -7985,12 +9618,12 @@
-[section:keep_alive basic_socket::keep_alive]
+[section:keep_alive basic_raw_socket::keep_alive]
['Inherited from socket_base.]
-Socket option to send keep-alives.
+[indexterm2 keep_alive..basic_raw_socket] Socket option to send keep-alives.
typedef implementation_defined keep_alive;
@@ -8028,12 +9661,12 @@
-[section:linger basic_socket::linger]
+[section:linger basic_raw_socket::linger]
['Inherited from socket_base.]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[indexterm2 linger..basic_raw_socket] Socket option to specify whether the socket lingers on close if unsent data is present.
typedef implementation_defined linger;
@@ -8071,17 +9704,20 @@
[endsect]
-[section:local_endpoint basic_socket::local_endpoint]
+[section:local_endpoint basic_raw_socket::local_endpoint]
-Get the local endpoint of the socket.
+[indexterm2 local_endpoint..basic_raw_socket] Get the local endpoint of the socket.
- endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload1 local_endpoint]``() const;
+ endpoint_type ``[link boost_asio.reference.basic_raw_socket.local_endpoint.overload1 local_endpoint]``() const;
- endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload2 local_endpoint]``(
+ endpoint_type ``[link boost_asio.reference.basic_raw_socket.local_endpoint.overload2 local_endpoint]``(
boost::system::error_code & ec) const;
-[section:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::local_endpoint (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Get the local endpoint of the socket.
@@ -8121,7 +9757,10 @@
-[section:overload2 basic_socket::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::local_endpoint (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Get the local endpoint of the socket.
@@ -8169,9 +9808,12 @@
[endsect]
-[section:lowest_layer basic_socket::lowest_layer]
+[section:lowest_layer basic_raw_socket::lowest_layer]
+
+
+['Inherited from basic_socket.]
-Get a reference to the lowest layer.
+[indexterm2 lowest_layer..basic_raw_socket] Get a reference to the lowest layer.
lowest_layer_type & lowest_layer();
@@ -8189,11 +9831,14 @@
-[section:lowest_layer_type basic_socket::lowest_layer_type]
+[section:lowest_layer_type basic_raw_socket::lowest_layer_type]
-A basic_socket is always the lowest layer.
- typedef basic_socket< Protocol, SocketService > lowest_layer_type;
+['Inherited from basic_socket.]
+
+[indexterm2 lowest_layer_type..basic_raw_socket] A basic_socket is always the lowest layer.
+
+ typedef basic_socket< Protocol, RawSocketService > lowest_layer_type;
[heading Types]
@@ -8460,6 +10105,17 @@
]
+[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]]
@@ -8486,6 +10142,22 @@
]
+[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 basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
@@ -8502,12 +10174,12 @@
-[section:max_connections basic_socket::max_connections]
+[section:max_connections basic_raw_socket::max_connections]
['Inherited from socket_base.]
-The maximum length of the queue of pending incoming connections.
+[indexterm2 max_connections..basic_raw_socket] The maximum length of the queue of pending incoming connections.
static const int max_connections = implementation_defined;
@@ -8517,12 +10189,12 @@
-[section:message_do_not_route basic_socket::message_do_not_route]
+[section:message_do_not_route basic_raw_socket::message_do_not_route]
['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
+[indexterm2 message_do_not_route..basic_raw_socket] Specify that the data should not be subject to routing.
static const int message_do_not_route = implementation_defined;
@@ -8532,12 +10204,12 @@
-[section:message_flags basic_socket::message_flags]
+[section:message_flags basic_raw_socket::message_flags]
['Inherited from socket_base.]
-Bitmask type for flags that can be passed to send and receive operations.
+[indexterm2 message_flags..basic_raw_socket] Bitmask type for flags that can be passed to send and receive operations.
typedef int message_flags;
@@ -8548,12 +10220,12 @@
-[section:message_out_of_band basic_socket::message_out_of_band]
+[section:message_out_of_band basic_raw_socket::message_out_of_band]
['Inherited from socket_base.]
-Process out-of-band data.
+[indexterm2 message_out_of_band..basic_raw_socket] Process out-of-band data.
static const int message_out_of_band = implementation_defined;
@@ -8563,12 +10235,12 @@
-[section:message_peek basic_socket::message_peek]
+[section:message_peek basic_raw_socket::message_peek]
['Inherited from socket_base.]
-Peek at incoming data without removing it from the input queue.
+[indexterm2 message_peek..basic_raw_socket] Peek at incoming data without removing it from the input queue.
static const int message_peek = implementation_defined;
@@ -8578,9 +10250,12 @@
-[section:native basic_socket::native]
+[section:native basic_raw_socket::native]
+
+
+['Inherited from basic_socket.]
-Get the native socket representation.
+[indexterm2 native..basic_raw_socket] Get the native socket representation.
native_type native();
@@ -8592,11 +10267,11 @@
-[section:native_type basic_socket::native_type]
+[section:native_type basic_raw_socket::native_type]
-The native representation of a socket.
+[indexterm2 native_type..basic_raw_socket] The native representation of a socket.
- typedef SocketService::native_type native_type;
+ typedef RawSocketService::native_type native_type;
@@ -8605,12 +10280,12 @@
-[section:non_blocking_io basic_socket::non_blocking_io]
+[section:non_blocking_io basic_raw_socket::non_blocking_io]
['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+[indexterm2 non_blocking_io..basic_raw_socket] IO control command to set the blocking mode of the socket.
typedef implementation_defined non_blocking_io;
@@ -8636,19 +10311,22 @@
[endsect]
-[section:open basic_socket::open]
+[section:open basic_raw_socket::open]
-Open the socket using the specified protocol.
+[indexterm2 open..basic_raw_socket] Open the socket using the specified protocol.
- void ``[link boost_asio.reference.basic_socket.open.overload1 open]``(
+ void ``[link boost_asio.reference.basic_raw_socket.open.overload1 open]``(
const protocol_type & protocol = protocol_type());
- boost::system::error_code ``[link boost_asio.reference.basic_socket.open.overload2 open]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.open.overload2 open]``(
const protocol_type & protocol,
boost::system::error_code & ec);
-[section:overload1 basic_socket::open (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::open (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Open the socket using the specified protocol.
@@ -8693,7 +10371,10 @@
-[section:overload2 basic_socket::open (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::open (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
Open the socket using the specified protocol.
@@ -8739,9 +10420,9 @@
[endsect]
-[section:protocol_type basic_socket::protocol_type]
+[section:protocol_type basic_raw_socket::protocol_type]
-The protocol type.
+[indexterm2 protocol_type..basic_raw_socket] The protocol type.
typedef Protocol protocol_type;
@@ -8751,132 +10432,210 @@
[endsect]
+[section:receive basic_raw_socket::receive]
-[section:receive_buffer_size basic_socket::receive_buffer_size]
+[indexterm2 receive..basic_raw_socket] Receive some data on a connected socket.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive.overload1 receive]``(
+ const MutableBufferSequence & buffers);
-['Inherited from socket_base.]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive.overload2 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags);
-Socket option for the receive buffer size of a socket.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive.overload3 receive]``(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
- typedef implementation_defined receive_buffer_size;
+[section:overload1 basic_raw_socket::receive (1 of 3 overloads)]
+Receive some data on a connected socket.
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers);
-[heading Examples]
-
-Setting the option:
+This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+]
-Getting the current option value:
+[heading Return Value]
+
+The number of bytes received.
- 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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
+[heading Remarks]
+
+The receive operation can only be used with a connected socket. Use the receive\_from function to receive data on an unconnected raw 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.
-[section:receive_low_watermark basic_socket::receive_low_watermark]
+[endsect]
-['Inherited from socket_base.]
-Socket option for the receive low watermark.
- typedef implementation_defined receive_low_watermark;
+[section:overload2 basic_raw_socket::receive (2 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,
+ socket_base::message_flags flags);
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.
-[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);
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+[[flags][Flags specifying how the receive call is to be made.]]
+]
-Getting the current option value:
+[heading Return Value]
+
+The number of bytes received.
- 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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
+[heading Remarks]
+
+The receive operation can only be used with a connected socket. Use the receive\_from function to receive data on an unconnected raw socket.
[endsect]
-[section:remote_endpoint basic_socket::remote_endpoint]
-Get the remote endpoint of the socket.
+[section:overload3 basic_raw_socket::receive (3 of 3 overloads)]
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+Receive some data on a connected socket.
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
+ 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);
-[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
+This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.
-Get the remote endpoint of the socket.
- endpoint_type remote_endpoint() const;
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
-This function is used to obtain the remote endpoint of the socket.
+[[flags][Flags specifying how the receive call is to be made.]]
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
[heading Return Value]
-An object that represents the remote endpoint of the socket.
+The number of bytes received.
-[heading Exceptions]
-
+[heading Remarks]
+
+The receive operation can only be used with a connected socket. Use the receive\_from function to receive data on an unconnected raw socket.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
+[endsect]
+
+
+[endsect]
+
+
+[section:receive_buffer_size basic_raw_socket::receive_buffer_size]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 receive_buffer_size..basic_raw_socket] Socket option for the receive buffer size of a socket.
+
+ typedef implementation_defined receive_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+
+
+[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);
- boost::asio::ip::tcp::socket socket(io_service);
+
+
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+ boost::asio::socket_base::receive_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
@@ -8886,16 +10645,44 @@
[endsect]
+[section:receive_from basic_raw_socket::receive_from]
-[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
+[indexterm2 receive_from..basic_raw_socket] Receive raw data with the endpoint of the sender.
-Get the remote endpoint of the socket.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive_from.overload1 receive_from]``(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint);
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive_from.overload2 receive_from]``(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags);
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.receive_from.overload3 receive_from]``(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
-This function is used to obtain the remote endpoint of the socket.
+[section:overload1 basic_raw_socket::receive_from (1 of 3 overloads)]
+
+Receive raw data with the endpoint of the sender.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive_from(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint);
+
+
+This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.
[heading Parameters]
@@ -8903,74 +10690,84 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[buffers][One or more buffers into which the data will be received.]]
+
+[[sender_endpoint][An endpoint object that receives the endpoint of the remote sender of the data.]]
]
[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]
-
+The number of bytes received.
+[heading Exceptions]
+
- 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.
- }
+[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:
+ boost::asio::ip::udp::endpoint sender_endpoint;
+ socket.receive_from(
+ boost::asio::buffer(data, size), sender_endpoint);
+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:reuse_address basic_socket::reuse_address]
-
-['Inherited from socket_base.]
+[section:overload2 basic_raw_socket::receive_from (2 of 3 overloads)]
-Socket option to allow the socket to be bound to an address that is already in use.
+Receive raw data with the endpoint of the sender.
- typedef implementation_defined reuse_address;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive_from(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags);
+This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
-
+[[buffers][One or more buffers into which the data will be received.]]
+[[sender_endpoint][An endpoint object that receives the endpoint of the remote sender of the data.]]
+[[flags][Flags specifying how the receive call is to be made.]]
-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();
+[heading Return Value]
+
+The number of bytes received.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -8978,61 +10775,61 @@
-[section:send_buffer_size basic_socket::send_buffer_size]
-
-
-['Inherited from socket_base.]
+[section:overload3 basic_raw_socket::receive_from (3 of 3 overloads)]
-Socket option for the send buffer size of a socket.
+Receive raw data with the endpoint of the sender.
- typedef implementation_defined send_buffer_size;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive_from(
+ const MutableBufferSequence & buffers,
+ endpoint_type & sender_endpoint,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
+This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.
-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);
-
+[[buffers][One or more buffers into which the data will be received.]]
+[[sender_endpoint][An endpoint object that receives the endpoint of the remote sender of the data.]]
+[[flags][Flags specifying how the receive call is to be made.]]
-Getting the current option value:
+[[ec][Set to indicate what error occurred, if any.]]
- 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]
+
+The number of bytes received.
+[endsect]
[endsect]
-
-[section:send_low_watermark basic_socket::send_low_watermark]
+[section:receive_low_watermark basic_raw_socket::receive_low_watermark]
['Inherited from socket_base.]
-Socket option for the send low watermark.
+[indexterm2 receive_low_watermark..basic_raw_socket] Socket option for the receive low watermark.
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined receive_low_watermark;
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
[heading Examples]
@@ -9041,7 +10838,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_low_watermark option(1024);
+ boost::asio::socket_base::receive_low_watermark option(1024);
socket.set_option(option);
@@ -9051,7 +10848,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_low_watermark option;
+ boost::asio::socket_base::receive_low_watermark option;
socket.get_option(option);
int size = option.value();
@@ -9063,59 +10860,32 @@
[endsect]
+[section:remote_endpoint basic_raw_socket::remote_endpoint]
-[section:service_type basic_socket::service_type]
-
-
-['Inherited from basic_io_object.]
-
-The type of the service that will be used to provide I/O operations.
-
- typedef SocketService service_type;
-
-
-
-
-[endsect]
-
-
-[section:set_option basic_socket::set_option]
-
-Set an option on the socket.
+[indexterm2 remote_endpoint..basic_raw_socket] Get the remote endpoint of the socket.
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
+ endpoint_type ``[link boost_asio.reference.basic_raw_socket.remote_endpoint.overload1 remote_endpoint]``() const;
- 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);
+ endpoint_type ``[link boost_asio.reference.basic_raw_socket.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
-[section:overload1 basic_socket::set_option (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::remote_endpoint (1 of 2 overloads)]
-Set an option on the socket.
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+['Inherited from basic_socket.]
+Get the remote endpoint of the socket.
-This function is used to set an option on the socket.
+ endpoint_type remote_endpoint() const;
-[heading Parameters]
-
+This function is used to obtain the remote endpoint of the socket.
-[variablelist
-
-[[option][The new option value to be set on the socket.]]
-]
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket.
[heading Exceptions]
@@ -9128,12 +10898,11 @@
[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);
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
@@ -9144,18 +10913,18 @@
-[section:overload2 basic_socket::set_option (2 of 2 overloads)]
+[section:overload2 basic_raw_socket::remote_endpoint (2 of 2 overloads)]
-Set an option on the socket.
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+['Inherited from basic_socket.]
+
+Get the remote endpoint of the socket.
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
-This function is used to set an option on the socket.
+
+This function is used to obtain the remote endpoint of the socket.
[heading Parameters]
@@ -9163,21 +10932,22 @@
[variablelist
-[[option][The new option value to be set on the socket.]]
-
[[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]
-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);
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
if (ec)
{
// An error occurred.
@@ -9193,54 +10963,40 @@
[endsect]
-[section:shutdown basic_socket::shutdown]
-
-Disable sends or receives on the socket.
-
- void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
- boost::system::error_code ``[link boost_asio.reference.basic_socket.shutdown.overload2 shutdown]``(
- shutdown_type what,
- boost::system::error_code & ec);
+[section:reuse_address basic_raw_socket::reuse_address]
-[section:overload1 basic_socket::shutdown (1 of 2 overloads)]
+['Inherited from socket_base.]
-Disable sends or receives on the socket.
+[indexterm2 reuse_address..basic_raw_socket] Socket option to allow the socket to be bound to an address that is already in use.
- void shutdown(
- shutdown_type what);
+ typedef implementation_defined reuse_address;
-This function is used to disable send operations, receive operations, or both.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[what][Determines what types of operation will no longer be allowed.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
-
-Shutting down the send side of the socket:
+Getting the current option value:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
@@ -9250,17 +11006,40 @@
[endsect]
+[section:send basic_raw_socket::send]
-[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
+[indexterm2 send..basic_raw_socket] Send some data on a connected socket.
-Disable sends or receives on the socket.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send.overload1 send]``(
+ const ConstBufferSequence & buffers);
- boost::system::error_code shutdown(
- shutdown_type what,
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send.overload2 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send.overload3 send]``(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
boost::system::error_code & ec);
-This function is used to disable send operations, receive operations, or both.
+[section:overload1 basic_raw_socket::send (1 of 3 overloads)]
+
+Send some data on a connected socket.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers);
+
+
+This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.
[heading Parameters]
@@ -9268,407 +11047,259 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[buffers][One ore more data buffers to be sent on the socket.]]
-[[ec][Set to indicate what error occurred, if any.]]
+]
+
+[heading Return Value]
+
+The number of bytes sent.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
]
+[heading Remarks]
+
+The send operation can only be used with a connected socket. Use the send\_to function to send data on an unconnected raw socket.
+
[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.
- }
+To send a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+ socket.send(boost::asio::buffer(data, size));
+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:overload2 basic_raw_socket::send (2 of 3 overloads)]
-[section:shutdown_type basic_socket::shutdown_type]
+Send some data on a connected socket.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
-['Inherited from socket_base.]
+This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.
-Different ways a socket may be shutdown.
- enum shutdown_type
+[heading Parameters]
+
-[heading Values]
[variablelist
+
+[[buffers][One ore more data buffers to be sent on the socket.]]
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+[[flags][Flags specifying how the send call is to be made.]]
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+]
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
+[heading Return Value]
+
+The number of bytes sent.
-]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[heading Remarks]
+
+The send operation can only be used with a connected socket. Use the send\_to function to send data on an unconnected raw socket.
[endsect]
-[section:basic_socket_acceptor basic_socket_acceptor]
-Provides the ability to accept new connections.
- 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
+[section:overload3 basic_raw_socket::send (3 of 3 overloads)]
+Send some data on a connected socket.
-[heading Types]
-[table
- [[Name][Description]]
+ 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_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.
- [
- [[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]
+
+
+[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_acceptor.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+[[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. ]
-
- ]
+[heading Return Value]
+
+The number of bytes sent.
- [
+[heading Remarks]
+
+The send operation can only be used with a connected socket. Use the send\_to function to send data on an unconnected raw socket.
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[section:send_buffer_size basic_raw_socket::send_buffer_size]
- [
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+['Inherited from socket_base.]
- [
+[indexterm2 send_buffer_size..basic_raw_socket] Socket option for the send buffer size of a socket.
- [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+ typedef implementation_defined send_buffer_size;
- [
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
- [
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
- [[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 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.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. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.basic_socket_acceptor.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::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
- [
- [[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. ]
-
- ]
+[endsect]
- [
- [[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. ]
-
- ]
- [
+[section:send_low_watermark basic_raw_socket::send_low_watermark]
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
-]
+['Inherited from socket_base.]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 send_low_watermark..basic_raw_socket] Socket option for the send low watermark.
- [
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
- [Accept a new connection. ]
- ]
-
- [
- [[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. ]
- ]
-
- [
- [[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. ]
- ]
-
-]
+ typedef implementation_defined send_low_watermark;
-[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. ]
- ]
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
- [
- [[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 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);
-The basic_socket_acceptor class template is used for accepting new socket connections.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+Getting the current option value:
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+ 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::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();
-[section:accept basic_socket_acceptor::accept]
+[endsect]
-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);
+[section:send_to basic_raw_socket::send_to]
+
+[indexterm2 send_to..basic_raw_socket] Send raw data to the specified endpoint.
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);
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send_to.overload1 send_to]``(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination);
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);
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send_to.overload2 send_to]``(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags);
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,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_raw_socket.send_to.overload3 send_to]``(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)]
+[section:overload1 basic_raw_socket::send_to (1 of 3 overloads)]
-Accept a new connection.
+Send raw data to the specified endpoint.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer);
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send_to(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination);
-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.
+This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
[heading Parameters]
@@ -9676,10 +11307,16 @@
[variablelist
-[[peer][The socket into which the new connection will be accepted.]]
+[[buffers][One or more data buffers to be sent to the remote endpoint.]]
+
+[[destination][The remote endpoint to which the data will be sent.]]
]
+[heading Return Value]
+
+The number of bytes sent.
+
[heading Exceptions]
@@ -9691,15 +11328,63 @@
[heading Example]
+To send a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ boost::asio::ip::udp::endpoint destination(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.send_to(boost::asio::buffer(data, size), destination);
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- acceptor.accept(socket);
+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:overload2 basic_raw_socket::send_to (2 of 3 overloads)]
+
+Send raw data to the specified endpoint.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send_to(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags);
+
+
+This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be sent to the remote endpoint.]]
+
+[[destination][The remote endpoint to which the data will be sent.]]
+
+[[flags][Flags specifying how the send call is to be made.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes sent.
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
@@ -9707,18 +11392,20 @@
-[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)]
+[section:overload3 basic_raw_socket::send_to (3 of 3 overloads)]
-Accept a new connection.
+Send raw data to the specified endpoint.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send_to(
+ const ConstBufferSequence & buffers,
+ const endpoint_type & destination,
+ socket_base::message_flags flags,
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.
+This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
[heading Parameters]
@@ -9726,27 +11413,51 @@
[variablelist
-[[peer][The socket into which the new connection will be accepted.]]
+[[buffers][One or more data buffers to be sent to the remote endpoint.]]
+
+[[destination][The remote endpoint to which the data will be sent.]]
+
+[[flags][Flags specifying how the send call is to be made.]]
[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Example]
-
+[heading Return Value]
+
+The number of bytes sent.
- 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.
- }
+
+[endsect]
+
+
+[endsect]
+
+
+[section:service basic_raw_socket::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_raw_socket] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+[section:service_type basic_raw_socket::service_type]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service_type..basic_raw_socket] The type of the service that will be used to provide I/O operations.
+
+ typedef RawSocketService service_type;
@@ -9754,19 +11465,30 @@
[endsect]
+[section:set_option basic_raw_socket::set_option]
-[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
+[indexterm2 set_option..basic_raw_socket] Set an option on the socket.
-Accept a new connection and obtain the endpoint of the peer.
+ void ``[link boost_asio.reference.basic_raw_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint);
+ boost::system::error_code ``[link boost_asio.reference.basic_raw_socket.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ 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.
+[section:overload1 basic_raw_socket::set_option (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ void set_option(
+ const SettableSocketOption & option);
+
+
+This function is used to set an option on the socket.
[heading Parameters]
@@ -9774,9 +11496,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.]]
+[[option][The new option value to be set on the socket.]]
]
@@ -9791,13 +11511,12 @@
[heading Example]
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
-
- 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);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
@@ -9808,19 +11527,19 @@
-[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)]
+[section:overload2 basic_raw_socket::set_option (2 of 2 overloads)]
-Accept a new connection and obtain the endpoint of the peer.
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
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 is used to set an option on the socket.
[heading Parameters]
@@ -9828,9 +11547,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.]]
+[[option][The new option value to be set on the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -9838,14 +11555,13 @@
[heading Example]
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
-
- 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::tcp::no_delay option(true);
boost::system::error_code ec;
- acceptor.accept(socket, endpoint, ec);
+ socket.set_option(option, ec);
if (ec)
{
// An error occurred.
@@ -9861,83 +11577,80 @@
[endsect]
-[section:assign basic_socket_acceptor::assign]
+[section:shutdown basic_raw_socket::shutdown]
-Assigns an existing native acceptor to the acceptor.
+[indexterm2 shutdown..basic_raw_socket] Disable sends or receives on the socket.
- void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_acceptor);
+ void ``[link boost_asio.reference.basic_raw_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
- 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 ``[link boost_asio.reference.basic_raw_socket.shutdown.overload2 shutdown]``(
+ shutdown_type what,
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
+[section:overload1 basic_raw_socket::shutdown (1 of 2 overloads)]
-Assigns an existing native acceptor to the acceptor.
- void assign(
- const protocol_type & protocol,
- const native_type & native_acceptor);
+['Inherited from basic_socket.]
+Disable sends or receives on the socket.
+ void shutdown(
+ shutdown_type what);
-[endsect]
+This function is used to disable send operations, receive operations, or both.
-[section:overload2 basic_socket_acceptor::assign (2 of 2 overloads)]
+[heading Parameters]
+
-Assigns an existing native acceptor to the acceptor.
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[endsect]
+]
+[heading Example]
+
+Shutting down the send side of the socket:
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
-[section:async_accept basic_socket_acceptor::async_accept]
-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);
- 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);
-[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
+[endsect]
-Start an asynchronous accept.
- 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);
+[section:overload2 basic_raw_socket::shutdown (2 of 2 overloads)]
-This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
+
+['Inherited from basic_socket.]
+
+Disable sends or receives on the socket.
+
+ 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]
@@ -9945,38 +11658,25 @@
[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.]]
-
-[[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.
- );
+[[what][Determines what types of operation will no longer be allowed.]]
-``
-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]
+Shutting down the send side of the socket:
-
- void accept_handler(const boost::system::error_code& error)
+ 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)
{
- if (!error)
- {
- // Accept succeeded.
- }
+ // An error occurred.
}
- ...
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::socket socket(io_service);
- acceptor.async_accept(socket, accept_handler);
-
@@ -9985,40 +11685,35 @@
[endsect]
+[endsect]
-[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
-
-Start an asynchronous accept.
- 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);
+[section:shutdown_type basic_raw_socket::shutdown_type]
-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.
+['Inherited from socket_base.]
+[indexterm2 shutdown_type..basic_raw_socket] Different ways a socket may be shutdown.
-[heading Parameters]
-
+ enum shutdown_type
+[heading Values]
[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.]]
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
-[[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.
- );
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
-``
-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(). ]]
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
]
@@ -10027,87 +11722,189 @@
[endsect]
-[endsect]
-
-[section:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
-Construct an acceptor without opening it.
+[endsect]
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``(
- boost::asio::io_service & io_service);
+[section:basic_serial_port basic_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);
+Provides serial port functionality.
- ``[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);
+ template<
+ typename ``[link boost_asio.reference.SerialPortService SerialPortService]`` = serial_port_service>
+ class basic_serial_port :
+ public basic_io_object< SerialPortService >,
+ public serial_port_base
- ``[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);
+[heading Types]
+[table
+ [[Name][Description]]
-[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
+ [
-Construct an acceptor without opening it.
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
- basic_socket_acceptor(
- boost::asio::io_service & io_service);
+ [
+ [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_serial_port is always the lowest layer. ]
+
+ ]
-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.
+ [
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [The native representation of a serial port. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[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. ]
-[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
+ ]
]
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
+ [Get a 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. ]
+ ]
+
+]
-[endsect]
+[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_serial_port.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
+]
-Construct an open acceptor.
+The basic_serial_port class template provides functionality that is common to all serial ports.
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-This constructor creates an acceptor and automatically opens it.
+[*Shared] [*objects:] Unsafe.
-[heading Parameters]
-
+[section:assign basic_serial_port::assign]
-[variablelist
-
-[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
+[indexterm2 assign..basic_serial_port] Assign an existing native serial port to the serial port.
-[[protocol][An object specifying protocol parameters to be used.]]
+ void ``[link boost_asio.reference.basic_serial_port.assign.overload1 assign]``(
+ const native_type & native_serial_port);
-]
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.assign.overload2 assign]``(
+ const native_type & native_serial_port,
+ boost::system::error_code & ec);
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[section:overload1 basic_serial_port::assign (1 of 2 overloads)]
-]
+Assign an existing native serial port to the serial port.
+
+ void assign(
+ const native_type & native_serial_port);
@@ -10115,54 +11912,70 @@
-[section:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
+[section:overload2 basic_serial_port::assign (2 of 2 overloads)]
-Construct an acceptor opened on the given endpoint.
+Assign an existing native serial port to the serial port.
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint,
- bool reuse_addr = true);
+ boost::system::error_code assign(
+ const native_type & native_serial_port,
+ boost::system::error_code & ec);
-This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
+[endsect]
-[[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.]]
+[section:async_read_some basic_serial_port::async_read_some]
-]
+[indexterm2 async_read_some..basic_serial_port] Start an asynchronous read.
-[heading Exceptions]
+ template<
+ 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 read data from the serial port. The function call always returns immediately.
+
+
+[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 Remarks]
-This constructor is equivalent to the following code:
+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.
- 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]
+
+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.
@@ -10170,17 +11983,19 @@
-[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
+[section:async_write_some basic_serial_port::async_write_some]
-Construct a basic_socket_acceptor on an existing native acceptor.
+[indexterm2 async_write_some..basic_serial_port] Start an asynchronous write.
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_acceptor);
+ 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 constructor creates an acceptor object to hold an existing native acceptor.
+This function is used to asynchronously write data to the serial port. The function call always returns immediately.
[heading Parameters]
@@ -10188,98 +12003,96 @@
[variablelist
-[[io_service][The 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.]]
+[[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.]]
-[[native_acceptor][A native acceptor.]]
+[[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 Exceptions]
-
+[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.
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure. ]]
+To write 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);
+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:bind basic_socket_acceptor::bind]
-Bind the acceptor to the given local endpoint.
+[section:basic_serial_port basic_serial_port::basic_serial_port]
- void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+[indexterm2 basic_serial_port..basic_serial_port] Construct a basic_serial_port without opening it.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 basic_serial_port]``(
+ boost::asio::io_service & io_service);
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const char * device);
-[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const std::string & device);
-Bind the acceptor to the given local endpoint.
+ ``[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);
- void bind(
- const endpoint_type & endpoint);
+[section:overload1 basic_serial_port::basic_serial_port (1 of 4 overloads)]
-This function binds the socket acceptor to the specified endpoint on the local machine.
+Construct a basic_serial_port without opening it.
+ basic_serial_port(
+ boost::asio::io_service & io_service);
-[heading Parameters]
-
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+This constructor creates a serial port without opening it.
-]
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[io_service][The io\_service object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]]
]
-[heading Example]
-
-
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
- acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
-
-
-
-
[endsect]
-[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
+[section:overload2 basic_serial_port::basic_serial_port (2 of 4 overloads)]
-Bind the acceptor to the given local endpoint.
+Construct and open a basic_serial_port.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const char * device);
-This function binds the socket acceptor to the specified endpoint on the local machine.
+This constructor creates and opens a serial port for the specified device name.
[heading Parameters]
@@ -10287,72 +12100,40 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+[[io_service][The io\_service object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[device][The platform-specific device name for this serial port. ]]
]
-[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.
- }
-
-
-
-
-
-
-[endsect]
[endsect]
-[section:broadcast basic_socket_acceptor::broadcast]
-
-['Inherited from socket_base.]
+[section:overload3 basic_serial_port::basic_serial_port (3 of 4 overloads)]
-Socket option to permit sending of broadcast messages.
+Construct and open a basic_serial_port.
- typedef implementation_defined broadcast;
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const std::string & device);
+This constructor creates and opens a serial port for the specified device name.
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-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();
-
+[[io_service][The 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. ]]
+]
@@ -10360,56 +12141,63 @@
-[section:bytes_readable basic_socket_acceptor::bytes_readable]
-
-
-['Inherited from socket_base.]
+[section:overload4 basic_serial_port::basic_serial_port (4 of 4 overloads)]
-IO control command to get the amount of data that can be read without blocking.
+Construct a basic_serial_port on an existing native serial port.
- typedef implementation_defined bytes_readable;
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const native_type & native_serial_port);
+This constructor creates a serial port object to hold an existing native serial port.
-Implements the FIONREAD IO control command.
+[heading Parameters]
+
-[heading Example]
+[variablelist
+[[io_service][The 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.]]
- 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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
[endsect]
-[section:cancel basic_socket_acceptor::cancel]
+[endsect]
-Cancel all asynchronous operations associated with the acceptor.
+[section:cancel basic_serial_port::cancel]
- void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
+[indexterm2 cancel..basic_serial_port] Cancel all asynchronous operations associated with the serial port.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
+ void ``[link boost_asio.reference.basic_serial_port.cancel.overload1 cancel]``();
+
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.cancel.overload2 cancel]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
+[section:overload1 basic_serial_port::cancel (1 of 2 overloads)]
-Cancel all asynchronous operations associated with the acceptor.
+Cancel all asynchronous operations associated with the serial port.
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.
+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]
@@ -10427,15 +12215,15 @@
-[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
+[section:overload2 basic_serial_port::cancel (2 of 2 overloads)]
-Cancel all asynchronous operations associated with the acceptor.
+Cancel all asynchronous operations associated with the serial port.
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.
+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]
@@ -10454,26 +12242,24 @@
[endsect]
-[section:close basic_socket_acceptor::close]
+[section:close basic_serial_port::close]
-Close the acceptor.
+[indexterm2 close..basic_serial_port] Close the serial port.
- void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
+ void ``[link boost_asio.reference.basic_serial_port.close.overload1 close]``();
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
+[section:overload1 basic_serial_port::close (1 of 2 overloads)]
-Close the acceptor.
+Close the serial port.
void close();
-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 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]
@@ -10491,17 +12277,15 @@
-[section:overload2 basic_socket_acceptor::close (2 of 2 overloads)]
+[section:overload2 basic_serial_port::close (2 of 2 overloads)]
-Close the acceptor.
+Close the serial port.
boost::system::error_code close(
boost::system::error_code & ec);
-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 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]
@@ -10509,182 +12293,24 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[ec][Set to indicate what error occurred, if any. ]]
]
-[heading Example]
-
-
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::system::error_code ec;
- acceptor.close(ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:debug basic_socket_acceptor::debug]
-
-
-['Inherited from socket_base.]
-
-Socket option to enable socket-level debugging.
-
- typedef implementation_defined debug;
-
-
-
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
-
-
-[heading Examples]
-
-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();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:do_not_route basic_socket_acceptor::do_not_route]
-
-
-['Inherited from socket_base.]
-
-Socket option to prevent routing, use local interfaces only.
-
- typedef implementation_defined do_not_route;
-
-
-
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-
-
-[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);
-
-
-
-
-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();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
-
-
-['Inherited from socket_base.]
-
-Socket option to report aborted connections on accept.
-
- 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:
-
- 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();
-
-
-
-
[endsect]
-
-[section:endpoint_type basic_socket_acceptor::endpoint_type]
-
-The endpoint type.
-
- typedef Protocol::endpoint endpoint_type;
-
-
-
-
[endsect]
-
-[section:get_io_service basic_socket_acceptor::get_io_service]
+[section:get_io_service basic_serial_port::get_io_service]
['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_serial_port] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -10701,33 +12327,33 @@
[endsect]
-[section:get_option basic_socket_acceptor::get_option]
+[section:get_option basic_serial_port::get_option]
-Get an option from the acceptor.
+[indexterm2 get_option..basic_serial_port] Get an option from the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
- GettableSocketOption & option);
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.get_option.overload1 get_option]``(
+ GettableSerialPortOption & option);
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,
+ 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);
-[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
+[section:overload1 basic_serial_port::get_option (1 of 2 overloads)]
-Get an option from the acceptor.
+Get an option from the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
void get_option(
- GettableSocketOption & option);
+ GettableSerialPortOption & option);
-This function is used to get the current value of an option on the acceptor.
+This function is used to get the current value of an option on the serial port.
[heading Parameters]
@@ -10735,7 +12361,7 @@
[variablelist
-[[option][The option value to be obtained from the acceptor.]]
+[[option][The option value to be obtained from the serial port.]]
]
@@ -10748,37 +12374,24 @@
]
-[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();
-
-
-
-
[endsect]
-[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
+[section:overload2 basic_serial_port::get_option (2 of 2 overloads)]
-Get an option from the acceptor.
+Get an option from the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
boost::system::error_code get_option(
- GettableSocketOption & option,
+ GettableSerialPortOption & option,
boost::system::error_code & ec);
-This function is used to get the current value of an option on the acceptor.
+This function is used to get the current value of an option on the serial port.
[heading Parameters]
@@ -10786,44 +12399,41 @@
[variablelist
-[[option][The option value to be obtained from the acceptor.]]
+[[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]
-
-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::system::error_code ec;
- acceptor.get_option(option, ec);
- if (ec)
- {
- // An error occurred.
- }
- bool is_set = option.get();
+
+[endsect]
+[endsect]
+[section:implementation basic_serial_port::implementation]
-[endsect]
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_serial_port] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
[endsect]
-[section:implementation_type basic_socket_acceptor::implementation_type]
+
+[section:implementation_type basic_serial_port::implementation_type]
['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_serial_port] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -10834,12 +12444,12 @@
-[section:io_service basic_socket_acceptor::io_service]
+[section:io_service basic_serial_port::io_service]
['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_serial_port] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -10857,9 +12467,9 @@
-[section:is_open basic_socket_acceptor::is_open]
+[section:is_open basic_serial_port::is_open]
-Determine whether the acceptor is open.
+[indexterm2 is_open..basic_serial_port] Determine whether the serial port is open.
bool is_open() const;
@@ -10869,113 +12479,237 @@
-[section:keep_alive basic_socket_acceptor::keep_alive]
+[section:lowest_layer basic_serial_port::lowest_layer]
+[indexterm2 lowest_layer..basic_serial_port] Get a reference to the lowest layer.
-['Inherited from socket_base.]
+ lowest_layer_type & lowest_layer();
-Socket option to send keep-alives.
- typedef implementation_defined keep_alive;
+This function returns a reference to the lowest layer in a stack of layers. Since a basic_serial_port 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.
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-[heading Examples]
-
-Setting the option:
+[endsect]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+[section:lowest_layer_type basic_serial_port::lowest_layer_type]
+[indexterm2 lowest_layer_type..basic_serial_port] A basic_serial_port is always the lowest layer.
-Getting the current option value:
+ typedef basic_serial_port< SerialPortService > lowest_layer_type;
- 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 Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.basic_serial_port.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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [The native representation of a serial port. ]
+
+ ]
+ [
-[section:linger basic_socket_acceptor::linger]
+ [[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. ]
+
+ ]
+]
-['Inherited from socket_base.]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
+ [Get a 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. ]
+ ]
+
+]
- typedef implementation_defined linger;
+[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_serial_port.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+]
+The basic_serial_port class template provides functionality that is common to all serial ports.
-[heading Examples]
+
+[heading Thread Safety]
-Setting the option:
+[*Distinct] [*objects:] Safe.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option(true, 30);
- socket.set_option(option);
+[*Shared] [*objects:] Unsafe.
-Getting the current option value:
+[endsect]
+
- 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:native basic_serial_port::native]
+[indexterm2 native..basic_serial_port] Get the native serial port representation.
+
+ native_type native();
+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.
[endsect]
-[section:listen basic_socket_acceptor::listen]
-Place the acceptor into the state where it will listen for new connections.
+[section:native_type basic_serial_port::native_type]
- void ``[link boost_asio.reference.basic_socket_acceptor.listen.overload1 listen]``(
- int backlog = socket_base::max_connections);
+[indexterm2 native_type..basic_serial_port] The native representation of a serial port.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.listen.overload2 listen]``(
- int backlog,
+ typedef SerialPortService::native_type native_type;
+
+
+
+
+[endsect]
+
+
+[section:open basic_serial_port::open]
+
+[indexterm2 open..basic_serial_port] Open the serial port using the specified device name.
+
+ void ``[link boost_asio.reference.basic_serial_port.open.overload1 open]``(
+ const std::string & device);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.open.overload2 open]``(
+ const std::string & device,
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::listen (1 of 2 overloads)]
+[section:overload1 basic_serial_port::open (1 of 2 overloads)]
-Place the acceptor into the state where it will listen for new connections.
+Open the serial port using the specified device name.
- void listen(
- int backlog = socket_base::max_connections);
+ void open(
+ const std::string & device);
-This function puts the socket acceptor into the state where it may accept new connections.
+This function opens the serial port for the specified device name.
[heading Parameters]
@@ -10983,7 +12717,7 @@
[variablelist
-[[backlog][The maximum length of the queue of pending connections.]]
+[[device][The platform-specific device name.]]
]
@@ -11002,16 +12736,16 @@
-[section:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
+[section:overload2 basic_serial_port::open (2 of 2 overloads)]
-Place the acceptor into the state where it will listen for new connections.
+Open the serial port using the specified device name.
- boost::system::error_code listen(
- int backlog,
+ boost::system::error_code open(
+ const std::string & device,
boost::system::error_code & ec);
-This function puts the socket acceptor into the state where it may accept new connections.
+This function opens the serial port using the given platform-specific device name.
[heading Parameters]
@@ -11019,78 +12753,85 @@
[variablelist
-[[backlog][The maximum length of the queue of pending connections.]]
+[[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::system::error_code ec;
- acceptor.listen(boost::asio::socket_base::max_connections, 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.
-[section:local_endpoint basic_socket_acceptor::local_endpoint]
+ 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);
-Get the local endpoint of the acceptor.
+ 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);
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
+[section:overload1 basic_serial_port::read_some (1 of 2 overloads)]
+Read some data from the serial port.
-[section:overload1 basic_socket_acceptor::local_endpoint (1 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
-Get the local endpoint of the acceptor.
- endpoint_type local_endpoint() const;
+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 obtain the locally bound endpoint of the acceptor.
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
+]
[heading Return Value]
-An object that represents the local endpoint of the acceptor.
+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]
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
-
+ serial_port.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.
@@ -11098,15 +12839,18 @@
-[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_serial_port::read_some (2 of 2 overloads)]
-Get the local endpoint of the acceptor.
+Read some data from the serial port.
- endpoint_type local_endpoint(
- 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);
-This function is used to obtain the locally bound endpoint of 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.
[heading Parameters]
@@ -11114,29 +12858,20 @@
[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]
-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::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
+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.
@@ -11145,61 +12880,77 @@
[endsect]
+[section:send_break basic_serial_port::send_break]
-[section:max_connections basic_socket_acceptor::max_connections]
+[indexterm2 send_break..basic_serial_port] Send a break sequence to the serial port.
+ void ``[link boost_asio.reference.basic_serial_port.send_break.overload1 send_break]``();
-['Inherited from socket_base.]
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.send_break.overload2 send_break]``(
+ boost::system::error_code & ec);
-The maximum length of the queue of pending incoming connections.
- static const int max_connections = implementation_defined;
+[section:overload1 basic_serial_port::send_break (1 of 2 overloads)]
+Send a break sequence to the serial port.
+ void send_break();
-[endsect]
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
-[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
- static const int message_do_not_route = implementation_defined;
+[endsect]
-[endsect]
+[section:overload2 basic_serial_port::send_break (2 of 2 overloads)]
+Send a break sequence to the serial port.
+ boost::system::error_code send_break(
+ boost::system::error_code & ec);
-[section:message_flags basic_socket_acceptor::message_flags]
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
-['Inherited from socket_base.]
-Bitmask type for flags that can be passed to send and receive operations.
+[heading Parameters]
+
- typedef int message_flags;
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+]
[endsect]
+[endsect]
-[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
+[section:service basic_serial_port::service]
-['Inherited from socket_base.]
-Process out-of-band data.
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_serial_port] The service associated with the I/O object.
- static const int message_out_of_band = implementation_defined;
+ service_type & service;
@@ -11207,100 +12958,133 @@
-[section:message_peek basic_socket_acceptor::message_peek]
+[section:service_type basic_serial_port::service_type]
-['Inherited from socket_base.]
+['Inherited from basic_io_object.]
-Peek at incoming data without removing it from the input queue.
+[indexterm2 service_type..basic_serial_port] The type of the service that will be used to provide I/O operations.
+
+ typedef SerialPortService service_type;
- static const int message_peek = implementation_defined;
[endsect]
+[section:set_option basic_serial_port::set_option]
-[section:native basic_socket_acceptor::native]
+[indexterm2 set_option..basic_serial_port] Set an option on the serial port.
-Get the native acceptor representation.
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.set_option.overload1 set_option]``(
+ const SettableSerialPortOption & option);
- native_type native();
+ 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);
-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.
+[section:overload1 basic_serial_port::set_option (1 of 2 overloads)]
+Set an option on the serial port.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void set_option(
+ const SettableSerialPortOption & option);
+This function is used to set an option on the serial port.
-[section:native_type basic_socket_acceptor::native_type]
-The native representation of an acceptor.
+[heading Parameters]
+
- typedef SocketAcceptorService::native_type native_type;
+[variablelist
+
+[[option][The option value to be set on the serial port.]]
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[endsect]
+]
-[section:non_blocking_io basic_socket_acceptor::non_blocking_io]
+[endsect]
-['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+[section:overload2 basic_serial_port::set_option (2 of 2 overloads)]
- typedef implementation_defined non_blocking_io;
+Set an option on the serial port.
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ boost::system::error_code set_option(
+ const SettableSerialPortOption & option,
+ boost::system::error_code & ec);
-Implements the FIONBIO IO control command.
+This function is used to set an option on the serial port.
-[heading Example]
-
+[heading Parameters]
+
+[variablelist
+
+[[option][The option value to be set on the serial port.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[endsect]
[endsect]
+[section:write_some basic_serial_port::write_some]
-[section:open basic_socket_acceptor::open]
-
-Open the acceptor using the specified protocol.
+[indexterm2 write_some..basic_serial_port] Write some data to the serial port.
- void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
+ 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);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
- const protocol_type & protocol,
+ 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);
-[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
+[section:overload1 basic_serial_port::write_some (1 of 2 overloads)]
-Open the acceptor using the specified protocol.
+Write some data to the serial port.
- void open(
- const protocol_type & protocol = protocol_type());
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-This function opens the socket acceptor so that it will use the specified protocol.
+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]
@@ -11308,28 +13092,38 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
+[[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 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:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
-
+ 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.
@@ -11337,16 +13131,18 @@
-[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
+[section:overload2 basic_serial_port::write_some (2 of 2 overloads)]
-Open the acceptor using the specified protocol.
+Write some data to the serial port.
- boost::system::error_code open(
- const protocol_type & protocol,
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
boost::system::error_code & ec);
-This function opens the socket acceptor so that it will use the specified protocol.
+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]
@@ -11354,210 +13150,466 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
+[[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.
+[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);
- boost::system::error_code ec;
- acceptor.open(boost::asio::ip::tcp::v4(), ec);
- if (ec)
- {
- // An error occurred.
- }
+[endsect]
+[endsect]
[endsect]
+[section:basic_socket basic_socket]
-[endsect]
+Provides socket functionality.
+ 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
-[section:protocol_type basic_socket_acceptor::protocol_type]
-The protocol type.
+[heading Types]
+[table
+ [[Name][Description]]
- typedef Protocol protocol_type;
+ [
+ [[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:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+ [
-['Inherited from socket_base.]
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-Socket option for the receive buffer size of a socket.
+ [
- typedef implementation_defined receive_buffer_size;
+ [[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. ]
+
+ ]
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+ [
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
-[heading Examples]
+ [
+
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-Setting the option:
+ ]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
+ [
+ [[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. ]
+
+ ]
-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_socket.native_type [*native_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.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. ]
+
+ ]
+ [
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
-[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
+ [
+ [[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. ]
+
+ ]
-['Inherited from socket_base.]
+ [
-Socket option for the receive low watermark.
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
- typedef implementation_defined receive_low_watermark;
+ [
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+ [
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+ [[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 Examples]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
-Setting the option:
+ ]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+]
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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]]
-Getting the current option value:
+ [
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
- 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 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. ]
+ ]
+ [
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+]
-[endsect]
+[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. ]
+ ]
-[section:reuse_address basic_socket_acceptor::reuse_address]
+]
+The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
-['Inherited from socket_base.]
-Socket option to allow the socket to be bound to an address that is already in use.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- typedef implementation_defined reuse_address;
+[*Shared] [*objects:] Unsafe.
+[section:assign basic_socket::assign]
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[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);
-[heading Examples]
-
-Setting the option:
+ 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);
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[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]
-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();
+[section:overload2 basic_socket::assign (2 of 2 overloads)]
+Assign an existing native socket to the socket.
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
[endsect]
+[endsect]
-[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
+[section:async_connect basic_socket::async_connect]
-['Inherited from socket_base.]
+[indexterm2 async_connect..basic_socket] Start an asynchronous connect.
-Socket option for the send buffer size of a socket.
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
- typedef implementation_defined send_buffer_size;
+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\_SNDBUF socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(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().]]
+]
+[heading Example]
+
-Getting the current option value:
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
- boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+
+ 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);
@@ -11567,142 +13619,176 @@
[endsect]
+[section:at_mark basic_socket::at_mark]
-[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
+[indexterm2 at_mark..basic_socket] Determine whether the socket is at the out-of-band data mark.
+ bool ``[link boost_asio.reference.basic_socket.at_mark.overload1 at_mark]``() const;
-['Inherited from socket_base.]
+ bool ``[link boost_asio.reference.basic_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
-Socket option for the send low watermark.
- typedef implementation_defined send_low_watermark;
+[section:overload1 basic_socket::at_mark (1 of 2 overloads)]
+Determine whether the socket is at the out-of-band data mark.
+ bool at_mark() const;
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[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);
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
+
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-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: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;
-[endsect]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[section:service_type basic_socket_acceptor::service_type]
+[heading Parameters]
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
-['Inherited from basic_io_object.]
+]
-The type of the service that will be used to provide I/O operations.
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
- typedef SocketAcceptorService service_type;
+[endsect]
[endsect]
+[section:available basic_socket::available]
-[section:set_option basic_socket_acceptor::set_option]
+[indexterm2 available..basic_socket] Determine the number of bytes available for reading.
-Set an option on the acceptor.
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
- 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);
+[section:overload1 basic_socket::available (1 of 2 overloads)]
-[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
+Determine the number of bytes available for reading.
-Set an option on the acceptor.
+ std::size_t available() const;
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+This function is used to determine the number of bytes that may be read without blocking.
-This function is used to set an option on the acceptor.
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
-[heading Parameters]
+[heading Exceptions]
[variablelist
-[[option][The new option value to be set on the acceptor.]]
+[[boost::system::system_error][Thrown on failure. ]]
]
-[heading Exceptions]
+
+
+[endsect]
+
+
+
+[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;
+
+
+This function is used to determine the number of bytes that may be read without blocking.
+
+
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Example]
-
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::acceptor::reuse_address option(true);
- acceptor.set_option(option);
+[endsect]
+[endsect]
+[section:basic_socket basic_socket::basic_socket]
-[endsect]
+[indexterm2 basic_socket..basic_socket] Construct a basic_socket without opening it.
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload1 basic_socket]``(
+ boost::asio::io_service & io_service);
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload2 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
-Set an option on the acceptor.
+ ``[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);
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
-This function is used to set an option on the acceptor.
+Construct a basic_socket without opening it.
+
+ basic_socket(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a socket without opening it.
[heading Parameters]
@@ -11710,63 +13796,45 @@
[variablelist
-[[option][The new option value to be set on the acceptor.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
]
-[heading Example]
-
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::acceptor::reuse_address option(true);
- boost::system::error_code ec;
- acceptor.set_option(option, ec);
- if (ec)
- {
- // An error occurred.
- }
+[endsect]
+[section:overload2 basic_socket::basic_socket (2 of 4 overloads)]
+Construct and open a basic_socket.
-[endsect]
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-[endsect]
+This constructor creates and opens a socket.
-[section:shutdown_type basic_socket_acceptor::shutdown_type]
+[heading Parameters]
+
+[variablelist
+
+[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
-['Inherited from socket_base.]
+[[protocol][An object specifying protocol parameters to be used.]]
-Different ways a socket may be shutdown.
+]
- enum shutdown_type
+[heading Exceptions]
+
-[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. ]
- ]
+
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -11776,87 +13844,79 @@
-[endsect]
+[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
-[section:basic_socket_iostream basic_socket_iostream]
+Construct a basic_socket, opening it and binding it to the given local endpoint.
-Iostream interface for a socket.
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
- class basic_socket_iostream
+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 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. ]
- ]
-
- [
- [[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. ]
- ]
+[heading Parameters]
+
+
+[variablelist
- [
- [[link boost_asio.reference.basic_socket_iostream.rdbuf [*rdbuf]]]
- [Return a pointer to the underlying streambuf. ]
- ]
+[[io_service][The 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+[[boost::system::system_error][Thrown on failure. ]]
+
]
-[section:basic_socket_iostream basic_socket_iostream::basic_socket_iostream]
-Construct a basic_socket_iostream without establishing a connection.
- ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 basic_socket_iostream]``();
+[endsect]
- template<
- typename T1,
- ... ,
- typename TN>
- ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 basic_socket_iostream]``(
- T1 t1,
- ... ,
- TN tn);
-[section:overload1 basic_socket_iostream::basic_socket_iostream (1 of 2 overloads)]
+[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
-Construct a basic_socket_iostream without establishing a connection.
+Construct a basic_socket on an existing native socket.
- basic_socket_iostream();
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_socket);
+This constructor creates a socket object to hold an existing native socket.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
-[section:overload2 basic_socket_iostream::basic_socket_iostream (2 of 2 overloads)]
+[[protocol][An object specifying protocol parameters to be used.]]
-Establish a connection to an endpoint corresponding to a resolver query.
+[[native_socket][A native socket.]]
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_iostream(
- T1 t1,
- ... ,
- TN tn);
+]
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
-This constructor automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
[endsect]
@@ -11864,45 +13924,58 @@
[endsect]
+[section:bind basic_socket::bind]
-[section:close basic_socket_iostream::close]
+[indexterm2 bind..basic_socket] Bind the socket to the given local endpoint.
-Close the connection.
+ void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
- void close();
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+[section:overload1 basic_socket::bind (1 of 2 overloads)]
-[endsect]
+Bind the socket to the given local endpoint.
+ void bind(
+ const endpoint_type & endpoint);
-[section:connect basic_socket_iostream::connect]
+This function binds the socket to the specified endpoint on the local machine.
-Establish a connection to an endpoint corresponding to a resolver query.
- template<
- typename T1,
- ... ,
- typename TN>
- void connect(
- T1 t1,
- ... ,
- TN tn);
+[heading Parameters]
+
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
+]
+[heading Exceptions]
+
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+[heading Example]
+
-[section:rdbuf basic_socket_iostream::rdbuf]
+ 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));
+
-Return a pointer to the underlying streambuf.
- basic_socket_streambuf< Protocol, StreamSocketService > * rdbuf() const;
@@ -11910,496 +13983,216 @@
-[endsect]
+[section:overload2 basic_socket::bind (2 of 2 overloads)]
-[section:basic_socket_streambuf basic_socket_streambuf]
+Bind the socket to the given local endpoint.
-Iostream streambuf for a socket.
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
- 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 >
+This function binds the socket to the specified endpoint on the local machine.
-[heading Types]
-[table
- [[Name][Description]]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
+[variablelist
- ]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
- [
+[[ec][Set to indicate what error occurred, if any.]]
- [[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. ]
+]
+
+[heading Example]
- ]
- [
- [[link boost_asio.reference.basic_socket_streambuf.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+ 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.
+ }
- [
- [[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_streambuf.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]]]
- [The endpoint type. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_streambuf.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_streambuf.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[section:broadcast basic_socket::broadcast]
- [
- [[link boost_asio.reference.basic_socket_streambuf.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+['Inherited from socket_base.]
- [
+[indexterm2 broadcast..basic_socket] Socket option to permit sending of broadcast messages.
- [[link boost_asio.reference.basic_socket_streambuf.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
+ typedef implementation_defined broadcast;
- [
- [[link boost_asio.reference.basic_socket_streambuf.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
- [
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
- [[link boost_asio.reference.basic_socket_streambuf.native_type [*native_type]]]
- [The native representation of a socket. ]
+
+[heading Examples]
- ]
+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_streambuf.non_blocking_io [*non_blocking_io]]]
- [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. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.basic_socket_streambuf.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+ 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_streambuf.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
- [
- [[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_streambuf.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_streambuf.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
- [
+[section:bytes_readable basic_socket::bytes_readable]
- [[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. ]
-
- ]
- [
+['Inherited from socket_base.]
- [[link boost_asio.reference.basic_socket_streambuf.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
+[indexterm2 bytes_readable..basic_socket] IO control command to get the amount of data that can be read without blocking.
-]
+ typedef implementation_defined bytes_readable;
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.basic_socket_streambuf.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[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_streambuf.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_streambuf.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.close [*close]]]
- [Close the connection. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.connect [*connect]]]
- [Establish a connection. ]
- ]
-
- [
- [[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_streambuf.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[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.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]]]
- [Determine whether the socket is open. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.local_endpoint [*local_endpoint]]]
- [Get the local endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.native [*native]]]
- [Get the native socket representation. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.open [*open]]]
- [Open the socket using the specified protocol. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
-
- [
- [[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 Data Members]
-[table
- [[Name][Description]]
-
- [
- [[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_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_streambuf.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_streambuf.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
-
-]
-
-[section:assign basic_socket_streambuf::assign]
-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);
+Implements the FIONREAD IO control command.
- 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);
+[heading Example]
+
-[section:overload1 basic_socket_streambuf::assign (1 of 2 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();
-['Inherited from basic_socket.]
-Assign an existing native socket to the socket.
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
[endsect]
+[section:cancel basic_socket::cancel]
-[section:overload2 basic_socket_streambuf::assign (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[indexterm2 cancel..basic_socket] Cancel all asynchronous operations associated with the socket.
-Assign an existing native socket to the socket.
+ void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
boost::system::error_code & ec);
+[section:overload1 basic_socket::cancel (1 of 2 overloads)]
-[endsect]
-
-
-[endsect]
-
-
-[section:async_connect basic_socket_streambuf::async_connect]
-
-
-['Inherited from basic_socket.]
-
-Start an asynchronous connect.
-
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
+Cancel all asynchronous operations associated with the socket.
+ void cancel();
-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 returned to the closed state.
+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]
+[heading Exceptions]
[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().]]
+[[boost::system::system_error][Thrown on failure.]]
]
-[heading Example]
-
-
+[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:
- void connect_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Connect succeeded.
- }
- }
+* 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.
- 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);
+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.
[endsect]
-[section:at_mark basic_socket_streambuf::at_mark]
-
-Determine whether the socket is at the out-of-band data mark.
-
- bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 at_mark]``() const;
-
- bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
-
-
-[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-Determine whether the socket is at the out-of-band data mark.
+[section:overload2 basic_socket::cancel (2 of 2 overloads)]
- bool at_mark() const;
+Cancel all asynchronous operations associated with the socket.
+ boost::system::error_code cancel(
+ 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 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 Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
-[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:
+* It will only cancel asynchronous operations that were initiated in the current thread.
-[endsect]
-
-
-
-[section:overload2 basic_socket_streambuf::at_mark (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-Determine whether the socket is at the out-of-band data mark.
-
- 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.
-
+* 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
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
+* Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP.
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+* 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]
@@ -12407,60 +14200,54 @@
[endsect]
-[section:available basic_socket_streambuf::available]
-
-Determine the number of bytes available for reading.
-
- std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload1 available]``() const;
-
- std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload2 available]``(
- boost::system::error_code & ec) const;
+[section:close basic_socket::close]
+[indexterm2 close..basic_socket] Close the socket.
-[section:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
+ void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
+ boost::system::error_code & ec);
-['Inherited from basic_socket.]
-Determine the number of bytes available for reading.
+[section:overload1 basic_socket::close (1 of 2 overloads)]
- std::size_t available() const;
+Close the socket.
+ void close();
-This function is used to determine the number of bytes that may be read without blocking.
+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 Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[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]
-
+[endsect]
-[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::close (2 of 2 overloads)]
-Determine the number of bytes available for reading.
+Close the socket.
- std::size_t available(
- boost::system::error_code & ec) const;
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-This function is used to determine the number of bytes that may be read without blocking.
+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]
@@ -12472,53 +14259,56 @@
]
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
-
+[heading Example]
+
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
-[endsect]
-[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-Construct a basic_socket_streambuf without establishing a connection.
- basic_socket_streambuf();
+[endsect]
[endsect]
+[section:connect basic_socket::connect]
-[section:bind basic_socket_streambuf::bind]
-
-Bind the socket to the given local endpoint.
+[indexterm2 connect..basic_socket] Connect the socket to the specified endpoint.
- void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+ void ``[link boost_asio.reference.basic_socket.connect.overload1 connect]``(
+ const endpoint_type & peer_endpoint);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.bind.overload2 bind]``(
- const endpoint_type & endpoint,
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
-
+[section:overload1 basic_socket::connect (1 of 2 overloads)]
-['Inherited from basic_socket.]
+Connect the socket to the specified endpoint.
-Bind the socket to the given local endpoint.
+ void connect(
+ const endpoint_type & peer_endpoint);
- void bind(
- const endpoint_type & endpoint);
+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.
-This function binds the socket to the specified endpoint on the local machine.
+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]
@@ -12526,7 +14316,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
]
@@ -12544,9 +14334,9 @@
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::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.connect(endpoint);
@@ -12557,19 +14347,18 @@
-[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::connect (2 of 2 overloads)]
-Bind the socket to the given local endpoint.
+Connect the socket to the specified endpoint.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-This function binds the socket to the specified endpoint on the local machine.
+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]
@@ -12577,7 +14366,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -12588,10 +14377,10 @@
boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
+ socket.connect(endpoint, ec);
if (ec)
{
// An error occurred.
@@ -12608,27 +14397,27 @@
[endsect]
-[section:broadcast basic_socket_streambuf::broadcast]
+[section:debug basic_socket::debug]
['Inherited from socket_base.]
-Socket option to permit sending of broadcast messages.
+[indexterm2 debug..basic_socket] Socket option to enable socket-level debugging.
- typedef implementation_defined broadcast;
+ typedef implementation_defined debug;
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+Implements the SOL\_SOCKET/SO\_DEBUG 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::broadcast option(true);
+ boost::asio::socket_base::debug option(true);
socket.set_option(option);
@@ -12636,9 +14425,9 @@
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::broadcast option;
+ boost::asio::socket_base::debug option;
socket.get_option(option);
bool is_set = option.value();
@@ -12651,486 +14440,111 @@
-[section:bytes_readable basic_socket_streambuf::bytes_readable]
+[section:do_not_route basic_socket::do_not_route]
['Inherited from socket_base.]
-IO control command to get the amount of data that can be read without blocking.
+[indexterm2 do_not_route..basic_socket] Socket option to prevent routing, use local interfaces only.
- typedef implementation_defined bytes_readable;
+ typedef implementation_defined do_not_route;
-Implements the FIONREAD IO control command.
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-[heading Example]
+[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::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+ 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();
-[endsect]
-[section:cancel basic_socket_streambuf::cancel]
-Cancel all asynchronous operations associated with the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
+[section:enable_connection_aborted basic_socket::enable_connection_aborted]
-['Inherited from basic_socket.]
-Cancel all asynchronous operations associated with the socket.
+['Inherited from socket_base.]
- void cancel();
+[indexterm2 enable_connection_aborted..basic_socket] Socket option to report aborted connections on accept.
+ typedef implementation_defined enable_connection_aborted;
-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]
-
+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]
-[[boost::system::system_error][Thrown on failure.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
-[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:
+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();
-* 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_socket_streambuf::cancel (2 of 2 overloads)]
+[section:endpoint_type basic_socket::endpoint_type]
+[indexterm2 endpoint_type..basic_socket] The endpoint type.
-['Inherited from basic_socket.]
+ typedef Protocol::endpoint endpoint_type;
-Cancel all asynchronous operations associated with the socket.
- 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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+[section:get_io_service basic_socket::get_io_service]
-]
-[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:
+['Inherited from basic_io_object.]
-* 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.
-
-
-[endsect]
-
-
-[endsect]
-
-[section:close basic_socket_streambuf::close]
-
-Close the connection.
-
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
- boost::system::error_code & ec);
-
-
-[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
-
-Close the connection.
-
- basic_socket_streambuf< Protocol, StreamSocketService > * close();
-
-
-
-[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]
-
-
-[variablelist
-
-[[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.close(ec);
- if (ec)
- {
- // An error occurred.
- }
-
-
-
-
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:connect basic_socket_streambuf::connect]
-
-Establish a connection.
-
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload1 connect]``(
- const endpoint_type & endpoint);
-
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload2 connect]``(
- T1 t1,
- ... ,
- TN tn);
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.connect.overload3 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
-
-
-[section:overload1 basic_socket_streambuf::connect (1 of 3 overloads)]
-
-Establish a connection.
-
- basic_socket_streambuf< Protocol, StreamSocketService > * connect(
- const endpoint_type & endpoint);
-
-
-This function establishes a connection to the specified endpoint.
-
-
-[heading Return Value]
-
-this if a connection was successfully established, a null pointer otherwise.
-
-
-
-[endsect]
-
-
-
-[section:overload2 basic_socket_streambuf::connect (2 of 3 overloads)]
-
-Establish a connection.
-
- 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.
-
-
-
-[endsect]
-
-
-
-[section:overload3 basic_socket_streambuf::connect (3 of 3 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 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 returned to the closed state.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[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]
-
-
-[endsect]
-
-
-[section:debug basic_socket_streambuf::debug]
-
-
-['Inherited from socket_base.]
-
-Socket option to enable socket-level debugging.
-
- typedef implementation_defined debug;
-
-
-
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
-
-
-[heading Examples]
-
-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();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:do_not_route basic_socket_streambuf::do_not_route]
-
-
-['Inherited from socket_base.]
-
-Socket option to prevent routing, use local interfaces only.
-
- typedef implementation_defined do_not_route;
-
-
-
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-
-
-[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);
-
-
-
-
-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();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
-
-
-['Inherited from socket_base.]
-
-Socket option to report aborted connections on accept.
-
- 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:
-
- 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();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:endpoint_type basic_socket_streambuf::endpoint_type]
-
-The endpoint type.
-
- typedef Protocol::endpoint endpoint_type;
-
-
-
-
-[endsect]
-
-
-
-[section:get_io_service basic_socket_streambuf::get_io_service]
-
-
-['Inherited from basic_io_object.]
-
-Get the io_service associated with the object.
+[indexterm2 get_io_service..basic_socket] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
@@ -13147,25 +14561,28 @@
[endsect]
-[section:get_option basic_socket_streambuf::get_option]
+[section:get_option basic_socket::get_option]
-Get an option from the socket.
+[indexterm2 get_option..basic_socket] Get an option from the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload1 get_option]``(
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
GettableSocketOption & option) const;
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload2 get_option]``(
+ 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;
-[section:overload1 basic_socket_streambuf::get_option (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::get_option (1 of 2 overloads)]
Get an option from the socket.
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
void get_option(
GettableSocketOption & option) const;
@@ -13210,13 +14627,12 @@
-[section:overload2 basic_socket_streambuf::get_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::get_option (2 of 2 overloads)]
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;
@@ -13262,12 +14678,27 @@
[endsect]
-[section:implementation_type basic_socket_streambuf::implementation_type]
+[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:implementation_type basic_socket::implementation_type]
['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
+[indexterm2 implementation_type..basic_socket] The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
@@ -13277,25 +14708,28 @@
[endsect]
-[section:io_control basic_socket_streambuf::io_control]
+[section:io_control basic_socket::io_control]
-Perform an IO control command on the socket.
+[indexterm2 io_control..basic_socket] Perform an IO control command on the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload1 io_control]``(
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void ``[link boost_asio.reference.basic_socket.io_control.overload1 io_control]``(
IoControlCommand & command);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload2 io_control]``(
+ 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);
-[section:overload1 basic_socket_streambuf::io_control (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::io_control (1 of 2 overloads)]
Perform an IO control command on the socket.
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
void io_control(
IoControlCommand & command);
@@ -13340,13 +14774,12 @@
-[section:overload2 basic_socket_streambuf::io_control (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::io_control (2 of 2 overloads)]
Perform an IO control command on the socket.
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
boost::system::error_code io_control(
IoControlCommand & command,
boost::system::error_code & ec);
@@ -13392,12 +14825,12 @@
[endsect]
-[section:io_service basic_socket_streambuf::io_service]
+[section:io_service basic_socket::io_service]
['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[indexterm2 io_service..basic_socket] (Deprecated: use get_io_service().) Get the io_service associated with the object.
boost::asio::io_service & io_service();
@@ -13415,12 +14848,9 @@
-[section:is_open basic_socket_streambuf::is_open]
-
-
-['Inherited from basic_socket.]
+[section:is_open basic_socket::is_open]
-Determine whether the socket is open.
+[indexterm2 is_open..basic_socket] Determine whether the socket is open.
bool is_open() const;
@@ -13430,12 +14860,12 @@
-[section:keep_alive basic_socket_streambuf::keep_alive]
+[section:keep_alive basic_socket::keep_alive]
['Inherited from socket_base.]
-Socket option to send keep-alives.
+[indexterm2 keep_alive..basic_socket] Socket option to send keep-alives.
typedef implementation_defined keep_alive;
@@ -13473,12 +14903,12 @@
-[section:linger basic_socket_streambuf::linger]
+[section:linger basic_socket::linger]
['Inherited from socket_base.]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[indexterm2 linger..basic_socket] Socket option to specify whether the socket lingers on close if unsent data is present.
typedef implementation_defined linger;
@@ -13516,20 +14946,17 @@
[endsect]
-[section:local_endpoint basic_socket_streambuf::local_endpoint]
+[section:local_endpoint basic_socket::local_endpoint]
-Get the local endpoint of the socket.
+[indexterm2 local_endpoint..basic_socket] Get the local endpoint of the socket.
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 local_endpoint]``() const;
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload1 local_endpoint]``() const;
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 local_endpoint]``(
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload2 local_endpoint]``(
boost::system::error_code & ec) const;
-[section:overload1 basic_socket_streambuf::local_endpoint (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
Get the local endpoint of the socket.
@@ -13569,10 +14996,7 @@
-[section:overload2 basic_socket_streambuf::local_endpoint (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::local_endpoint (2 of 2 overloads)]
Get the local endpoint of the socket.
@@ -13620,12 +15044,9 @@
[endsect]
-[section:lowest_layer basic_socket_streambuf::lowest_layer]
-
-
-['Inherited from basic_socket.]
+[section:lowest_layer basic_socket::lowest_layer]
-Get a reference to the lowest layer.
+[indexterm2 lowest_layer..basic_socket] Get a reference to the lowest layer.
lowest_layer_type & lowest_layer();
@@ -13643,14 +15064,11 @@
-[section:lowest_layer_type basic_socket_streambuf::lowest_layer_type]
-
-
-['Inherited from basic_socket.]
+[section:lowest_layer_type basic_socket::lowest_layer_type]
-A basic_socket is always the lowest layer.
+[indexterm2 lowest_layer_type..basic_socket] A basic_socket is always the lowest layer.
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+ typedef basic_socket< Protocol, SocketService > lowest_layer_type;
[heading Types]
@@ -13917,6 +15335,17 @@
]
+[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]]
@@ -13943,6 +15372,22 @@
]
+[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 basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
@@ -13959,12 +15404,12 @@
-[section:max_connections basic_socket_streambuf::max_connections]
+[section:max_connections basic_socket::max_connections]
['Inherited from socket_base.]
-The maximum length of the queue of pending incoming connections.
+[indexterm2 max_connections..basic_socket] The maximum length of the queue of pending incoming connections.
static const int max_connections = implementation_defined;
@@ -13974,12 +15419,12 @@
-[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
+[section:message_do_not_route basic_socket::message_do_not_route]
['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
+[indexterm2 message_do_not_route..basic_socket] Specify that the data should not be subject to routing.
static const int message_do_not_route = implementation_defined;
@@ -13989,12 +15434,12 @@
-[section:message_flags basic_socket_streambuf::message_flags]
+[section:message_flags basic_socket::message_flags]
['Inherited from socket_base.]
-Bitmask type for flags that can be passed to send and receive operations.
+[indexterm2 message_flags..basic_socket] Bitmask type for flags that can be passed to send and receive operations.
typedef int message_flags;
@@ -14005,12 +15450,12 @@
-[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
+[section:message_out_of_band basic_socket::message_out_of_band]
['Inherited from socket_base.]
-Process out-of-band data.
+[indexterm2 message_out_of_band..basic_socket] Process out-of-band data.
static const int message_out_of_band = implementation_defined;
@@ -14020,12 +15465,12 @@
-[section:message_peek basic_socket_streambuf::message_peek]
+[section:message_peek basic_socket::message_peek]
['Inherited from socket_base.]
-Peek at incoming data without removing it from the input queue.
+[indexterm2 message_peek..basic_socket] Peek at incoming data without removing it from the input queue.
static const int message_peek = implementation_defined;
@@ -14035,12 +15480,9 @@
-[section:native basic_socket_streambuf::native]
-
-
-['Inherited from basic_socket.]
+[section:native basic_socket::native]
-Get the native socket representation.
+[indexterm2 native..basic_socket] Get the native socket representation.
native_type native();
@@ -14052,14 +15494,11 @@
-[section:native_type basic_socket_streambuf::native_type]
-
-
-['Inherited from basic_socket.]
+[section:native_type basic_socket::native_type]
-The native representation of a socket.
+[indexterm2 native_type..basic_socket] The native representation of a socket.
- typedef StreamSocketService::native_type native_type;
+ typedef SocketService::native_type native_type;
@@ -14068,12 +15507,12 @@
-[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
+[section:non_blocking_io basic_socket::non_blocking_io]
['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+[indexterm2 non_blocking_io..basic_socket] IO control command to set the blocking mode of the socket.
typedef implementation_defined non_blocking_io;
@@ -14099,22 +15538,19 @@
[endsect]
-[section:open basic_socket_streambuf::open]
+[section:open basic_socket::open]
-Open the socket using the specified protocol.
+[indexterm2 open..basic_socket] Open the socket using the specified protocol.
- void ``[link boost_asio.reference.basic_socket_streambuf.open.overload1 open]``(
+ void ``[link boost_asio.reference.basic_socket.open.overload1 open]``(
const protocol_type & protocol = protocol_type());
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.open.overload2 open]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.open.overload2 open]``(
const protocol_type & protocol,
boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::open (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::open (1 of 2 overloads)]
Open the socket using the specified protocol.
@@ -14159,10 +15595,7 @@
-[section:overload2 basic_socket_streambuf::open (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::open (2 of 2 overloads)]
Open the socket using the specified protocol.
@@ -14208,12 +15641,9 @@
[endsect]
-[section:protocol_type basic_socket_streambuf::protocol_type]
-
-
-['Inherited from basic_socket.]
+[section:protocol_type basic_socket::protocol_type]
-The protocol type.
+[indexterm2 protocol_type..basic_socket] The protocol type.
typedef Protocol protocol_type;
@@ -14224,12 +15654,12 @@
-[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
+[section:receive_buffer_size basic_socket::receive_buffer_size]
['Inherited from socket_base.]
-Socket option for the receive buffer size of a socket.
+[indexterm2 receive_buffer_size..basic_socket] Socket option for the receive buffer size of a socket.
typedef implementation_defined receive_buffer_size;
@@ -14267,12 +15697,12 @@
-[section:receive_low_watermark basic_socket_streambuf::receive_low_watermark]
+[section:receive_low_watermark basic_socket::receive_low_watermark]
['Inherited from socket_base.]
-Socket option for the receive low watermark.
+[indexterm2 receive_low_watermark..basic_socket] Socket option for the receive low watermark.
typedef implementation_defined receive_low_watermark;
@@ -14309,20 +15739,17 @@
[endsect]
-[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
+[section:remote_endpoint basic_socket::remote_endpoint]
-Get the remote endpoint of the socket.
+[indexterm2 remote_endpoint..basic_socket] Get the remote endpoint of the socket.
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
boost::system::error_code & ec) const;
-[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
Get the remote endpoint of the socket.
@@ -14362,10 +15789,7 @@
-[section:overload2 basic_socket_streambuf::remote_endpoint (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
Get the remote endpoint of the socket.
@@ -14413,12 +15837,12 @@
[endsect]
-[section:reuse_address basic_socket_streambuf::reuse_address]
+[section:reuse_address basic_socket::reuse_address]
['Inherited from socket_base.]
-Socket option to allow the socket to be bound to an address that is already in use.
+[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 reuse_address;
@@ -14456,12 +15880,12 @@
-[section:send_buffer_size basic_socket_streambuf::send_buffer_size]
+[section:send_buffer_size basic_socket::send_buffer_size]
['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+[indexterm2 send_buffer_size..basic_socket] Socket option for the send buffer size of a socket.
typedef implementation_defined send_buffer_size;
@@ -14499,12 +15923,12 @@
-[section:send_low_watermark basic_socket_streambuf::send_low_watermark]
+[section:send_low_watermark basic_socket::send_low_watermark]
['Inherited from socket_base.]
-Socket option for the send low watermark.
+[indexterm2 send_low_watermark..basic_socket] Socket option for the send low watermark.
typedef implementation_defined send_low_watermark;
@@ -14542,14 +15966,29 @@
-[section:service_type basic_socket_streambuf::service_type]
+[section:service basic_socket::service]
['Inherited from basic_io_object.]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 service..basic_socket] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
- typedef StreamSocketService service_type;
+
+
+[section:service_type basic_socket::service_type]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service_type..basic_socket] The type of the service that will be used to provide I/O operations.
+
+ typedef SocketService service_type;
@@ -14557,25 +15996,28 @@
[endsect]
-[section:set_option basic_socket_streambuf::set_option]
+[section:set_option basic_socket::set_option]
-Set an option on the socket.
+[indexterm2 set_option..basic_socket] Set an option on the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload1 set_option]``(
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket.set_option.overload1 set_option]``(
const SettableSocketOption & option);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload2 set_option]``(
+ 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);
-[section:overload1 basic_socket_streambuf::set_option (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[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);
@@ -14619,13 +16061,12 @@
-[section:overload2 basic_socket_streambuf::set_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::set_option (2 of 2 overloads)]
Set an option on the socket.
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
boost::system::error_code set_option(
const SettableSocketOption & option,
boost::system::error_code & ec);
@@ -14669,22 +16110,19 @@
[endsect]
-[section:shutdown basic_socket_streambuf::shutdown]
+[section:shutdown basic_socket::shutdown]
-Disable sends or receives on the socket.
+[indexterm2 shutdown..basic_socket] Disable sends or receives on the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 shutdown]``(
+ void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
shutdown_type what);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 shutdown]``(
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.shutdown.overload2 shutdown]``(
shutdown_type what,
boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::shutdown (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload1 basic_socket::shutdown (1 of 2 overloads)]
Disable sends or receives on the socket.
@@ -14730,10 +16168,7 @@
-[section:overload2 basic_socket_streambuf::shutdown (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
Disable sends or receives on the socket.
@@ -14780,12 +16215,12 @@
[endsect]
-[section:shutdown_type basic_socket_streambuf::shutdown_type]
+[section:shutdown_type basic_socket::shutdown_type]
['Inherited from socket_base.]
-Different ways a socket may be shutdown.
+[indexterm2 shutdown_type..basic_socket] Different ways a socket may be shutdown.
enum shutdown_type
@@ -14815,11 +16250,11 @@
-[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
+[section:_basic_socket basic_socket::~basic_socket]
-Destructor flushes buffered data.
+[indexterm2 ~basic_socket..basic_socket] Protected destructor to prevent deletion through this type.
- virtual ~basic_socket_streambuf();
+ ~basic_socket();
@@ -14829,15 +16264,16 @@
[endsect]
-[section:basic_stream_socket basic_stream_socket]
+[section:basic_socket_acceptor basic_socket_acceptor]
-Provides stream-oriented socket functionality.
+Provides the ability to accept new connections.
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 >
+ 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]
@@ -14846,147 +16282,140 @@
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
[Socket option to enable socket-level debugging. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_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_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]]]
+ [[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_stream_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
+ [The native representation of an acceptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [[link boost_asio.reference.basic_socket_acceptor.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]]]
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
[The protocol type. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_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_stream_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_stream_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_stream_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_stream_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
@@ -14998,148 +16427,83 @@
[[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_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
+ [Assigns an existing native acceptor to the acceptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
- [Construct a basic_stream_socket without opening it. ]
+ [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
+ [Construct an acceptor without opening it. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
+ [Bind the acceptor to the given local endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_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_socket_acceptor.get_option [*get_option]]]
+ [Get an option from the acceptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
+ [[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_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. ]
- ]
-
- [
- [[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. ]
+ [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote 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_stream_socket.send [*send]]]
- [Send some data on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the acceptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
+ [Get the native acceptor representation. ]
]
[
- [[link boost_asio.reference.basic_stream_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. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
+ [Set an option on the acceptor. ]
]
]
@@ -15149,28 +16513,44 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_socket.message_out_of_band [*message_out_of_band]]]
+ [[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_stream_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. ]
]
]
-The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
+[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 basic_socket_acceptor class template is used for accepting new socket connections.
[heading Thread Safety]
@@ -15179,73 +16559,111 @@
[*Shared] [*objects:] Unsafe.
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
-[section:assign basic_stream_socket::assign]
+ 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();
-Assign an existing native socket to the socket.
- void ``[link boost_asio.reference.basic_stream_socket.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket,
+
+
+[section:accept basic_socket_acceptor::accept]
+
+[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);
+
+ 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);
+ 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);
-[section:overload1 basic_stream_socket::assign (1 of 2 overloads)]
+ 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);
-['Inherited from basic_socket.]
+[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)]
-Assign an existing native socket to the socket.
+Accept a new connection.
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer);
+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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[peer][The socket into which the new connection will be accepted.]]
-[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
+]
+[heading Exceptions]
+
-['Inherited from basic_socket.]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-Assign an existing native socket to the socket.
+]
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+[heading Example]
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ acceptor.accept(socket);
-[endsect]
-[endsect]
-[section:async_connect basic_stream_socket::async_connect]
+[endsect]
-['Inherited from basic_socket.]
-Start an asynchronous connect.
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
+[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 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 returned to the closed state.
+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.
[heading Parameters]
@@ -15253,16 +16671,9 @@
[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
- );
+[[peer][The socket into which the new connection will be accepted.]]
-``
-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.]]
]
@@ -15270,21 +16681,16 @@
- void connect_handler(const boost::system::error_code& error)
+ 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)
{
- if (!error)
- {
- // Connect succeeded.
- }
+ // An error occurred.
}
- ...
-
- 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);
-
@@ -15294,19 +16700,18 @@
-[section:async_read_some basic_stream_socket::async_read_some]
+[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
-Start an asynchronous read.
+Accept a new connection and obtain the endpoint of the peer.
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.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint);
-This function is used to asynchronously read data from the stream socket. The function call always returns immediately.
+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]
@@ -15314,74 +16719,53 @@
[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.
- );
+[[peer][The socket into which the new connection will be accepted.]]
-``
-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().]]
+[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
]
-[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 Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
[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);
+
+ 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);
+
-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_receive basic_stream_socket::async_receive]
-Start an asynchronous receive.
+[section:overload4 basic_socket_acceptor::accept (4 of 4 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.overload1 async_receive]``(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+Accept a new connection and obtain the endpoint of the peer.
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);
+ 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);
-[section:overload1 basic_stream_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,
- ReadHandler handler);
-
-
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+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]
@@ -15389,94 +16773,75 @@
[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.]]
+[[peer][The socket into which the new connection will be accepted.]]
-[[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.
- );
+[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
-``
-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:
- socket.async_receive(boost::asio::buffer(data, size), handler);
+
+ 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.
+ }
-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:overload2 basic_stream_socket::async_receive (2 of 2 overloads)]
+[endsect]
-Start an asynchronous receive.
+[section:assign basic_socket_acceptor::assign]
- 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);
+[indexterm2 assign..basic_socket_acceptor] Assigns an existing native acceptor to the acceptor.
+ void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+ 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);
-[heading Parameters]
-
+[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
-[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.]]
+Assigns an existing native acceptor to the acceptor.
-[[flags][Flags specifying how the receive call is to be made.]]
+ void assign(
+ const protocol_type & protocol,
+ const native_type & native_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().]]
-]
+[endsect]
-[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:
- socket.async_receive(boost::asio::buffer(data, size), 0, handler);
+[section:overload2 basic_socket_acceptor::assign (2 of 2 overloads)]
+Assigns an existing native acceptor to the acceptor.
-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.
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_acceptor,
+ boost::system::error_code & ec);
@@ -15485,39 +16850,39 @@
[endsect]
-[section:async_send basic_stream_socket::async_send]
+[section:async_accept basic_socket_acceptor::async_accept]
-Start an asynchronous send.
+[indexterm2 async_accept..basic_socket_acceptor] Start an asynchronous accept.
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);
+ 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);
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);
+ 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);
-[section:overload1 basic_stream_socket::async_send (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
-Start an asynchronous send.
+Start an asynchronous accept.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ 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);
-This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
[heading Parameters]
@@ -15525,35 +16890,39 @@
[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.]]
+[[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.]]
-[[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:
+[[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.
- std::size_t bytes_transferred // Number of bytes sent.
+ 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 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.
-
[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);
+
+ 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);
+
-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.
@@ -15561,20 +16930,20 @@
-[section:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
+[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
-Start an asynchronous send.
+Start an asynchronous accept.
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);
+ 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 send data on the stream socket. The function call always returns immediately.
+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.
[heading Parameters]
@@ -15582,59 +16951,58 @@
[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.]]
+[[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.]]
-[[flags][Flags specifying how the send call is to be made.]]
+[[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 send 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 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.
- std::size_t bytes_transferred // Number of bytes sent.
+ 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().]]
+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 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.
-[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.
+[endsect]
+[section:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
+[indexterm2 basic_socket_acceptor..basic_socket_acceptor] Construct an acceptor without opening it.
-[endsect]
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service);
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-[endsect]
+ ``[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);
+ ``[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);
-[section:async_write_some basic_stream_socket::async_write_some]
-Start an asynchronous write.
+[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
- 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 acceptor without opening it.
+
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service);
-This function is used to asynchronously write data to the stream socket. The function call always returns immediately.
+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.
[heading Parameters]
@@ -15642,67 +17010,38 @@
[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().]]
+[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
]
-[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.
-
[endsect]
-[section:at_mark basic_stream_socket::at_mark]
-
-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;
-
- bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
+[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
-[section:overload1 basic_stream_socket::at_mark (1 of 2 overloads)]
+Construct an open acceptor.
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-['Inherited from basic_socket.]
-Determine whether the socket is at the out-of-band data mark.
+This constructor creates an acceptor and automatically opens it.
- bool at_mark() const;
+[heading Parameters]
+
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+[variablelist
+
+[[io_service][The 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 Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+]
[heading Exceptions]
@@ -15719,66 +17058,86 @@
-[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
+[section:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
+Construct an acceptor opened on the given endpoint.
-['Inherited from basic_socket.]
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint,
+ bool reuse_addr = true);
-Determine whether the socket is at the out-of-band data mark.
- bool at_mark(
- boost::system::error_code & ec) const;
+This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+[heading Parameters]
+
+[variablelist
+
+[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
-[heading Parameters]
+[[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.]]
+
+]
+
+[heading Exceptions]
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[boost::system::system_error][Thrown on failure.]]
]
-[heading Return Value]
+[heading Remarks]
-A bool indicating whether the socket is at the out-of-band data mark.
+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);
-[endsect]
-[endsect]
-[section:available basic_stream_socket::available]
-Determine the number of bytes available for reading.
+[endsect]
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload1 available]``() const;
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload2 available]``(
- boost::system::error_code & ec) const;
+[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
-[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
+Construct a basic_socket_acceptor on an existing native acceptor.
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
-['Inherited from basic_socket.]
-Determine the number of bytes available for reading.
+This constructor creates an acceptor object to hold an existing native acceptor.
- std::size_t available() const;
+[heading Parameters]
+
-This function is used to determine the number of bytes that may be read without blocking.
+[variablelist
+
+[[io_service][The 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 Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+[[native_acceptor][A native acceptor.]]
+
+]
[heading Exceptions]
@@ -15794,19 +17153,29 @@
[endsect]
+[endsect]
-[section:overload2 basic_stream_socket::available (2 of 2 overloads)]
+[section:bind basic_socket_acceptor::bind]
+[indexterm2 bind..basic_socket_acceptor] Bind the acceptor to the given local endpoint.
-['Inherited from basic_socket.]
+ void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
-Determine the number of bytes available for reading.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
- std::size_t available(
- boost::system::error_code & ec) const;
+[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
-This function is used to determine the number of bytes that may be read without blocking.
+Bind the acceptor to the given local endpoint.
+
+ void bind(
+ const endpoint_type & endpoint);
+
+
+This function binds the socket acceptor to the specified endpoint on the local machine.
[heading Parameters]
@@ -15814,51 +17183,46 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
]
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[heading Example]
+
-[endsect]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
+ acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
-[section:basic_stream_socket basic_stream_socket::basic_stream_socket]
-Construct a basic_stream_socket without opening it.
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 basic_stream_socket]``(
- boost::asio::io_service & io_service);
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
- ``[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);
+[endsect]
-[section:overload1 basic_stream_socket::basic_stream_socket (1 of 4 overloads)]
-Construct a basic_stream_socket without opening it.
+[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
- basic_stream_socket(
- boost::asio::io_service & io_service);
+Bind the acceptor to the given local endpoint.
+
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
-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.
+This function binds the socket acceptor to the specified endpoint on the local machine.
[heading Parameters]
@@ -15866,117 +17230,130 @@
[variablelist
-[[io_service][The 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 socket acceptor will be bound.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
]
+[heading Example]
+
-[endsect]
+ 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.
+ }
-[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
-Construct and open a basic_stream_socket.
- 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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[io_service][The io\_service object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+[section:broadcast basic_socket_acceptor::broadcast]
-[[protocol][An object specifying protocol parameters to be used.]]
-]
+['Inherited from socket_base.]
-[heading Exceptions]
-
+[indexterm2 broadcast..basic_socket_acceptor] Socket option to permit sending of broadcast messages.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef implementation_defined broadcast;
-]
+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:overload3 basic_stream_socket::basic_stream_socket (3 of 4 overloads)]
-Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+Getting the current option value:
-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.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[heading Parameters]
-
-[variablelist
-
-[[io_service][The 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.]]
-]
-[heading Exceptions]
-
+[endsect]
-[variablelist
+
+
+[section:bytes_readable basic_socket_acceptor::bytes_readable]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 bytes_readable..basic_socket_acceptor] 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::system::system_error][Thrown on failure. ]]
-]
+ 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:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
-Construct a basic_stream_socket on an existing native socket.
+[endsect]
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
+[section:cancel basic_socket_acceptor::cancel]
-This constructor creates a stream socket object to hold an existing native socket.
+[indexterm2 cancel..basic_socket_acceptor] Cancel all asynchronous operations associated with the acceptor.
+ void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
-[heading Parameters]
-
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
-[variablelist
-
-[[io_service][The 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:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
-[[native_socket][The new underlying socket implementation.]]
+Cancel all asynchronous operations associated with the acceptor.
+
+ 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]
@@ -15992,83 +17369,82 @@
[endsect]
-[endsect]
-
-[section:bind basic_stream_socket::bind]
-Bind the socket to the given local endpoint.
+[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
- void ``[link boost_asio.reference.basic_stream_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+Cancel all asynchronous operations associated with the acceptor.
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
+ boost::system::error_code cancel(
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::bind (1 of 2 overloads)]
+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.
-['Inherited from basic_socket.]
+[heading Parameters]
+
-Bind the socket to the given local endpoint.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
- void bind(
- const endpoint_type & endpoint);
+]
-This function binds the socket to the specified endpoint on the local machine.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[endsect]
-]
+[section:close basic_socket_acceptor::close]
-[heading Exceptions]
-
+[indexterm2 close..basic_socket_acceptor] Close the acceptor.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+ void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
-]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
+ boost::system::error_code & ec);
-[heading Example]
-
+[section:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
- 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));
+Close the acceptor.
+ void close();
+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.
-[endsect]
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
+[endsect]
-['Inherited from basic_socket.]
-Bind the socket to the given local endpoint.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+[section:overload2 basic_socket_acceptor::close (2 of 2 overloads)]
+
+Close the acceptor.
+
+ boost::system::error_code close(
boost::system::error_code & ec);
-This function binds the socket to the specified endpoint on the local machine.
+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]
@@ -16076,8 +17452,6 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-
[[ec][Set to indicate what error occurred, if any.]]
]
@@ -16086,11 +17460,10 @@
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
+ acceptor.close(ec);
if (ec)
{
// An error occurred.
@@ -16107,27 +17480,27 @@
[endsect]
-[section:broadcast basic_stream_socket::broadcast]
+[section:debug basic_socket_acceptor::debug]
['Inherited from socket_base.]
-Socket option to permit sending of broadcast messages.
+[indexterm2 debug..basic_socket_acceptor] Socket option to enable socket-level debugging.
- typedef implementation_defined broadcast;
+ typedef implementation_defined debug;
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+Implements the SOL\_SOCKET/SO\_DEBUG 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::broadcast option(true);
+ boost::asio::socket_base::debug option(true);
socket.set_option(option);
@@ -16135,9 +17508,9 @@
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::broadcast option;
+ boost::asio::socket_base::debug option;
socket.get_option(option);
bool is_set = option.value();
@@ -16150,160 +17523,164 @@
-[section:bytes_readable basic_stream_socket::bytes_readable]
+[section:do_not_route basic_socket_acceptor::do_not_route]
['Inherited from socket_base.]
-IO control command to get the amount of data that can be read without blocking.
+[indexterm2 do_not_route..basic_socket_acceptor] Socket option to prevent routing, use local interfaces only.
- typedef implementation_defined bytes_readable;
+ typedef implementation_defined do_not_route;
-Implements the FIONREAD IO control command.
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-[heading Example]
+[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::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+ 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();
-[endsect]
-[section:cancel basic_stream_socket::cancel]
-Cancel all asynchronous operations associated with the socket.
- void ``[link boost_asio.reference.basic_stream_socket.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 basic_stream_socket::cancel (1 of 2 overloads)]
+[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
-['Inherited from basic_socket.]
-Cancel all asynchronous operations associated with the socket.
+['Inherited from socket_base.]
- void cancel();
+[indexterm2 enable_connection_aborted..basic_socket_acceptor] Socket option to report aborted connections on accept.
+ typedef implementation_defined enable_connection_aborted;
-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]
-
+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]
-[[boost::system::system_error][Thrown on failure.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
-[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:
+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();
-* 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::cancel (2 of 2 overloads)]
+[section:endpoint_type basic_socket_acceptor::endpoint_type]
+[indexterm2 endpoint_type..basic_socket_acceptor] The endpoint type.
-['Inherited from basic_socket.]
+ typedef Protocol::endpoint endpoint_type;
-Cancel all asynchronous operations associated with the socket.
- 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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+[section:get_io_service basic_socket_acceptor::get_io_service]
-]
-[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:
+['Inherited from basic_io_object.]
-* It will only cancel asynchronous operations that were initiated in the current thread.
+[indexterm2 get_io_service..basic_socket_acceptor] Get the io_service associated with the object.
-* 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.
+ boost::asio::io_service & get_io_service();
-For portable cancellation, consider using one of the following alternatives:
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-* 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 Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-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_stream_socket::close]
+[section:get_option basic_socket_acceptor::get_option]
-Close the socket.
+[indexterm2 get_option..basic_socket_acceptor] Get an option from the acceptor.
- void ``[link boost_asio.reference.basic_stream_socket.close.overload1 close]``();
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
+ GettableSocketOption & option);
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.close.overload2 close]``(
+ 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);
-[section:overload1 basic_stream_socket::close (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
+Get an option from the acceptor.
-['Inherited from basic_socket.]
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option);
-Close the socket.
- void close();
+This function is used to get the current value of an option on the acceptor.
-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]
+
+[variablelist
+
+[[option][The option value to be obtained from the acceptor.]]
+
+]
[heading Exceptions]
@@ -16314,28 +17691,37 @@
]
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing 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();
-[endsect]
-[section:overload2 basic_stream_socket::close (2 of 2 overloads)]
+[endsect]
-['Inherited from basic_socket.]
-Close the socket.
+[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
- boost::system::error_code close(
+Get an option from the acceptor.
+
+ template<
+ 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 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 get the current value of an option on the acceptor.
[heading Parameters]
@@ -16343,30 +17729,30 @@
[variablelist
+[[option][The option value to be obtained from the acceptor.]]
+
[[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::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
+ boost::asio::ip::tcp::acceptor::reuse_address option;
boost::system::error_code ec;
- socket.close(ec);
+ acceptor.get_option(option, ec);
if (ec)
{
// An error occurred.
}
+ bool is_set = option.get();
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-
[endsect]
@@ -16374,62 +17760,30 @@
[endsect]
-[section:connect basic_stream_socket::connect]
-
-Connect the socket to the specified endpoint.
-
- void ``[link boost_asio.reference.basic_stream_socket.connect.overload1 connect]``(
- const endpoint_type & peer_endpoint);
-
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.connect.overload2 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
-
-
-[section:overload1 basic_stream_socket::connect (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-Connect the socket to the specified endpoint.
-
- void connect(
- const endpoint_type & peer_endpoint);
+[section:implementation basic_socket_acceptor::implementation]
-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 returned to the closed state.
+['Inherited from basic_io_object.]
+[indexterm2 implementation..basic_socket_acceptor] The underlying implementation of the I/O object.
-[heading Parameters]
-
+ implementation_type implementation;
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-]
-[heading Exceptions]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
-
+[section:implementation_type basic_socket_acceptor::implementation_type]
- 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);
+['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;
@@ -16438,71 +17792,53 @@
-[section:overload2 basic_stream_socket::connect (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:io_service basic_socket_acceptor::io_service]
-Connect the socket to the specified endpoint.
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
+[indexterm2 io_service..basic_socket_acceptor] (Deprecated: use get_io_service().) Get the io_service associated with the object.
-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.
+ boost::asio::io_service & io_service();
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is returned to the closed state.
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-[heading Parameters]
-
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[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:is_open basic_socket_acceptor::is_open]
+[indexterm2 is_open..basic_socket_acceptor] Determine whether the acceptor is open.
+ bool is_open() const;
[endsect]
-[endsect]
-
-[section:debug basic_stream_socket::debug]
+[section:keep_alive basic_socket_acceptor::keep_alive]
['Inherited from socket_base.]
-Socket option to enable socket-level debugging.
+[indexterm2 keep_alive..basic_socket_acceptor] Socket option to send keep-alives.
- typedef implementation_defined debug;
+ typedef implementation_defined keep_alive;
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
[heading Examples]
@@ -16511,7 +17847,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::debug option(true);
+ boost::asio::socket_base::keep_alive option(true);
socket.set_option(option);
@@ -16521,7 +17857,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::debug option;
+ boost::asio::socket_base::keep_alive option;
socket.get_option(option);
bool is_set = option.value();
@@ -16534,27 +17870,27 @@
-[section:do_not_route basic_stream_socket::do_not_route]
+[section:linger basic_socket_acceptor::linger]
['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
+[indexterm2 linger..basic_socket_acceptor] Socket option to specify whether the socket lingers on close if unsent data is present.
- typedef implementation_defined do_not_route;
+ typedef implementation_defined linger;
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+Implements the SOL\_SOCKET/SO\_LINGER 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::linger option(true, 30);
socket.set_option(option);
@@ -16562,11 +17898,12 @@
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::linger option;
socket.get_option(option);
- bool is_set = option.value();
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
@@ -16576,119 +17913,122 @@
[endsect]
+[section:listen basic_socket_acceptor::listen]
+
+[indexterm2 listen..basic_socket_acceptor] Place the acceptor into the state where it will listen for new connections.
-[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
+ void ``[link boost_asio.reference.basic_socket_acceptor.listen.overload1 listen]``(
+ int backlog = socket_base::max_connections);
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.listen.overload2 listen]``(
+ int backlog,
+ boost::system::error_code & ec);
-['Inherited from socket_base.]
-Socket option to report aborted connections on accept.
+[section:overload1 basic_socket_acceptor::listen (1 of 2 overloads)]
- typedef implementation_defined enable_connection_aborted;
+Place the acceptor into the state where it will listen for new connections.
+ void listen(
+ int backlog = socket_base::max_connections);
-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.
+This function puts the socket acceptor into the state where it may accept new connections.
-[heading Examples]
+[heading Parameters]
+
+
+[variablelist
-Setting the option:
+[[backlog][The maximum length of the queue of pending connections.]]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+]
+[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:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
+Place the acceptor into the state where it will listen for new connections.
-[endsect]
+ boost::system::error_code listen(
+ int backlog,
+ boost::system::error_code & ec);
+This function puts the socket acceptor into the state where it may accept new connections.
-[section:endpoint_type basic_stream_socket::endpoint_type]
-The endpoint type.
+[heading Parameters]
+
- typedef Protocol::endpoint endpoint_type;
+[variablelist
+
+[[backlog][The maximum length of the queue of pending connections.]]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Example]
+
-[endsect]
+ 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.
+ }
-[section:get_io_service basic_stream_socket::get_io_service]
-['Inherited from basic_io_object.]
-Get the io_service associated with the object.
- boost::asio::io_service & get_io_service();
+[endsect]
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[endsect]
+[section:local_endpoint basic_socket_acceptor::local_endpoint]
-[heading Return Value]
-
-A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-[endsect]
-
+[indexterm2 local_endpoint..basic_socket_acceptor] Get the local endpoint of the acceptor.
-[section:get_option basic_stream_socket::get_option]
-
-Get an option from the socket.
-
- void ``[link boost_asio.reference.basic_stream_socket.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.get_option.overload2 get_option]``(
- GettableSocketOption & option,
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
boost::system::error_code & ec) const;
-[section:overload1 basic_stream_socket::get_option (1 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
-
-Get an option from the socket.
-
- void get_option(
- GettableSocketOption & option) const;
+[section:overload1 basic_socket_acceptor::local_endpoint (1 of 2 overloads)]
+Get the local endpoint of the acceptor.
-This function is used to get the current value of an option on the socket.
+ endpoint_type local_endpoint() const;
-[heading Parameters]
-
+This function is used to obtain the locally bound endpoint of the acceptor.
-[variablelist
-
-[[option][The option value to be obtained from the socket.]]
-]
+[heading Return Value]
+
+An object that represents the local endpoint of the acceptor.
[heading Exceptions]
@@ -16701,13 +18041,11 @@
[heading Example]
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
- boost::asio::ip::tcp::socket socket(io_service);
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- boost::asio::ip::tcp::socket::keep_alive option;
- socket.get_option(option);
- bool is_set = option.get();
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
@@ -16718,19 +18056,15 @@
-[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
-Get an option from the socket.
+Get the local endpoint of the acceptor.
- boost::system::error_code get_option(
- GettableSocketOption & option,
+ endpoint_type local_endpoint(
boost::system::error_code & ec) const;
-This function is used to get the current value of an option on the socket.
+This function is used to obtain the locally bound endpoint of the acceptor.
[heading Parameters]
@@ -16738,26 +18072,26 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
-
[[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]
-Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
- boost::asio::ip::tcp::socket socket(io_service);
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- boost::asio::ip::tcp::socket::keep_alive option;
boost::system::error_code ec;
- socket.get_option(option, ec);
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
if (ec)
{
// An error occurred.
}
- bool is_set = option.get();
@@ -16770,45 +18104,161 @@
[endsect]
-[section:implementation_type basic_stream_socket::implementation_type]
+[section:max_connections basic_socket_acceptor::max_connections]
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
-The underlying implementation type of I/O object.
+[indexterm2 max_connections..basic_socket_acceptor] The maximum length of the queue of pending incoming connections.
- typedef service_type::implementation_type implementation_type;
+ static const int max_connections = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
+
+
+['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;
[endsect]
-[section:io_control basic_stream_socket::io_control]
-Perform an IO control command on the socket.
+[section:message_flags basic_socket_acceptor::message_flags]
- void ``[link boost_asio.reference.basic_stream_socket.io_control.overload1 io_control]``(
- IoControlCommand & command);
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.io_control.overload2 io_control]``(
- IoControlCommand & command,
- boost::system::error_code & ec);
+['Inherited from socket_base.]
+[indexterm2 message_flags..basic_socket_acceptor] Bitmask type for flags that can be passed to send and receive operations.
-[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
+ typedef int message_flags;
-['Inherited from basic_socket.]
-Perform an IO control command on the socket.
- void io_control(
- IoControlCommand & command);
+[endsect]
-This function is used to execute an IO control command on the socket.
+
+[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
+
+
+['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]
+
+
+
+[section:message_peek basic_socket_acceptor::message_peek]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 message_peek..basic_socket_acceptor] Peek at incoming data without removing it from the input queue.
+
+ static const int message_peek = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:native basic_socket_acceptor::native]
+
+[indexterm2 native..basic_socket_acceptor] Get the native acceptor representation.
+
+ native_type native();
+
+
+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]
+
+
+
+[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;
+
+
+
+
+[endsect]
+
+
+
+[section:non_blocking_io basic_socket_acceptor::non_blocking_io]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 non_blocking_io..basic_socket_acceptor] 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);
+
+
+
+
+
+
+[endsect]
+
+
+[section:open basic_socket_acceptor::open]
+
+[indexterm2 open..basic_socket_acceptor] Open the acceptor using the specified protocol.
+
+ void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
+
+Open the acceptor using the specified protocol.
+
+ void open(
+ const protocol_type & protocol = protocol_type());
+
+
+This function opens the socket acceptor so that it will use the specified protocol.
[heading Parameters]
@@ -16816,7 +18266,7 @@
[variablelist
-[[command][The IO control command to be performed on the socket.]]
+[[protocol][An object specifying which protocol is to be used.]]
]
@@ -16831,36 +18281,30 @@
[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();
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
-[endsect]
+[endsect]
-[section:overload2 basic_stream_socket::io_control (2 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
-Perform an IO control command on the socket.
+Open the acceptor using the specified protocol.
- boost::system::error_code io_control(
- IoControlCommand & command,
+ boost::system::error_code open(
+ const protocol_type & protocol,
boost::system::error_code & ec);
-This function is used to execute an IO control command on the socket.
+This function opens the socket acceptor so that it will use the specified protocol.
[heading Parameters]
@@ -16868,7 +18312,7 @@
[variablelist
-[[command][The IO control command to be performed on the socket.]]
+[[protocol][An object specifying which protocol is to be used.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -16876,18 +18320,15 @@
[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;
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
boost::system::error_code ec;
- socket.io_control(command, ec);
+ acceptor.open(boost::asio::ip::tcp::v4(), ec);
if (ec)
{
// An error occurred.
}
- std::size_t bytes_readable = command.get();
@@ -16900,37 +18341,55 @@
[endsect]
-[section:io_service basic_stream_socket::io_service]
+[section:protocol_type basic_socket_acceptor::protocol_type]
+[indexterm2 protocol_type..basic_socket_acceptor] The protocol type.
-['Inherited from basic_io_object.]
+ typedef Protocol protocol_type;
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
- boost::asio::io_service & io_service();
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[endsect]
-[heading Return Value]
-
-A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+[section:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
-[endsect]
+['Inherited from socket_base.]
+
+[indexterm2 receive_buffer_size..basic_socket_acceptor] Socket option for the receive buffer size of a socket.
+ typedef implementation_defined receive_buffer_size;
-[section:is_open basic_stream_socket::is_open]
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+
+
+[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();
-['Inherited from basic_socket.]
-Determine whether the socket is open.
- bool is_open() const;
@@ -16938,18 +18397,18 @@
-[section:keep_alive basic_stream_socket::keep_alive]
+[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
['Inherited from socket_base.]
-Socket option to send keep-alives.
+[indexterm2 receive_low_watermark..basic_socket_acceptor] Socket option for the receive low watermark.
- typedef implementation_defined keep_alive;
+ typedef implementation_defined receive_low_watermark;
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
[heading Examples]
@@ -16958,7 +18417,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option(true);
+ boost::asio::socket_base::receive_low_watermark option(1024);
socket.set_option(option);
@@ -16968,9 +18427,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option;
+ boost::asio::socket_base::receive_low_watermark option;
socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
@@ -16981,40 +18440,39 @@
-[section:linger basic_stream_socket::linger]
+[section:reuse_address basic_socket_acceptor::reuse_address]
['Inherited from socket_base.]
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[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 linger;
+ typedef implementation_defined reuse_address;
-Implements the SOL\_SOCKET/SO\_LINGER 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::linger option(true, 30);
- socket.set_option(option);
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
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::linger option;
- socket.get_option(option);
- bool is_set = option.enabled();
- unsigned short timeout = option.timeout();
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
@@ -17024,49 +18482,40 @@
[endsect]
-[section:local_endpoint basic_stream_socket::local_endpoint]
-
-Get the local endpoint of the socket.
-
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
-
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
+[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
-[section:overload1 basic_stream_socket::local_endpoint (1 of 2 overloads)]
+['Inherited from socket_base.]
-['Inherited from basic_socket.]
+[indexterm2 send_buffer_size..basic_socket_acceptor] Socket option for the send buffer size of a socket.
-Get the local endpoint of the socket.
+ typedef implementation_defined send_buffer_size;
- endpoint_type local_endpoint() const;
-This function is used to obtain the locally bound endpoint of the socket.
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
-[heading Return Value]
-
-An object that represents the local endpoint of the socket.
+[heading Examples]
+
+Setting the option:
-[heading Exceptions]
-
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
-
+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 = socket.local_endpoint();
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
@@ -17077,45 +18526,39 @@
-[section:overload2 basic_stream_socket::local_endpoint (2 of 2 overloads)]
+[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Get the local endpoint of the socket.
+[indexterm2 send_low_watermark..basic_socket_acceptor] Socket option for the send low watermark.
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
+ typedef implementation_defined send_low_watermark;
-This function is used to obtain the locally bound endpoint of the socket.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[ec][Set to indicate what error occurred, if any.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
-[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);
+Getting the current option value:
+
+ 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.
- }
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
@@ -17125,189 +18568,481 @@
[endsect]
-[endsect]
-
-[section:lowest_layer basic_stream_socket::lowest_layer]
+[section:service basic_socket_acceptor::service]
-['Inherited from basic_socket.]
+['Inherited from basic_io_object.]
-Get a reference to the lowest layer.
+[indexterm2 service..basic_socket_acceptor] The service associated with the I/O object.
- lowest_layer_type & lowest_layer();
+ service_type & service;
-This function returns a reference to the lowest layer in a stack of layers. Since a basic_socket 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:service_type basic_socket_acceptor::service_type]
-[endsect]
+['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.
-[section:lowest_layer_type basic_stream_socket::lowest_layer_type]
+ typedef SocketAcceptorService service_type;
-['Inherited from basic_socket.]
-A basic_socket is always the lowest layer.
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+[endsect]
-[heading Types]
-[table
- [[Name][Description]]
+[section:set_option basic_socket_acceptor::set_option]
- [
+[indexterm2 set_option..basic_socket_acceptor] Set an option on the acceptor.
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
- [
+ 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);
- [[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. ]
-
- ]
- [
+[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+Set an option on the acceptor.
- [
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
- [
+This function is used to set an option on the acceptor.
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+[variablelist
- ]
+[[option][The new option value to be set on the acceptor.]]
- [
+]
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+[heading Exceptions]
+
+
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure.]]
- [
+]
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
+[heading Example]
- ]
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
- [
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
+ acceptor.set_option(option);
- [[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.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. ]
-
- ]
+
+[endsect]
+
+
+
+[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
+
+Set an option on the acceptor.
+
+ template<
+ 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 set an option on the acceptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[option][The new option value to be set on the acceptor.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Example]
+
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
+ boost::system::error_code ec;
+ acceptor.set_option(option, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[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
+
+[heading Values]
+[variablelist
[
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [
+ [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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[section:basic_socket_iostream basic_socket_iostream::basic_socket_iostream]
+
+[indexterm2 basic_socket_iostream..basic_socket_iostream] Construct a basic_socket_iostream without establishing a connection.
+
+ ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload1 basic_socket_iostream]``();
+
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 basic_socket_iostream]``(
+ T1 t1,
+ ... ,
+ TN tn);
+
+
+[section:overload1 basic_socket_iostream::basic_socket_iostream (1 of 2 overloads)]
+
+Construct a basic_socket_iostream without establishing a connection.
+
+ basic_socket_iostream();
+
+
+
+[endsect]
+
+
+
+[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:close basic_socket_iostream::close]
+
+[indexterm2 close..basic_socket_iostream] Close the connection.
+
+ void close();
+
+
+
+[endsect]
+
+
+
+[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);
+
+
+This function automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
+
+
+[endsect]
+
+
+
+[section:rdbuf basic_socket_iostream::rdbuf]
+
+[indexterm2 rdbuf..basic_socket_iostream] Return a pointer to the underlying streambuf.
+
+ basic_socket_streambuf< Protocol, StreamSocketService > * rdbuf() const;
+
+
+
+[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>>
+ class basic_socket_streambuf :
+ public basic_socket< Protocol, StreamSocketService >
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[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_streambuf.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[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_streambuf.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]]]
+ [The endpoint 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_streambuf.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[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_streambuf.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]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_streambuf.native_type [*native_type]]]
[The native representation of a socket. ]
]
[
- [[link boost_asio.reference.basic_socket.non_blocking_io [*non_blocking_io]]]
+ [[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.protocol_type [*protocol_type]]]
+ [[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. ]
]
@@ -17319,110 +19054,141 @@
[[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. ]
+ [[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. ]
]
[
- [[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. ]
]
[
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [[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.get_option [*get_option]]]
+ [[link boost_asio.reference.basic_socket_streambuf.get_option [*get_option]]]
[Get an option from the socket. ]
]
[
- [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
+ [[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.io_service [*io_service]]]
+ [[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.is_open [*is_open]]]
+ [[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. ]
]
[
- [[link boost_asio.reference.basic_socket.native [*native]]]
+ [[link boost_asio.reference.basic_socket_streambuf.native [*native]]]
[Get the native socket representation. ]
]
[
- [[link boost_asio.reference.basic_socket.open [*open]]]
+ [[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.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]
+[table
+ [[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]]]
+ []
+ ]
+
]
[heading Data Members]
@@ -17430,51 +19196,67 @@
[[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_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. ]
]
]
-The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
-
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-[*Shared] [*objects:] Unsafe.
+ [
+ [[link boost_asio.reference.basic_socket_streambuf.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+]
+[section:assign basic_socket_streambuf::assign]
+[indexterm2 assign..basic_socket_streambuf] Assign an existing native socket to the socket.
-[endsect]
+ void ``[link boost_asio.reference.basic_socket_streambuf.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_socket);
+ 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);
-[section:max_connections basic_stream_socket::max_connections]
+[section:overload1 basic_socket_streambuf::assign (1 of 2 overloads)]
-['Inherited from socket_base.]
+['Inherited from basic_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_type & native_socket);
@@ -17482,90 +19264,122 @@
-[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.]
-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_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.]
-Bitmask type for flags that can be passed to send and receive operations.
+['Inherited from basic_socket.]
- typedef int message_flags;
+[indexterm2 async_connect..basic_socket_streambuf] Start an asynchronous connect.
+ 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:message_out_of_band basic_stream_socket::message_out_of_band]
+[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().]]
-['Inherited from socket_base.]
+]
-Process out-of-band data.
+[heading Example]
+
- static const int message_out_of_band = implementation_defined;
+ 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);
-[section:message_peek basic_stream_socket::message_peek]
-['Inherited from socket_base.]
-Peek at incoming data without removing it from the input queue.
+[endsect]
- static const int message_peek = implementation_defined;
+[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.
-[endsect]
+ bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload1 at_mark]``() const;
+ bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
-[section:native basic_stream_socket::native]
+[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
['Inherited from basic_socket.]
-Get the native socket representation.
+Determine whether the socket is at the out-of-band data mark.
- native_type native();
+ bool at_mark() const;
-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]
-
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[section:native_type basic_stream_socket::native_type]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
-The native representation of a socket.
+[heading Exceptions]
+
- typedef StreamSocketService::native_type native_type;
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -17573,110 +19387,94 @@
-[section:non_blocking_io basic_stream_socket::non_blocking_io]
+[section:overload2 basic_socket_streambuf::at_mark (2 of 2 overloads)]
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
-IO control command to set the blocking mode of the socket.
+Determine whether the socket is at the out-of-band data mark.
- typedef implementation_defined non_blocking_io;
+ 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.
-Implements the FIONBIO IO control command.
+[heading Parameters]
+
-[heading Example]
+[variablelist
+[[ec][Set to indicate what error occurred, if any.]]
+]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
-
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
+[endsect]
[endsect]
+[section:available basic_socket_streambuf::available]
-[section:open basic_stream_socket::open]
-
-Open the socket using the specified protocol.
+[indexterm2 available..basic_socket_streambuf] Determine the number of bytes available for reading.
- void ``[link boost_asio.reference.basic_stream_socket.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
+ std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload1 available]``() const;
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
+ std::size_t ``[link boost_asio.reference.basic_socket_streambuf.available.overload2 available]``(
+ boost::system::error_code & ec) const;
-[section:overload1 basic_stream_socket::open (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
['Inherited from basic_socket.]
-Open the socket using the specified protocol.
-
- void open(
- const protocol_type & protocol = protocol_type());
-
+Determine the number of bytes available for reading.
-This function opens the socket so that it will use the specified protocol.
+ std::size_t available() const;
-[heading Parameters]
-
+This function is used to determine the number of bytes that may be read without blocking.
-[variablelist
-
-[[protocol][An object specifying protocol parameters to be used.]]
-]
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
[heading Exceptions]
[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);
- socket.open(boost::asio::ip::tcp::v4());
-
-
-
-
[endsect]
-[section:overload2 basic_stream_socket::open (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
['Inherited from basic_socket.]
-Open the socket using the specified protocol.
+Determine the number of bytes available for reading.
- boost::system::error_code open(
- const protocol_type & protocol,
- boost::system::error_code & ec);
+ std::size_t available(
+ boost::system::error_code & ec) const;
-This function opens the socket so that it will use the specified protocol.
+This function is used to determine the number of bytes that may be read without blocking.
[heading Parameters]
@@ -17684,26 +19482,13 @@
[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.
- }
-
-
-
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
@@ -17713,45 +19498,41 @@
[endsect]
-[section:protocol_type basic_stream_socket::protocol_type]
-
-The protocol type.
+[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
- typedef Protocol protocol_type;
+[indexterm2 basic_socket_streambuf..basic_socket_streambuf] Construct a basic_socket_streambuf without establishing a connection.
+ basic_socket_streambuf();
[endsect]
-[section:read_some basic_stream_socket::read_some]
+[section:bind basic_socket_streambuf::bind]
-Read some data from the socket.
+[indexterm2 bind..basic_socket_streambuf] Bind the socket to the given local endpoint.
- 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);
+ void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
- 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 ``[link boost_asio.reference.basic_socket_streambuf.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::read_some (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
-Read some data from the socket.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+['Inherited from basic_socket.]
+
+Bind the socket to the given local endpoint.
+ void bind(
+ const endpoint_type & endpoint);
-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 binds the socket to the specified endpoint on the local machine.
[heading Parameters]
@@ -17759,38 +19540,30 @@
[variablelist
-[[buffers][One or more buffers into which the data will be read.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
]
-[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.]]
+[[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:
- socket.read_some(boost::asio::buffer(data, size));
+
+ 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));
+
-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.
@@ -17798,18 +19571,19 @@
-[section:overload2 basic_stream_socket::read_some (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
-Read some data from the socket.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
+['Inherited from basic_socket.]
+
+Bind the socket to the given local endpoint.
+
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
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 binds the socket to the specified endpoint on the local machine.
[heading Parameters]
@@ -17817,101 +19591,73 @@
[variablelist
-[[buffers][One or more buffers into which the data will be read.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
[[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]
+
-[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::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.
+ }
-[endsect]
-[endsect]
-[section:receive basic_stream_socket::receive]
-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);
- 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);
+[endsect]
- 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);
+[section:broadcast basic_socket_streambuf::broadcast]
-[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
-Receive some data on the socket.
+['Inherited from socket_base.]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers);
+[indexterm2 broadcast..basic_socket_streambuf] Socket option to permit sending of broadcast messages.
+ typedef implementation_defined broadcast;
-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]
-
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
-[variablelist
-
-[[buffers][One or more buffers into which the data will be received.]]
-]
+[heading Examples]
+
+Setting the option:
-[heading Return Value]
-
-The number of bytes received.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
-[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 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.
+Getting the current option value:
-[heading Example]
-
-To receive into a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
- socket.receive(boost::asio::buffer(data, size));
-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.
@@ -17919,242 +19665,159 @@
-[section:overload2 basic_stream_socket::receive (2 of 3 overloads)]
+[section:bytes_readable basic_socket_streambuf::bytes_readable]
-Receive some data on the socket.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags);
+['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.
-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.
+ typedef implementation_defined bytes_readable;
-[heading Parameters]
-
-[variablelist
+Implements the FIONREAD IO control command.
+
+
+[heading Example]
-[[buffers][One or more buffers into which the data will be received.]]
-[[flags][Flags specifying how the receive call is to be made.]]
-]
+ 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 Return Value]
-
-The number of bytes received.
-[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 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:
+[endsect]
- socket.receive(boost::asio::buffer(data, size), 0);
+[section:cancel basic_socket_streambuf::cancel]
-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 cancel..basic_socket_streambuf] Cancel all asynchronous operations associated with the socket.
+ void ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload1 cancel]``();
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
-[section:overload3 basic_stream_socket::receive (3 of 3 overloads)]
+['Inherited from basic_socket.]
-Receive some data on a connected socket.
+Cancel all asynchronous operations associated with the socket.
- 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);
+ void cancel();
-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 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]
+[heading Exceptions]
[variablelist
-[[buffers][One or more buffers into which the data will be received.]]
-
-[[flags][Flags specifying how the receive call is to be made.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[boost::system::system_error][Thrown on failure.]]
]
-[heading Return Value]
-
-The number of bytes received. Returns 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.read read] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:receive_buffer_size basic_stream_socket::receive_buffer_size]
-
-
-['Inherited from socket_base.]
-
-Socket option for the receive buffer size of a socket.
-
- typedef implementation_defined receive_buffer_size;
-
-
-
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
-
-
-[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);
-
-
+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.
-Getting the current option value:
+* 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.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+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.
[endsect]
-[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
+[section:overload2 basic_socket_streambuf::cancel (2 of 2 overloads)]
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
-Socket option for the receive low watermark.
+Cancel all asynchronous operations associated with the socket.
- typedef implementation_defined receive_low_watermark;
+ 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\_RCVLOWAT socket option.
+[heading Parameters]
+
-[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);
+[[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:
+* It will only cancel asynchronous operations that were initiated in the current thread.
-Getting the current option value:
+* 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.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+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.
[endsect]
-[section:remote_endpoint basic_stream_socket::remote_endpoint]
-
-Get the remote endpoint of the socket.
-
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+[endsect]
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
+[section:close basic_socket_streambuf::close]
+[indexterm2 close..basic_socket_streambuf] Close the connection.
-[section:overload1 basic_stream_socket::remote_endpoint (1 of 2 overloads)]
+ basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
+ boost::system::error_code & ec);
-['Inherited from basic_socket.]
-Get the remote endpoint of the socket.
+[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
- endpoint_type remote_endpoint() const;
+Close the connection.
+ basic_socket_streambuf< Protocol, StreamSocketService > * close();
-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.
-
-[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 = socket.remote_endpoint();
-
-
-
+`this` if a connection was successfully established, a null pointer otherwise.
@@ -18162,18 +19825,18 @@
-[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::close (2 of 2 overloads)]
['Inherited from basic_socket.]
-Get the remote endpoint of the socket.
+Close the socket.
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-This function is used to obtain the remote endpoint 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.
[heading Parameters]
@@ -18185,10 +19848,6 @@
]
-[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]
@@ -18196,7 +19855,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ socket.close(ec);
if (ec)
{
// An error occurred.
@@ -18205,148 +19864,101 @@
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-[endsect]
-
[endsect]
-[section:reuse_address basic_stream_socket::reuse_address]
-
+[endsect]
-['Inherited from socket_base.]
+[section:connect basic_socket_streambuf::connect]
-Socket option to allow the socket to be bound to an address that is already in use.
+[indexterm2 connect..basic_socket_streambuf] Establish a connection.
- typedef implementation_defined reuse_address;
+ basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload1 connect]``(
+ const endpoint_type & endpoint);
+ template<
+ typename T1,
+ ... ,
+ typename TN>
+ basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload2 connect]``(
+ T1 t1,
+ ... ,
+ TN tn);
-
-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);
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.connect.overload3 connect]``(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+[section:overload1 basic_socket_streambuf::connect (1 of 3 overloads)]
+Establish a connection.
-Getting the current option value:
+ basic_socket_streambuf< Protocol, StreamSocketService > * connect(
+ const endpoint_type & endpoint);
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
+This function establishes a connection to the specified endpoint.
+[heading Return Value]
+
+`this` if a connection was successfully established, a null pointer otherwise.
[endsect]
-[section:send basic_stream_socket::send]
-
-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);
-
- 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);
-
- 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);
-
-[section:overload1 basic_stream_socket::send (1 of 3 overloads)]
+[section:overload2 basic_socket_streambuf::connect (2 of 3 overloads)]
-Send some data on the socket.
+Establish a connection.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers);
-
-
-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.
-
+ typename T1,
+ ... ,
+ typename TN>
+ basic_socket_streambuf< Protocol, StreamSocketService > * connect(
+ T1 t1,
+ ... ,
+ TN tn);
-[heading Parameters]
-
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket.]]
+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]
-The number of bytes sent.
-
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
-
-[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 Example]
-
-To send a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+`this` if a connection was successfully established, a null pointer otherwise.
- socket.send(boost::asio::buffer(data, size));
-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_socket_streambuf::connect (3 of 3 overloads)]
+['Inherited from basic_socket.]
-[section:overload2 basic_stream_socket::send (2 of 3 overloads)]
+Connect the socket to the specified endpoint.
-Send some data on the socket.
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags);
+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.
-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.
+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]
@@ -18354,113 +19966,101 @@
[variablelist
-[[buffers][One or more data buffers to be sent on the socket.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-[[flags][Flags specifying how the send call is to be made.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Return Value]
-
-The number of bytes sent.
-
-[heading Exceptions]
-
-
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure.]]
-]
-[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::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 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);
-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:debug basic_socket_streambuf::debug]
-[section:overload3 basic_stream_socket::send (3 of 3 overloads)]
-Send some data on the socket.
+['Inherited from socket_base.]
- 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);
+[indexterm2 debug..basic_socket_streambuf] Socket option to enable socket-level debugging.
+ typedef implementation_defined debug;
-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]
-
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
-[variablelist
+
+[heading Examples]
-[[buffers][One or more data buffers to be sent on the socket.]]
+Setting the option:
-[[flags][Flags specifying how the send call is to be made.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[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.
+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();
+
-[endsect]
[endsect]
-[section:send_buffer_size basic_stream_socket::send_buffer_size]
+
+[section:do_not_route basic_socket_streambuf::do_not_route]
['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+[indexterm2 do_not_route..basic_socket_streambuf] Socket option to prevent routing, use local interfaces only.
- typedef implementation_defined send_buffer_size;
+ typedef implementation_defined do_not_route;
-Implements the SOL\_SOCKET/SO\_SNDBUF 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::send_buffer_size option(8192);
+ boost::asio::socket_base::do_not_route option(true);
socket.set_option(option);
@@ -18468,11 +20068,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_buffer_size option;
+ boost::asio::socket_base::do_not_route option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -18483,39 +20083,39 @@
-[section:send_low_watermark basic_stream_socket::send_low_watermark]
+[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
['Inherited from socket_base.]
-Socket option for the send low watermark.
+[indexterm2 enable_connection_aborted..basic_socket_streambuf] Socket option to report aborted connections on accept.
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined enable_connection_aborted;
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+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:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- boost::asio::socket_base::send_low_watermark option(1024);
- socket.set_option(option);
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
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::send_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
@@ -18526,45 +20126,65 @@
-[section:service_type basic_stream_socket::service_type]
+[section:endpoint_type basic_socket_streambuf::endpoint_type]
+
+[indexterm2 endpoint_type..basic_socket_streambuf] The endpoint type.
+
+ typedef Protocol::endpoint endpoint_type;
+
+
+
+
+[endsect]
+
+
+
+[section:get_io_service basic_socket_streambuf::get_io_service]
['Inherited from basic_io_object.]
-The type of the service that will be used to provide I/O operations.
+[indexterm2 get_io_service..basic_socket_streambuf] Get the io_service associated with the object.
- typedef StreamSocketService service_type;
+ boost::asio::io_service & get_io_service();
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+
[endsect]
-[section:set_option basic_stream_socket::set_option]
+[section:get_option basic_socket_streambuf::get_option]
-Set an option on the socket.
+[indexterm2 get_option..basic_socket_streambuf] Get an option from the socket.
- void ``[link boost_asio.reference.basic_stream_socket.set_option.overload1 set_option]``(
- const SettableSocketOption & option);
+ void ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.set_option.overload2 set_option]``(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
-[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::get_option (1 of 2 overloads)]
['Inherited from basic_socket.]
-Set an option on the socket.
+Get an option from the socket.
- void set_option(
- const SettableSocketOption & option);
+ void get_option(
+ GettableSocketOption & option) const;
-This function is used to set an option on the socket.
+This function is used to get the current value of an option on the socket.
[heading Parameters]
@@ -18572,7 +20192,7 @@
[variablelist
-[[option][The new option value to be set on the socket.]]
+[[option][The option value to be obtained from the socket.]]
]
@@ -18587,12 +20207,13 @@
[heading Example]
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
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::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
@@ -18603,19 +20224,19 @@
-[section:overload2 basic_stream_socket::set_option (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::get_option (2 of 2 overloads)]
['Inherited from basic_socket.]
-Set an option on the socket.
+Get an option from the socket.
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
-This function is used to set an option on the socket.
+This function is used to get the current value of an option on the socket.
[heading Parameters]
@@ -18623,7 +20244,7 @@
[variablelist
-[[option][The new option value to be set on the socket.]]
+[[option][The option value to be obtained from the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -18631,17 +20252,18 @@
[heading Example]
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::no_delay option(true);
+ boost::asio::ip::tcp::socket::keep_alive option;
boost::system::error_code ec;
- socket.set_option(option, ec);
+ socket.get_option(option, ec);
if (ec)
{
// An error occurred.
}
+ bool is_set = option.get();
@@ -18653,30 +20275,61 @@
[endsect]
-[section:shutdown basic_stream_socket::shutdown]
-Disable sends or receives on the socket.
+[section:implementation basic_socket_streambuf::implementation]
- void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.shutdown.overload2 shutdown]``(
- shutdown_type what,
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_socket_streambuf] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[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;
+
+
+
+
+[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);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.io_control.overload2 io_control]``(
+ IoControlCommand & command,
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::shutdown (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::io_control (1 of 2 overloads)]
['Inherited from basic_socket.]
-Disable sends or receives on the socket.
+Perform an IO control command on the socket.
- void shutdown(
- shutdown_type what);
+ void io_control(
+ IoControlCommand & command);
-This function is used to disable send operations, receive operations, or both.
+This function is used to execute an IO control command on the socket.
[heading Parameters]
@@ -18684,7 +20337,7 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[command][The IO control command to be performed on the socket.]]
]
@@ -18699,11 +20352,13 @@
[heading Example]
-Shutting down the send side of the socket:
+Getting the number of bytes ready to read:
boost::asio::ip::tcp::socket socket(io_service);
...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
@@ -18714,19 +20369,19 @@
-[section:overload2 basic_stream_socket::shutdown (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::io_control (2 of 2 overloads)]
['Inherited from basic_socket.]
-Disable sends or receives on the socket.
+Perform an IO control command on the socket.
- boost::system::error_code shutdown(
- shutdown_type what,
+ boost::system::error_code io_control(
+ IoControlCommand & command,
boost::system::error_code & ec);
-This function is used to disable send operations, receive operations, or both.
+This function is used to execute an IO control command on the socket.
[heading Parameters]
@@ -18734,7 +20389,7 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[command][The IO control command to be performed on the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -18742,16 +20397,18 @@
[heading Example]
-Shutting down the send side of the socket:
+Getting the number of bytes ready to read:
boost::asio::ip::tcp::socket socket(io_service);
...
+ boost::asio::ip::tcp::socket::bytes_readable command;
boost::system::error_code ec;
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
+ socket.io_control(command, ec);
if (ec)
{
// An error occurred.
}
+ std::size_t bytes_readable = command.get();
@@ -18764,165 +20421,265 @@
[endsect]
-[section:shutdown_type basic_stream_socket::shutdown_type]
-
+[section:io_service basic_socket_streambuf::io_service]
-['Inherited from socket_base.]
-Different ways a socket may be shutdown.
+['Inherited from basic_io_object.]
- enum shutdown_type
+[indexterm2 io_service..basic_socket_streambuf] (Deprecated: use get_io_service().) Get the io_service associated with the object.
-[heading Values]
-[variablelist
+ boost::asio::io_service & io_service();
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
-]
+[heading Return Value]
+
+A reference to the 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_stream_socket::write_some]
-Write some data to the socket.
+[section:is_open basic_socket_streambuf::is_open]
- 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);
- 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);
+['Inherited from basic_socket.]
+[indexterm2 is_open..basic_socket_streambuf] Determine whether the socket is open.
-[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
+ bool is_open() const;
-Write some data to the socket.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+[endsect]
-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]
-
+[section:keep_alive basic_socket_streambuf::keep_alive]
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket.]]
-]
+['Inherited from socket_base.]
-[heading Return Value]
-
-The number of bytes written.
+[indexterm2 keep_alive..basic_socket_streambuf] Socket option to send keep-alives.
-[heading Exceptions]
-
+ typedef implementation_defined keep_alive;
-[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 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.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-[heading Example]
+
+[heading Examples]
-To write a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+Setting the option:
- socket.write_some(boost::asio::buffer(data, size));
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
-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.
+Getting the current option value:
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[section:overload2 basic_stream_socket::write_some (2 of 2 overloads)]
-Write some data to the socket.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[endsect]
-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]
-
+[section:linger basic_socket_streambuf::linger]
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket.]]
-[[ec][Set to indicate what error occurred, if any.]]
+['Inherited from socket_base.]
-]
+[indexterm2 linger..basic_socket_streambuf] Socket option to specify whether the socket lingers on close if unsent data is present.
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
+ 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();
+
+
+
+
+
+
+[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;
+
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+
+
+[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.
+
+
+[heading Return Value]
+
+An object that represents the local endpoint 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 = socket.local_endpoint();
-[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]
+
+[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.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[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]
+
+
+
+ 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_streambuf basic_streambuf]
-Automatically resizable buffer class based on std::streambuf.
+[endsect]
- template<
- typename Allocator = std::allocator<char>>
- class basic_streambuf :
- noncopyable
+
+[section:lowest_layer basic_socket_streambuf::lowest_layer]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 lowest_layer..basic_socket_streambuf] 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 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.
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type basic_socket_streambuf::lowest_layer_type]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 lowest_layer_type..basic_socket_streambuf] A basic_socket is always the lowest layer.
+
+ typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
[heading Types]
@@ -18931,15 +20688,148 @@
[
- [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
- [The type used to represent the get area as a list of buffers. ]
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
]
[
- [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
- [The type used to represent the put area as a list of buffers. ]
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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.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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket.native_type [*native_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.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[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.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
]
@@ -18950,50 +20840,174 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
- [Construct a buffer with a specified maximum size. ]
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
]
[
- [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
- [Move the start of the put area by the specified number of characters. ]
+ [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
[
- [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
- [Move the start of the get area by the specified number of characters. ]
+ [[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_streambuf.data [*data]]]
- [Get a list of buffers that represents the get area. ]
+ [[link boost_asio.reference.basic_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
]
[
- [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
- [Return the maximum size of the buffer. ]
+ [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it. ]
]
[
- [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
- [Get a list of buffers that represents the put area, with the given size. ]
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
]
[
- [[link boost_asio.reference.basic_streambuf.size [*size]]]
- [Return the size of the get area in characters. ]
+ [[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. ]
+ ]
+
+ [
+ [[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]]
-[section:basic_streambuf basic_streambuf::basic_streambuf]
+ [
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
-Construct a buffer with a specified maximum size.
+[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. ]
+ ]
+
+ [
+ [[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]]
+
+ [
+ [[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 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.
- basic_streambuf(
- std::size_t max_size = (std::numeric_limits< std::size_t >::max)(),
- const Allocator & allocator = Allocator());
@@ -19001,12 +21015,14 @@
-[section:commit basic_streambuf::commit]
+[section:max_connections basic_socket_streambuf::max_connections]
-Move the start of the put area by the specified number of characters.
- void commit(
- std::size_t n);
+['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;
@@ -19014,12 +21030,14 @@
-[section:const_buffers_type basic_streambuf::const_buffers_type]
+[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
-The type used to represent the get area as a list of buffers.
- typedef implementation_defined const_buffers_type;
+['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;
@@ -19027,12 +21045,15 @@
-[section:consume basic_streambuf::consume]
+[section:message_flags basic_socket_streambuf::message_flags]
-Move the start of the get area by the specified number of characters.
- void consume(
- 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.
+
+ typedef int message_flags;
+
@@ -19040,11 +21061,14 @@
-[section:data basic_streambuf::data]
+[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
-Get a list of buffers that represents the get area.
- const_buffers_type data() const;
+['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;
@@ -19052,11 +21076,14 @@
-[section:max_size basic_streambuf::max_size]
+[section:message_peek basic_socket_streambuf::message_peek]
-Return the maximum size of the buffer.
- std::size_t max_size() const;
+['Inherited from socket_base.]
+
+[indexterm2 message_peek..basic_socket_streambuf] Peek at incoming data without removing it from the input queue.
+
+ static const int message_peek = implementation_defined;
@@ -19064,25 +21091,32 @@
-[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
+[section:native basic_socket_streambuf::native]
-The type used to represent the put area as a list of buffers.
- typedef implementation_defined mutable_buffers_type;
+['Inherited from basic_socket.]
+
+[indexterm2 native..basic_socket_streambuf] Get the native socket representation.
+
+ 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]
-[section:prepare basic_streambuf::prepare]
+[section:native_type basic_socket_streambuf::native_type]
-Get a list of buffers that represents the put area, with the given size.
- mutable_buffers_type prepare(
- std::size_t size);
+['Inherited from basic_socket.]
+
+[indexterm2 native_type..basic_socket_streambuf] The native representation of a socket.
+
+ typedef StreamSocketService::native_type native_type;
+
@@ -19090,201 +21124,17565 @@
-[section:size basic_streambuf::size]
+[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 non_blocking_io..basic_socket_streambuf] 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);
+
+
+
+
+
+
+[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());
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_socket_streambuf::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_socket_streambuf::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:overflow basic_socket_streambuf::overflow]
+
+[indexterm2 overflow..basic_socket_streambuf]
+
+ int_type overflow(
+ int_type c);
+
+
+
+[endsect]
+
+
+
+[section:protocol_type basic_socket_streambuf::protocol_type]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 protocol_type..basic_socket_streambuf] The protocol type.
+
+ typedef Protocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 receive_buffer_size..basic_socket_streambuf] Socket option for the receive buffer size of a socket.
+
+ typedef implementation_defined receive_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+
+
+[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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[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;
+
+
+
+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();
+
+
+
+
+
+
+[endsect]
+
+
+[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
+
+[indexterm2 remote_endpoint..basic_socket_streambuf] Get the remote endpoint of the socket.
+
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
+
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Get the remote 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 remote endpoint 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 = socket.remote_endpoint();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_socket_streambuf::remote_endpoint (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+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]
+
+
+[variablelist
+
+[[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::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:reuse_address basic_socket_streambuf::reuse_address]
+
+
+['Inherited from socket_base.]
+
+[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;
+
+
+
+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);
+
+
+
+
+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:send_buffer_size basic_socket_streambuf::send_buffer_size]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 send_buffer_size..basic_socket_streambuf] Socket option for the send buffer size of a socket.
+
+ typedef implementation_defined send_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+
+
+[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);
+
+
+
+
+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:send_low_watermark basic_socket_streambuf::send_low_watermark]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 send_low_watermark..basic_socket_streambuf] Socket option for the send low watermark.
+
+ typedef implementation_defined send_low_watermark;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+
+
+[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);
+
+
+
+
+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:service basic_socket_streambuf::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_socket_streambuf] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type basic_socket_streambuf::service_type]
+
+
+['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;
+
+
+
+
+[endsect]
+
+
+[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.basic_socket_streambuf.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_socket_streambuf::set_option (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ void set_option(
+ const SettableSocketOption & option);
+
+
+This function is used to set an option on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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.]
+
+Set an option on the socket.
+
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+
+
+This function is used to set an option on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+
+[[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:shutdown basic_socket_streambuf::shutdown]
+
+[indexterm2 shutdown..basic_socket_streambuf] Disable sends or receives on the socket.
+
+ void ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload2 shutdown]``(
+ shutdown_type what,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_socket_streambuf::shutdown (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Disable sends or receives on the socket.
+
+ void shutdown(
+ shutdown_type what);
+
+
+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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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.]
+
+Disable sends or receives on the socket.
+
+ 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 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:shutdown_type basic_socket_streambuf::shutdown_type]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 shutdown_type..basic_socket_streambuf] Different ways a socket may be shutdown.
+
+ enum shutdown_type
+
+[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]
+
+
+
+[section:sync basic_socket_streambuf::sync]
+
+[indexterm2 sync..basic_socket_streambuf]
+
+ int sync();
+
+
+
+[endsect]
+
+
+
+[section:underflow basic_socket_streambuf::underflow]
+
+[indexterm2 underflow..basic_socket_streambuf]
+
+ int_type underflow();
+
+
+
+[endsect]
+
+
+
+[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
+
+[indexterm2 ~basic_socket_streambuf..basic_socket_streambuf] Destructor flushes buffered data.
+
+ virtual ~basic_socket_streambuf();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[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 >
+
+
+[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_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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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_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 basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[section:assign basic_stream_socket::assign]
+
+[indexterm2 assign..basic_stream_socket] Assign an existing native socket to the socket.
+
+ void ``[link boost_asio.reference.basic_stream_socket.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_socket);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.assign.overload2 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::assign (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Assign an existing native socket to the socket.
+
+ void assign(
+ const protocol_type & protocol,
+ const native_type & native_socket);
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Assign an existing native socket to the socket.
+
+ 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]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 async_connect..basic_stream_socket] Start an asynchronous connect.
+
+ 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]
+
+
+[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().]]
+
+]
+
+[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]
+
+
+
+[section:async_read_some basic_stream_socket::async_read_some]
+
+[indexterm2 async_read_some..basic_stream_socket] Start an asynchronous read.
+
+ template<
+ 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 read data from the stream socket. 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 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:
+
+ socket.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_receive basic_stream_socket::async_receive]
+
+[indexterm2 async_receive..basic_stream_socket] Start an asynchronous receive.
+
+ 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);
+
+ 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);
+
+
+[section:overload1 basic_stream_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,
+ ReadHandler handler);
+
+
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+
+
+[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.]]
+
+[[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().]]
+
+]
+
+[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:
+
+ 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.
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::async_receive (2 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 flags,
+ ReadHandler handler);
+
+
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+
+
+[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.]]
+
+[[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().]]
+
+]
+
+[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:
+
+ 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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:async_send basic_stream_socket::async_send]
+
+[indexterm2 async_send..basic_stream_socket] Start an asynchronous send.
+
+ 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);
+
+ 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);
+
+
+[section:overload1 basic_stream_socket::async_send (1 of 2 overloads)]
+
+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,
+ WriteHandler handler);
+
+
+This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+
+
+[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.]]
+
+[[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 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.
+
+[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);
+
+
+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:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
+
+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);
+
+
+This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+
+
+[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 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.
+
+[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]
+
+
+[endsect]
+
+
+[section:async_write_some basic_stream_socket::async_write_some]
+
+[indexterm2 async_write_some..basic_stream_socket] 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 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().]]
+
+]
+
+[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.
+
+
+
+[endsect]
+
+
+[section:at_mark basic_stream_socket::at_mark]
+
+[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;
+
+ bool ``[link boost_asio.reference.basic_stream_socket.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_stream_socket::at_mark (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+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
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Determine whether the socket is at the out-of-band data mark.
+
+ 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]
+
+
+[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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:available basic_stream_socket::available]
+
+[indexterm2 available..basic_stream_socket] Determine the number of bytes available for reading.
+
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload1 available]``() const;
+
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Determine the number of bytes available for reading.
+
+ std::size_t available() const;
+
+
+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]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::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]
+
+
+[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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_stream_socket basic_stream_socket::basic_stream_socket]
+
+[indexterm2 basic_stream_socket..basic_stream_socket] Construct a basic_stream_socket without opening it.
+
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload1 basic_stream_socket]``(
+ boost::asio::io_service & io_service);
+
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+
+ ``[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);
+
+
+[section:overload1 basic_stream_socket::basic_stream_socket (1 of 4 overloads)]
+
+Construct a basic_stream_socket without opening it.
+
+ basic_stream_socket(
+ boost::asio::io_service & io_service);
+
+
+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 Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
+
+Construct and open a basic_stream_socket.
+
+ 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 Parameters]
+
+
+[variablelist
+
+[[io_service][The 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload3 basic_stream_socket::basic_stream_socket (3 of 4 overloads)]
+
+Construct a basic_stream_socket, opening it and binding it to the given local endpoint.
+
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+
+
+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]
+
+
+[variablelist
+
+[[io_service][The 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
+
+Construct a basic_stream_socket on an existing native socket.
+
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_socket);
+
+
+This constructor creates a stream socket object to hold an existing native socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:bind basic_stream_socket::bind]
+
+[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);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::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.]]
+
+]
+
+[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());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Bind the socket to the given local endpoint.
+
+ 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 Parameters]
+
+
+[variablelist
+
+[[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]
+
+
+
+ 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.
+ }
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:broadcast basic_stream_socket::broadcast]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 broadcast..basic_stream_socket] 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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:bytes_readable basic_stream_socket::bytes_readable]
+
+
+['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.
+
+ typedef implementation_defined bytes_readable;
+
+
+
+Implements the FIONREAD IO control command.
+
+
+[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: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]``();
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::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]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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.
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::cancel (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Cancel all asynchronous operations associated with the socket.
+
+ 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 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.
+
+
+[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]``();
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.close.overload2 close]``(
+ boost::system::error_code & ec);
+
+
+[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.
+
+ 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]
+
+
+[variablelist
+
+[[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.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
+
+
+
+[endsect]
+
+
+[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);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::connect (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Connect the socket to the specified endpoint.
+
+ void connect(
+ const endpoint_type & peer_endpoint);
+
+
+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
+
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+
+]
+
+[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_stream_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 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
+
+[[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]
+
+
+[endsect]
+
+
+[section:debug basic_stream_socket::debug]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 debug..basic_stream_socket] Socket option to enable socket-level debugging.
+
+ typedef implementation_defined debug;
+
+
+
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+
+
+[heading Examples]
+
+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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:do_not_route basic_stream_socket::do_not_route]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 do_not_route..basic_stream_socket] Socket option to prevent routing, use local interfaces only.
+
+ typedef implementation_defined do_not_route;
+
+
+
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+
+
+[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);
+
+
+
+
+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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 enable_connection_aborted..basic_stream_socket] Socket option to report aborted connections on accept.
+
+ 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:
+
+ 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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:endpoint_type basic_stream_socket::endpoint_type]
+
+[indexterm2 endpoint_type..basic_stream_socket] The endpoint type.
+
+ typedef Protocol::endpoint endpoint_type;
+
+
+
+
+[endsect]
+
+
+
+[section:get_io_service basic_stream_socket::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..basic_stream_socket] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the 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]
+
+[indexterm2 get_option..basic_stream_socket] Get an option from the socket.
+
+ void ``[link boost_asio.reference.basic_stream_socket.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.get_option.overload2 get_option]``(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_stream_socket::get_option (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Get an option from the socket.
+
+ void get_option(
+ GettableSocketOption & option) 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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Get an option from the socket.
+
+ 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.]]
+
+]
+
+[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();
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:implementation basic_stream_socket::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..basic_stream_socket] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type basic_stream_socket::implementation_type]
+
+
+['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;
+
+
+
+
+[endsect]
+
+
+[section:io_control basic_stream_socket::io_control]
+
+[indexterm2 io_control..basic_stream_socket] Perform an IO control command on the socket.
+
+ void ``[link boost_asio.reference.basic_stream_socket.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Perform an IO control command on the socket.
+
+ void io_control(
+ IoControlCommand & command);
+
+
+This function is used to execute an IO control command on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::io_control (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Perform an IO control command on the socket.
+
+ 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.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the socket.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[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;
+ boost::system::error_code ec;
+ socket.io_control(command, ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ std::size_t bytes_readable = command.get();
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:io_service basic_stream_socket::io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 io_service..basic_stream_socket] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the 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_stream_socket::is_open]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 is_open..basic_stream_socket] Determine whether the socket is open.
+
+ bool is_open() const;
+
+
+
+[endsect]
+
+
+
+[section:keep_alive basic_stream_socket::keep_alive]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 keep_alive..basic_stream_socket] 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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:linger basic_stream_socket::linger]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 linger..basic_stream_socket] 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();
+
+
+
+
+
+
+[endsect]
+
+
+[section:local_endpoint basic_stream_socket::local_endpoint]
+
+[indexterm2 local_endpoint..basic_stream_socket] Get the local endpoint of the socket.
+
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
+
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_stream_socket::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.
+
+
+[heading Return Value]
+
+An object that represents the local endpoint 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 = socket.local_endpoint();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::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.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[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]
+
+
+
+ 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_stream_socket::lowest_layer]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 lowest_layer..basic_stream_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 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.
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type basic_stream_socket::lowest_layer_type]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 lowest_layer_type..basic_stream_socket] A basic_socket is always the lowest layer.
+
+ typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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.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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket.native_type [*native_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.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[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.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[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.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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]]
+
+ [
+ [[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 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.
+
+
+
+
+[endsect]
+
+
+
+[section:max_connections basic_stream_socket::max_connections]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 max_connections..basic_stream_socket] The maximum length of the queue of pending incoming connections.
+
+ static const int max_connections = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:message_do_not_route basic_stream_socket::message_do_not_route]
+
+
+['Inherited from socket_base.]
+
+[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]
+
+
+
+[section:message_flags basic_stream_socket::message_flags]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 message_flags..basic_stream_socket] Bitmask type for flags that can be passed to send and receive operations.
+
+ typedef int message_flags;
+
+
+
+
+[endsect]
+
+
+
+[section:message_out_of_band basic_stream_socket::message_out_of_band]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 message_out_of_band..basic_stream_socket] Process out-of-band data.
+
+ static const int message_out_of_band = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:message_peek basic_stream_socket::message_peek]
+
+
+['Inherited from socket_base.]
+
+[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]
+
+
+
+[section:native basic_stream_socket::native]
+
+
+['Inherited from basic_socket.]
+
+[indexterm2 native..basic_stream_socket] Get the native socket representation.
+
+ 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]
+
+
+
+[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]
+
+
+
+[section:non_blocking_io basic_stream_socket::non_blocking_io]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 non_blocking_io..basic_stream_socket] 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);
+
+
+
+
+
+
+[endsect]
+
+
+[section:open basic_stream_socket::open]
+
+[indexterm2 open..basic_stream_socket] Open the socket using the specified protocol.
+
+ void ``[link boost_asio.reference.basic_stream_socket.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_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_stream_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_stream_socket::protocol_type]
+
+[indexterm2 protocol_type..basic_stream_socket] The protocol type.
+
+ typedef Protocol protocol_type;
+
+
+
+
+[endsect]
+
+
+[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);
+
+ 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);
+
+
+[section:overload1 basic_stream_socket::read_some (1 of 2 overloads)]
+
+Read some data from the socket.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
+
+
+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.]]
+
+]
+
+[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 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:
+
+ socket.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.
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::read_some (2 of 2 overloads)]
+
+Read some data from the socket.
+
+ 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 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.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:receive basic_stream_socket::receive]
+
+[indexterm2 receive..basic_stream_socket] Receive some data on the socket.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload1 receive]``(
+ const MutableBufferSequence & buffers);
+
+ 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);
+
+ 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);
+
+
+[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
+
+Receive some data on the 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 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]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes received.
+
+[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 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));
+
+
+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:overload2 basic_stream_socket::receive (2 of 3 overloads)]
+
+Receive some data on the socket.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers,
+ socket_base::message_flags flags);
+
+
+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]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+
+[[flags][Flags specifying how the receive call is to be made.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes received.
+
+[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 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);
+
+
+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:overload3 basic_stream_socket::receive (3 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,
+ socket_base::message_flags flags,
+ 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.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
+
+[[flags][Flags specifying how the receive call is to be made.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes received. Returns 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.read read] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:receive_buffer_size basic_stream_socket::receive_buffer_size]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 receive_buffer_size..basic_stream_socket] Socket option for the receive buffer size of a socket.
+
+ typedef implementation_defined receive_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+
+
+[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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 receive_low_watermark..basic_stream_socket] Socket option for the receive low watermark.
+
+ 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();
+
+
+
+
+
+
+[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;
+
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
+
+
+[section:overload1 basic_stream_socket::remote_endpoint (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Get the remote 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 remote endpoint 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 = socket.remote_endpoint();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+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]
+
+
+[variablelist
+
+[[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::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:reuse_address basic_stream_socket::reuse_address]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 reuse_address..basic_stream_socket] Socket option to allow the socket to be bound to an address that is already in use.
+
+ typedef implementation_defined reuse_address;
+
+
+
+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);
+
+
+
+
+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:send basic_stream_socket::send]
+
+[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);
+
+ 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);
+
+ 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);
+
+
+[section:overload1 basic_stream_socket::send (1 of 3 overloads)]
+
+Send some data on the socket.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers);
+
+
+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.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes sent.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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 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));
+
+
+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:overload2 basic_stream_socket::send (2 of 3 overloads)]
+
+Send some data on the socket.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags);
+
+
+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.]]
+
+[[flags][Flags specifying how the send call is to be made.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes sent.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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 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);
+
+
+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:overload3 basic_stream_socket::send (3 of 3 overloads)]
+
+Send some data on 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);
+
+
+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.]]
+
+[[flags][Flags specifying how the send call is to be made.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[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.
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:send_buffer_size basic_stream_socket::send_buffer_size]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 send_buffer_size..basic_stream_socket] Socket option for the send buffer size of a socket.
+
+ typedef implementation_defined send_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+
+
+[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);
+
+
+
+
+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:send_low_watermark basic_stream_socket::send_low_watermark]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 send_low_watermark..basic_stream_socket] Socket option for the send low watermark.
+
+ typedef implementation_defined send_low_watermark;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+
+
+[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);
+
+
+
+
+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:service basic_stream_socket::service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 service..basic_stream_socket] The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type basic_stream_socket::service_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.
+
+ typedef StreamSocketService service_type;
+
+
+
+
+[endsect]
+
+
+[section:set_option basic_stream_socket::set_option]
+
+[indexterm2 set_option..basic_stream_socket] Set an option on the socket.
+
+ void ``[link boost_asio.reference.basic_stream_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.set_option.overload2 set_option]``(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ void set_option(
+ const SettableSocketOption & option);
+
+
+This function is used to set an option on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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_stream_socket::set_option (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
+ boost::system::error_code & ec);
+
+
+This function is used to set an option on the socket.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+
+[[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:shutdown basic_stream_socket::shutdown]
+
+[indexterm2 shutdown..basic_stream_socket] Disable sends or receives on the socket.
+
+ void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
+
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.shutdown.overload2 shutdown]``(
+ shutdown_type what,
+ boost::system::error_code & ec);
+
+
+[section:overload1 basic_stream_socket::shutdown (1 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Disable sends or receives on the socket.
+
+ void shutdown(
+ shutdown_type what);
+
+
+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.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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_stream_socket::shutdown (2 of 2 overloads)]
+
+
+['Inherited from basic_socket.]
+
+Disable sends or receives on the socket.
+
+ 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 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:shutdown_type basic_stream_socket::shutdown_type]
+
+
+['Inherited from socket_base.]
+
+[indexterm2 shutdown_type..basic_stream_socket] Different ways a socket may be shutdown.
+
+ enum shutdown_type
+
+[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]
+
+
+[section:write_some basic_stream_socket::write_some]
+
+[indexterm2 write_some..basic_stream_socket] Write some data to the socket.
+
+ 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);
+
+ 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);
+
+
+[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
+
+Write some data to the socket.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
+
+
+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]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to 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.]]
+
+]
+
+[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));
+
+
+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:overload2 basic_stream_socket::write_some (2 of 2 overloads)]
+
+Write some data to the socket.
+
+ 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 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]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to 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 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]
+
+
+[endsect]
+
+[section:basic_streambuf basic_streambuf]
+
+Automatically resizable buffer class based on std::streambuf.
+
+ template<
+ typename Allocator = std::allocator<char>>
+ class basic_streambuf :
+ noncopyable
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
+ [The type used to represent the get area as a list of buffers. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
+ [The type used to represent the put area as a list of buffers. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
+ [Construct a buffer with a specified maximum size. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
+ [Move the start of the put area by the specified number of characters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
+ [Move the start of the get area by the specified number of characters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.data [*data]]]
+ [Get a list of buffers that represents the get area. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
+ [Return the maximum size of the buffer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
+ [Get a list of buffers that represents the put area, with the given size. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.size [*size]]]
+ [Return the size of the get area in characters. ]
+ ]
+
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
+ []
+ ]
+
+]
+
+
+[section:basic_streambuf basic_streambuf::basic_streambuf]
+
+[indexterm2 basic_streambuf..basic_streambuf] Construct a buffer with a specified maximum size.
+
+ basic_streambuf(
+ std::size_t max_size = (std::numeric_limits< std::size_t >::max)(),
+ const Allocator & allocator = Allocator());
+
+
+
+[endsect]
+
+
+
+[section:commit basic_streambuf::commit]
+
+[indexterm2 commit..basic_streambuf] Move the start of the put area by the specified number of characters.
+
+ void commit(
+ std::size_t n);
+
+
+
+[endsect]
+
+
+
+[section:const_buffers_type basic_streambuf::const_buffers_type]
+
+[indexterm2 const_buffers_type..basic_streambuf] The type used to represent the get area as a list of buffers.
+
+ typedef implementation_defined const_buffers_type;
+
+
+
+
+[endsect]
+
+
+
+[section:consume basic_streambuf::consume]
+
+[indexterm2 consume..basic_streambuf] Move the start of the get area by the specified number of characters.
+
+ void consume(
+ std::size_t n);
+
+
+
+[endsect]
+
+
+
+[section:data basic_streambuf::data]
+
+[indexterm2 data..basic_streambuf] Get a list of buffers that represents the get area.
+
+ const_buffers_type data() const;
+
+
+
+[endsect]
+
+
+
+[section:max_size basic_streambuf::max_size]
+
+[indexterm2 max_size..basic_streambuf] Return the maximum size of the buffer.
+
+ std::size_t max_size() const;
+
+
+
+[endsect]
+
+
+
+[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
+
+[indexterm2 mutable_buffers_type..basic_streambuf] The type used to represent the put area as a list of buffers.
+
+ typedef implementation_defined mutable_buffers_type;
+
+
+
+
+[endsect]
+
+
+
+[section:overflow basic_streambuf::overflow]
+
+[indexterm2 overflow..basic_streambuf]
+
+ int_type overflow(
+ int_type c);
+
+
+
+[endsect]
+
+
+
+[section:prepare basic_streambuf::prepare]
+
+[indexterm2 prepare..basic_streambuf] Get a list of buffers that represents the put area, with the given size.
+
+ mutable_buffers_type prepare(
+ std::size_t size);
+
+
+
+[endsect]
+
+
+
+[section:reserve basic_streambuf::reserve]
+
+[indexterm2 reserve..basic_streambuf]
+
+ void reserve(
+ std::size_t n);
+
+
+
+[endsect]
+
+
+
+[section:size basic_streambuf::size]
+
+[indexterm2 size..basic_streambuf] Return the size of the get area in characters.
+
+ std::size_t size() const;
+
+
+
+[endsect]
+
+
+
+[section:underflow basic_streambuf::underflow]
+
+[indexterm2 underflow..basic_streambuf]
+
+ int_type underflow();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[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.
+
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload1 buffer]``(
+ const mutable_buffer & b);
+
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload2 buffer]``(
+ const mutable_buffer & b,
+ std::size_t max_size_in_bytes);
+
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload3 buffer]``(
+ const const_buffer & b);
+
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload4 buffer]``(
+ const const_buffer & b,
+ std::size_t max_size_in_bytes);
+
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload5 buffer]``(
+ void * data,
+ std::size_t size_in_bytes);
+
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload6 buffer]``(
+ const void * data,
+ std::size_t size_in_bytes);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload7 buffer]``(
+ PodType & data);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload8 buffer]``(
+ PodType & data,
+ std::size_t max_size_in_bytes);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
+ const PodType & data);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload10 buffer]``(
+ const PodType & data,
+ std::size_t max_size_in_bytes);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
+ boost::array< PodType, N > & data);
+
+ 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);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload13 buffer]``(
+ boost::array< const PodType, N > & data);
+
+ 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);
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload15 buffer]``(
+ const boost::array< PodType, N > & data);
+
+ 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);
+
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload17 buffer]``(
+ std::vector< PodType, Allocator > & data);
+
+ 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);
+
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload19 buffer]``(
+ const std::vector< PodType, Allocator > & data);
+
+ 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);
+
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload21 buffer]``(
+ const std::string & data);
+
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
+ const std::string & data,
+ std::size_t max_size_in_bytes);
+
+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 mutable_buffer and const_buffer, respectively. To mirror C++'s conversion rules, a mutable_buffer is implicitly convertible to a const_buffer, and the opposite conversion is not permitted.
+
+The simplest use case involves reading or writing a single buffer of a specified size:
+
+
+
+ sock.send(boost::asio::buffer(data, size));
+
+
+
+
+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.
+
+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:
+
+
+
+ char d1[128];
+ size_t bytes_transferred = sock.receive(boost::asio::buffer(d1));
+
+ 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));
+
+
+
+
+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.
+
+
+[heading Accessing Buffer Contents]
+
+
+
+The contents of a buffer may be accessed using the boost::asio::buffer\_size and boost::asio::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);
+
+ boost::asio::const_buffer b2 = ...;
+ std::size_t s2 = boost::asio::buffer_size(b2);
+ const void* p2 = boost::asio::buffer_cast<const void*>(b2);
+
+
+
+
+The boost::asio::buffer\_cast function permits violations of type safety, so uses of it in application code should be carefully considered.
+
+
+[heading Buffer Invalidation]
+
+
+
+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)
+
+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 Buffer Arithmetic]
+
+
+
+Buffer objects may be manipulated using simple arithmetic in a safe way which helps prevent buffer overruns. Consider an array initialised as follows:
+
+
+
+ boost::array<char, 6> a = { 'a', 'b', 'c', 'd', 'e' };
+
+
+
+
+A buffer object `b1` created using:
+
+
+
+ b1 = boost::asio::buffer(a);
+
+
+
+
+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:
+
+
+
+ b2 = boost::asio::buffer(a, 3);
+
+
+
+
+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;
+
+
+
+
+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.
+
+Both an offset and size may be specified to create a buffer that corresponds to a specific range of bytes within an existing buffer:
+
+
+
+ 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]
+
+
+
+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:
+
+
+
+ char d1[128];
+ std::vector<char> d2(128);
+ boost::array<char, 128> d3;
+
+ 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);
+
+
+
+
+
+[section:overload1 buffer (1 of 22 overloads)]
+
+Create a new modifiable buffer from an existing buffer.
+
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b);
+
+
+
+[heading Return Value]
+
+`mutable_buffers_1(b)`.
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffer (2 of 22 overloads)]
+
+Create a new modifiable buffer from an existing buffer.
+
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ buffer_cast<void*>(b),
+ min(buffer_size(b), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload3 buffer (3 of 22 overloads)]
+
+Create a new non-modifiable buffer from an existing buffer.
+
+ const_buffers_1 buffer(
+ const const_buffer & b);
+
+
+
+[heading Return Value]
+
+`const_buffers_1(b)`.
+
+
+
+[endsect]
+
+
+
+[section:overload4 buffer (4 of 22 overloads)]
+
+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);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ buffer_cast<const void*>(b),
+ min(buffer_size(b), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload5 buffer (5 of 22 overloads)]
+
+Create a new modifiable buffer that represents the given memory range.
+
+ mutable_buffers_1 buffer(
+ void * data,
+ std::size_t size_in_bytes);
+
+
+
+[heading Return Value]
+
+`mutable_buffers_1(data, size_in_bytes)`.
+
+
+
+[endsect]
+
+
+
+[section:overload6 buffer (6 of 22 overloads)]
+
+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);
+
+
+
+[heading Return Value]
+
+`const_buffers_1(data, size_in_bytes)`.
+
+
+
+[endsect]
+
+
+
+[section:overload7 buffer (7 of 22 overloads)]
+
+Create a new modifiable buffer that represents the given POD array.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ PodType & data);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ static_cast<void*>(data),
+ N * sizeof(PodType));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload8 buffer (8 of 22 overloads)]
+
+Create a new modifiable buffer that represents the given POD array.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ PodType & data,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ static_cast<void*>(data),
+ min(N * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload9 buffer (9 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType & data);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ static_cast<const void*>(data),
+ N * sizeof(PodType));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload10 buffer (10 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType & data,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ static_cast<const void*>(data),
+ min(N * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload11 buffer (11 of 22 overloads)]
+
+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);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload12 buffer (12 of 22 overloads)]
+
+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,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload13 buffer (13 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
+
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ boost::array< const PodType, N > & data);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload14 buffer (14 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
+
+ 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 const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload15 buffer (15 of 22 overloads)]
+
+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);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ data.size() * sizeof(PodType));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload16 buffer (16 of 22 overloads)]
+
+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,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload17 buffer (17 of 22 overloads)]
+
+Create a new modifiable buffer that represents the given POD vector.
+
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ data.size() ? &data[0] : 0,
+ data.size() * sizeof(PodType));
+
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
+
+
+
+[endsect]
+
+
+
+[section:overload18 buffer (18 of 22 overloads)]
+
+Create a new modifiable buffer that represents the given POD vector.
+
+ template<
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A mutable_buffers_1 value equivalent to:
+
+ mutable_buffers_1(
+ data.size() ? &data[0] : 0,
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
+
+
+
+[endsect]
+
+
+
+[section:overload19 buffer (19 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD vector.
+
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::vector< PodType, Allocator > & data);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.size() ? &data[0] : 0,
+ data.size() * sizeof(PodType));
+
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
+
+
+
+[endsect]
+
+
+
+[section:overload20 buffer (20 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD vector.
+
+ template<
+ typename PodType,
+ typename Allocator>
+ const_buffers_1 buffer(
+ const std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.size() ? &data[0] : 0,
+ min(data.size() * sizeof(PodType), max_size_in_bytes));
+
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
+
+
+
+[endsect]
+
+
+
+[section:overload21 buffer (21 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given string.
+
+ const_buffers_1 buffer(
+ const std::string & data);
+
+
+
+[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.
+
+
+
+[endsect]
+
+
+
+[section:overload22 buffer (22 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given string.
+
+ const_buffers_1 buffer(
+ const std::string & data,
+ std::size_t max_size_in_bytes);
+
+
+
+[heading Return Value]
+
+A const_buffers_1 value equivalent to:
+
+ const_buffers_1(
+ data.data(),
+ min(data.size(), max_size_in_bytes));
+
+
+
+
+[heading Remarks]
+
+The buffer is invalidated by any non-const operation called on the given string object.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:buffered_read_stream buffered_read_stream]
+
+Adds buffering to the read-related operations of a stream.
+
+ template<
+ typename Stream>
+ class buffered_read_stream :
+ noncopyable
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.buffered_read_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
+
+ [
+
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.buffered_read_stream.default_buffer_size [*default_buffer_size]]]
+ [The default buffer size. ]
+ ]
+
+]
+
+The buffered_read_stream class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[section:async_fill buffered_read_stream::async_fill]
+
+[indexterm2 async_fill..buffered_read_stream] Start an asynchronous fill.
+
+ template<
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
+
+
+
+[endsect]
+
+
+
+[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);
+
+
+
+[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.
+
+ 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]
+
+[indexterm2 buffered_read_stream..buffered_read_stream] Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
+ Arg & a);
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
+ Arg & a,
+ std::size_t buffer_size);
+
+
+[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
+
+Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ buffered_read_stream(
+ Arg & a);
+
+
+
+[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:close buffered_read_stream::close]
+
+[indexterm2 close..buffered_read_stream] Close the stream.
+
+ void ``[link boost_asio.reference.buffered_read_stream.close.overload1 close]``();
+
+ boost::system::error_code ``[link boost_asio.reference.buffered_read_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_read_stream::close (1 of 2 overloads)]
+
+Close the stream.
+
+ void close();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
+
+Close the stream.
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[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.
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
+ boost::system::error_code & ec);
+
+
+[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:overload2 buffered_read_stream::fill (2 of 2 overloads)]
+
+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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service buffered_read_stream::get_io_service]
+
+[indexterm2 get_io_service..buffered_read_stream] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+[section:in_avail buffered_read_stream::in_avail]
+
+[indexterm2 in_avail..buffered_read_stream] Determine the amount of data that may be read without blocking.
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload1 in_avail]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
+
+Determine the amount of data that may be read without blocking.
+
+ std::size_t in_avail();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_read_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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:io_service buffered_read_stream::io_service]
+
+[indexterm2 io_service..buffered_read_stream] (Deprecated: use get_io_service().) Get the 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.
+
+ lowest_layer_type & lowest_layer();
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..buffered_read_stream] The type of the lowest layer.
+
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+
+
+[endsect]
+
+
+
+[section:next_layer buffered_read_stream::next_layer]
+
+[indexterm2 next_layer..buffered_read_stream] Get a reference to the next layer.
+
+ next_layer_type & next_layer();
+
+
+
+[endsect]
+
+
+
+[section:next_layer_type buffered_read_stream::next_layer_type]
+
+[indexterm2 next_layer_type..buffered_read_stream] The type of the next layer.
+
+ typedef boost::remove_reference< Stream >::type next_layer_type;
+
+
+
+
+[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.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+
+ 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);
+
+
+[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: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);
+
+
+
+[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);
+
+ 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);
+
+
+[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);
+
+
+
+[endsect]
+
+
+
+[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.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[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.
+
+ 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);
+
+ 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);
+
+
+[section:overload1 buffered_read_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);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_read_stream::write_some (2 of 2 overloads)]
+
+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 write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+
+[section:buffered_stream buffered_stream]
+
+Adds buffering to the read- and write-related operations of a stream.
+
+ template<
+ typename Stream>
+ class buffered_stream :
+ noncopyable
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.buffered_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.buffered_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.buffered_stream.async_fill [*async_fill]]]
+ [Start an asynchronous fill. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_stream.async_flush [*async_flush]]]
+ [Start an asynchronous flush. ]
+ ]
+
+ [
+ [[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.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.buffered_stream.buffered_stream [*buffered_stream]]]
+ [Construct, passing the specified argument to initialise the next layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_stream.close [*close]]]
+ [Close the stream. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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.buffered_stream.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.buffered_stream.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_stream.lowest_layer [*lowest_layer]]]
+ [Get a 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.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.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.buffered_stream.write_some [*write_some]]]
+ [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure. ]
+ ]
+
+]
+
+The 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]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+[section:async_fill buffered_stream::async_fill]
+
+[indexterm2 async_fill..buffered_stream] Start an asynchronous fill.
+
+ template<
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
+
+
+
+[endsect]
+
+
+
+[section:async_flush buffered_stream::async_flush]
+
+[indexterm2 async_flush..buffered_stream] Start an asynchronous flush.
+
+ template<
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
+
+
+
+[endsect]
+
+
+
+[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.
+
+ 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]
+
+
+
+[section:async_write_some buffered_stream::async_write_some]
+
+[indexterm2 async_write_some..buffered_stream] Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
+
+ 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_stream buffered_stream::buffered_stream]
+
+[indexterm2 buffered_stream..buffered_stream] Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
+ Arg & a);
+
+ template<
+ typename Arg>
+ ``[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);
+
+
+[section:overload1 buffered_stream::buffered_stream (1 of 2 overloads)]
+
+Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ buffered_stream(
+ Arg & a);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_stream::buffered_stream (2 of 2 overloads)]
+
+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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:close buffered_stream::close]
+
+[indexterm2 close..buffered_stream] Close the stream.
+
+ void ``[link boost_asio.reference.buffered_stream.close.overload1 close]``();
+
+ boost::system::error_code ``[link boost_asio.reference.buffered_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_stream::close (1 of 2 overloads)]
+
+Close the stream.
+
+ void close();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_stream::close (2 of 2 overloads)]
+
+Close the stream.
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[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]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload2 fill]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_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:overload2 buffered_stream::fill (2 of 2 overloads)]
+
+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);
+
+
+
+[endsect]
+
+
+[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.
+
+ std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload1 flush]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload2 flush]``(
+ boost::system::error_code & ec);
+
+
+[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.
+
+ std::size_t flush();
+
+
+
+[endsect]
+
+
+
+[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.
+
+ std::size_t flush(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service buffered_stream::get_io_service]
+
+[indexterm2 get_io_service..buffered_stream] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+[section:in_avail buffered_stream::in_avail]
+
+[indexterm2 in_avail..buffered_stream] Determine the amount of data that may be read without blocking.
+
+ std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload1 in_avail]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_stream::in_avail (1 of 2 overloads)]
+
+Determine the amount of data that may be read without blocking.
+
+ std::size_t in_avail();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:io_service buffered_stream::io_service]
+
+[indexterm2 io_service..buffered_stream] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer buffered_stream::lowest_layer]
+
+[indexterm2 lowest_layer..buffered_stream] Get a reference to the lowest layer.
+
+ lowest_layer_type & lowest_layer();
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type buffered_stream::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..buffered_stream] The type of the lowest layer.
+
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+
+
+[endsect]
+
+
+
+[section:next_layer buffered_stream::next_layer]
+
+[indexterm2 next_layer..buffered_stream] Get a reference to the next layer.
+
+ next_layer_type & next_layer();
+
+
+
+[endsect]
+
+
+
+[section:next_layer_type buffered_stream::next_layer_type]
+
+[indexterm2 next_layer_type..buffered_stream] The type of the next layer.
+
+ typedef boost::remove_reference< Stream >::type next_layer_type;
+
+
+
+
+[endsect]
+
+
+[section:peek buffered_stream::peek]
+
+[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);
+
+ 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);
+
+
+[section:overload1 buffered_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:overload2 buffered_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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:read_some buffered_stream::read_some]
+
+[indexterm2 read_some..buffered_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_stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+
+ 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);
+
+
+[section:overload1 buffered_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);
+
+
+
+[endsect]
+
+
+
+[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:write_some buffered_stream::write_some]
+
+[indexterm2 write_some..buffered_stream] 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 ``[link boost_asio.reference.buffered_stream.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+
+ 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);
+
+
+[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);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_stream::write_some (2 of 2 overloads)]
+
+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 write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+
+[section:buffered_write_stream buffered_write_stream]
+
+Adds buffering to the write-related operations of a stream.
+
+ template<
+ typename Stream>
+ class buffered_write_stream :
+ noncopyable
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.buffered_write_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
+
+ ]
+
+]
+
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer [*lowest_layer]]]
+ [Get a 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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.buffered_write_stream.default_buffer_size [*default_buffer_size]]]
+ [The default buffer size. ]
+ ]
+
+]
+
+The 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.
+
+
+
+[section:async_flush buffered_write_stream::async_flush]
+
+[indexterm2 async_flush..buffered_write_stream] Start an asynchronous flush.
+
+ template<
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
+
+
+
+[endsect]
+
+
+
+[section:async_read_some buffered_write_stream::async_read_some]
+
+[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.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+
+
+
+[endsect]
+
+
+
+[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.
+
+ 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_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.
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 buffered_write_stream]``(
+ Arg & a);
+
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 buffered_write_stream]``(
+ Arg & a,
+ std::size_t buffer_size);
+
+
+[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
+
+Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ buffered_write_stream(
+ Arg & a);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
+
+Construct, passing the specified argument to initialise the next layer.
+
+ template<
+ typename Arg>
+ buffered_write_stream(
+ Arg & a,
+ std::size_t buffer_size);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:close buffered_write_stream::close]
+
+[indexterm2 close..buffered_write_stream] Close the stream.
+
+ void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
+
+ boost::system::error_code ``[link boost_asio.reference.buffered_write_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_write_stream::close (1 of 2 overloads)]
+
+Close the stream.
+
+ void close();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
+
+Close the stream.
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[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.
+
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload1 flush]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload2 flush]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_write_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.
+
+ std::size_t flush();
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_write_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.
+
+ std::size_t flush(
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service buffered_write_stream::get_io_service]
+
+[indexterm2 get_io_service..buffered_write_stream] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+[section:in_avail buffered_write_stream::in_avail]
+
+[indexterm2 in_avail..buffered_write_stream] Determine the amount of data that may be read without blocking.
+
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload1 in_avail]``();
+
+ std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 buffered_write_stream::in_avail (1 of 2 overloads)]
+
+Determine the amount of data that may be read without blocking.
+
+ std::size_t in_avail();
+
+
+
+[endsect]
+
+
+
+[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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:io_service buffered_write_stream::io_service]
+
+[indexterm2 io_service..buffered_write_stream] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer buffered_write_stream::lowest_layer]
+
+[indexterm2 lowest_layer..buffered_write_stream] Get a reference to the lowest layer.
+
+ lowest_layer_type & lowest_layer();
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
+
+[indexterm2 lowest_layer_type..buffered_write_stream] The type of the lowest layer.
+
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
+
+
+
+
+[endsect]
+
+
+
+[section:next_layer buffered_write_stream::next_layer]
+
+[indexterm2 next_layer..buffered_write_stream] Get a reference to the next layer.
+
+ next_layer_type & next_layer();
+
+
+
+[endsect]
+
+
+
+[section:next_layer_type buffered_write_stream::next_layer_type]
+
+[indexterm2 next_layer_type..buffered_write_stream] The type of the next layer.
+
+ typedef boost::remove_reference< Stream >::type next_layer_type;
+
+
+
+
+[endsect]
+
+
+[section:peek buffered_write_stream::peek]
+
+[indexterm2 peek..buffered_write_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_write_stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+
+ 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);
+
+
+[section:overload1 buffered_write_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:overload2 buffered_write_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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:read_some buffered_write_stream::read_some]
+
+[indexterm2 read_some..buffered_write_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_write_stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+
+ 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);
+
+
+[section:overload1 buffered_write_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);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_write_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: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.
+
+ 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);
+
+ 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);
+
+
+[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.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
+
+
+
+[endsect]
+
+
+
+[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
+
+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.
+
+ 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:buffers_begin buffers_begin]
+
+[indexterm1 buffers_begin] Construct an iterator representing the beginning of the buffers' data.
+
+ template<
+ typename BufferSequence>
+ buffers_iterator< BufferSequence > buffers_begin(
+ const BufferSequence & buffers);
+
+
+
+[endsect]
+
+
+
+[section:buffers_end buffers_end]
+
+[indexterm1 buffers_end] Construct an iterator representing the end of the buffers' data.
+
+ template<
+ typename BufferSequence>
+ buffers_iterator< BufferSequence > buffers_end(
+ const BufferSequence & buffers);
+
+
+
+[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
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+
+[section:begin buffers_iterator::begin]
+
+[indexterm2 begin..buffers_iterator] Construct an iterator representing the beginning of the buffers' data.
+
+ static buffers_iterator begin(
+ const BufferSequence & buffers);
+
+
+
+[endsect]
+
+
+
+[section:buffers_iterator buffers_iterator::buffers_iterator]
+
+[indexterm2 buffers_iterator..buffers_iterator] Default constructor. Creates an iterator in an undefined state.
+
+ buffers_iterator();
+
+
+
+[endsect]
+
+
+
+[section:end buffers_iterator::end]
+
+[indexterm2 end..buffers_iterator] Construct an iterator representing the end of the buffers' data.
+
+ static buffers_iterator end(
+ const BufferSequence & buffers);
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:const_buffer const_buffer]
+
+Holds a buffer that cannot be modified.
+
+ class const_buffer
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+
+[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 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.
+
+
+[section:buffer_cast const_buffer::buffer_cast]
+
+[indexterm2 buffer_cast..const_buffer] Cast a non-modifiable buffer to a specified pointer to POD type.
+
+ template<
+ typename PointerToPodType>
+ PointerToPodType buffer_cast(
+ const const_buffer & b);
+
+
+
+[endsect]
+
+
+
+[section:buffer_size const_buffer::buffer_size]
+
+[indexterm2 buffer_size..const_buffer] Get the number of bytes in a non-modifiable buffer.
+
+ std::size_t buffer_size(
+ const const_buffer & b);
+
+
+
+[endsect]
+
+
+[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]``();
+
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload2 const_buffer]``(
+ const void * data,
+ std::size_t size);
+
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload3 const_buffer]``(
+ const mutable_buffer & b);
+
+
+[section:overload1 const_buffer::const_buffer (1 of 3 overloads)]
+
+Construct an empty buffer.
+
+ const_buffer();
+
+
+
+[endsect]
+
+
+
+[section:overload2 const_buffer::const_buffer (2 of 3 overloads)]
+
+Construct a buffer to represent a given memory range.
+
+ const_buffer(
+ const void * data,
+ std::size_t size);
+
+
+
+[endsect]
+
+
+
+[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
+
+Construct a non-modifiable buffer from a modifiable one.
+
+ const_buffer(
+ const mutable_buffer & b);
+
+
+
+[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.
+
+ const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload1 operator+]``(
+ const const_buffer & b,
+ std::size_t start);
+
+ const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
+
+
+[section:overload1 const_buffer::operator+ (1 of 2 overloads)]
+
+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:overload2 const_buffer::operator+ (2 of 2 overloads)]
+
+Create a new non-modifiable buffer that is offset from the start of another.
+
+ const_buffer operator+(
+ std::size_t start,
+ const const_buffer & b);
+
+
+
+[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.
+
+ class const_buffers_1 :
+ public const_buffer
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[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.const_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.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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.const_buffers_1.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+
+[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: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);
+
+
+
+[endsect]
+
+
+[section:const_buffers_1 const_buffers_1::const_buffers_1]
+
+[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);
+
+ ``[link boost_asio.reference.const_buffers_1.const_buffers_1.overload2 const_buffers_1]``(
+ const const_buffer & b);
+
+
+[section:overload1 const_buffers_1::const_buffers_1 (1 of 2 overloads)]
+
+Construct to represent a given memory range.
+
+ const_buffers_1(
+ const void * data,
+ std::size_t size);
+
+
+
+[endsect]
+
+
+
+[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]
+
+
+[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;
+
+
+
+
+[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);
+
+ const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
+
+
+[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:overload2 const_buffers_1::operator+ (2 of 2 overloads)]
+
+
+['Inherited from const_buffer.]
+
+Create a new non-modifiable buffer that is offset from the start of another.
+
+ const_buffer operator+(
+ std::size_t start,
+ const const_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[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 const_buffer value_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+
+[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 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.
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:datagram_socket_service datagram_socket_service]
+
+Default service implementation for a datagram socket.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class datagram_socket_service :
+ public io_service::service
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.datagram_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.datagram_socket_service.implementation_type [*implementation_type]]]
+ [The type of a datagram socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.datagram_socket_service.native_type [*native_type]]]
+ [The native socket type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.datagram_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a datagram socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.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.datagram_socket_service.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[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.datagram_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.bind [*bind]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.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.datagram_socket_service.connect [*connect]]]
+ [Connect the datagram socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.construct [*construct]]]
+ [Construct a new datagram socket implementation. ]
+ ]
+
+ [
+ [[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.datagram_socket_service.destroy [*destroy]]]
+ [Destroy a datagram socket implementation. ]
+ ]
+
+ [
+ [[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.datagram_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[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.datagram_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.native [*native]]]
+ [Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.open [*open]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.datagram_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.datagram_socket_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+
+]
+
+
+[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);
+
+
+
+[endsect]
+
+
+
+[section:async_connect datagram_socket_service::async_connect]
+
+[indexterm2 async_connect..datagram_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:async_receive datagram_socket_service::async_receive]
+
+[indexterm2 async_receive..datagram_socket_service] Start an asynchronous receive.
+
+ 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);
+
+
+
+[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.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:async_send datagram_socket_service::async_send]
+
+[indexterm2 async_send..datagram_socket_service] Start an asynchronous send.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:async_send_to datagram_socket_service::async_send_to]
+
+[indexterm2 async_send_to..datagram_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: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;
+
+
+
+[endsect]
+
+
+
+[section:available datagram_socket_service::available]
+
+[indexterm2 available..datagram_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]
+
+
+
+[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);
+
+
+
+[endsect]
+
+
+
+[section:cancel datagram_socket_service::cancel]
+
+[indexterm2 cancel..datagram_socket_service] Cancel all asynchronous operations associated with the socket.
+
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:close datagram_socket_service::close]
+
+[indexterm2 close..datagram_socket_service] Close a datagram socket implementation.
+
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:connect datagram_socket_service::connect]
+
+[indexterm2 connect..datagram_socket_service] Connect the datagram socket to the specified endpoint.
+
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:construct datagram_socket_service::construct]
+
+[indexterm2 construct..datagram_socket_service] Construct a new datagram socket implementation.
+
+ void construct(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[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 io_service.
+
+ datagram_socket_service(
+ boost::asio::io_service & io_service);
+
+
+
+[endsect]
+
+
+
+[section:destroy datagram_socket_service::destroy]
+
+[indexterm2 destroy..datagram_socket_service] Destroy a datagram socket implementation.
+
+ void destroy(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:endpoint_type datagram_socket_service::endpoint_type]
+
+[indexterm2 endpoint_type..datagram_socket_service] The endpoint type.
+
+ typedef Protocol::endpoint endpoint_type;
+
+
+
+
+[endsect]
+
+
+
+[section:get_io_service datagram_socket_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..datagram_socket_service] Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[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;
+
+
+
+[endsect]
+
+
+
+[section:id datagram_socket_service::id]
+
+[indexterm2 id..datagram_socket_service] The unique service identifier.
+
+ static boost::asio::io_service::id id;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type datagram_socket_service::implementation_type]
+
+[indexterm2 implementation_type..datagram_socket_service] The type of a datagram socket.
+
+ typedef implementation_defined implementation_type;
+
+
+
+
+[endsect]
+
+
+
+[section:io_control datagram_socket_service::io_control]
+
+[indexterm2 io_control..datagram_socket_service] Perform an IO control command on the socket.
+
+ 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]
+
+
+
+[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 io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[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;
+
+
+
+[endsect]
+
+
+
+[section:local_endpoint datagram_socket_service::local_endpoint]
+
+[indexterm2 local_endpoint..datagram_socket_service] Get the local endpoint.
+
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+
+[section:native datagram_socket_service::native]
+
+[indexterm2 native..datagram_socket_service] Get the native socket implementation.
+
+ native_type native(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:native_type datagram_socket_service::native_type]
+
+[indexterm2 native_type..datagram_socket_service] The native socket type.
+
+ typedef implementation_defined native_type;
+
+
+
+
+[endsect]
+
+
+
+[section:open datagram_socket_service::open]
+
+[indexterm2 open..datagram_socket_service]
+
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:protocol_type datagram_socket_service::protocol_type]
+
+[indexterm2 protocol_type..datagram_socket_service] The protocol type.
+
+ typedef Protocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:receive datagram_socket_service::receive]
+
+[indexterm2 receive..datagram_socket_service] Receive some data from the peer.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:receive_from datagram_socket_service::receive_from]
+
+[indexterm2 receive_from..datagram_socket_service] Receive a datagram 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);
+
+
+
+[endsect]
+
+
+
+[section:remote_endpoint datagram_socket_service::remote_endpoint]
+
+[indexterm2 remote_endpoint..datagram_socket_service] Get the remote endpoint.
+
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+
+[section:send datagram_socket_service::send]
+
+[indexterm2 send..datagram_socket_service] Send the given data to the peer.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:send_to datagram_socket_service::send_to]
+
+[indexterm2 send_to..datagram_socket_service] Send a datagram to the specified endpoint.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:set_option datagram_socket_service::set_option]
+
+[indexterm2 set_option..datagram_socket_service] Set a socket option.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:shutdown datagram_socket_service::shutdown]
+
+[indexterm2 shutdown..datagram_socket_service] 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);
+
+
+
+[endsect]
+
+
+
+[section:shutdown_service datagram_socket_service::shutdown_service]
+
+[indexterm2 shutdown_service..datagram_socket_service] Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:deadline_timer deadline_timer]
+
+[indexterm1 deadline_timer] Typedef for the typical usage of timer.
+
+ typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_deadline_timer.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_deadline_timer.time_type [*time_type]]]
+ [The time 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.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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_deadline_timer.expires_from_now [*expires_from_now]]]
+ [Get 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]]
+
+ [
+ [[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 basic_deadline_timer class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
+
+Most applications will use the boost::asio::deadline\_timer typedef.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+[heading Examples]
+
+Performing a blocking wait:
+
+ // 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();
+
+
+
+
+Performing an asynchronous wait:
+
+ 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"));
+
+ // Start an asynchronous wait.
+ timer.async_wait(handler);
+
+
+
+
+[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.
+
+
+
+
+[endsect]
+
+
+[section:deadline_timer_service deadline_timer_service]
+
+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
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.deadline_timer_service.expires_at [*expires_at]]]
+ [Get 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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+
+[section:async_wait deadline_timer_service::async_wait]
+
+[indexterm2 async_wait..deadline_timer_service]
+
+ template<
+ typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
+ void async_wait(
+ implementation_type & impl,
+ WaitHandler handler);
+
+
+
+[endsect]
+
+
+
+[section:cancel deadline_timer_service::cancel]
+
+[indexterm2 cancel..deadline_timer_service] Cancel any asynchronous wait operations associated with the timer.
+
+ std::size_t cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:construct deadline_timer_service::construct]
+
+[indexterm2 construct..deadline_timer_service] Construct a new timer implementation.
+
+ void construct(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:deadline_timer_service deadline_timer_service::deadline_timer_service]
+
+[indexterm2 deadline_timer_service..deadline_timer_service] Construct a new timer service for the specified io_service.
+
+ deadline_timer_service(
+ boost::asio::io_service & io_service);
+
+
+
+[endsect]
+
+
+
+[section:destroy deadline_timer_service::destroy]
+
+[indexterm2 destroy..deadline_timer_service] Destroy a timer implementation.
+
+ void destroy(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:duration_type deadline_timer_service::duration_type]
+
+[indexterm2 duration_type..deadline_timer_service] The duration type.
+
+ typedef traits_type::duration_type duration_type;
+
+
+
+
+[endsect]
+
+
+[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.
+
+ time_type ``[link boost_asio.reference.deadline_timer_service.expires_at.overload1 expires_at]``(
+ const implementation_type & impl) const;
+
+ 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);
+
+
+[section:overload1 deadline_timer_service::expires_at (1 of 2 overloads)]
+
+Get the expiry time for the timer as an absolute time.
+
+ time_type expires_at(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
+
+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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[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.
+
+ duration_type ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 expires_from_now]``(
+ const implementation_type & impl) const;
+
+ 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);
+
+
+[section:overload1 deadline_timer_service::expires_from_now (1 of 2 overloads)]
+
+Get the expiry time for the timer relative to now.
+
+ duration_type expires_from_now(
+ const implementation_type & impl) const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 deadline_timer_service::expires_from_now (2 of 2 overloads)]
+
+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);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service deadline_timer_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..deadline_timer_service] Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:id deadline_timer_service::id]
+
+[indexterm2 id..deadline_timer_service] The unique service identifier.
+
+ static boost::asio::io_service::id id;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type deadline_timer_service::implementation_type]
+
+[indexterm2 implementation_type..deadline_timer_service] The implementation type of the deadline timer.
+
+ typedef implementation_defined implementation_type;
+
+
+
+
+[endsect]
+
+
+
+[section:io_service deadline_timer_service::io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 io_service..deadline_timer_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[section:shutdown_service deadline_timer_service::shutdown_service]
+
+[indexterm2 shutdown_service..deadline_timer_service] Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
+
+
+
+[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;
+
+
+
+
+[endsect]
+
+
+
+[section:traits_type deadline_timer_service::traits_type]
+
+[indexterm2 traits_type..deadline_timer_service] The time traits type.
+
+ typedef TimeTraits traits_type;
+
+
+
+
+[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();
+
+
+
+[endsect]
+
+
+
+[section:error__addrinfo_errors error::addrinfo_errors]
+
+[indexterm1 error::addrinfo_errors]
+
+ enum addrinfo_errors
+
+[heading Values]
+[variablelist
+
+ [
+ [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:error__basic_errors error::basic_errors]
+
+[indexterm1 error::basic_errors]
+
+ enum basic_errors
+
+[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. ]
+ ]
+
+ [
+ [already_started]
+ [Operation already in progress. ]
+ ]
+
+ [
+ [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. ]
+ ]
+
+ [
+ [in_progress]
+ [Operation now in progress. ]
+ ]
+
+ [
+ [interrupted]
+ [Interrupted system call. ]
+ ]
+
+ [
+ [invalid_argument]
+ [Invalid argument. ]
+ ]
+
+ [
+ [message_size]
+ [Message too long. ]
+ ]
+
+ [
+ [name_too_long]
+ [The name was too long. ]
+ ]
+
+ [
+ [network_down]
+ [Network is down. ]
+ ]
+
+ [
+ [network_reset]
+ [Network dropped connection on reset. ]
+ ]
+
+ [
+ [network_unreachable]
+ [Network is unreachable. ]
+ ]
+
+ [
+ [no_descriptors]
+ [Too many open files. ]
+ ]
+
+ [
+ [no_buffer_space]
+ [No buffer space available. ]
+ ]
+
+ [
+ [no_memory]
+ [Cannot allocate memory. ]
+ ]
+
+ [
+ [no_permission]
+ [Operation not permitted. ]
+ ]
+
+ [
+ [no_protocol_option]
+ [Protocol not available. ]
+ ]
+
+ [
+ [not_connected]
+ [Transport endpoint is not connected. ]
+ ]
+
+ [
+ [not_socket]
+ [Socket operation on non-socket. ]
+ ]
+
+ [
+ [operation_aborted]
+ [Operation cancelled. ]
+ ]
+
+ [
+ [operation_not_supported]
+ [Operation not supported. ]
+ ]
+
+ [
+ [shut_down]
+ [Cannot send after transport endpoint shutdown. ]
+ ]
+
+ [
+ [timed_out]
+ [Connection timed out. ]
+ ]
+
+ [
+ [try_again]
+ [Resource temporarily unavailable. ]
+ ]
+
+ [
+ [would_block]
+ [The socket is marked non-blocking and the requested operation would block. ]
+ ]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:error__get_addrinfo_category error::get_addrinfo_category]
+
+[indexterm1 error::get_addrinfo_category]
+
+ const boost::system::error_category & get_addrinfo_category();
+
+
+
+[endsect]
+
+
+
+[section:error__get_misc_category error::get_misc_category]
+
+[indexterm1 error::get_misc_category]
+
+ const boost::system::error_category & get_misc_category();
+
+
+
+[endsect]
+
+
+
+[section:error__get_netdb_category error::get_netdb_category]
+
+[indexterm1 error::get_netdb_category]
+
+ const boost::system::error_category & get_netdb_category();
+
+
+
+[endsect]
+
+
+
+[section:error__get_ssl_category error::get_ssl_category]
+
+[indexterm1 error::get_ssl_category]
+
+ const boost::system::error_category & get_ssl_category();
+
+
+
+[endsect]
+
+
+
+[section:error__get_system_category error::get_system_category]
+
+[indexterm1 error::get_system_category]
+
+ const boost::system::error_category & get_system_category();
+
+
+
+[endsect]
+
+
+[section:error__make_error_code error::make_error_code]
+
+[indexterm1 error::make_error_code]
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
+ basic_errors e);
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
+ netdb_errors e);
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload3 make_error_code]``(
+ addrinfo_errors e);
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload4 make_error_code]``(
+ misc_errors e);
+
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload5 make_error_code]``(
+ ssl_errors e);
+
+
+[section:overload1 error::make_error_code (1 of 5 overloads)]
+
+
+
+ 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:overload3 error::make_error_code (3 of 5 overloads)]
+
+
+
+ boost::system::error_code make_error_code(
+ addrinfo_errors e);
+
+
+
+[endsect]
+
+
+
+[section:overload4 error::make_error_code (4 of 5 overloads)]
+
+
+
+ boost::system::error_code make_error_code(
+ misc_errors e);
+
+
+
+[endsect]
+
+
+
+[section:overload5 error::make_error_code (5 of 5 overloads)]
+
+
+
+ boost::system::error_code make_error_code(
+ ssl_errors e);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:error__misc_category error::misc_category]
+
+[indexterm1 error::misc_category]
+
+ static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
+
+
+
+[endsect]
+
+
+
+[section:error__misc_errors error::misc_errors]
+
+[indexterm1 error::misc_errors]
+
+ enum misc_errors
+
+[heading Values]
+[variablelist
+
+ [
+ [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. ]
+ ]
+
+]
+
+
+
+[endsect]
+
+
+
+[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();
+
+
+
+[endsect]
+
+
+
+[section:error__netdb_errors error::netdb_errors]
+
+[indexterm1 error::netdb_errors]
+
+ enum netdb_errors
+
+[heading Values]
+[variablelist
+
+ [
+ [host_not_found]
+ [Host not found (authoritative). ]
+ ]
+
+ [
+ [host_not_found_try_again]
+ [Host not found (non-authoritative). ]
+ ]
+
+ [
+ [no_data]
+ [The query is valid but does not have associated address data. ]
+ ]
+
+ [
+ [no_recovery]
+ [A non-recoverable error occurred. ]
+ ]
+
+]
+
+
+
+[endsect]
+
+
+
+[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();
+
+
+
+[endsect]
+
+
+
+[section:error__ssl_errors error::ssl_errors]
+
+[indexterm1 error::ssl_errors]
+
+ enum ssl_errors
+
+
+
+[endsect]
+
+
+
+[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();
+
+
+
+[endsect]
+
+
+
+[section:has_service has_service]
+
+[indexterm1 has_service]
+
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ bool has_service(
+ io_service & ios);
+
+
+This function is used to determine whether the io_service contains a service object corresponding to the given service type.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
+
+]
+
+[heading Return Value]
+
+A boolean indicating whether the io_service contains the service.
+
+
+
+[endsect]
+
+
+[section:invalid_service_owner invalid_service_owner]
+
+Exception thrown when trying to add a service object to an io_service where the service has a different owner.
+
+ class invalid_service_owner
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.invalid_service_owner.invalid_service_owner [*invalid_service_owner]]]
+ []
+ ]
+
+]
+
+
+[section:invalid_service_owner invalid_service_owner::invalid_service_owner]
+
+[indexterm2 invalid_service_owner..invalid_service_owner]
+
+ invalid_service_owner();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:io_service io_service]
+
+Provides core I/O functionality.
+
+ class io_service :
+ noncopyable
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[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. ]
+
+ ]
+
+]
+
+[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's event processing loop to execute ready handlers. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service.poll_one [*poll_one]]]
+ [Run the io_service'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's event processing loop. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service.run_one [*run_one]]]
+ [Run the io_service's event processing loop to execute at most one handler. ]
+ ]
+
+ [
+ [[link boost_asio.reference.io_service.stop [*stop]]]
+ [Stop the io_service'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. ]
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+The io_service class provides the core I/O functionality for users of the asynchronous I/O objects, including:
+
+
+* boost::asio::ip::tcp::socket
+
+* boost::asio::ip::tcp::acceptor
+
+* boost::asio::ip::udp::socket
+
+* boost::asio::deadline_timer.
+
+The io_service class also includes facilities intended for developers of custom asynchronous services.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe, with the exception that calling reset() while there are unfinished run() calls results in undefined behaviour.
+
+[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 boost::asio::io\_service::run(), boost::asio::io\_service::run\_one(), boost::asio::io\_service::poll() or boost::asio::io\_service::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 boost::asio::io\_service::run(), boost::asio::io\_service::run\_one(), boost::asio::io\_service::poll() or boost::asio::io\_service::poll\_one() call may be restarted [*without] the need for an intervening call to boost::asio::io\_service::reset(). This allows the thread to rejoin the io\_service's thread pool without impacting any other threads in the pool.
+
+For example:
+
+
+
+ boost::asio::io_service io_service;
+ ...
+ for (;;)
+ {
+ try
+ {
+ io_service.run();
+ break; // run() exited normally
+ }
+ catch (my_exception& e)
+ {
+ // Deal with exception as appropriate.
+ }
+ }
+
+
+
+
+
+[heading Stopping the io_service from running out of work]
+
+
+
+Some applications may need to prevent an io\_service's run() call from returning when there is no more work to do. For example, the 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]:
+
+
+
+ boost::asio::io_service io_service;
+ boost::asio::io_service::work work(io_service);
+ ...
+
+
+
+
+To effect a shutdown, the application will then need to call the io\_service's stop() member function. This will cause the io_servicerun() 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.
+
+
+
+ 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.
+
+
+
+
+
+[section:add_service io_service::add_service]
+
+[indexterm2 add_service..io_service] Add a service object to the io_service.
+
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend void add_service(
+ io_service & ios,
+ Service * svc);
+
+
+This function is used to add a service to the io_service.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
+
+[[svc][The service object. On success, ownership of the service object is transferred to the io\_service. When the io\_service object is destroyed, it will destroy the service object by performing:
+``
+ delete static_cast<io_service::service*>(svc)
+``
+]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the io\_service.]]
+
+[[boost::asio::invalid_service_owner][Thrown if the service's owning io\_service is not the io\_service object specified by the ios parameter. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:dispatch io_service::dispatch]
+
+[indexterm2 dispatch..io_service] Request the io_service to invoke the given handler.
+
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void dispatch(
+ CompletionHandler handler);
+
+
+This function is used to ask the io_service to execute the given handler.
+
+The 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 Parameters]
+
+
+[variablelist
+
+[[handler][The handler to be called. The io\_service will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:has_service io_service::has_service]
+
+[indexterm2 has_service..io_service] Determine if an io_service contains a specified service type.
+
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend bool has_service(
+ io_service & ios);
+
+
+This function is used to determine whether the io_service contains a service object corresponding to the given service type.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
+
+]
+
+[heading Return Value]
+
+A boolean indicating whether the io_service contains the service.
+
+
+
+[endsect]
+
+
+[section:io_service io_service::io_service]
+
+[indexterm2 io_service..io_service] Constructor.
+
+ ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
+
+ ``[link boost_asio.reference.io_service.io_service.overload2 io_service]``(
+ std::size_t concurrency_hint);
+
+
+[section:overload1 io_service::io_service (1 of 2 overloads)]
+
+Constructor.
+
+ io_service();
+
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::io_service (2 of 2 overloads)]
+
+Constructor.
+
+ io_service(
+ std::size_t concurrency_hint);
+
+
+Construct with a hint about the required level of concurrency.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:poll io_service::poll]
+
+[indexterm2 poll..io_service] Run the io_service's event processing loop to execute ready handlers.
+
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
+
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 io_service::poll (1 of 2 overloads)]
+
+Run the io_service's event processing loop to execute ready handlers.
+
+ std::size_t poll();
+
+
+The poll() function runs handlers that are ready to run, without blocking, until the io_service has been stopped or there are no more ready handlers.
+
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::poll (2 of 2 overloads)]
+
+Run the io_service'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 io_service has been stopped or there are no more ready handlers.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:poll_one io_service::poll_one]
+
+[indexterm2 poll_one..io_service] Run the io_service's event processing loop to execute one ready handler.
+
+ std::size_t ``[link boost_asio.reference.io_service.poll_one.overload1 poll_one]``();
+
+ std::size_t ``[link boost_asio.reference.io_service.poll_one.overload2 poll_one]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 io_service::poll_one (1 of 2 overloads)]
+
+Run the io_service's event processing loop to execute one ready handler.
+
+ std::size_t poll_one();
+
+
+The poll\_one() function runs at most one handler that is ready to run, without blocking.
+
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::poll_one (2 of 2 overloads)]
+
+Run the io_service'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 Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:post io_service::post]
+
+[indexterm2 post..io_service] Request the 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 io_service to execute the given handler, but without allowing the io_service to call the handler from inside this function.
+
+The 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.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[handler][The handler to be called. The io\_service will make a copy of the handler object as required. The function signature of the handler must be:
+``
+ void handler();
+``
+]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:reset io_service::reset]
+
+[indexterm2 reset..io_service] Reset the io_service in preparation for a subsequent run() invocation.
+
+ void reset();
+
+
+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.
+
+This function must not be called while there are any unfinished calls to the run(), run\_one(), poll() or poll\_one() functions.
+
+
+[endsect]
+
+
+[section:run io_service::run]
+
+[indexterm2 run..io_service] Run the io_service's event processing loop.
+
+ std::size_t ``[link boost_asio.reference.io_service.run.overload1 run]``();
+
+ std::size_t ``[link boost_asio.reference.io_service.run.overload2 run]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 io_service::run (1 of 2 overloads)]
+
+Run the io_service's event processing loop.
+
+ std::size_t run();
+
+
+The run() function blocks until all work has finished and there are no more handlers to be dispatched, or until the io_service has been stopped.
+
+Multiple threads may call the run() function to set up a pool of threads from which the io_service may execute handlers. All threads that are 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().
+
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[heading Remarks]
+
+The poll() function may also be used to dispatch ready handlers, but without blocking.
+
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::run (2 of 2 overloads)]
+
+Run the io_service's event processing loop.
+
+ std::size_t run(
+ boost::system::error_code & ec);
+
+
+The run() function blocks until all work has finished and there are no more handlers to be dispatched, or until the io_service has been stopped.
+
+Multiple threads may call the run() function to set up a pool of threads from which the io_service may execute handlers. All threads that are 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().
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+[heading Remarks]
+
+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 io_service's event processing loop to execute at most one handler.
+
+ std::size_t ``[link boost_asio.reference.io_service.run_one.overload1 run_one]``();
+
+ std::size_t ``[link boost_asio.reference.io_service.run_one.overload2 run_one]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 io_service::run_one (1 of 2 overloads)]
+
+Run the io_service's event processing loop to execute at most one handler.
+
+ std::size_t run_one();
+
+
+The run\_one() function blocks until one handler has been dispatched, or until the io_service has been stopped.
+
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::run_one (2 of 2 overloads)]
+
+Run the io_service's event processing loop to execute at most one handler.
+
+ std::size_t run_one(
+ boost::system::error_code & ec);
+
+
+The run\_one() function blocks until one handler has been dispatched, or until the io_service has been stopped.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of handlers that were executed.
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:stop io_service::stop]
+
+[indexterm2 stop..io_service] Stop the io_service's event processing loop.
+
+ void stop();
+
+
+This function does not block, but instead simply signals the 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:use_service io_service::use_service]
+
+[indexterm2 use_service..io_service] Obtain the service object corresponding to the given type.
+
+ 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 io_service will create a new instance of the service.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ios][The 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.
+
+
+
+[endsect]
+
+
+
+[section:wrap io_service::wrap]
+
+[indexterm2 wrap..io_service] Create a new handler that automatically dispatches the wrapped handler on the io_service.
+
+ 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 io\_service's dispatch function.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[handler][The handler to be wrapped. The 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);
+``
+]]
+
+]
+
+[heading Return Value]
+
+A function object that, when invoked, passes the wrapped handler to the io\_service's dispatch function. Given a function object with the signature:
+
+ R f(A1 a1, ... An an);
+
+
+If this function object is passed to the wrap function like so:
+
+ 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));
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:_io_service io_service::~io_service]
+
+[indexterm2 ~io_service..io_service] Destructor.
+
+ ~io_service();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:io_service__id io_service::id]
+
+Class used to uniquely identify a service.
+
+ class id :
+ noncopyable
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.io_service__id.id [*id]]]
+ [Constructor. ]
+ ]
+
+]
+
+
+[section:id io_service::id::id]
+
+[indexterm2 id..io_service::id] Constructor.
+
+ id();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:io_service__service io_service::service]
+
+Base class for all io_service services.
+
+ class service :
+ noncopyable
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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:get_io_service io_service::service::get_io_service]
+
+[indexterm2 get_io_service..io_service::service] Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:io_service io_service::service::io_service]
+
+[indexterm2 io_service..io_service::service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[section:service io_service::service::service]
+
+[indexterm2 service..io_service::service] Constructor.
+
+ service(
+ boost::asio::io_service & owner);
+
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[owner][The io\_service object that owns the service. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:_service io_service::service::~service]
+
+[indexterm2 ~service..io_service::service] Destructor.
+
+ virtual ~service();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:io_service__strand io_service::strand]
+
+Provides serialised handler execution.
+
+ class strand
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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 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]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+[section:dispatch io_service::strand::dispatch]
+
+[indexterm2 dispatch..io_service::strand] Request the strand to invoke the given handler.
+
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ void dispatch(
+ Handler handler);
+
+
+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.
+
+The strand's guarantee is in addition to the guarantee provided by the underlying io_service. The 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 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();
+``
+]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:get_io_service io_service::strand::get_io_service]
+
+[indexterm2 get_io_service..io_service::strand] Get the io_service associated with the strand.
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+
+
+
+[endsect]
+
+
+
+[section:io_service io_service::strand::io_service]
+
+[indexterm2 io_service..io_service::strand] (Deprecated: use get_io_service().) Get the io_service associated with the strand.
+
+ boost::asio::io_service & io_service();
+
+
+This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+
+
+
+[endsect]
+
+
+
+[section:post io_service::strand::post]
+
+[indexterm2 post..io_service::strand] Request the strand to invoke the given handler and return immediately.
+
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ void post(
+ Handler handler);
+
+
+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 io_service. The 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 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();
+``
+]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:strand io_service::strand::strand]
+
+[indexterm2 strand..io_service::strand] Constructor.
+
+ strand(
+ boost::asio::io_service & io_service);
+
+
+Constructs the strand.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the strand will use to dispatch handlers that are ready to be run. ]]
+
+]
+
+
+
+[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.
+
+ 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 strand's dispatch function.
+
+
+[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);
+``
+]]
+
+]
+
+[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);
+
+
+If this function object is passed to the wrap function like so:
+
+ 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:_strand io_service::strand::~strand]
+
+[indexterm2 ~strand..io_service::strand] Destructor.
+
+ ~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:io_service__work io_service::work]
+
+Class to inform the io_service when it has work to do.
+
+ class work
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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 io_service when work starts and finishes. This ensures that the io\_service'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.
+
+
+[section:get_io_service io_service::work::get_io_service]
+
+[indexterm2 get_io_service..io_service::work] Get the io_service associated with the work.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:io_service io_service::work::io_service]
+
+[indexterm2 io_service..io_service::work] (Deprecated: use get_io_service().) Get the io_service associated with the work.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+[section:work io_service::work::work]
+
+[indexterm2 work..io_service::work] Constructor notifies the io_service that work is starting.
+
+ ``[link boost_asio.reference.io_service__work.work.overload1 work]``(
+ boost::asio::io_service & io_service);
+
+ ``[link boost_asio.reference.io_service__work.work.overload2 work]``(
+ const work & other);
+
+
+[section:overload1 io_service::work::work (1 of 2 overloads)]
+
+Constructor notifies the io_service that work is starting.
+
+ work(
+ boost::asio::io_service & io_service);
+
+
+The constructor is used to inform the io_service that some work has begun. This ensures that the io\_service's run() function will not exit while the work is underway.
+
+
+[endsect]
+
+
+
+[section:overload2 io_service::work::work (2 of 2 overloads)]
+
+Copy constructor notifies the io_service that work is starting.
+
+ work(
+ const work & other);
+
+
+The constructor is used to inform the io_service that some work has begun. This ensures that the io\_service's run() function will not exit while the work is underway.
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:_work io_service::work::~work]
+
+[indexterm2 ~work..io_service::work] Destructor notifies the io_service that the work is complete.
+
+ ~work();
+
+
+The destructor is used to inform the io_service that some work has finished. Once the count of unfinished work reaches zero, the io\_service's run() function is permitted to exit.
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__address ip::address]
+
+Implements version-independent IP addresses.
+
+ class address
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__address.address [*address]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two addresses for equality. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[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.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[section:address ip::address::address]
+
+[indexterm2 address..ip::address] Default constructor.
+
+ ``[link boost_asio.reference.ip__address.address.overload1 address]``();
+
+ ``[link boost_asio.reference.ip__address.address.overload2 address]``(
+ const boost::asio::ip::address_v4 & ipv4_address);
+
+ ``[link boost_asio.reference.ip__address.address.overload3 address]``(
+ const boost::asio::ip::address_v6 & ipv6_address);
+
+ ``[link boost_asio.reference.ip__address.address.overload4 address]``(
+ const address & other);
+
+
+[section:overload1 ip::address::address (1 of 4 overloads)]
+
+Default constructor.
+
+ address();
+
+
+
+[endsect]
+
+
+
+[section:overload2 ip::address::address (2 of 4 overloads)]
+
+Construct an address from an IPv4 address.
+
+ address(
+ const boost::asio::ip::address_v4 & ipv4_address);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address::address (3 of 4 overloads)]
+
+Construct an address from an IPv6 address.
+
+ address(
+ const boost::asio::ip::address_v6 & ipv6_address);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::address::address (4 of 4 overloads)]
+
+Copy constructor.
+
+ address(
+ const address & other);
+
+
+
+[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.
+
+ static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
+ const char * str);
+
+ static address ``[link boost_asio.reference.ip__address.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+
+ static address ``[link boost_asio.reference.ip__address.from_string.overload3 from_string]``(
+ const std::string & str);
+
+ static address ``[link boost_asio.reference.ip__address.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+[section:overload1 ip::address::from_string (1 of 4 overloads)]
+
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+
+ static address from_string(
+ const char * str);
+
+
+
+[endsect]
+
+
+
+[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.
+
+ static address from_string(
+ const char * str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:overload3 ip::address::from_string (3 of 4 overloads)]
+
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+
+ static address from_string(
+ const std::string & str);
+
+
+
+[endsect]
+
+
+
+[section:overload4 ip::address::from_string (4 of 4 overloads)]
+
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+
+ static address from_string(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:is_v4 ip::address::is_v4]
+
+[indexterm2 is_v4..ip::address] Get whether the address is an IP version 4 address.
+
+ bool is_v4() const;
+
+
+
+[endsect]
+
+
+
+[section:is_v6 ip::address::is_v6]
+
+[indexterm2 is_v6..ip::address] Get whether the address is an IP version 6 address.
+
+ bool is_v6() const;
+
+
+
+[endsect]
+
+
+
+[section:operator_not__eq_ ip::address::operator!=]
+
+[indexterm2 operator!=..ip::address] Compare two addresses for inequality.
+
+ friend bool operator!=(
+ const address & a1,
+ const address & a2);
+
+
+
+[endsect]
+
+
+
+[section:operator_lt_ ip::address::operator<]
+
+[indexterm2 operator<..ip::address] Compare addresses for ordering.
+
+ friend bool operator<(
+ const address & a1,
+ const address & a2);
+
+
+
+[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_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);
+
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload2 operator=]``(
+ const boost::asio::ip::address_v4 & ipv4_address);
+
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload3 operator=]``(
+ const boost::asio::ip::address_v6 & ipv6_address);
+
+
+[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);
+
+
+
+[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;
+
+ std::string ``[link boost_asio.reference.ip__address.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+
+
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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.
+
+
+[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]``();
+
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload2 address_v4]``(
+ const bytes_type & bytes);
+
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload3 address_v4]``(
+ unsigned long addr);
+
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
+ const address_v4 & other);
+
+
+[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]``();
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload2 broadcast]``(
+ const address_v4 & addr,
+ const address_v4 & mask);
+
+
+[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;
+
+
+
+
+[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);
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload3 from_string]``(
+ const std::string & str);
+
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+[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_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: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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[endsect]
+
+
+
+[section:to_bytes ip::address_v4::to_bytes]
+
+[indexterm2 to_bytes..ip::address_v4] Get the address in bytes.
+
+ 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;
+
+ std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+
+
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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.
+
+
+[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]``();
+
+ ``[link boost_asio.reference.ip__address_v6.address_v6.overload2 address_v6]``(
+ const bytes_type & bytes,
+ unsigned long scope_id = 0);
+
+ ``[link boost_asio.reference.ip__address_v6.address_v6.overload3 address_v6]``(
+ const address_v6 & other);
+
+
+[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;
+
+
+
+
+[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);
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload2 from_string]``(
+ const char * str,
+ boost::system::error_code & ec);
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload3 from_string]``(
+ const std::string & str);
+
+ static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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;
+
+ void ``[link boost_asio.reference.ip__address_v6.scope_id.overload2 scope_id]``(
+ unsigned long id);
+
+
+[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.
+
+ 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;
+
+ std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload2 to_string]``(
+ boost::system::error_code & ec) const;
+
+
+[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
+
+[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.
+
+
+[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;
+
+ void ``[link boost_asio.reference.ip__basic_endpoint.address.overload2 address]``(
+ const boost::asio::ip::address & addr);
+
+
+[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]``();
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
+ const InternetProtocol & protocol,
+ unsigned short port_num);
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
+ const boost::asio::ip::address & addr,
+ unsigned short port_num);
+
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
+ const basic_endpoint & other);
+
+
+[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 & 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]``();
+
+ const data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload2 data]``() const;
+
+
+[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;
+
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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_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);
+
+
+
+[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;
+
+ void ``[link boost_asio.reference.ip__basic_endpoint.port.overload2 port]``(
+ unsigned short port_num);
+
+
+[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;
+
+
+
+
+[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 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 resolve a query 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]]]
+ [Resolve a query 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 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.
+
+
+[section:async_resolve ip::basic_resolver::async_resolve]
+
+[indexterm2 async_resolve..ip::basic_resolver] Asynchronously resolve 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);
+
+ 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);
+
+
+[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)]
+
+Asynchronously resolve 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 resolve 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 basic_resolver.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The 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;
+
+
+
+
+[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 io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the 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;
+
+
+
+
+[endsect]
+
+
+
+[section:io_service ip::basic_resolver::io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 io_service..ip::basic_resolver] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+
+
+
+[endsect]
+
+
+
+[section:iterator ip::basic_resolver::iterator]
+
+[indexterm2 iterator..ip::basic_resolver] The iterator type.
+
+ typedef InternetProtocol::resolver_iterator iterator;
+
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::basic_resolver::protocol_type]
+
+[indexterm2 protocol_type..ip::basic_resolver] The protocol type.
+
+ typedef InternetProtocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:query ip::basic_resolver::query]
+
+[indexterm2 query..ip::basic_resolver] The query type.
+
+ typedef InternetProtocol::resolver_query query;
+
+
+
+
+[endsect]
+
+
+[section:resolve ip::basic_resolver::resolve]
+
+[indexterm2 resolve..ip::basic_resolver] Resolve a query to a list of entries.
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
+ const query & q);
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload2 resolve]``(
+ const query & q,
+ boost::system::error_code & ec);
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload3 resolve]``(
+ const endpoint_type & e);
+
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload4 resolve]``(
+ const endpoint_type & e,
+ boost::system::error_code & ec);
+
+
+[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)]
+
+Resolve 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)]
+
+Resolve 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)]
+
+Resolve 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)]
+
+Resolve 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;
+
+
+
+
+[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. ]
+ ]
+
+ [
+ [[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.
+
+
+[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]``();
+
+ ``[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);
+
+
+[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 & endpoint,
+ const std::string & host_name,
+ const std::string & service_name);
+
+
+
+[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;
+
+
+
+
+[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;
+
+
+
+
+[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. ]
+ ]
+
+]
+
+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.
+
+
+
+[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);
+
+ 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);
+
+
+[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]
+
+
+[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.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. ]
+ ]
+
+ [
+ [[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.
+
+
+
+[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 int 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 int 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_name,
+ int flags = passive|address_configured);
+
+ ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 basic_resolver_query]``(
+ const protocol_type & protocol,
+ const std::string & service_name,
+ int flags = passive|address_configured);
+
+ ``[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,
+ int flags = address_configured);
+
+ ``[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,
+ int flags = address_configured);
+
+
+[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_name,
+ int flags = passive|address_configured);
+
+
+
+[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_name,
+ int flags = passive|address_configured);
+
+
+
+[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_name,
+ const std::string & service_name,
+ int flags = address_configured);
+
+
+
+[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_name,
+ const std::string & service_name,
+ int flags = address_configured);
+
+
+
+[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 int canonical_name = implementation_defined;
+
+
+
+[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 int 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 int 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 int 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;
+
+
+
+
+[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 int 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]``();
+
+ std::string ``[link boost_asio.reference.ip__host_name.overload2 host_name]``(
+ boost::system::error_code & ec);
+
+
+[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.resolver_iterator [*resolver_iterator]]]
+ [The type of a resolver iterator. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__icmp.resolver_query [*resolver_query]]]
+ [The type of a resolver query. ]
+
+ ]
+
+ [
+
+ [[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.
+
+
+
+[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
+
+[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.
+
+
+
+
+[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);
+
+
+
+[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);
+
+
+
+[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 resolve a query 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]]]
+ [Resolve a query 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 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.
+
+
+
+
+[endsect]
+
+
+
+[section:resolver_iterator ip::icmp::resolver_iterator]
+
+[indexterm2 resolver_iterator..ip::icmp] The type of a resolver iterator.
+
+ typedef basic_resolver_iterator< icmp > 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. ]
+ ]
+
+]
+
+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.
+
+
+
+
+[endsect]
+
+
+
+[section:resolver_query ip::icmp::resolver_query]
+
+[indexterm2 resolver_query..ip::icmp] The type of a resolver query.
+
+ typedef basic_resolver_query< icmp > resolver_query;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[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. ]
+ ]
+
+ [
+ [[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.
+
+
+
+
+[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_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. ]
+
+ ]
+
+ [
+
+ [[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. ]
+ ]
+
+ [
+ [[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.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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_raw_socket.native [*native]]]
+ [Get the native socket representation. ]
+ ]
+
+ [
+ [[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_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 basic_raw_socket class template provides asynchronous and blocking raw-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[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();
+
+
+
+
+
+
+[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();
+
+
+
+
+
+
+[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);
+
+
+
+
+
+
+[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);
+
+
+
+
+
+
+[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);
+
+
+
+
+
+
+[endsect]
+
+
+[section:ip__resolver_query_base ip::resolver_query_base]
+
+The resolver_query_base class is used as a base for the basic_resolver_query class templates to provide a common place to define the flag constants.
+
+ class resolver_query_base
+
+
+[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. ]
+ ]
+
+]
+
+
+[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 int 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 int 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 int canonical_name = implementation_defined;
+
+
+
+[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 int 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 int 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 int 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 int 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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[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);
+
+ 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);
+
+
+[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;
+
+
+
+
+[endsect]
+
+
+
+[section:get_io_service ip::resolver_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..ip::resolver_service] Get the 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;
+
+
+
+
+[endsect]
+
+
+
+[section:io_service ip::resolver_service::io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 io_service..ip::resolver_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
+
+
+
+[endsect]
+
+
+
+[section:iterator_type ip::resolver_service::iterator_type]
+
+[indexterm2 iterator_type..ip::resolver_service] The iterator type.
+
+ typedef InternetProtocol::resolver_iterator iterator_type;
+
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::resolver_service::protocol_type]
+
+[indexterm2 protocol_type..ip::resolver_service] The protocol type.
+
+ typedef InternetProtocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:query_type ip::resolver_service::query_type]
+
+[indexterm2 query_type..ip::resolver_service] The query type.
+
+ typedef InternetProtocol::resolver_query query_type;
+
+
+
+
+[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);
+
+ iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload2 resolve]``(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+[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 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.
+
+ 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.resolver_iterator [*resolver_iterator]]]
+ [The type of a resolver iterator. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.resolver_query [*resolver_query]]]
+ [The type of a resolver query. ]
+
+ ]
+
+ [
+
+ [[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.
+
+
+
+[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_type [*native_type]]]
+ [The native representation of an acceptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.non_blocking_io [*non_blocking_io]]]
+ [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. ]
+
+ ]
+
+ [
-Return the size of the get area in characters.
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
- std::size_t size() const;
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+ [
-[endsect]
+ [[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]
+ [
-[section:buffer buffer]
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-Create a new modifiable buffer from an existing buffer.
+ [
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload1 buffer]``(
- const mutable_buffer & b);
+ [[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. ]
+
+ ]
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload2 buffer]``(
- const mutable_buffer & b,
- std::size_t max_size_in_bytes);
+ [
- const_buffers_1 ``[link boost_asio.reference.buffer.overload3 buffer]``(
- const const_buffer & b);
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
- const_buffers_1 ``[link boost_asio.reference.buffer.overload4 buffer]``(
- const const_buffer & b,
- std::size_t max_size_in_bytes);
+]
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload5 buffer]``(
- void * data,
- std::size_t size_in_bytes);
+[heading Member Functions]
+[table
+ [[Name][Description]]
- const_buffers_1 ``[link boost_asio.reference.buffer.overload6 buffer]``(
- const void * data,
- std::size_t size_in_bytes);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload7 buffer]``(
- PodType & data);
+[heading Data Members]
+[table
+ [[Name][Description]]
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload8 buffer]``(
- PodType & data,
- std::size_t max_size_in_bytes);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
- const PodType & data);
+ [
+ [[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. ]
+ ]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload10 buffer]``(
- const PodType & data,
- std::size_t max_size_in_bytes);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
- boost::array< PodType, N > & data);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
- 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);
+]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload13 buffer]``(
- boost::array< const PodType, N > & data);
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
- 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);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload15 buffer]``(
- const boost::array< PodType, N > & data);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
- 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);
+]
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload17 buffer]``(
- std::vector< PodType, Allocator > & data);
+The basic_socket_acceptor class template is used for accepting new socket connections.
- 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);
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload19 buffer]``(
- const std::vector< PodType, Allocator > & data);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- 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);
+[*Shared] [*objects:] Unsafe.
- const_buffers_1 ``[link boost_asio.reference.buffer.overload21 buffer]``(
- const std::string & data);
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
- const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
- const std::string & data,
- std::size_t max_size_in_bytes);
+ 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();
-The simplest use case involves reading or writing a single buffer of a specified size:
- sock.write(boost::asio::buffer(data, size));
+[endsect]
-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.
-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:
+[section:endpoint ip::tcp::endpoint]
+[indexterm2 endpoint..ip::tcp] The type of a TCP endpoint.
- char d1[128];
- size_t bytes_transferred = sock.read(boost::asio::buffer(d1));
+ typedef basic_endpoint< tcp > endpoint;
- std::vector<char> d2(128);
- bytes_transferred = sock.read(boost::asio::buffer(d2));
- boost::array<char, 128> d3;
- bytes_transferred = sock.read(boost::asio::buffer(d3));
+[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. ]
+
+ ]
+ [
-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:
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
- char d1[128];
- std::vector<char> d2(128);
- boost::array<char, 128> d3;
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
- boost::array<mutable_buffer, 3> bufs1 = {
- boost::asio::buffer(d1),
- boost::asio::buffer(d2),
- boost::asio::buffer(d3) };
- bytes_transferred = sock.read(bufs1);
+[heading Friends]
+[table
+ [[Name][Description]]
- 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.write(bufs2);
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
+[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.
-[section:overload1 buffer (1 of 22 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Create a new modifiable buffer from an existing buffer.
+[*Shared] [*objects:] Unsafe.
- mutable_buffers_1 buffer(
- const mutable_buffer & b);
@@ -19292,13 +38690,11 @@
-[section:overload2 buffer (2 of 22 overloads)]
+[section:family ip::tcp::family]
-Create a new modifiable buffer from an existing buffer.
+[indexterm2 family..ip::tcp] Obtain an identifier for the protocol family.
- mutable_buffers_1 buffer(
- const mutable_buffer & b,
- std::size_t max_size_in_bytes);
+ int family() const;
@@ -19306,54 +38702,78 @@
-[section:overload3 buffer (3 of 22 overloads)]
+[section:iostream ip::tcp::iostream]
-Create a new non-modifiable buffer from an existing buffer.
+[indexterm2 iostream..ip::tcp] The TCP iostream type.
- const_buffers_1 buffer(
- const const_buffer & b);
+ typedef basic_socket_iostream< tcp > iostream;
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
-[section:overload4 buffer (4 of 22 overloads)]
+[endsect]
-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);
+[section:no_delay ip::tcp::no_delay]
+[indexterm2 no_delay..ip::tcp] Socket option for disabling the Nagle algorithm.
-[endsect]
+ typedef implementation_defined no_delay;
-[section:overload5 buffer (5 of 22 overloads)]
+Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
-Create a new modifiable buffer that represents the given memory range.
- mutable_buffers_1 buffer(
- void * data,
- std::size_t size_in_bytes);
+[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);
-[endsect]
+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();
-[section:overload6 buffer (6 of 22 overloads)]
-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);
@@ -19361,15 +38781,13 @@
-[section:overload7 buffer (7 of 22 overloads)]
+[section:operator_not__eq_ ip::tcp::operator!=]
-Create a new modifiable buffer that represents the given POD array.
+[indexterm2 operator!=..ip::tcp] Compare two protocols for inequality.
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- PodType & data);
+ friend bool operator!=(
+ const tcp & p1,
+ const tcp & p2);
@@ -19377,16 +38795,13 @@
-[section:overload8 buffer (8 of 22 overloads)]
+[section:operator_eq__eq_ ip::tcp::operator==]
-Create a new modifiable buffer that represents the given POD array.
+[indexterm2 operator==..ip::tcp] Compare two protocols for equality.
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- PodType & data,
- std::size_t max_size_in_bytes);
+ friend bool operator==(
+ const tcp & p1,
+ const tcp & p2);
@@ -19394,15 +38809,11 @@
-[section:overload9 buffer (9 of 22 overloads)]
+[section:protocol ip::tcp::protocol]
-Create a new non-modifiable buffer that represents the given POD array.
+[indexterm2 protocol..ip::tcp] Obtain an identifier for the protocol.
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const PodType & data);
+ int protocol() const;
@@ -19410,115 +38821,169 @@
-[section:overload10 buffer (10 of 22 overloads)]
-
-Create a new non-modifiable buffer that represents the given POD array.
+[section:resolver ip::tcp::resolver]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const PodType & data,
- std::size_t max_size_in_bytes);
+[indexterm2 resolver..ip::tcp] The TCP resolver type.
+ typedef basic_resolver< tcp > resolver;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-[section:overload11 buffer (11 of 22 overloads)]
+ [
-Create a new modifiable buffer that represents the given POD array.
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- boost::array< PodType, N > & data);
+ [
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:overload12 buffer (12 of 22 overloads)]
+ [
-Create a new modifiable buffer that represents the given POD array.
+ [[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. ]
+
+ ]
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously resolve a query 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]]]
+ [Resolve a query 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:overload13 buffer (13 of 22 overloads)]
+]
-Create a new non-modifiable buffer that represents the given POD array.
+The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- boost::array< const PodType, N > & data);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
-[section:overload14 buffer (14 of 22 overloads)]
+[endsect]
-Create a new non-modifiable buffer that represents the given POD array.
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- boost::array< const PodType, N > & data,
- std::size_t max_size_in_bytes);
+[section:resolver_iterator ip::tcp::resolver_iterator]
+[indexterm2 resolver_iterator..ip::tcp] The type of a resolver iterator.
-[endsect]
+ typedef basic_resolver_iterator< tcp > resolver_iterator;
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:overload15 buffer (15 of 22 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 a new non-modifiable buffer that represents the given POD array.
+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.
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const boost::array< PodType, N > & data);
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+ const basic_resolver_entry<InternetProtocol>
-[endsect]
-[section:overload16 buffer (16 of 22 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Create a new non-modifiable buffer that represents the given POD array.
+[*Shared] [*objects:] Unsafe.
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const boost::array< PodType, N > & data,
- std::size_t max_size_in_bytes);
@@ -19526,161 +38991,265 @@
-[section:overload17 buffer (17 of 22 overloads)]
+[section:resolver_query ip::tcp::resolver_query]
-Create a new modifiable buffer that represents the given POD vector.
+[indexterm2 resolver_query..ip::tcp] The type of a resolver query.
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data);
+ typedef basic_resolver_query< tcp > resolver_query;
+[heading Types]
+[table
+ [[Name][Description]]
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
+
+ ]
+]
-[endsect]
+[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. ]
+ ]
+
+ [
+ [[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]]
-[section:overload18 buffer (18 of 22 overloads)]
+ [
+ [[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. ]
+ ]
-Create a new modifiable buffer that represents the given POD vector.
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
+ ]
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
+ [
+ [[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. ]
+ ]
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+ [
+ [[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:overload19 buffer (19 of 22 overloads)]
+[*Shared] [*objects:] Unsafe.
-Create a new non-modifiable buffer that represents the given POD vector.
- template<
- typename PodType,
- typename Allocator>
- const_buffers_1 buffer(
- const std::vector< PodType, Allocator > & data);
+[endsect]
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+[section:socket ip::tcp::socket]
-[endsect]
+[indexterm2 socket..ip::tcp] The TCP socket type.
+ typedef basic_stream_socket< tcp > socket;
-[section:overload20 buffer (20 of 22 overloads)]
+[heading Types]
+[table
+ [[Name][Description]]
-Create a new non-modifiable buffer that represents the given POD vector.
+ [
- 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.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. ]
+
+ ]
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+ [
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:overload21 buffer (21 of 22 overloads)]
+ [
-Create a new non-modifiable buffer that represents the given string.
+ [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
- const_buffers_1 buffer(
- const std::string & data);
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[heading Remarks]
-
-The buffer is invalidated by any non-const operation called on the given string 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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+ [
-[section:overload22 buffer (22 of 22 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. ]
+
+ ]
-Create a new non-modifiable buffer that represents the given string.
+ [
- const_buffers_1 buffer(
- const std::string & data,
- std::size_t max_size_in_bytes);
+ [[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. ]
+
+ ]
-[heading Remarks]
-
-The buffer is invalidated by any non-const operation called on the given string object.
+ [
+ [[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]
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
-[section:buffered_read_stream buffered_read_stream]
+ [
-Adds buffering to the read-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_read_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_read_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_read_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. ]
]
@@ -19691,73 +39260,148 @@
[[Name][Description]]
[
- [[link boost_asio.reference.buffered_read_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_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.basic_stream_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
[
- [[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.basic_stream_socket.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[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.basic_stream_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.buffered_read_stream.close [*close]]]
- [Close the stream. ]
+ [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
+ [Start an asynchronous send. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[link boost_asio.reference.buffered_read_stream.get_io_service [*get_io_service]]]
+ [[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. ]
+ ]
+
+ [
+ [[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_read_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_read_stream.io_service [*io_service]]]
+ [[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.buffered_read_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. ]
]
[
- [[link boost_asio.reference.buffered_read_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[link boost_asio.reference.basic_stream_socket.native [*native]]]
+ [Get the native socket representation. ]
]
[
- [[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. ]
+ [[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. ]
+ ]
+
+ [
+ [[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.buffered_read_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.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
+ [Write some data to the socket. ]
]
]
@@ -19767,95 +39411,52 @@
[[Name][Description]]
[
- [[link boost_asio.reference.buffered_read_stream.default_buffer_size [*default_buffer_size]]]
- [The default buffer size. ]
+ [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
]
-]
-
-The buffered_read_stream class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.
-
-
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-
-
-[section:async_fill buffered_read_stream::async_fill]
-
-Start an asynchronous fill.
-
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
-
-
-
-[endsect]
-
-
-
-[section:async_read_some buffered_read_stream::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.
-
- 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]
-
-
-
-[section:async_write_some buffered_read_stream::async_write_some]
-
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
-
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ [
+ [[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. ]
+ ]
-[endsect]
+]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[section:buffered_read_stream buffered_read_stream::buffered_read_stream]
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-Construct, passing the specified argument to initialise the next layer.
+ [
+ [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
- Arg & a);
+]
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
- Arg & a,
- std::size_t buffer_size);
+The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
-[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Construct, passing the specified argument to initialise the next layer.
+[*Shared] [*objects:] Unsafe.
- template<
- typename Arg>
- buffered_read_stream(
- Arg & a);
@@ -19863,38 +39464,23 @@
-[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);
+[section:type ip::tcp::type]
+[indexterm2 type..ip::tcp] Obtain an identifier for the type of the protocol.
+ int type() const;
-[endsect]
[endsect]
-[section:close buffered_read_stream::close]
-
-Close the stream.
-
- void ``[link boost_asio.reference.buffered_read_stream.close.overload1 close]``();
-
- boost::system::error_code ``[link boost_asio.reference.buffered_read_stream.close.overload2 close]``(
- boost::system::error_code & ec);
-[section:overload1 buffered_read_stream::close (1 of 2 overloads)]
+[section:v4 ip::tcp::v4]
-Close the stream.
+[indexterm2 v4..ip::tcp] Construct to represent the IPv4 TCP protocol.
- void close();
+ static tcp v4();
@@ -19902,122 +39488,247 @@
-[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
-
-Close the stream.
-
- boost::system::error_code close(
- boost::system::error_code & ec);
+[section:v6 ip::tcp::v6]
+[indexterm2 v6..ip::tcp] Construct to represent the IPv6 TCP protocol.
+ static tcp v6();
-[endsect]
[endsect]
-[section:default_buffer_size buffered_read_stream::default_buffer_size]
-
-The default buffer size.
-
- static const std::size_t default_buffer_size = implementation_defined;
-
-
[endsect]
+[section:ip__udp ip::udp]
-[section:fill buffered_read_stream::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.
-
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
-
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
- boost::system::error_code & ec);
-
-
-[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();
-
+Encapsulates the flags needed for UDP.
+ class udp
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:overload2 buffered_read_stream::fill (2 of 2 overloads)]
+ [[link boost_asio.reference.ip__udp.endpoint [*endpoint]]]
+ [The type of a UDP endpoint. ]
+
+ ]
-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);
+ [[link boost_asio.reference.ip__udp.resolver [*resolver]]]
+ [The UDP resolver type. ]
+
+ ]
+ [
+ [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
+ [The type of a resolver iterator. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
+ [The type of a resolver query. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ip__udp.socket [*socket]]]
+ [The UDP socket type. ]
+
+ ]
-[section:get_io_service buffered_read_stream::get_io_service]
+]
-Get the io_service associated with the object.
+[heading Member Functions]
+[table
+ [[Name][Description]]
- boost::asio::io_service & get_io_service();
+ [
+ [[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. ]
+ ]
+
+]
-[endsect]
+The
+[link boost_asio.reference.ip__udp ip::udp] class contains flags necessary for UDP sockets.
-[section:in_avail buffered_read_stream::in_avail]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Determine the amount of data that may be read without blocking.
+[*Shared] [*objects:] Safe.
- std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload1 in_avail]``();
- std::size_t ``[link boost_asio.reference.buffered_read_stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
+[section:endpoint ip::udp::endpoint]
-[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
+[indexterm2 endpoint..ip::udp] The type of a UDP endpoint.
-Determine the amount of data that may be read without blocking.
+ typedef basic_endpoint< udp > endpoint;
- std::size_t in_avail();
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:overload2 buffered_read_stream::in_avail (2 of 2 overloads)]
+]
-Determine the amount of data that may be read without blocking.
+[heading Member Functions]
+[table
+ [[Name][Description]]
- std::size_t in_avail(
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
-[endsect]
+[heading Related Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
-[endsect]
+The
+[link boost_asio.reference.ip__basic_endpoint ip::basic_endpoint] class template describes an endpoint that may be associated with a particular socket.
-[section:io_service buffered_read_stream::io_service]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[*Shared] [*objects:] Unsafe.
- boost::asio::io_service & io_service();
@@ -20025,11 +39736,11 @@
-[section:lowest_layer buffered_read_stream::lowest_layer]
+[section:family ip::udp::family]
-Get a reference to the lowest layer.
+[indexterm2 family..ip::udp] Obtain an identifier for the protocol family.
- lowest_layer_type & lowest_layer();
+ int family() const;
@@ -20037,12 +39748,13 @@
-[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
-
-The type of the lowest layer.
+[section:operator_not__eq_ ip::udp::operator!=]
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[indexterm2 operator!=..ip::udp] Compare two protocols for inequality.
+ friend bool operator!=(
+ const udp & p1,
+ const udp & p2);
@@ -20050,11 +39762,13 @@
-[section:next_layer buffered_read_stream::next_layer]
+[section:operator_eq__eq_ ip::udp::operator==]
-Get a reference to the next layer.
+[indexterm2 operator==..ip::udp] Compare two protocols for equality.
- next_layer_type & next_layer();
+ friend bool operator==(
+ const udp & p1,
+ const udp & p2);
@@ -20062,173 +39776,193 @@
-[section:next_layer_type buffered_read_stream::next_layer_type]
-
-The type of the next layer.
+[section:protocol ip::udp::protocol]
- typedef boost::remove_reference< Stream >::type next_layer_type;
+[indexterm2 protocol..ip::udp] Obtain an identifier for the protocol.
+ int protocol() const;
[endsect]
-[section:peek buffered_read_stream::peek]
-
-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_read_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
-
- 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);
-
-
-[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:resolver ip::udp::resolver]
+[indexterm2 resolver..ip::udp] The UDP resolver type.
+ typedef basic_resolver< udp > resolver;
-[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.
+[heading Types]
+[table
+ [[Name][Description]]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
-[section:read_some buffered_read_stream::read_some]
+ [
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
- 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);
+ [
- 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);
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+ [
-[section:overload1 buffered_read_stream::read_some (1 of 2 overloads)]
+ [[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. ]
+
+ ]
-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);
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously resolve a query 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]]]
+ [Resolve a query to a list of entries. ]
+ ]
+
+]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[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 buffered_read_stream::read_some (2 of 2 overloads)]
+The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
-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);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
[endsect]
-[section:write_some buffered_read_stream::write_some]
-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 ``[link boost_asio.reference.buffered_read_stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
+[section:resolver_iterator ip::udp::resolver_iterator]
- 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);
+[indexterm2 resolver_iterator..ip::udp] The type of a resolver iterator.
+ typedef basic_resolver_iterator< udp > resolver_iterator;
-[section:overload1 buffered_read_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 Member Functions]
+[table
+ [[Name][Description]]
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ [
+ [[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
+[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 buffered_read_stream::write_some (2 of 2 overloads)]
-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 write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
[endsect]
-[endsect]
-[section:buffered_stream buffered_stream]
+[section:resolver_query ip::udp::resolver_query]
-Adds buffering to the read- and write-related operations of a stream.
+[indexterm2 resolver_query..ip::udp] The type of a resolver query.
- template<
- typename Stream>
- class buffered_stream :
- noncopyable
+ typedef basic_resolver_query< udp > resolver_query;
[heading Types]
@@ -20237,15 +39971,8 @@
[
- [[link boost_asio.reference.buffered_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.buffered_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
]
@@ -20256,121 +39983,78 @@
[[Name][Description]]
[
- [[link boost_asio.reference.buffered_stream.async_fill [*async_fill]]]
- [Start an asynchronous fill. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_stream.async_flush [*async_flush]]]
- [Start an asynchronous flush. ]
- ]
-
- [
- [[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.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.buffered_stream.buffered_stream [*buffered_stream]]]
- [Construct, passing the specified argument to initialise the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.buffered_stream.close [*close]]]
- [Close the stream. ]
+ [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
]
[
- [[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.ip__basic_resolver_query.host_name [*host_name]]]
+ [Get the host name associated with the query. ]
]
[
- [[link boost_asio.reference.buffered_stream.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[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.buffered_stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
+ [[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.buffered_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[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.buffered_stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[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.buffered_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[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.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.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.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.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
]
-
+
[
- [[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_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 buffered_stream class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
+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.
-
-
-
-[section:async_fill buffered_stream::async_fill]
-
-Start an asynchronous fill.
-
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
-
-
-
-[endsect]
-
-
-
-[section:async_flush buffered_stream::async_flush]
-
-Start an asynchronous flush.
+[*Shared] [*objects:] Unsafe.
- template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
@@ -20378,140 +40062,368 @@
-[section:async_read_some buffered_stream::async_read_some]
+[section:socket ip::udp::socket]
-Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
+[indexterm2 socket..ip::udp] The UDP socket type.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+ typedef basic_datagram_socket< udp > socket;
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+ [
-[section:async_write_some buffered_stream::async_write_some]
+ [[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. ]
+
+ ]
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
+ [
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-[section:buffered_stream buffered_stream::buffered_stream]
+ [
-Construct, passing the specified argument to initialise the next layer.
+ [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
- Arg & a);
+ [
- template<
- typename Arg>
- ``[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);
+ [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[section:overload1 buffered_stream::buffered_stream (1 of 2 overloads)]
+ [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
-Construct, passing the specified argument to initialise the next layer.
+ [
- template<
- typename Arg>
- buffered_stream(
- Arg & a);
+ [[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:overload2 buffered_stream::buffered_stream (2 of 2 overloads)]
+ [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [The native representation of a socket. ]
+
+ ]
-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);
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
+ [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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
-[endsect]
+ [
-[section:close buffered_stream::close]
+ [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
-Close the stream.
+ [
- void ``[link boost_asio.reference.buffered_stream.close.overload1 close]``();
+ [[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. ]
+
+ ]
- boost::system::error_code ``[link boost_asio.reference.buffered_stream.close.overload2 close]``(
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
-[section:overload1 buffered_stream::close (1 of 2 overloads)]
+ [
-Close the stream.
+ [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
- void close();
+ [
+ [[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. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:overload2 buffered_stream::close (2 of 2 overloads)]
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
-Close the stream.
+[heading Data Members]
+[table
+ [[Name][Description]]
- boost::system::error_code close(
- boost::system::error_code & ec);
+ [
+ [[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. ]
+ ]
+]
-[endsect]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[section:fill buffered_stream::fill]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-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.
+ [
+ [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
- std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload1 fill]``();
+]
- std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload2 fill]``(
- boost::system::error_code & ec);
+The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
-[section:overload1 buffered_stream::fill (1 of 2 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-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.
+[*Shared] [*objects:] Unsafe.
- std::size_t fill();
@@ -20519,35 +40431,23 @@
-[section:overload2 buffered_stream::fill (2 of 2 overloads)]
-
-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);
+[section:type ip::udp::type]
+[indexterm2 type..ip::udp] Obtain an identifier for the type of the protocol.
+ int type() const;
-[endsect]
[endsect]
-[section:flush buffered_stream::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.
-
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload1 flush]``();
-
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload2 flush]``(
- boost::system::error_code & ec);
-[section:overload1 buffered_stream::flush (1 of 2 overloads)]
+[section:v4 ip::udp::v4]
-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.
+[indexterm2 v4..ip::udp] Construct to represent the IPv4 UDP protocol.
- std::size_t flush();
+ static udp v4();
@@ -20555,98 +40455,93 @@
-[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.
-
- std::size_t flush(
- boost::system::error_code & ec);
+[section:v6 ip::udp::v6]
+[indexterm2 v6..ip::udp] Construct to represent the IPv6 UDP protocol.
+ static udp v6();
-[endsect]
[endsect]
-[section:get_io_service buffered_stream::get_io_service]
-
-Get the io_service associated with the object.
-
- boost::asio::io_service & get_io_service();
-
-
[endsect]
-[section:in_avail buffered_stream::in_avail]
-
-Determine the amount of data that may be read without blocking.
+[section:ip__unicast__hops ip::unicast::hops]
- std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload1 in_avail]``();
+[indexterm1 ip::unicast::hops] Socket option for time-to-live associated with outgoing unicast packets.
- std::size_t ``[link boost_asio.reference.buffered_stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
+ typedef implementation_defined hops;
-[section:overload1 buffered_stream::in_avail (1 of 2 overloads)]
-Determine the amount of data that may be read without blocking.
+Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
- std::size_t in_avail();
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option(4);
+ socket.set_option(option);
-[endsect]
-[section:overload2 buffered_stream::in_avail (2 of 2 overloads)]
+Getting the current option value:
-Determine the amount of data that may be read without blocking.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option;
+ socket.get_option(option);
+ int ttl = option.value();
- std::size_t in_avail(
- boost::system::error_code & ec);
-[endsect]
[endsect]
-[section:io_service buffered_stream::io_service]
-
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
-
- boost::asio::io_service & io_service();
+[section:ip__v6_only ip::v6_only]
+[indexterm1 ip::v6_only] Socket option for determining whether an IPv6 socket supports IPv6 communication only.
-[endsect]
+ typedef implementation_defined v6_only;
-[section:lowest_layer buffered_stream::lowest_layer]
+Implements the IPPROTO\_IPV6/IP\_V6ONLY socket option.
-Get a reference to the lowest layer.
- lowest_layer_type & lowest_layer();
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::v6_only option(true);
+ socket.set_option(option);
-[endsect]
+Getting the current option value:
-[section:lowest_layer_type buffered_stream::lowest_layer_type]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::v6_only option;
+ socket.get_option(option);
+ bool v6_only = option.value();
-The type of the lowest layer.
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
@@ -20654,103 +40549,67 @@
[endsect]
+[section:is_match_condition is_match_condition]
-[section:next_layer buffered_stream::next_layer]
-
-Get a reference to the next layer.
-
- next_layer_type & next_layer();
+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
-[endsect]
+[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. ]
+ ]
+]
-[section:next_layer_type buffered_stream::next_layer_type]
-The type of the next layer.
+[section:value is_match_condition::value]
- typedef boost::remove_reference< Stream >::type next_layer_type;
+[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]
-[section:peek buffered_stream::peek]
-
-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);
-
- 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);
-
-
-[section:overload1 buffered_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:is_read_buffered is_read_buffered]
-
-[section:overload2 buffered_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.
+The 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 ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[endsect]
+ typename Stream>
+ class is_read_buffered
-[section:read_some buffered_stream::read_some]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+[heading Data Members]
+[table
+ [[Name][Description]]
- 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);
+ [
+ [[link boost_asio.reference.is_read_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of read data. ]
+ ]
- 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);
+]
-[section:overload1 buffered_stream::read_some (1 of 2 overloads)]
+[section:value is_read_buffered::value]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+[indexterm2 value..is_read_buffered] The value member is true only if the Stream type supports buffering of read data.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+ static const bool value;
@@ -20758,82 +40617,50 @@
-[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]
+[section:is_write_buffered is_write_buffered]
-[endsect]
-
-[section:write_some buffered_stream::write_some]
-
-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 ``[link boost_asio.reference.buffered_stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
-
- 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);
-
-
-[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.
+The 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 ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ typename Stream>
+ class is_write_buffered
+[heading Data Members]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.is_write_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of written data. ]
+ ]
+]
-[section:overload2 buffered_stream::write_some (2 of 2 overloads)]
+[section:value is_write_buffered::value]
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
+[indexterm2 value..is_write_buffered] The value member is true only if the Stream type supports buffering of written data.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+ static const bool value;
[endsect]
-[endsect]
-
[endsect]
-[section:buffered_write_stream buffered_write_stream]
+[section:local__basic_endpoint local::basic_endpoint]
-Adds buffering to the write-related operations of a stream.
+Describes an endpoint for a UNIX socket.
template<
- typename Stream>
- class buffered_write_stream :
- noncopyable
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class basic_endpoint
[heading Types]
@@ -20842,15 +40669,15 @@
[
- [[link boost_asio.reference.buffered_write_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
+ [[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.buffered_write_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
]
@@ -20861,89 +40688,81 @@
[[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.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.close [*close]]]
- [Close the stream. ]
+ [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
+ [Get the underlying endpoint in the native type. ]
]
[
- [[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.local__basic_endpoint.operator_eq_ [*operator=]]]
+ [Assign from another endpoint. ]
]
[
- [[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.local__basic_endpoint.path [*path]]]
+ [Get the path associated with the endpoint. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
+ [The protocol associated with the endpoint. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
+ [Set the underlying size of the endpoint in the native type. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[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.buffered_write_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.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [Compare two endpoints for inequality. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
+ [Compare endpoints for ordering. ]
]
[
- [[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. ]
+ [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
]
]
-[heading Data Members]
+[heading Related Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.buffered_write_stream.default_buffer_size [*default_buffer_size]]]
- [The default buffer size. ]
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
]
-
+
]
-The buffered_write_stream class template can be used to add buffering to the synchronous and asynchronous write operations of a stream.
+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]
@@ -20953,166 +40772,53 @@
[*Shared] [*objects:] Unsafe.
+[section:basic_endpoint local::basic_endpoint::basic_endpoint]
-[section:async_flush buffered_write_stream::async_flush]
-
-Start an asynchronous flush.
-
- template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
-
-
-
-[endsect]
-
-
-
-[section:async_read_some buffered_write_stream::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.
-
- 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]
-
-
-
-[section:async_write_some buffered_write_stream::async_write_some]
-
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
-
- 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_write_stream buffered_write_stream::buffered_write_stream]
-
-Construct, passing the specified argument to initialise the next layer.
-
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload1 buffered_write_stream]``(
- Arg & a);
-
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 buffered_write_stream]``(
- Arg & a,
- std::size_t buffer_size);
-
-
-[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
-
-Construct, passing the specified argument to initialise the next layer.
-
- template<
- typename Arg>
- buffered_write_stream(
- Arg & a);
-
-
-
-[endsect]
-
-
+[indexterm2 basic_endpoint..local::basic_endpoint] Default constructor.
-[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
-
-Construct, passing the specified argument to initialise the next layer.
-
- template<
- typename Arg>
- buffered_write_stream(
- Arg & a,
- std::size_t buffer_size);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:close buffered_write_stream::close]
-
-Close the stream.
-
- void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
-
- boost::system::error_code ``[link boost_asio.reference.buffered_write_stream.close.overload2 close]``(
- boost::system::error_code & ec);
-
-
-[section:overload1 buffered_write_stream::close (1 of 2 overloads)]
-
-Close the stream.
-
- void close();
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
+ const char * path);
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
+ const std::string & path);
-[endsect]
-
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
+ const basic_endpoint & other);
-[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
+[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)]
-Close the stream.
+Default constructor.
- boost::system::error_code close(
- boost::system::error_code & ec);
+ basic_endpoint();
[endsect]
-[endsect]
-
-[section:default_buffer_size buffered_write_stream::default_buffer_size]
+[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)]
-The default buffer size.
+Construct an endpoint using the specified path name.
- static const std::size_t default_buffer_size = implementation_defined;
+ basic_endpoint(
+ const char * path);
[endsect]
-[section:flush buffered_write_stream::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.
-
- std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload1 flush]``();
-
- std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload2 flush]``(
- boost::system::error_code & ec);
-
-[section:overload1 buffered_write_stream::flush (1 of 2 overloads)]
+[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 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.
+Construct an endpoint using the specified path name.
- std::size_t flush();
+ basic_endpoint(
+ const std::string & path);
@@ -21120,12 +40826,12 @@
-[section:overload2 buffered_write_stream::flush (2 of 2 overloads)]
+[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 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.
+Copy constructor.
- std::size_t flush(
- boost::system::error_code & ec);
+ basic_endpoint(
+ const basic_endpoint & other);
@@ -21135,32 +40841,31 @@
[endsect]
-[section:get_io_service buffered_write_stream::get_io_service]
+[section:capacity local::basic_endpoint::capacity]
-Get the io_service associated with the object.
+[indexterm2 capacity..local::basic_endpoint] Get the capacity of the endpoint in the native type.
- boost::asio::io_service & get_io_service();
+ std::size_t capacity() const;
[endsect]
-[section:in_avail buffered_write_stream::in_avail]
+[section:data local::basic_endpoint::data]
-Determine the amount of data that may be read without blocking.
+[indexterm2 data..local::basic_endpoint] Get the underlying endpoint in the native type.
- std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload1 in_avail]``();
+ data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload1 data]``();
- std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
+ const data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload2 data]``() const;
-[section:overload1 buffered_write_stream::in_avail (1 of 2 overloads)]
+[section:overload1 local::basic_endpoint::data (1 of 2 overloads)]
-Determine the amount of data that may be read without blocking.
+Get the underlying endpoint in the native type.
- std::size_t in_avail();
+ data_type * data();
@@ -21168,12 +40873,11 @@
-[section:overload2 buffered_write_stream::in_avail (2 of 2 overloads)]
+[section:overload2 local::basic_endpoint::data (2 of 2 overloads)]
-Determine the amount of data that may be read without blocking.
+Get the underlying endpoint in the native type.
- std::size_t in_avail(
- boost::system::error_code & ec);
+ const data_type * data() const;
@@ -21183,11 +40887,12 @@
[endsect]
-[section:io_service buffered_write_stream::io_service]
+[section:data_type local::basic_endpoint::data_type]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[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;
- boost::asio::io_service & io_service();
@@ -21195,11 +40900,13 @@
-[section:lowest_layer buffered_write_stream::lowest_layer]
+[section:operator_not__eq_ local::basic_endpoint::operator!=]
-Get a reference to the lowest layer.
+[indexterm2 operator!=..local::basic_endpoint] Compare two endpoints for inequality.
- lowest_layer_type & lowest_layer();
+ friend bool operator!=(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
@@ -21207,12 +40914,13 @@
-[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
-
-The type of the lowest layer.
+[section:operator_lt_ local::basic_endpoint::operator<]
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[indexterm2 operator<..local::basic_endpoint] Compare endpoints for ordering.
+ friend bool operator<(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
@@ -21220,54 +40928,45 @@
-[section:next_layer buffered_write_stream::next_layer]
-
-Get a reference to the next layer.
+[section:operator_lt__lt_ local::basic_endpoint::operator<<]
- next_layer_type & next_layer();
+[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);
-[endsect]
+Used to output a human-readable string for a specified endpoint.
+[heading Parameters]
+
-[section:next_layer_type buffered_write_stream::next_layer_type]
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
-The type of the next layer.
+[[endpoint][The endpoint to be written.]]
- typedef boost::remove_reference< Stream >::type next_layer_type;
+]
+[heading Return Value]
+
+The output stream.
[endsect]
-[section:peek buffered_write_stream::peek]
-
-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_write_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
-
- 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);
-
-[section:overload1 buffered_write_stream::peek (1 of 2 overloads)]
+[section:operator_eq_ local::basic_endpoint::operator=]
-Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure.
+[indexterm2 operator=..local::basic_endpoint] Assign from another endpoint.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+ basic_endpoint & operator=(
+ const basic_endpoint & other);
@@ -21275,47 +40974,37 @@
-[section:overload2 buffered_write_stream::peek (2 of 2 overloads)]
+[section:operator_eq__eq_ local::basic_endpoint::operator==]
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
+[indexterm2 operator==..local::basic_endpoint] Compare two endpoints for equality.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ friend bool operator==(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
[endsect]
-[endsect]
+[section:path local::basic_endpoint::path]
-[section:read_some buffered_write_stream::read_some]
+[indexterm2 path..local::basic_endpoint] Get the path associated with the endpoint.
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+ std::string ``[link boost_asio.reference.local__basic_endpoint.path.overload1 path]``() const;
- 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);
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload2 path]``(
+ const char * p);
- 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);
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload3 path]``(
+ const std::string & p);
-[section:overload1 buffered_write_stream::read_some (1 of 2 overloads)]
+[section:overload1 local::basic_endpoint::path (1 of 3 overloads)]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+Get the path associated with the endpoint.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+ std::string path() const;
@@ -21323,117 +41012,77 @@
-[section:overload2 buffered_write_stream::read_some (2 of 2 overloads)]
+[section:overload2 local::basic_endpoint::path (2 of 3 overloads)]
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
+Set the path associated with the endpoint.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ void path(
+ const char * p);
[endsect]
-[endsect]
-[section:write_some buffered_write_stream::write_some]
+[section:overload3 local::basic_endpoint::path (3 of 3 overloads)]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+Set the path associated with the endpoint.
- 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);
+ void path(
+ const std::string & p);
- 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);
-[section:overload1 buffered_write_stream::write_some (1 of 2 overloads)]
+[endsect]
-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);
+[endsect]
+[section:protocol local::basic_endpoint::protocol]
-[endsect]
+[indexterm2 protocol..local::basic_endpoint] The protocol associated with the endpoint.
+ protocol_type protocol() const;
-[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
-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.
+[endsect]
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:protocol_type local::basic_endpoint::protocol_type]
-[endsect]
+[indexterm2 protocol_type..local::basic_endpoint] The protocol type associated with the endpoint.
+ typedef Protocol protocol_type;
-[endsect]
-[endsect]
-[section:const_buffer const_buffer]
+[endsect]
-Holds a buffer that cannot be modified.
- class const_buffer
+[section:resize local::basic_endpoint::resize]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[indexterm2 resize..local::basic_endpoint] Set the underlying size of the endpoint in the native type.
- [
- [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer. ]
- ]
-
-]
+ void resize(
+ std::size_t size);
-[heading Friends]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.const_buffer.buffer_cast_helper [*buffer_cast_helper]]]
- []
- ]
-
- [
- [[link boost_asio.reference.const_buffer.buffer_size_helper [*buffer_size_helper]]]
- []
- ]
-
-]
-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.
+[endsect]
-[section:buffer_cast_helper const_buffer::buffer_cast_helper]
+[section:size local::basic_endpoint::size]
+[indexterm2 size..local::basic_endpoint] Get the underlying size of the endpoint in the native type.
- friend const void * buffer_cast_helper(
- const const_buffer & b);
+ std::size_t size() const;
@@ -21441,81 +41090,133 @@
-[section:buffer_size_helper const_buffer::buffer_size_helper]
-
+[endsect]
+[section:local__connect_pair local::connect_pair]
- friend std::size_t buffer_size_helper(
- const const_buffer & b);
+[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);
+ 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);
-[endsect]
+[section:overload1 local::connect_pair (1 of 2 overloads)]
+Create a pair of connected sockets.
-[section:const_buffer const_buffer::const_buffer]
+ 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 empty buffer.
- ``[link boost_asio.reference.const_buffer.const_buffer.overload1 const_buffer]``();
- ``[link boost_asio.reference.const_buffer.const_buffer.overload2 const_buffer]``(
- const void * data,
- std::size_t size);
+[endsect]
- ``[link boost_asio.reference.const_buffer.const_buffer.overload3 const_buffer]``(
- const mutable_buffer & b);
-[section:overload1 const_buffer::const_buffer (1 of 3 overloads)]
+[section:overload2 local::connect_pair (2 of 2 overloads)]
-Construct an empty buffer.
+Create a pair of connected sockets.
- const_buffer();
+ 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:overload2 const_buffer::const_buffer (2 of 3 overloads)]
+[section:local__datagram_protocol local::datagram_protocol]
-Construct a buffer to represent a given memory range.
+Encapsulates the flags needed for datagram-oriented UNIX sockets.
- const_buffer(
- const void * data,
- std::size_t size);
+ class datagram_protocol
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.local__datagram_protocol.endpoint [*endpoint]]]
+ [The type of a UNIX domain endpoint. ]
+
+ ]
+ [
-[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
+ [[link boost_asio.reference.local__datagram_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
-Construct a non-modifiable buffer from a modifiable one.
+]
- const_buffer(
- const mutable_buffer & b);
+[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.
-[endsect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-[endsect]
+[*Shared] [*objects:] Safe.
-[endsect]
-[section:const_buffers_1 const_buffers_1]
+[section:endpoint local::datagram_protocol::endpoint]
-Adapts a single non-modifiable buffer so that it meets the requirements of the ConstBufferSequence concept.
+[indexterm2 endpoint..local::datagram_protocol] The type of a UNIX domain endpoint.
- class const_buffers_1 :
- public const_buffer
+ typedef basic_endpoint< datagram_protocol > endpoint;
[heading Types]
@@ -21524,15 +41225,15 @@
[
- [[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.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.const_buffers_1.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
]
@@ -21543,28 +41244,89 @@
[[Name][Description]]
[
- [[link boost_asio.reference.const_buffers_1.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor. ]
]
[
- [[link boost_asio.reference.const_buffers_1.const_buffers_1 [*const_buffers_1]]]
- [Construct to represent a single non-modifiable buffer. ]
+ [[link boost_asio.reference.local__basic_endpoint.capacity [*capacity]]]
+ [Get the capacity of the endpoint in the native type. ]
]
[
- [[link boost_asio.reference.const_buffers_1.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
+ [[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. ]
+ ]
+
+ [
+ [[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]]
-[section:begin const_buffers_1::begin]
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
-Get a random-access iterator to the first element.
+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.
- const_iterator begin() const;
@@ -21572,12 +41334,11 @@
-[section:const_buffers_1 const_buffers_1::const_buffers_1]
+[section:family local::datagram_protocol::family]
-Construct to represent a single non-modifiable buffer.
+[indexterm2 family..local::datagram_protocol] Obtain an identifier for the protocol family.
- const_buffers_1(
- const const_buffer & b);
+ int family() const;
@@ -21585,12 +41346,11 @@
-[section:const_iterator const_buffers_1::const_iterator]
-
-A random-access iterator type that may be used to read elements.
+[section:protocol local::datagram_protocol::protocol]
- typedef const const_buffer * const_iterator;
+[indexterm2 protocol..local::datagram_protocol] Obtain an identifier for the protocol.
+ int protocol() const;
@@ -21598,101 +41358,161 @@
-[section:end const_buffers_1::end]
+[section:socket local::datagram_protocol::socket]
-Get a random-access iterator for one past the last element.
+[indexterm2 socket..local::datagram_protocol] The UNIX domain socket type.
- const_iterator end() const;
+ typedef basic_datagram_socket< datagram_protocol > socket;
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+ [
-[section:value_type const_buffers_1::value_type]
+ [[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. ]
+
+ ]
-The type for each element in the list of buffers.
+ [
- typedef const_buffer value_type;
+ [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+ [
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [[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.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer. ]
+
+ [[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. ]
-]
+ ]
-[heading Friends]
-[table
- [[Name][Description]]
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
[
- [[link boost_asio.reference.const_buffer.buffer_cast_helper [*buffer_cast_helper]]]
- []
+
+ [[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.const_buffer.buffer_size_helper [*buffer_size_helper]]]
- []
+
+ [[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. ]
-]
+ ]
-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.
+ [
+ [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
+ [The native representation of a socket. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
+ [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. ]
+
+ ]
-[endsect]
+ [
-[section:datagram_socket_service datagram_socket_service]
+ [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
-Default service implementation for a datagram socket.
+ [
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class datagram_socket_service :
- public io_service::service
+ [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+ [
-[heading Types]
-[table
- [[Name][Description]]
+ [[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.datagram_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[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.datagram_socket_service.implementation_type [*implementation_type]]]
- [The type of a datagram 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.datagram_socket_service.native_type [*native_type]]]
- [The native socket type. ]
+ [[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.datagram_socket_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
]
@@ -21703,158 +41523,148 @@
[[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_datagram_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_datagram_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.basic_datagram_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
]
[
- [[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_datagram_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.async_send [*async_send]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.async_send_to [*async_send_to]]]
+ [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
[Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.at_mark [*at_mark]]]
+ [[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.datagram_socket_service.available [*available]]]
+ [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
[Determine the number of bytes available for reading. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.bind [*bind]]]
- []
- ]
-
- [
- [[link boost_asio.reference.datagram_socket_service.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_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
+ [Construct a basic_datagram_socket without opening it. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.connect [*connect]]]
- [Connect the datagram socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.construct [*construct]]]
- [Construct a new datagram socket implementation. ]
+ [[link boost_asio.reference.basic_datagram_socket.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with 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_datagram_socket.close [*close]]]
+ [Close the socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.destroy [*destroy]]]
- [Destroy a datagram socket implementation. ]
+ [[link boost_asio.reference.basic_datagram_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
]
[
- [[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_datagram_socket.get_io_service [*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_datagram_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.io_control [*io_control]]]
+ [[link boost_asio.reference.basic_datagram_socket.io_control [*io_control]]]
[Perform an IO control command on the socket. ]
]
[
- [[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_datagram_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.is_open [*is_open]]]
+ [[link boost_asio.reference.basic_datagram_socket.is_open [*is_open]]]
[Determine whether the socket is open. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[link boost_asio.reference.basic_datagram_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.native [*native]]]
- [Get the native socket implementation. ]
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.open [*open]]]
- []
+ [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
+ [Get the native socket representation. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
]
[
- [[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_datagram_socket.receive [*receive]]]
+ [Receive some data on a connected socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
+ [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint of the socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
+ [Send some data on a connected socket. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
]
[
- [[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_datagram_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
]
]
@@ -21864,203 +41674,52 @@
[[Name][Description]]
[
- [[link boost_asio.reference.datagram_socket_service.id [*id]]]
- [The unique service identifier. ]
+ [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
]
-]
-
-
-[section:assign datagram_socket_service::assign]
-
-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);
-
-
-
-[endsect]
-
-
-
-[section:async_connect datagram_socket_service::async_connect]
-
-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:async_receive datagram_socket_service::async_receive]
-
-Start an asynchronous receive.
-
- 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);
-
-
-
-[endsect]
-
-
-
-[section:async_receive_from datagram_socket_service::async_receive_from]
-
-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);
-
-
-
-[endsect]
-
-
-
-[section:async_send datagram_socket_service::async_send]
-
-Start an asynchronous send.
-
- 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);
-
-
-
-[endsect]
-
-
-
-[section:async_send_to datagram_socket_service::async_send_to]
-
-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:at_mark datagram_socket_service::at_mark]
-
-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;
-
-
-
-[endsect]
-
-
-
-[section:available datagram_socket_service::available]
-
-Determine the number of bytes available for reading.
-
- std::size_t available(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
-
-
-
-[endsect]
-
-
-
-[section:bind datagram_socket_service::bind]
-
-
-
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:cancel datagram_socket_service::cancel]
-
-Cancel all asynchronous operations associated with the socket.
-
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
+ [
+ [[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. ]
+ ]
-[section:close datagram_socket_service::close]
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
-Close a datagram socket implementation.
+]
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
+[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]
+]
+The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
-[section:connect datagram_socket_service::connect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Connect the datagram socket to the specified endpoint.
+[*Shared] [*objects:] Unsafe.
- boost::system::error_code connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
@@ -22068,12 +41727,11 @@
-[section:construct datagram_socket_service::construct]
+[section:type local::datagram_protocol::type]
-Construct a new datagram socket implementation.
+[indexterm2 type..local::datagram_protocol] Obtain an identifier for the type of the protocol.
- void construct(
- implementation_type & impl);
+ int type() const;
@@ -22081,167 +41739,386 @@
-[section:datagram_socket_service datagram_socket_service::datagram_socket_service]
-
-Construct a new datagram socket service for the specified io_service.
-
- datagram_socket_service(
- boost::asio::io_service & io_service);
-
-
-
[endsect]
+[section:local__stream_protocol local::stream_protocol]
+Encapsulates the flags needed for stream-oriented UNIX sockets.
-[section:destroy datagram_socket_service::destroy]
-
-Destroy a datagram socket implementation.
+ class stream_protocol
- void destroy(
- implementation_type & impl);
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:endpoint_type datagram_socket_service::endpoint_type]
+ [
-The endpoint type.
+ [[link boost_asio.reference.local__stream_protocol.iostream [*iostream]]]
+ [The UNIX domain iostream type. ]
+
+ ]
- typedef Protocol::endpoint endpoint_type;
+ [
+ [[link boost_asio.reference.local__stream_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[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.
-[section:get_io_service datagram_socket_service::get_io_service]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Safe.
-['Inherited from io_service.]
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+[section:acceptor local::stream_protocol::acceptor]
+[indexterm2 acceptor..local::stream_protocol] The UNIX domain acceptor type.
+ typedef basic_socket_acceptor< stream_protocol > acceptor;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:get_option datagram_socket_service::get_option]
+ [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
-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;
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+ [
-[section:id datagram_socket_service::id]
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-The unique service identifier.
+ [
- static boost::asio::io_service::id id;
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+ [
-[section:implementation_type datagram_socket_service::implementation_type]
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
-The type of a datagram socket.
+ [
- typedef implementation_defined implementation_type;
+ [[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. ]
+
+ ]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
-[section:io_control datagram_socket_service::io_control]
+ [
-Perform an IO control command on the socket.
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:io_service datagram_socket_service::io_service]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-['Inherited from io_service.]
+ [
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+ [[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. ]
+
+ ]
- boost::asio::io_service & io_service();
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+]
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+[heading Data Members]
+[table
+ [[Name][Description]]
-[section:is_open datagram_socket_service::is_open]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
-Determine whether the socket is open.
+ [
+ [[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. ]
+ ]
- bool is_open(
- const implementation_type & impl) const;
+ [
+ [[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. ]
+ ]
+]
-[endsect]
+[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. ]
+ ]
-[section:local_endpoint datagram_socket_service::local_endpoint]
+]
-Get the local endpoint.
+The basic_socket_acceptor class template is used for accepting new socket connections.
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
+[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();
-[section:native datagram_socket_service::native]
-Get the native socket implementation.
- native_type native(
- implementation_type & impl);
@@ -22249,39 +42126,120 @@
-[section:native_type datagram_socket_service::native_type]
-
-The native socket type.
+[section:endpoint local::stream_protocol::endpoint]
- typedef implementation_defined native_type;
+[indexterm2 endpoint..local::stream_protocol] The type of a UNIX domain endpoint.
+ typedef basic_endpoint< stream_protocol > endpoint;
+[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:open datagram_socket_service::open]
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default 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. ]
+ ]
+
+ [
+ [[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_eq__eq_ [*operator==]]]
+ [Compare two endpoints for equality. ]
+ ]
+
+]
-[endsect]
+[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.
-[section:protocol_type datagram_socket_service::protocol_type]
-The protocol type.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- typedef Protocol protocol_type;
+[*Shared] [*objects:] Unsafe.
@@ -22290,17 +42248,11 @@
-[section:receive datagram_socket_service::receive]
+[section:family local::stream_protocol::family]
-Receive some data from the peer.
+[indexterm2 family..local::stream_protocol] Obtain an identifier for the protocol family.
- 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);
+ int family() const;
@@ -22308,32 +42260,38 @@
-[section:receive_from datagram_socket_service::receive_from]
-
-Receive a datagram 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);
-
-
-
-[endsect]
+[section:iostream local::stream_protocol::iostream]
+[indexterm2 iostream..local::stream_protocol] The UNIX domain iostream type.
+ typedef basic_socket_iostream< stream_protocol > iostream;
-[section:remote_endpoint datagram_socket_service::remote_endpoint]
-Get the remote endpoint.
+[heading Member Functions]
+[table
+ [[Name][Description]]
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
@@ -22341,17 +42299,11 @@
-[section:send datagram_socket_service::send]
+[section:protocol local::stream_protocol::protocol]
-Send the given data to the peer.
+[indexterm2 protocol..local::stream_protocol] Obtain an identifier for the protocol.
- 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);
+ int protocol() const;
@@ -22359,115 +42311,161 @@
-[section:send_to datagram_socket_service::send_to]
-
-Send a datagram to the specified endpoint.
-
- 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);
+[section:socket local::stream_protocol::socket]
+[indexterm2 socket..local::stream_protocol] The UNIX domain socket type.
+ typedef basic_stream_socket< stream_protocol > socket;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:set_option datagram_socket_service::set_option]
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
-Set a socket option.
+ [
- 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);
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+ [
-[section:shutdown datagram_socket_service::shutdown]
+ [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-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);
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+ [
-[section:shutdown_service datagram_socket_service::shutdown_service]
+ [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
-Destroy all user-defined handler objects owned by the service.
+ [
- void shutdown_service();
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[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. ]
+
+ ]
+ [
-[section:deadline_timer deadline_timer]
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
-Typedef for the typical usage of timer.
+ [
- typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+ [
-[heading Types]
-[table
- [[Name][Description]]
+ [[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_deadline_timer.duration_type [*duration_type]]]
- [The duration type. ]
+ [[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_deadline_timer.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+ [[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_deadline_timer.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.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
]
[
- [[link boost_asio.reference.basic_deadline_timer.time_type [*time_type]]]
- [The time type. ]
+ [[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_deadline_timer.traits_type [*traits_type]]]
- [The time traits type. ]
+ [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
]
@@ -22478,241 +42476,148 @@
[[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. ]
- ]
-
- [
- [[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. ]
- ]
-
- [
- [[link boost_asio.reference.basic_deadline_timer.expires_from_now [*expires_from_now]]]
- [Get the timer's expiry time relative to now. ]
+ [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
]
[
- [[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_stream_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
[
- [[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_stream_socket.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.basic_deadline_timer.wait [*wait]]]
- [Perform a blocking wait on the timer. ]
- ]
-
-]
-
-The basic_deadline_timer class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
-
-Most applications will use the boost::asio::deadline\_timer typedef.
-
-
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-[heading Examples]
-
-Performing a blocking wait:
-
- // 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();
-
-
-
-
-Performing an asynchronous wait:
-
- 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"));
-
- // Start an asynchronous wait.
- timer.async_wait(handler);
-
-
-
-
-[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.
-
-
-
-
-[endsect]
-
-
-[section:deadline_timer_service deadline_timer_service]
-
-Default service implementation for a timer.
-
- template<
- typename ``[link boost_asio.reference.TimeType TimeType]``,
- typename ``[link boost_asio.reference.TimeTraits TimeTraits]`` = boost::asio::time_traits<TimeType>>
- class deadline_timer_service :
- public io_service::service
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
+ [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
[
-
- [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
- [The duration type. ]
+ [[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.deadline_timer_service.implementation_type [*implementation_type]]]
- [The implementation type of the deadline timer. ]
+ [[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.deadline_timer_service.time_type [*time_type]]]
- [The time type. ]
+ [[link boost_asio.reference.basic_stream_socket.basic_stream_socket [*basic_stream_socket]]]
+ [Construct a basic_stream_socket without opening it. ]
+ ]
+ [
+ [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [Bind the socket to the given local endpoint. ]
]
-
+
[
-
- [[link boost_asio.reference.deadline_timer_service.traits_type [*traits_type]]]
- [The time traits type. ]
+ [[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. ]
]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
[
- [[link boost_asio.reference.deadline_timer_service.async_wait [*async_wait]]]
- []
+ [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [Connect the socket to the specified endpoint. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.cancel [*cancel]]]
- [Cancel any asynchronous wait operations associated with the timer. ]
+ [[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.deadline_timer_service.construct [*construct]]]
- [Construct a new timer implementation. ]
+ [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
+ [Get an option from the socket. ]
]
[
- [[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.basic_stream_socket.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.destroy [*destroy]]]
- [Destroy a timer implementation. ]
+ [[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.deadline_timer_service.expires_at [*expires_at]]]
- [Get the expiry time for the timer as an absolute time. ]
+ [[link boost_asio.reference.basic_stream_socket.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.expires_from_now [*expires_from_now]]]
- [Get the expiry time for the timer relative to now. ]
+ [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the socket. ]
]
[
- [[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.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[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.basic_stream_socket.native [*native]]]
+ [Get the native socket representation. ]
]
[
- [[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.basic_stream_socket.open [*open]]]
+ [Open the socket using the specified protocol. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.wait [*wait]]]
- []
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
]
]
@@ -22722,36 +42627,52 @@
[[Name][Description]]
[
- [[link boost_asio.reference.deadline_timer_service.id [*id]]]
- [The unique service identifier. ]
+ [[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. ]
+ ]
-[section:async_wait deadline_timer_service::async_wait]
+ [
+ [[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. ]
+ ]
+]
- template<
- typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
- void async_wait(
- implementation_type & impl,
- WaitHandler handler);
+[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. ]
+ ]
-[endsect]
+]
+The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
-[section:cancel deadline_timer_service::cancel]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Cancel any asynchronous wait operations associated with the timer.
+[*Shared] [*objects:] Unsafe.
- std::size_t cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
@@ -22759,12 +42680,11 @@
-[section:construct deadline_timer_service::construct]
+[section:type local::stream_protocol::type]
-Construct a new timer implementation.
+[indexterm2 type..local::stream_protocol] Obtain an identifier for the type of the protocol.
- void construct(
- implementation_type & impl);
+ int type() const;
@@ -22772,63 +42692,93 @@
-[section:deadline_timer_service deadline_timer_service::deadline_timer_service]
+[endsect]
+
+[section:mutable_buffer mutable_buffer]
-Construct a new timer service for the specified io_service.
+Holds a buffer that can be modified.
+
+ class mutable_buffer
- deadline_timer_service(
- boost::asio::io_service & io_service);
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
-[endsect]
+[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. ]
+ ]
+
+]
+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.
-[section:destroy deadline_timer_service::destroy]
-Destroy a timer implementation.
+[section:buffer_cast mutable_buffer::buffer_cast]
- void destroy(
- implementation_type & impl);
+[indexterm2 buffer_cast..mutable_buffer] 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:duration_type deadline_timer_service::duration_type]
-The duration type.
+[section:buffer_size mutable_buffer::buffer_size]
- typedef traits_type::duration_type duration_type;
+[indexterm2 buffer_size..mutable_buffer] Get the number of bytes in a non-modifiable buffer.
+ std::size_t buffer_size(
+ const mutable_buffer & b);
[endsect]
-[section:expires_at deadline_timer_service::expires_at]
+[section:mutable_buffer mutable_buffer::mutable_buffer]
-Get the expiry time for the timer as an absolute time.
+[indexterm2 mutable_buffer..mutable_buffer] Construct an empty buffer.
- time_type ``[link boost_asio.reference.deadline_timer_service.expires_at.overload1 expires_at]``(
- const implementation_type & impl) const;
+ ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 mutable_buffer]``();
- 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);
+ ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 mutable_buffer]``(
+ void * data,
+ std::size_t size);
-[section:overload1 deadline_timer_service::expires_at (1 of 2 overloads)]
+[section:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
-Get the expiry time for the timer as an absolute time.
+Construct an empty buffer.
- time_type expires_at(
- const implementation_type & impl) const;
+ mutable_buffer();
@@ -22836,14 +42786,13 @@
-[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
+[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
-Set the expiry time for the timer as an absolute time.
+Construct a buffer to represent a given memory range.
- std::size_t expires_at(
- implementation_type & impl,
- const time_type & expiry_time,
- boost::system::error_code & ec);
+ mutable_buffer(
+ void * data,
+ std::size_t size);
@@ -22852,25 +42801,26 @@
[endsect]
-[section:expires_from_now deadline_timer_service::expires_from_now]
+[section:operator_plus_ mutable_buffer::operator+]
-Get the expiry time for the timer relative to now.
+[indexterm2 operator+..mutable_buffer] Create a new modifiable buffer that is offset from the start of another.
- duration_type ``[link boost_asio.reference.deadline_timer_service.expires_from_now.overload1 expires_from_now]``(
- const implementation_type & impl) const;
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload1 operator+]``(
+ const mutable_buffer & b,
+ std::size_t start);
- 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);
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const mutable_buffer & b);
-[section:overload1 deadline_timer_service::expires_from_now (1 of 2 overloads)]
+[section:overload1 mutable_buffer::operator+ (1 of 2 overloads)]
-Get the expiry time for the timer relative to now.
+Create a new modifiable buffer that is offset from the start of another.
- duration_type expires_from_now(
- const implementation_type & impl) const;
+ mutable_buffer operator+(
+ const mutable_buffer & b,
+ std::size_t start);
@@ -22878,14 +42828,13 @@
-[section:overload2 deadline_timer_service::expires_from_now (2 of 2 overloads)]
+[section:overload2 mutable_buffer::operator+ (2 of 2 overloads)]
-Set the expiry time for the timer relative to now.
+Create a new modifiable buffer that is offset from the start of another.
- std::size_t expires_from_now(
- implementation_type & impl,
- const duration_type & expiry_time,
- boost::system::error_code & ec);
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
@@ -22895,39 +42844,84 @@
[endsect]
-[section:get_io_service deadline_timer_service::get_io_service]
-
-
-['Inherited from io_service.]
-
-Get the io_service object that owns the service.
+[endsect]
- boost::asio::io_service & get_io_service();
+[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
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:id deadline_timer_service::id]
+ [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
+ ]
-The unique service identifier.
+ [
- static boost::asio::io_service::id id;
+ [[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]]
-[endsect]
+ [
+ [[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. ]
+ ]
+
+]
+[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. ]
+ ]
+
+]
-[section:implementation_type deadline_timer_service::implementation_type]
-The implementation type of the deadline timer.
+[section:begin mutable_buffers_1::begin]
- typedef implementation_defined implementation_type;
+[indexterm2 begin..mutable_buffers_1] Get a random-access iterator to the first element.
+ const_iterator begin() const;
@@ -22935,14 +42929,17 @@
-[section:io_service deadline_timer_service::io_service]
+[section:buffer_cast mutable_buffers_1::buffer_cast]
-['Inherited from io_service.]
+['Inherited from mutable_buffer.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[indexterm2 buffer_cast..mutable_buffers_1] Cast a non-modifiable buffer to a specified pointer to POD type.
- boost::asio::io_service & io_service();
+ template<
+ typename PointerToPodType>
+ PointerToPodType buffer_cast(
+ const mutable_buffer & b);
@@ -22950,11 +42947,15 @@
-[section:shutdown_service deadline_timer_service::shutdown_service]
+[section:buffer_size mutable_buffers_1::buffer_size]
-Destroy all user-defined handler objects owned by the service.
- void shutdown_service();
+['Inherited from mutable_buffer.]
+
+[indexterm2 buffer_size..mutable_buffers_1] Get the number of bytes in a non-modifiable buffer.
+
+ std::size_t buffer_size(
+ const mutable_buffer & b);
@@ -22962,11 +42963,11 @@
-[section:time_type deadline_timer_service::time_type]
+[section:const_iterator mutable_buffers_1::const_iterator]
-The time type.
+[indexterm2 const_iterator..mutable_buffers_1] A random-access iterator type that may be used to read elements.
- typedef traits_type::time_type time_type;
+ typedef const mutable_buffer * const_iterator;
@@ -22975,68 +42976,80 @@
-[section:traits_type deadline_timer_service::traits_type]
-
-The time traits type.
+[section:end mutable_buffers_1::end]
- typedef TimeTraits traits_type;
+[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]
-[section:wait deadline_timer_service::wait]
+[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);
+ ``[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1.overload2 mutable_buffers_1]``(
+ const mutable_buffer & b);
- void wait(
- implementation_type & impl,
- boost::system::error_code & ec);
+[section:overload1 mutable_buffers_1::mutable_buffers_1 (1 of 2 overloads)]
+Construct to represent a given memory range.
-[endsect]
+ mutable_buffers_1(
+ void * data,
+ std::size_t size);
[endsect]
-[section:error__addrinfo_category error::addrinfo_category]
+[section:overload2 mutable_buffers_1::mutable_buffers_1 (2 of 2 overloads)]
+Construct to represent a single modifiable buffer.
- static const boost::system::error_category & addrinfo_category = boost::asio::error::get_addrinfo_category();
+ mutable_buffers_1(
+ const mutable_buffer & b);
[endsect]
+[endsect]
+
+[section:operator_plus_ mutable_buffers_1::operator+]
-[section:error__addrinfo_errors error::addrinfo_errors]
+[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);
+ mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const mutable_buffer & b);
- enum addrinfo_errors
-[heading Values]
-[variablelist
+[section:overload1 mutable_buffers_1::operator+ (1 of 2 overloads)]
- [
- [service_not_found]
- [The service is not supported for the given socket type. ]
- ]
- [
- [socket_type_not_supported]
- [The socket type is not supported. ]
- ]
+['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);
@@ -23044,224 +43057,195 @@
-[section:error__basic_errors error::basic_errors]
+[section:overload2 mutable_buffers_1::operator+ (2 of 2 overloads)]
+['Inherited from mutable_buffer.]
- enum basic_errors
+Create a new modifiable buffer that is offset from the start of another.
-[heading Values]
-[variablelist
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
- [
- [access_denied]
- [Permission denied. ]
- ]
- [
- [address_family_not_supported]
- [Address family not supported by protocol. ]
- ]
- [
- [address_in_use]
- [Address already in use. ]
- ]
+[endsect]
- [
- [already_connected]
- [Transport endpoint is already connected. ]
- ]
- [
- [already_started]
- [Operation already in progress. ]
- ]
+[endsect]
- [
- [broken_pipe]
- [Broken pipe. ]
- ]
- [
- [connection_aborted]
- [A connection has been aborted. ]
- ]
+[section:value_type mutable_buffers_1::value_type]
- [
- [connection_refused]
- [Connection refused. ]
- ]
+[indexterm2 value_type..mutable_buffers_1] The type for each element in the list of buffers.
- [
- [connection_reset]
- [Connection reset by peer. ]
- ]
+ typedef mutable_buffer value_type;
- [
- [bad_descriptor]
- [Bad file descriptor. ]
- ]
- [
- [fault]
- [Bad address. ]
- ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
- [host_unreachable]
- [No route to host. ]
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
]
+
+]
- [
- [in_progress]
- [Operation now in progress. ]
- ]
+[heading Related Functions]
+[table
+ [[Name][Description]]
[
- [interrupted]
- [Interrupted system call. ]
+ [[link boost_asio.reference.mutable_buffer.buffer_cast [*buffer_cast]]]
+ [Cast a non-modifiable buffer to a specified pointer to POD type. ]
]
-
+
[
- [invalid_argument]
- [Invalid argument. ]
+ [[link boost_asio.reference.mutable_buffer.buffer_size [*buffer_size]]]
+ [Get the number of bytes in a non-modifiable buffer. ]
]
-
+
[
- [message_size]
- [Message too long. ]
+ [[link boost_asio.reference.mutable_buffer.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
]
+
+]
- [
- [network_down]
- [Network is down. ]
- ]
+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.
- [
- [network_reset]
- [Network dropped connection on reset. ]
- ]
- [
- [network_unreachable]
- [Network is unreachable. ]
- ]
- [
- [no_descriptors]
- [Too many open files. ]
- ]
+[endsect]
- [
- [no_buffer_space]
- [No buffer space available. ]
- ]
- [
- [no_memory]
- [Cannot allocate memory. ]
- ]
- [
- [no_permission]
- [Operation not permitted. ]
- ]
+[endsect]
- [
- [no_protocol_option]
- [Protocol not available. ]
- ]
+[section:null_buffers null_buffers]
- [
- [not_connected]
- [Transport endpoint is not connected. ]
- ]
+An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
- [
- [not_socket]
- [Socket operation on non-socket. ]
- ]
+ class null_buffers
+
+
+[heading Types]
+[table
+ [[Name][Description]]
[
- [operation_aborted]
- [Operation cancelled. ]
- ]
- [
- [operation_not_supported]
- [Operation not supported. ]
+ [[link boost_asio.reference.null_buffers.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
]
[
- [shut_down]
- [Cannot send after transport endpoint shutdown. ]
- ]
- [
- [timed_out]
- [Connection timed out. ]
+ [[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]]
+
[
- [try_again]
- [Resource temporarily unavailable. ]
+ [[link boost_asio.reference.null_buffers.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
]
-
+
[
- [would_block]
- [The socket is marked non-blocking and the requested operation would block. ]
+ [[link boost_asio.reference.null_buffers.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
]
-
+
]
+[section:begin null_buffers::begin]
-[endsect]
-
+[indexterm2 begin..null_buffers] Get a random-access iterator to the first element.
+ const_iterator begin() const;
-[section:error__get_addrinfo_category error::get_addrinfo_category]
+[endsect]
- const boost::system::error_category & get_addrinfo_category();
+[section:const_iterator null_buffers::const_iterator]
-[endsect]
+[indexterm2 const_iterator..null_buffers] A random-access iterator type that may be used to read elements.
+ typedef const mutable_buffer * const_iterator;
-[section:error__get_misc_category error::get_misc_category]
+[endsect]
- const boost::system::error_category & get_misc_category();
+[section:end null_buffers::end]
-[endsect]
+[indexterm2 end..null_buffers] Get a random-access iterator for one past the last element.
+ const_iterator end() const;
-[section:error__get_netdb_category error::get_netdb_category]
+[endsect]
- const boost::system::error_category & get_netdb_category();
+[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;
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:error__get_ssl_category error::get_ssl_category]
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+[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. ]
+ ]
+
+]
- const boost::system::error_category & get_ssl_category();
+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.
@@ -23269,158 +43253,267 @@
-[section:error__get_system_category error::get_system_category]
+[endsect]
+[section:placeholders__bytes_transferred placeholders::bytes_transferred]
- const boost::system::error_category & get_system_category();
+[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;
-[endsect]
+[endsect]
-[section:error__make_error_code error::make_error_code]
+[section:placeholders__error placeholders::error]
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
- basic_errors e);
+[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.
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
- netdb_errors e);
+ unspecified error;
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload3 make_error_code]``(
- addrinfo_errors e);
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload4 make_error_code]``(
- misc_errors e);
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload5 make_error_code]``(
- ssl_errors e);
+[endsect]
-[section:overload1 error::make_error_code (1 of 5 overloads)]
+[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.
- boost::system::error_code make_error_code(
- basic_errors e);
+ unspecified iterator;
[endsect]
+[section:posix__basic_descriptor posix::basic_descriptor]
-[section:overload2 error::make_error_code (2 of 5 overloads)]
+Provides POSIX descriptor functionality.
+ template<
+ typename ``[link boost_asio.reference.DescriptorService DescriptorService]``>
+ class basic_descriptor :
+ public basic_io_object< DescriptorService >,
+ public posix::descriptor_base
- boost::system::error_code make_error_code(
- netdb_errors e);
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[section:overload3 error::make_error_code (3 of 5 overloads)]
+ [[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.posix__basic_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
+
+ ]
- boost::system::error_code make_error_code(
- addrinfo_errors e);
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
+ [
-[endsect]
+ [[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]]
-[section:overload4 error::make_error_code (4 of 5 overloads)]
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
- boost::system::error_code make_error_code(
- misc_errors e);
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[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. ]
+ ]
-[endsect]
+]
+The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
-[section:overload5 error::make_error_code (5 of 5 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
- boost::system::error_code make_error_code(
- ssl_errors e);
+[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_type & native_descriptor);
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.assign.overload2 assign]``(
+ const native_type & native_descriptor,
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 posix::basic_descriptor::assign (1 of 2 overloads)]
+Assign an existing native descriptor to the descriptor.
-[section:error__misc_category error::misc_category]
+ void assign(
+ const native_type & native_descriptor);
- static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
+[endsect]
-[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_type & native_descriptor,
+ boost::system::error_code & ec);
-[section:error__misc_errors error::misc_errors]
+[endsect]
- enum misc_errors
-[heading Values]
-[variablelist
+[endsect]
- [
- [already_open]
- [Already open. ]
- ]
+[section:basic_descriptor posix::basic_descriptor::basic_descriptor]
- [
- [eof]
- [End of file or stream. ]
- ]
+[indexterm2 basic_descriptor..posix::basic_descriptor] Construct a basic_descriptor without opening it.
- [
- [not_found]
- [Element not found. ]
- ]
+ ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``(
+ boost::asio::io_service & io_service);
- [
- [fd_set_failure]
- [The descriptor cannot fit into the select system call's fd_set. ]
- ]
+ ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload2 basic_descriptor]``(
+ boost::asio::io_service & io_service,
+ const native_type & native_descriptor);
-]
+[section:overload1 posix::basic_descriptor::basic_descriptor (1 of 2 overloads)]
+Construct a basic_descriptor without opening it.
-[endsect]
+ basic_descriptor(
+ boost::asio::io_service & io_service);
+This constructor creates a descriptor without opening it.
-[section:error__netdb_category error::netdb_category]
+[heading Parameters]
+
+[variablelist
+
+[[io_service][The io\_service object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
- static const boost::system::error_category & netdb_category = boost::asio::error::get_netdb_category();
+]
@@ -23428,34 +43521,35 @@
-[section:error__netdb_errors error::netdb_errors]
+[section:overload2 posix::basic_descriptor::basic_descriptor (2 of 2 overloads)]
+Construct a basic_descriptor on an existing native descriptor.
+ basic_descriptor(
+ boost::asio::io_service & io_service,
+ const native_type & native_descriptor);
- enum netdb_errors
-[heading Values]
+This constructor creates a descriptor object to hold an existing native descriptor.
+
+
+[heading Parameters]
+
+
[variablelist
+
+[[io_service][The io\_service object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
- [
- [host_not_found]
- [Host not found (authoritative). ]
- ]
+[[native_descriptor][A native descriptor.]]
- [
- [host_not_found_try_again]
- [Host not found (non-authoritative). ]
- ]
+]
- [
- [no_data]
- [The query is valid but does not have associated address data. ]
- ]
+[heading Exceptions]
+
- [
- [no_recovery]
- [A non-recoverable error occurred. ]
- ]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -23464,59 +43558,85 @@
[endsect]
+[endsect]
-[section:error__ssl_category error::ssl_category]
+[section:bytes_readable posix::basic_descriptor::bytes_readable]
- static const boost::system::error_category & ssl_category = boost::asio::error::get_ssl_category();
+['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;
-[endsect]
+Implements the FIONREAD IO control command.
-[section:error__ssl_errors error::ssl_errors]
+[heading Example]
+
- enum ssl_errors
+ 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 Values]
-[variablelist
-]
[endsect]
+[section:cancel posix::basic_descriptor::cancel]
-[section:error__system_category error::system_category]
+[indexterm2 cancel..posix::basic_descriptor] Cancel all asynchronous operations associated with the descriptor.
+ void ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload1 cancel]``();
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
- static const boost::system::error_category & system_category = boost::asio::error::get_system_category();
+[section:overload1 posix::basic_descriptor::cancel (1 of 2 overloads)]
+Cancel all asynchronous operations associated with the descriptor.
-[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:has_service has_service]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- bool has_service(
- io_service & ios);
+]
-This function is used to determine whether the io_service contains a service object corresponding to the given service type.
+
+[endsect]
+
+
+
+[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]
@@ -23524,239 +43644,160 @@
[variablelist
-[[ios][The io\_service object that owns the service.]]
+[[ec][Set to indicate what error occurred, if any. ]]
]
-[heading Return Value]
-
-A boolean indicating whether the io_service contains the service.
+[endsect]
+
[endsect]
+[section:close posix::basic_descriptor::close]
-[section:invalid_service_owner invalid_service_owner]
+[indexterm2 close..posix::basic_descriptor] Close the descriptor.
-Exception thrown when trying to add a service object to an io_service where the service has a different owner.
+ void ``[link boost_asio.reference.posix__basic_descriptor.close.overload1 close]``();
- class invalid_service_owner
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.close.overload2 close]``(
+ boost::system::error_code & ec);
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:overload1 posix::basic_descriptor::close (1 of 2 overloads)]
- [
- [[link boost_asio.reference.invalid_service_owner.invalid_service_owner [*invalid_service_owner]]]
- []
- ]
+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. ]]
+
]
-[section:invalid_service_owner invalid_service_owner::invalid_service_owner]
+[endsect]
- invalid_service_owner();
+[section:overload2 posix::basic_descriptor::close (2 of 2 overloads)]
+Close the descriptor.
-[endsect]
+ 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
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
[endsect]
-[section:io_service io_service]
-Provides core I/O functionality.
+[endsect]
- class io_service :
- noncopyable
+[section:get_io_service posix::basic_descriptor::get_io_service]
-[heading Types]
-[table
- [[Name][Description]]
- [
+['Inherited from basic_io_object.]
- [[link boost_asio.reference.io_service__id [*id]]]
- [Class used to uniquely identify a service. ]
-
- ]
+[indexterm2 get_io_service..posix::basic_descriptor] Get the io_service associated with the object.
- [
+ boost::asio::io_service & get_io_service();
- [[link boost_asio.reference.io_service__service [*service]]]
- [Base class for all io_service services. ]
-
- ]
- [
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
- [[link boost_asio.reference.io_service__strand [*strand]]]
- [Provides serialised handler execution. ]
-
- ]
- [
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
- [[link boost_asio.reference.io_service__work [*work]]]
- [Class to inform the io_service when it has work to do. ]
-
- ]
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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's event processing loop to execute ready handlers. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.poll_one [*poll_one]]]
- [Run the io_service'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's event processing loop. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.run_one [*run_one]]]
- [Run the io_service's event processing loop to execute at most one handler. ]
- ]
-
- [
- [[link boost_asio.reference.io_service.stop [*stop]]]
- [Stop the io_service'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. ]
- ]
-
-]
-[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. ]
- ]
-
-]
+[section:implementation posix::basic_descriptor::implementation]
-The io_service class provides the core I/O functionality for users of the asynchronous I/O objects, including:
+['Inherited from basic_io_object.]
-* boost::asio::ip::tcp::socket
+[indexterm2 implementation..posix::basic_descriptor] The underlying implementation of the I/O object.
-* boost::asio::ip::tcp::acceptor
+ implementation_type implementation;
-* boost::asio::ip::udp::socket
-* boost::asio::deadline_timer.
-The io_service class also includes facilities intended for developers of custom asynchronous services.
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Safe, with the exception that calling reset() while there are unfinished run() calls results in undefined behaviour.
+[section:implementation_type posix::basic_descriptor::implementation_type]
-[heading Effect of exceptions thrown from handlers]
-
+['Inherited from basic_io_object.]
-If an exception is thrown from a handler, the exception is allowed to propagate through the throwing thread's invocation of boost::asio::io\_service::run(), boost::asio::io\_service::run\_one(), boost::asio::io\_service::poll() or boost::asio::io\_service::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.
+[indexterm2 implementation_type..posix::basic_descriptor] The underlying implementation type of I/O object.
-After the exception has been caught, the boost::asio::io\_service::run(), boost::asio::io\_service::run\_one(), boost::asio::io\_service::poll() or boost::asio::io\_service::poll\_one() call may be restarted [*without] the need for an intervening call to boost::asio::io\_service::reset(). This allows the thread to rejoin the io\_service's thread pool without impacting any other threads in the pool.
+ typedef service_type::implementation_type implementation_type;
-For example:
- 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]
+[section:io_control posix::basic_descriptor::io_control]
+[indexterm2 io_control..posix::basic_descriptor] Perform an IO control command on 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);
+
+ 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);
-[section:add_service io_service::add_service]
-Add a service object to the io_service.
+[section:overload1 posix::basic_descriptor::io_control (1 of 2 overloads)]
+
+Perform an IO control command on the descriptor.
template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend void add_service(
- io_service & ios,
- Service * svc);
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
-This function is used to add a service to the io_service.
+This function is used to execute an IO control command on the descriptor.
[heading Parameters]
@@ -23764,14 +43805,7 @@
[variablelist
-[[ios][The io\_service object that owns the service.]]
-
-[[svc][The service object. On success, ownership of the service object is transferred to the io\_service. When the io\_service object is destroyed, it will destroy the service object by performing:
-``
- delete static_cast<io_service::service*>(svc)
-
-``
-]]
+[[command][The IO control command to be performed on the descriptor.]]
]
@@ -23780,31 +43814,41 @@
[variablelist
-[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the io\_service.]]
-
-[[boost::asio::invalid_service_owner][Thrown if the service's owning io\_service is not the io\_service object specified by the ios parameter. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[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();
+
+
+
+
[endsect]
-[section:dispatch io_service::dispatch]
+[section:overload2 posix::basic_descriptor::io_control (2 of 2 overloads)]
-Request the io_service to invoke the given handler.
+Perform an IO control command on the descriptor.
template<
- typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
- void dispatch(
- CompletionHandler 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 ask the io_service to execute the given handler.
-The 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 execute an IO control command on the descriptor.
[heading Parameters]
@@ -23812,270 +43856,330 @@
[variablelist
-[[handler][The handler to be called. The io\_service will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
+[[command][The IO control command to be performed on the descriptor.]]
-``
-]]
+[[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();
+
+
+
+
[endsect]
+[endsect]
-[section:has_service io_service::has_service]
-Determine if an io_service contains a specified service type.
+[section:io_service posix::basic_descriptor::io_service]
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend bool has_service(
- io_service & ios);
+['Inherited from basic_io_object.]
-This function is used to determine whether the io_service contains a service object corresponding to the given service type.
+[indexterm2 io_service..posix::basic_descriptor] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-[heading Parameters]
-
-[variablelist
-
-[[ios][The io\_service object that owns the service.]]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-]
[heading Return Value]
-A boolean indicating whether the io_service contains the service.
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
[endsect]
-[section:io_service io_service::io_service]
-Constructor.
+[section:is_open posix::basic_descriptor::is_open]
- ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
+[indexterm2 is_open..posix::basic_descriptor] Determine whether the descriptor is open.
- ``[link boost_asio.reference.io_service.io_service.overload2 io_service]``(
- std::size_t concurrency_hint);
+ bool is_open() const;
-[section:overload1 io_service::io_service (1 of 2 overloads)]
-Constructor.
+[endsect]
- io_service();
+[section:lowest_layer posix::basic_descriptor::lowest_layer]
-[endsect]
+[indexterm2 lowest_layer..posix::basic_descriptor] Get a reference to the lowest layer.
+ lowest_layer_type & lowest_layer();
-[section:overload2 io_service::io_service (2 of 2 overloads)]
+This function returns a reference to the lowest layer in a stack of layers. Since a basic_descriptor cannot contain any further layers, it simply returns a reference to itself.
-Constructor.
- io_service(
- std::size_t concurrency_hint);
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
-Construct with a hint about the required level of concurrency.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
-]
+[section:lowest_layer_type posix::basic_descriptor::lowest_layer_type]
+[indexterm2 lowest_layer_type..posix::basic_descriptor] A basic_descriptor is always the lowest layer.
+ typedef basic_descriptor< DescriptorService > lowest_layer_type;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
-[section:poll io_service::poll]
+ [[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. ]
+
+ ]
-Run the io_service's event processing loop to execute ready handlers.
+ [
- std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
- std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
+
+ ]
-[section:overload1 io_service::poll (1 of 2 overloads)]
+ [
-Run the io_service's event processing loop to execute ready handlers.
+ [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
+
+ ]
- std::size_t poll();
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
-The poll() function runs handlers that are ready to run, without blocking, until the io_service has been stopped or there are no more ready handlers.
+ [
+ [[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 Return Value]
-
-The number of handlers that were executed.
+]
-[heading Exceptions]
-
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
+ ]
-[[boost::system::system_error][Thrown on failure. ]]
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
+ [Construct a basic_descriptor without opening it. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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]]
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+]
+The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
-[section:overload2 io_service::poll (2 of 2 overloads)]
-Run the io_service's event processing loop to execute ready handlers.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- std::size_t poll(
- boost::system::error_code & ec);
+[*Shared] [*objects:] Unsafe.
-The poll() function runs handlers that are ready to run, without blocking, until the io_service has been stopped or there are no more ready handlers.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Return Value]
-
-The number of handlers that were executed.
+[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]
-[section:poll_one io_service::poll_one]
-Run the io_service's event processing loop to execute one ready handler.
- std::size_t ``[link boost_asio.reference.io_service.poll_one.overload1 poll_one]``();
+[section:native_type posix::basic_descriptor::native_type]
- std::size_t ``[link boost_asio.reference.io_service.poll_one.overload2 poll_one]``(
- boost::system::error_code & ec);
+[indexterm2 native_type..posix::basic_descriptor] The native representation of a descriptor.
+ typedef DescriptorService::native_type native_type;
-[section:overload1 io_service::poll_one (1 of 2 overloads)]
-Run the io_service's event processing loop to execute one ready handler.
- std::size_t poll_one();
+[endsect]
-The poll\_one() function runs at most one handler that is ready to run, without blocking.
-[heading Return Value]
-
-The number of handlers that were executed.
+[section:non_blocking_io posix::basic_descriptor::non_blocking_io]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+['Inherited from posix::descriptor_base.]
-]
+[indexterm2 non_blocking_io..posix::basic_descriptor] IO control command to set the blocking mode of the descriptor.
+ typedef implementation_defined non_blocking_io;
-[endsect]
+Implements the FIONBIO IO control command.
-[section:overload2 io_service::poll_one (2 of 2 overloads)]
+[heading Example]
+
-Run the io_service's event processing loop to execute one ready handler.
- std::size_t poll_one(
- boost::system::error_code & ec);
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
-The poll\_one() function runs at most one handler that is ready to run, without blocking.
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[endsect]
-[heading Return Value]
-
-The number of handlers that were executed.
+[section:service posix::basic_descriptor::service]
-[endsect]
+['Inherited from basic_io_object.]
-[endsect]
+[indexterm2 service..posix::basic_descriptor] The service associated with the I/O object.
+ service_type & service;
-[section:post io_service::post]
-Request the io_service to invoke the given handler and return immediately.
- template<
- typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
- void post(
- CompletionHandler handler);
+[endsect]
-This function is used to ask the io_service to execute the given handler, but without allowing the io_service to call the handler from inside this function.
-The 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:service_type posix::basic_descriptor::service_type]
-[heading Parameters]
-
+['Inherited from basic_io_object.]
-[variablelist
-
-[[handler][The handler to be called. The io\_service will make a copy of the handler object as required. The function signature of the handler must be:
-``
- void handler();
+[indexterm2 service_type..posix::basic_descriptor] The type of the service that will be used to provide I/O operations.
-``
-]]
+ typedef DescriptorService service_type;
-]
@@ -24083,147 +44187,295 @@
-[section:reset io_service::reset]
+[section:_basic_descriptor posix::basic_descriptor::~basic_descriptor]
-Reset the io_service in preparation for a subsequent run() invocation.
+[indexterm2 ~basic_descriptor..posix::basic_descriptor] Protected destructor to prevent deletion through this type.
- void reset();
+ ~basic_descriptor();
-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.
-This function must not be called while there are any unfinished calls to the run(), run\_one(), poll() or poll\_one() functions.
+[endsect]
+
[endsect]
+[section:posix__basic_stream_descriptor posix::basic_stream_descriptor]
-[section:run io_service::run]
+Provides stream-oriented descriptor functionality.
-Run the io_service's event processing loop.
+ template<
+ typename ``[link boost_asio.reference.StreamDescriptorService StreamDescriptorService]`` = stream_descriptor_service>
+ class basic_stream_descriptor :
+ public posix::basic_descriptor< StreamDescriptorService >
- std::size_t ``[link boost_asio.reference.io_service.run.overload1 run]``();
- std::size_t ``[link boost_asio.reference.io_service.run.overload2 run]``(
- boost::system::error_code & ec);
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:overload1 io_service::run (1 of 2 overloads)]
+ [[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. ]
+
+ ]
-Run the io_service's event processing loop.
+ [
- std::size_t run();
+ [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-The run() function blocks until all work has finished and there are no more handlers to be dispatched, or until the io_service has been stopped.
+ [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
+
+ ]
-Multiple threads may call the run() function to set up a pool of threads from which the io_service may execute handlers. All threads that are 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().
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
+
+ ]
+ [
-[heading Return Value]
-
-The number of handlers that were executed.
+ [[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. ]
+
+ ]
-[heading Exceptions]
-
+ [
-[variablelist
+ [[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. ]
-[[boost::system::system_error][Thrown on failure. ]]
+ ]
+
+]
+
+[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+ [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[endsect]
+]
+The posix::basic_stream_descriptor class template provides asynchronous and blocking stream-oriented descriptor functionality.
-[section:overload2 io_service::run (2 of 2 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Run the io_service's event processing loop.
+[*Shared] [*objects:] Unsafe.
- std::size_t run(
- boost::system::error_code & ec);
+[section:assign posix::basic_stream_descriptor::assign]
-The run() function blocks until all work has finished and there are no more handlers to be dispatched, or until the io_service has been stopped.
+[indexterm2 assign..posix::basic_stream_descriptor] Assign an existing native descriptor to the descriptor.
-Multiple threads may call the run() function to set up a pool of threads from which the io_service may execute handlers. All threads that are waiting in the pool are equivalent and the io_service may choose any one of them to invoke a handler.
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 assign]``(
+ const native_type & native_descriptor);
-The run() function may be safely called again once it has completed only after a call to reset().
+ 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);
-[heading Parameters]
-
+[section:overload1 posix::basic_stream_descriptor::assign (1 of 2 overloads)]
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
+['Inherited from posix::basic_descriptor.]
-[heading Return Value]
-
-The number of handlers that were executed.
+Assign an existing native descriptor to the descriptor.
+
+ void assign(
+ const native_type & native_descriptor);
[endsect]
-[endsect]
-[section:run_one io_service::run_one]
+[section:overload2 posix::basic_stream_descriptor::assign (2 of 2 overloads)]
-Run the io_service's event processing loop to execute at most one handler.
- std::size_t ``[link boost_asio.reference.io_service.run_one.overload1 run_one]``();
+['Inherited from posix::basic_descriptor.]
- std::size_t ``[link boost_asio.reference.io_service.run_one.overload2 run_one]``(
+Assign an existing native descriptor to the descriptor.
+
+ boost::system::error_code assign(
+ const native_type & native_descriptor,
boost::system::error_code & ec);
-[section:overload1 io_service::run_one (1 of 2 overloads)]
-Run the io_service'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 io_service has been stopped.
+[section:async_read_some posix::basic_stream_descriptor::async_read_some]
-[heading Return Value]
-
-The number of handlers that were executed.
+[indexterm2 async_read_some..posix::basic_stream_descriptor] Start an asynchronous read.
-[heading Exceptions]
+ template<
+ 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 read data from the stream descriptor. The function call always returns immediately.
+
+
+[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 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:
+
+ 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:overload2 io_service::run_one (2 of 2 overloads)]
+[section:async_write_some posix::basic_stream_descriptor::async_write_some]
-Run the io_service's event processing loop to execute at most one handler.
+[indexterm2 async_write_some..posix::basic_stream_descriptor] Start an asynchronous write.
- std::size_t run_one(
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
-The run\_one() function blocks until one handler has been dispatched, or until the io_service has been stopped.
+This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
[heading Parameters]
@@ -24231,47 +44483,61 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[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 Return Value]
+[heading Remarks]
-The number of handlers that were executed.
-
-
+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.
-[endsect]
+[heading Example]
+
+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);
-[endsect]
+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:stop io_service::stop]
-Stop the io_service's event processing loop.
- void stop();
+[endsect]
-This function does not block, but instead simply signals the 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.
+[section:basic_stream_descriptor posix::basic_stream_descriptor::basic_stream_descriptor]
+[indexterm2 basic_stream_descriptor..posix::basic_stream_descriptor] Construct a basic_stream_descriptor without opening it.
-[endsect]
+ ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 basic_stream_descriptor]``(
+ boost::asio::io_service & io_service);
+ ``[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);
-[section:use_service io_service::use_service]
+[section:overload1 posix::basic_stream_descriptor::basic_stream_descriptor (1 of 2 overloads)]
-Obtain the service object corresponding to the given type.
+Construct a basic_stream_descriptor without opening it.
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- friend Service & use_service(
- io_service & ios);
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service);
-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 io_service will create a new instance of the 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]
@@ -24279,31 +44545,26 @@
[variablelist
-[[ios][The io\_service object that owns the service.]]
+[[io_service][The io\_service object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
]
-[heading Return Value]
-
-The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
-
[endsect]
-[section:wrap io_service::wrap]
+[section:overload2 posix::basic_stream_descriptor::basic_stream_descriptor (2 of 2 overloads)]
-Create a new handler that automatically dispatches the wrapped handler on the io_service.
+Construct a basic_stream_descriptor on an existing native descriptor.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- unspecified wrap(
- Handler handler);
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service,
+ const native_type & native_descriptor);
-This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the io\_service's dispatch function.
+This constructor creates a stream descriptor object to hold an existing native descriptor.
[heading Parameters]
@@ -24311,218 +44572,179 @@
[variablelist
-[[handler][The handler to be wrapped. The 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);
+[[io_service][The 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 Return Value]
-
-A function object that, when invoked, passes the wrapped handler to the io\_service's dispatch function. Given a function object with the signature:
+[heading Exceptions]
+
- R f(A1 a1, ... An an);
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-If this function object is passed to the wrap function like so:
- io_service.wrap(f);
+[endsect]
-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:
+[section:bytes_readable posix::basic_stream_descriptor::bytes_readable]
- io_service.dispatch(boost::bind(f, a1, ... an));
+['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;
-[endsect]
+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();
-[section:_io_service io_service::~io_service]
-Destructor.
- ~io_service();
[endsect]
+[section:cancel posix::basic_stream_descriptor::cancel]
-[endsect]
+[indexterm2 cancel..posix::basic_stream_descriptor] Cancel all asynchronous operations associated with the descriptor.
-[section:io_service__id io_service::id]
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 cancel]``();
-Class used to uniquely identify a service.
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
- class id :
- noncopyable
+[section:overload1 posix::basic_stream_descriptor::cancel (1 of 2 overloads)]
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.io_service__id.id [*id]]]
- [Constructor. ]
- ]
-
-]
+['Inherited from posix::basic_descriptor.]
+Cancel all asynchronous operations associated with the descriptor.
-[section:id io_service::id::id]
+ void cancel();
-Constructor.
- id();
+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. ]]
+
+]
[endsect]
-[section:io_service__service io_service::service]
-Base class for all io_service services.
- class service :
- noncopyable
+[section:overload2 posix::basic_stream_descriptor::cancel (2 of 2 overloads)]
-[heading Member Functions]
-[table
- [[Name][Description]]
+['Inherited from posix::basic_descriptor.]
- [
- [[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. ]
- ]
-
-]
+Cancel all asynchronous operations associated with the descriptor.
+
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-[section:get_io_service io_service::service::get_io_service]
+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.
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
[endsect]
+[endsect]
-[section:io_service io_service::service::io_service]
+[section:close posix::basic_stream_descriptor::close]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[indexterm2 close..posix::basic_stream_descriptor] Close the descriptor.
- boost::asio::io_service & io_service();
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 close]``();
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 close]``(
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 posix::basic_stream_descriptor::close (1 of 2 overloads)]
+['Inherited from posix::basic_descriptor.]
-[endsect]
+Close the descriptor.
-[section:io_service__strand io_service::strand]
+ void close();
-Provides serialised handler execution.
- class strand
+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 Member Functions]
-[table
- [[Name][Description]]
+[heading Exceptions]
+
- [
- [[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. ]
- ]
+[variablelist
-]
+[[boost::system::system_error][Thrown on failure. ]]
-The 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]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Safe.
+[endsect]
-[section:dispatch io_service::strand::dispatch]
+[section:overload2 posix::basic_stream_descriptor::close (2 of 2 overloads)]
-Request the strand to invoke the given handler.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void dispatch(
- Handler handler);
+['Inherited from posix::basic_descriptor.]
+Close the descriptor.
-This function is used to ask the strand to execute the given handler.
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-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.
-The strand's guarantee is in addition to the guarantee provided by the underlying io_service. The 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.
+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]
@@ -24530,12 +44752,7 @@
[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();
-
-``
-]]
+[[ec][Set to indicate what error occurred, if any. ]]
]
@@ -24544,20 +44761,25 @@
[endsect]
+[endsect]
+
+
+[section:get_io_service posix::basic_stream_descriptor::get_io_service]
-[section:get_io_service io_service::strand::get_io_service]
-Get the io_service associated with the strand.
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..posix::basic_stream_descriptor] Get the io_service associated with the object.
boost::asio::io_service & get_io_service();
-This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
[heading Return Value]
-A reference to the io_service object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -24565,19 +44787,14 @@
-[section:io_service io_service::strand::io_service]
-
-(Deprecated: use get_io_service().) Get the io_service associated with the strand.
-
- boost::asio::io_service & io_service();
+[section:implementation posix::basic_stream_descriptor::implementation]
-This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
+['Inherited from basic_io_object.]
+[indexterm2 implementation..posix::basic_stream_descriptor] The underlying implementation of the I/O object.
-[heading Return Value]
-
-A reference to the io_service object that the strand will use to dispatch handlers. Ownership is not transferred to the caller.
+ implementation_type implementation;
@@ -24585,50 +44802,45 @@
-[section:post io_service::strand::post]
+[section:implementation_type posix::basic_stream_descriptor::implementation_type]
-Request the strand to invoke the given handler and return immediately.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void post(
- Handler handler);
+['Inherited from basic_io_object.]
+[indexterm2 implementation_type..posix::basic_stream_descriptor] The underlying implementation type of I/O object.
-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.
+ typedef service_type::implementation_type implementation_type;
-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 io_service. The 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 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();
+[endsect]
-``
-]]
-]
+[section:io_control posix::basic_stream_descriptor::io_control]
+
+[indexterm2 io_control..posix::basic_stream_descriptor] Perform an IO control command on the descriptor.
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 io_control]``(
+ IoControlCommand & command);
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 io_control]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 posix::basic_stream_descriptor::io_control (1 of 2 overloads)]
-[section:strand io_service::strand::strand]
+['Inherited from posix::basic_descriptor.]
-Constructor.
+Perform an IO control command on the descriptor.
- strand(
- boost::asio::io_service & io_service);
+ void io_control(
+ IoControlCommand & command);
-Constructs the strand.
+This function is used to execute an IO control command on the descriptor.
[heading Parameters]
@@ -24636,134 +44848,106 @@
[variablelist
-[[io_service][The io\_service object that the strand will use to dispatch handlers that are ready to be run. ]]
+[[command][The IO control command to be performed on the descriptor.]]
]
-
-
-[endsect]
-
-
-
-[section:wrap io_service::strand::wrap]
-
-Create a new handler that automatically dispatches the wrapped handler on the strand.
-
- 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 strand's dispatch function.
-
-
-[heading Parameters]
+[heading Exceptions]
[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);
-
-``
-]]
+[[boost::system::system_error][Thrown on failure.]]
]
-[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:
+[heading Example]
+
+Getting the number of bytes ready to read:
- R f(A1 a1, ... An an);
+ 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();
-If this function object is passed to the wrap function like so:
- strand.wrap(f);
-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:overload2 posix::basic_stream_descriptor::io_control (2 of 2 overloads)]
+['Inherited from posix::basic_descriptor.]
+Perform an IO control command on the descriptor.
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
-[endsect]
+This function is used to execute an IO control command on the descriptor.
+[heading Parameters]
+
-[section:_strand io_service::strand::~strand]
+[variablelist
+
+[[command][The IO control command to be performed on the descriptor.]]
-Destructor.
+[[ec][Set to indicate what error occurred, if any.]]
- ~strand();
+]
+[heading Example]
+
+Getting the number of bytes ready to read:
-Destroys a strand.
+ 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();
-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:io_service__work io_service::work]
-Class to inform the io_service when it has work to do.
+[endsect]
- class work
+[section:io_service posix::basic_stream_descriptor::io_service]
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[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. ]
- ]
-
- [
- [[link boost_asio.reference.io_service__work._work [*~work]]]
- [Destructor notifies the io_service that the work is complete. ]
- ]
-
-]
+['Inherited from basic_io_object.]
-The work class is used to inform the io_service when work starts and finishes. This ensures that the io\_service's run() function will not exit while work is underway, and that it does exit when there is no unfinished work remaining.
+[indexterm2 io_service..posix::basic_stream_descriptor] (Deprecated: use get_io_service().) Get the io_service associated with the object.
-The work class is copy-constructible so that it may be used as a data member in a handler class. It is not assignable.
+ boost::asio::io_service & io_service();
-[section:get_io_service io_service::work::get_io_service]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-Get the io_service associated with the work.
- boost::asio::io_service & get_io_service();
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -24771,152 +44955,186 @@
-[section:io_service io_service::work::io_service]
-
-(Deprecated: use get_io_service().) Get the io_service associated with the work.
+[section:is_open posix::basic_stream_descriptor::is_open]
- boost::asio::io_service & io_service();
+['Inherited from posix::basic_descriptor.]
+[indexterm2 is_open..posix::basic_stream_descriptor] Determine whether the descriptor is open.
-[endsect]
+ bool is_open() const;
-[section:work io_service::work::work]
-Constructor notifies the io_service that work is starting.
+[endsect]
- ``[link boost_asio.reference.io_service__work.work.overload1 work]``(
- boost::asio::io_service & io_service);
- ``[link boost_asio.reference.io_service__work.work.overload2 work]``(
- const work & other);
+[section:lowest_layer posix::basic_stream_descriptor::lowest_layer]
-[section:overload1 io_service::work::work (1 of 2 overloads)]
-Constructor notifies the io_service that work is starting.
+['Inherited from posix::basic_descriptor.]
- work(
- boost::asio::io_service & io_service);
+[indexterm2 lowest_layer..posix::basic_stream_descriptor] Get a reference to the lowest layer.
+ lowest_layer_type & lowest_layer();
-The constructor is used to inform the io_service that some work has begun. This ensures that the io\_service's run() function will not exit while the work is underway.
+This function returns a reference to the lowest layer in a stack of layers. Since a basic_descriptor 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:overload2 io_service::work::work (2 of 2 overloads)]
-Copy constructor notifies the io_service that work is starting.
+[endsect]
- work(
- const work & other);
-The constructor is used to inform the io_service that some work has begun. This ensures that the io\_service's run() function will not exit while the work is underway.
+[section:lowest_layer_type posix::basic_stream_descriptor::lowest_layer_type]
-[endsect]
+['Inherited from posix::basic_descriptor.]
+[indexterm2 lowest_layer_type..posix::basic_stream_descriptor] A basic_descriptor is always the lowest layer.
-[endsect]
+ typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
-[section:_work io_service::work::~work]
+[heading Types]
+[table
+ [[Name][Description]]
-Destructor notifies the io_service that the work is complete.
+ [
- ~work();
+ [[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. ]
+
+ ]
+ [
-The destructor is used to inform the io_service that some work has finished. Once the count of unfinished work reaches zero, the io\_service's run() function is permitted to exit.
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[endsect]
+ [[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.posix__basic_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
+
+ ]
-[endsect]
+ [
-[section:ip__address ip::address]
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
-Implements version-independent IP addresses.
+ [
- class address
+ [[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.ip__address.address [*address]]]
- [Default constructor. ]
+ [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
]
[
- [[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.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
+ [Construct a basic_descriptor without opening it. ]
]
[
- [[link boost_asio.reference.ip__address.is_v4 [*is_v4]]]
- [Get whether the address is an IP version 4 address. ]
+ [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address.is_v6 [*is_v6]]]
- [Get whether the address is an IP version 6 address. ]
+ [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
+ [Close the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address.operator_eq_ [*operator=]]]
- [Assign from another address. ]
+ [[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.ip__address.to_string [*to_string]]]
- [Get the address as a string in dotted decimal format. ]
+ [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address.to_v4 [*to_v4]]]
- [Get the address as an IP version 4 address. ]
+ [[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.ip__address.to_v6 [*to_v6]]]
- [Get the address as an IP version 6 address. ]
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
+ [Get the native descriptor representation. ]
]
]
-[heading Friends]
+[heading Protected Member Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address.operator_not__eq_ [*operator!=]]]
- [Compare two addresses for inequality. ]
+ [[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.ip__address.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ip__address.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
+ [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
]
-
+
]
-The
-[link boost_asio.reference.ip__address ip::address] class provides the ability to use either IP version 4 or version 6 addresses.
+The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
[heading Thread Safety]
@@ -24926,283 +45144,397 @@
[*Shared] [*objects:] Unsafe.
-[section:address ip::address::address]
-Default constructor.
- ``[link boost_asio.reference.ip__address.address.overload1 address]``();
+[endsect]
- ``[link boost_asio.reference.ip__address.address.overload2 address]``(
- const boost::asio::ip::address_v4 & ipv4_address);
- ``[link boost_asio.reference.ip__address.address.overload3 address]``(
- const boost::asio::ip::address_v6 & ipv6_address);
- ``[link boost_asio.reference.ip__address.address.overload4 address]``(
- const address & other);
+[section:native posix::basic_stream_descriptor::native]
-[section:overload1 ip::address::address (1 of 4 overloads)]
+['Inherited from posix::basic_descriptor.]
-Default constructor.
+[indexterm2 native..posix::basic_stream_descriptor] Get the native descriptor representation.
- address();
+ 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_type posix::basic_stream_descriptor::native_type]
+
+[indexterm2 native_type..posix::basic_stream_descriptor] The native representation of a descriptor.
+
+ typedef StreamDescriptorService::native_type native_type;
+
+
+
+
+[endsect]
+
+
+
+[section:non_blocking_io posix::basic_stream_descriptor::non_blocking_io]
+
+
+['Inherited from posix::descriptor_base.]
+
+[indexterm2 non_blocking_io..posix::basic_stream_descriptor] 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);
-[endsect]
-[section:overload2 ip::address::address (2 of 4 overloads)]
+[endsect]
-Construct an address from an IPv4 address.
- address(
- const boost::asio::ip::address_v4 & ipv4_address);
+[section:read_some posix::basic_stream_descriptor::read_some]
+[indexterm2 read_some..posix::basic_stream_descriptor] Read some data from the descriptor.
+ 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);
-[endsect]
+ 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 & ec);
+[section:overload1 posix::basic_stream_descriptor::read_some (1 of 2 overloads)]
-[section:overload3 ip::address::address (3 of 4 overloads)]
+Read some data from the descriptor.
-Construct an address from an IPv6 address.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
- address(
- const boost::asio::ip::address_v6 & ipv6_address);
+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:overload4 ip::address::address (4 of 4 overloads)]
+[heading Return Value]
+
+The number of bytes read.
-Copy constructor.
+[heading Exceptions]
+
- address(
- const address & other);
+[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 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));
-[endsect]
-[section:from_string ip::address::from_string]
+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.
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
- const char * str);
- static address ``[link boost_asio.reference.ip__address.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
+[endsect]
- static address ``[link boost_asio.reference.ip__address.from_string.overload3 from_string]``(
- const std::string & str);
- static address ``[link boost_asio.reference.ip__address.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
+[section:overload2 posix::basic_stream_descriptor::read_some (2 of 2 overloads)]
-[section:overload1 ip::address::from_string (1 of 4 overloads)]
+Read some data from the descriptor.
-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 read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
- static address from_string(
- const char * str);
+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.]]
+[[ec][Set to indicate what error occurred, if any.]]
-[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 Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
- static address from_string(
- const char * str,
- 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]
+[endsect]
-[section:overload3 ip::address::from_string (3 of 4 overloads)]
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+[section:service posix::basic_stream_descriptor::service]
- static address from_string(
- const std::string & str);
+['Inherited from basic_io_object.]
+[indexterm2 service..posix::basic_stream_descriptor] The service associated with the I/O object.
-[endsect]
+ service_type & service;
-[section:overload4 ip::address::from_string (4 of 4 overloads)]
+[endsect]
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address from_string(
- const std::string & str,
- boost::system::error_code & ec);
+[section:service_type posix::basic_stream_descriptor::service_type]
-[endsect]
+['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.
-[endsect]
+ typedef StreamDescriptorService service_type;
-[section:is_v4 ip::address::is_v4]
-Get whether the address is an IP version 4 address.
- bool is_v4() const;
+[endsect]
+[section:write_some posix::basic_stream_descriptor::write_some]
-[endsect]
+[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);
+ 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);
-[section:is_v6 ip::address::is_v6]
-Get whether the address is an IP version 6 address.
+[section:overload1 posix::basic_stream_descriptor::write_some (1 of 2 overloads)]
- bool is_v6() const;
+Write some data to the descriptor.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-[endsect]
+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]
+
-[section:operator_not__eq_ ip::address::operator!=]
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor.]]
-Compare two addresses for inequality.
+]
- friend bool operator!=(
- const address & a1,
- const address & a2);
+[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.]]
-[endsect]
+]
+[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:
-[section:operator_lt_ ip::address::operator<]
+ descriptor.write_some(boost::asio::buffer(data, size));
-Compare addresses for ordering.
- friend bool operator<(
- const address & a1,
- const address & a2);
+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:operator_eq_ ip::address::operator=]
-Assign from another address.
+[section:overload2 posix::basic_stream_descriptor::write_some (2 of 2 overloads)]
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload1 operator=]``(
- const address & other);
+Write some data to the descriptor.
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload2 operator=]``(
- const boost::asio::ip::address_v4 & ipv4_address);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload3 operator=]``(
- const boost::asio::ip::address_v6 & ipv6_address);
+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.
-[section:overload1 ip::address::operator= (1 of 3 overloads)]
-Assign from another address.
+[heading Parameters]
+
- address & operator=(
- const address & other);
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor.]]
+[[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:overload2 ip::address::operator= (2 of 3 overloads)]
-Assign from an IPv4 address.
+[endsect]
- address & operator=(
- const boost::asio::ip::address_v4 & ipv4_address);
+[endsect]
[endsect]
+[section:posix__descriptor_base posix::descriptor_base]
+The descriptor_base class is used as a base for the basic_stream_descriptor class template so that we have a common place to define the associated IO control commands.
-[section:overload3 ip::address::operator= (3 of 3 overloads)]
+ class descriptor_base
-Assign from an IPv6 address.
- address & operator=(
- const boost::asio::ip::address_v6 & ipv6_address);
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[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. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
-[endsect]
+]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
-[section:operator_eq__eq_ ip::address::operator==]
+ [
+ [[link boost_asio.reference.posix__descriptor_base._descriptor_base [*~descriptor_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
-Compare two addresses for equality.
- friend bool operator==(
- const address & a1,
- const address & a2);
+[section:bytes_readable posix::descriptor_base::bytes_readable]
+[indexterm2 bytes_readable..posix::descriptor_base] IO control command to get the amount of data that can be read without blocking.
+ typedef implementation_defined bytes_readable;
-[endsect]
-[section:to_string ip::address::to_string]
+Implements the FIONREAD IO control command.
-Get the address as a string in dotted decimal format.
- std::string ``[link boost_asio.reference.ip__address.to_string.overload1 to_string]``() const;
+[heading Example]
+
- std::string ``[link boost_asio.reference.ip__address.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
+ 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:overload1 ip::address::to_string (1 of 2 overloads)]
-Get the address as a string in dotted decimal format.
- std::string to_string() const;
@@ -25210,26 +45542,28 @@
-[section:overload2 ip::address::to_string (2 of 2 overloads)]
+[section:non_blocking_io posix::descriptor_base::non_blocking_io]
-Get the address as a string in dotted decimal format.
+[indexterm2 non_blocking_io..posix::descriptor_base] IO control command to set the blocking mode of the descriptor.
- std::string to_string(
- boost::system::error_code & ec) const;
+ typedef implementation_defined non_blocking_io;
-[endsect]
+Implements the FIONBIO IO control command.
-[endsect]
+[heading Example]
+
-[section:to_v4 ip::address::to_v4]
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
+
-Get the address as an IP version 4 address.
- boost::asio::ip::address_v4 to_v4() const;
@@ -25237,11 +45571,11 @@
-[section:to_v6 ip::address::to_v6]
+[section:_descriptor_base posix::descriptor_base::~descriptor_base]
-Get the address as an IP version 6 address.
+[indexterm2 ~descriptor_base..posix::descriptor_base] Protected destructor to prevent deletion through this type.
- boost::asio::ip::address_v6 to_v6() const;
+ ~descriptor_base();
@@ -25251,11 +45585,12 @@
[endsect]
-[section:ip__address_v4 ip::address_v4]
-Implements IP version 4 style addresses.
+[section:posix__stream_descriptor posix::stream_descriptor]
- class address_v4
+[indexterm1 posix::stream_descriptor] Typedef for the typical usage of a stream-oriented descriptor.
+
+ typedef basic_stream_descriptor stream_descriptor;
[heading Types]
@@ -25264,8 +45599,43 @@
[
- [[link boost_asio.reference.ip__address_v4.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
+ [[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.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[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.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. ]
+
+ ]
+
+ [
+
+ [[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. ]
]
@@ -25276,280 +45646,260 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address_v4.address_v4 [*address_v4]]]
- [Default constructor. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address_v4.any [*any]]]
- [Obtain an address object that represents any address. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.ip__address_v4.broadcast [*broadcast]]]
- [Obtain an address object that represents the broadcast address. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[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.posix__basic_stream_descriptor.basic_stream_descriptor [*basic_stream_descriptor]]]
+ [Construct a basic_stream_descriptor without opening it. ]
]
[
- [[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.posix__basic_stream_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
]
[
- [[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.posix__basic_stream_descriptor.close [*close]]]
+ [Close the descriptor. ]
]
[
- [[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.posix__basic_stream_descriptor.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.ip__address_v4.is_multicast [*is_multicast]]]
- [Determine whether the address is a multicast address. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address_v4.loopback [*loopback]]]
- [Obtain an address object that represents the loopback address. ]
+ [[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.ip__address_v4.netmask [*netmask]]]
- [Obtain the netmask that corresponds to the address, based on its address class. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
]
[
- [[link boost_asio.reference.ip__address_v4.operator_eq_ [*operator=]]]
- [Assign from another address. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.ip__address_v4.to_bytes [*to_bytes]]]
- [Get the address in bytes. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native [*native]]]
+ [Get the native descriptor representation. ]
]
[
- [[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.posix__basic_stream_descriptor.read_some [*read_some]]]
+ [Read some data from the descriptor. ]
]
[
- [[link boost_asio.reference.ip__address_v4.to_ulong [*to_ulong]]]
- [Get the address as an unsigned long in host byte order. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]]
+ [Write some data to the descriptor. ]
]
]
-[heading Friends]
+[heading Protected Data Members]
[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.posix__basic_stream_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ip__address_v4.operator_gt__eq_ [*operator>=]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
]
-
+
]
-The
-[link boost_asio.reference.ip__address_v4 ip::address_v4] class provides the ability to use and manipulate IP version 4 addresses.
+The posix::basic_stream_descriptor class template provides asynchronous and blocking stream-oriented descriptor functionality.
[heading Thread Safety]
[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
-
-
-[section:address_v4 ip::address_v4::address_v4]
-
-Default constructor.
-
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload1 address_v4]``();
-
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload2 address_v4]``(
- const bytes_type & bytes);
-
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload3 address_v4]``(
- unsigned long addr);
-
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
- const address_v4 & other);
-
-
-[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]
-
-Obtain an address object that represents any address.
+[*Shared] [*objects:] Unsafe.
- static address_v4 any();
[endsect]
-[section:broadcast ip::address_v4::broadcast]
-
-Obtain an address object that represents the broadcast address.
-
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload1 broadcast]``();
-
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload2 broadcast]``(
- const address_v4 & addr,
- const address_v4 & mask);
-
-
-[section:overload1 ip::address_v4::broadcast (1 of 2 overloads)]
-
-Obtain an address object that represents the broadcast address.
-
- static address_v4 broadcast();
+[section:posix__stream_descriptor_service posix::stream_descriptor_service]
+Default service implementation for a stream descriptor.
+ class stream_descriptor_service :
+ public io_service::service
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:overload2 ip::address_v4::broadcast (2 of 2 overloads)]
+ [[link boost_asio.reference.posix__stream_descriptor_service.implementation_type [*implementation_type]]]
+ [The type of a stream descriptor implementation. ]
+
+ ]
-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);
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_type [*native_type]]]
+ [The native descriptor type. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[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. ]
+ ]
+
+]
+[heading Data Members]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+]
-[section:bytes_type ip::address_v4::bytes_type]
-The type used to represent an address as an array of bytes.
+[section:assign posix::stream_descriptor_service::assign]
- typedef boost::array< unsigned char, 4 > bytes_type;
+[indexterm2 assign..posix::stream_descriptor_service] 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);
[endsect]
-[section:from_string ip::address_v4::from_string]
-
-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);
-
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
-
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload3 from_string]``(
- const std::string & str);
-
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
-
-[section:overload1 ip::address_v4::from_string (1 of 4 overloads)]
+[section:async_read_some posix::stream_descriptor_service::async_read_some]
-Create an address from an IP address string in dotted decimal form.
+[indexterm2 async_read_some..posix::stream_descriptor_service] Start an asynchronous read.
- static address_v4 from_string(
- const char * str);
+ 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 descriptorr);
@@ -25557,13 +45907,17 @@
-[section:overload2 ip::address_v4::from_string (2 of 4 overloads)]
+[section:async_write_some posix::stream_descriptor_service::async_write_some]
-Create an address from an IP address string in dotted decimal form.
+[indexterm2 async_write_some..posix::stream_descriptor_service] Start an asynchronous write.
- static address_v4 from_string(
- const char * str,
- boost::system::error_code & ec);
+ 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 descriptorr);
@@ -25571,12 +45925,13 @@
-[section:overload3 ip::address_v4::from_string (3 of 4 overloads)]
+[section:cancel posix::stream_descriptor_service::cancel]
-Create an address from an IP address string in dotted decimal form.
+[indexterm2 cancel..posix::stream_descriptor_service] Cancel all asynchronous operations associated with the descriptor.
- static address_v4 from_string(
- const std::string & str);
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -25584,12 +45939,12 @@
-[section:overload4 ip::address_v4::from_string (4 of 4 overloads)]
+[section:close posix::stream_descriptor_service::close]
-Create an address from an IP address string in dotted decimal form.
+[indexterm2 close..posix::stream_descriptor_service] Close a stream descriptor implementation.
- static address_v4 from_string(
- const std::string & str,
+ boost::system::error_code close(
+ implementation_type & impl,
boost::system::error_code & ec);
@@ -25597,14 +45952,13 @@
[endsect]
-[endsect]
-
-[section:is_class_a ip::address_v4::is_class_a]
+[section:construct posix::stream_descriptor_service::construct]
-Determine whether the address is a class A address.
+[indexterm2 construct..posix::stream_descriptor_service] Construct a new stream descriptor implementation.
- bool is_class_a() const;
+ void construct(
+ implementation_type & impl);
@@ -25612,11 +45966,12 @@
-[section:is_class_b ip::address_v4::is_class_b]
+[section:destroy posix::stream_descriptor_service::destroy]
-Determine whether the address is a class B address.
+[indexterm2 destroy..posix::stream_descriptor_service] Destroy a stream descriptor implementation.
- bool is_class_b() const;
+ void destroy(
+ implementation_type & impl);
@@ -25624,23 +45979,14 @@
-[section:is_class_c ip::address_v4::is_class_c]
-
-Determine whether the address is a class C address.
-
- bool is_class_c() const;
-
-
-
-[endsect]
+[section:get_io_service posix::stream_descriptor_service::get_io_service]
+['Inherited from io_service.]
-[section:is_multicast ip::address_v4::is_multicast]
-
-Determine whether the address is a multicast address.
+[indexterm2 get_io_service..posix::stream_descriptor_service] Get the io_service object that owns the service.
- bool is_multicast() const;
+ boost::asio::io_service & get_io_service();
@@ -25648,11 +45994,11 @@
-[section:loopback ip::address_v4::loopback]
+[section:id posix::stream_descriptor_service::id]
-Obtain an address object that represents the loopback address.
+[indexterm2 id..posix::stream_descriptor_service] The unique service identifier.
- static address_v4 loopback();
+ static boost::asio::io_service::id id;
@@ -25660,12 +46006,12 @@
-[section:netmask ip::address_v4::netmask]
+[section:implementation_type posix::stream_descriptor_service::implementation_type]
-Obtain the netmask that corresponds to the address, based on its address class.
+[indexterm2 implementation_type..posix::stream_descriptor_service] The type of a stream descriptor implementation.
+
+ typedef implementation_defined implementation_type;
- static address_v4 netmask(
- const address_v4 & addr);
@@ -25673,13 +46019,16 @@
-[section:operator_not__eq_ ip::address_v4::operator!=]
+[section:io_control posix::stream_descriptor_service::io_control]
-Compare two addresses for inequality.
+[indexterm2 io_control..posix::stream_descriptor_service] Perform an IO control command on the descriptor.
- friend bool operator!=(
- const address_v4 & a1,
- const address_v4 & a2);
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
+ boost::system::error_code & ec);
@@ -25687,27 +46036,14 @@
-[section:operator_lt_ ip::address_v4::operator<]
-
-Compare addresses for ordering.
-
- friend bool operator<(
- const address_v4 & a1,
- const address_v4 & a2);
-
-
-
-[endsect]
-
+[section:io_service posix::stream_descriptor_service::io_service]
-[section:operator_lt__eq_ ip::address_v4::operator<=]
+['Inherited from io_service.]
-Compare addresses for ordering.
+[indexterm2 io_service..posix::stream_descriptor_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
- friend bool operator<=(
- const address_v4 & a1,
- const address_v4 & a2);
+ boost::asio::io_service & io_service();
@@ -25715,12 +46051,12 @@
-[section:operator_eq_ ip::address_v4::operator=]
+[section:is_open posix::stream_descriptor_service::is_open]
-Assign from another address.
+[indexterm2 is_open..posix::stream_descriptor_service] Determine whether the descriptor is open.
- address_v4 & operator=(
- const address_v4 & other);
+ bool is_open(
+ const implementation_type & impl) const;
@@ -25728,13 +46064,12 @@
-[section:operator_eq__eq_ ip::address_v4::operator==]
+[section:native posix::stream_descriptor_service::native]
-Compare two addresses for equality.
+[indexterm2 native..posix::stream_descriptor_service] Get the native descriptor implementation.
- friend bool operator==(
- const address_v4 & a1,
- const address_v4 & a2);
+ native_type native(
+ implementation_type & impl);
@@ -25742,13 +46077,12 @@
-[section:operator_gt_ ip::address_v4::operator>]
+[section:native_type posix::stream_descriptor_service::native_type]
-Compare addresses for ordering.
+[indexterm2 native_type..posix::stream_descriptor_service] The native descriptor type.
+
+ typedef implementation_defined native_type;
- friend bool operator>(
- const address_v4 & a1,
- const address_v4 & a2);
@@ -25756,13 +46090,16 @@
-[section:operator_gt__eq_ ip::address_v4::operator>=]
+[section:read_some posix::stream_descriptor_service::read_some]
-Compare addresses for ordering.
+[indexterm2 read_some..posix::stream_descriptor_service] Read some data from the stream.
- friend bool operator>=(
- const address_v4 & a1,
- const address_v4 & a2);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
@@ -25770,32 +46107,24 @@
-[section:to_bytes ip::address_v4::to_bytes]
+[section:shutdown_service posix::stream_descriptor_service::shutdown_service]
-Get the address in bytes.
+[indexterm2 shutdown_service..posix::stream_descriptor_service] Destroy all user-defined descriptorr objects owned by the service.
- bytes_type to_bytes() const;
+ void shutdown_service();
[endsect]
-[section:to_string ip::address_v4::to_string]
-
-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;
-
- std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
-
-[section:overload1 ip::address_v4::to_string (1 of 2 overloads)]
+[section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service]
-Get the address as a string in dotted decimal format.
+[indexterm2 stream_descriptor_service..posix::stream_descriptor_service] Construct a new stream descriptor service for the specified io_service.
- std::string to_string() const;
+ stream_descriptor_service(
+ boost::asio::io_service & io_service);
@@ -25803,50 +46132,64 @@
-[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;
+[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:to_ulong ip::address_v4::to_ulong]
-
-Get the address as an unsigned long in host byte order.
- unsigned long to_ulong() const;
+[endsect]
+[section:raw_socket_service raw_socket_service]
+Default service implementation for a raw socket.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class raw_socket_service :
+ public io_service::service
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
-[section:ip__address_v6 ip::address_v6]
+ [[link boost_asio.reference.raw_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-Implements IP version 6 style addresses.
+ [
- class address_v6
+ [[link boost_asio.reference.raw_socket_service.implementation_type [*implementation_type]]]
+ [The type of a raw socket. ]
+
+ ]
+ [
-[heading Types]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.raw_socket_service.native_type [*native_type]]]
+ [The native socket type. ]
+
+ ]
[
- [[link boost_asio.reference.ip__address_v6.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
+ [[link boost_asio.reference.raw_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
]
@@ -25857,364 +46200,183 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address_v6.address_v6 [*address_v6]]]
- [Default constructor. ]
+ [[link boost_asio.reference.raw_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a raw socket. ]
]
[
- [[link boost_asio.reference.ip__address_v6.any [*any]]]
- [Obtain an address object that represents any address. ]
+ [[link boost_asio.reference.raw_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
[
- [[link boost_asio.reference.ip__address_v6.from_string [*from_string]]]
- [Create an address from an IP address string. ]
+ [[link boost_asio.reference.raw_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.ip__address_v6.is_link_local [*is_link_local]]]
- [Determine whether the address is link local. ]
+ [[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.ip__address_v6.is_loopback [*is_loopback]]]
- [Determine whether the address is a loopback address. ]
+ [[link boost_asio.reference.raw_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.ip__address_v6.is_multicast [*is_multicast]]]
- [Determine whether the address is a multicast address. ]
+ [[link boost_asio.reference.raw_socket_service.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
]
[
- [[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.raw_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
]
[
- [[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.raw_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
]
[
- [[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.raw_socket_service.bind [*bind]]]
+ []
]
[
- [[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.raw_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
]
[
- [[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.raw_socket_service.close [*close]]]
+ [Close a raw socket implementation. ]
]
[
- [[link boost_asio.reference.ip__address_v6.is_site_local [*is_site_local]]]
- [Determine whether the address is site local. ]
+ [[link boost_asio.reference.raw_socket_service.connect [*connect]]]
+ [Connect the raw socket to the specified endpoint. ]
]
[
- [[link boost_asio.reference.ip__address_v6.is_unspecified [*is_unspecified]]]
- [Determine whether the address is unspecified. ]
+ [[link boost_asio.reference.raw_socket_service.construct [*construct]]]
+ [Construct a new raw socket implementation. ]
]
[
- [[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.raw_socket_service.destroy [*destroy]]]
+ [Destroy a raw socket implementation. ]
]
[
- [[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.raw_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.ip__address_v6.loopback [*loopback]]]
- [Obtain an address object that represents the loopback address. ]
+ [[link boost_asio.reference.raw_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_eq_ [*operator=]]]
- [Assign from another address. ]
+ [[link boost_asio.reference.raw_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
]
[
- [[link boost_asio.reference.ip__address_v6.scope_id [*scope_id]]]
- [The scope ID of the address. ]
+ [[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.ip__address_v6.to_bytes [*to_bytes]]]
- [Get the address in bytes. ]
+ [[link boost_asio.reference.raw_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
]
[
- [[link boost_asio.reference.ip__address_v6.to_string [*to_string]]]
- [Get the address as a string. ]
+ [[link boost_asio.reference.raw_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
]
[
- [[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.raw_socket_service.native [*native]]]
+ [Get the native socket implementation. ]
]
[
- [[link boost_asio.reference.ip__address_v6.v4_compatible [*v4_compatible]]]
- [Create an IPv4-compatible IPv6 address. ]
+ [[link boost_asio.reference.raw_socket_service.open [*open]]]
+ []
]
[
- [[link boost_asio.reference.ip__address_v6.v4_mapped [*v4_mapped]]]
- [Create an IPv4-mapped IPv6 address. ]
+ [[link boost_asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]]
+ [Construct a new raw socket service for the specified io_service. ]
]
-]
-
-[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.raw_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.raw_socket_service.receive_from [*receive_from]]]
+ [Receive raw data with the endpoint of the sender. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.raw_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
+ [[link boost_asio.reference.raw_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_gt_ [*operator>]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.raw_socket_service.send_to [*send_to]]]
+ [Send raw data to the specified endpoint. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]]
- [Compare addresses for ordering. ]
+ [[link boost_asio.reference.raw_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
]
-]
-
-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]
+ [
+ [[link boost_asio.reference.raw_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-
-[section:address_v6 ip::address_v6::address_v6]
-
-Default constructor.
-
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload1 address_v6]``();
-
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload2 address_v6]``(
- const bytes_type & bytes,
- unsigned long scope_id = 0);
-
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload3 address_v6]``(
- const address_v6 & other);
-
-
-[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]
-
-Obtain an address object that represents any address.
-
- static address_v6 any();
-
-
-
-[endsect]
-
-
-
-[section:bytes_type ip::address_v6::bytes_type]
-
-The type used to represent an address as an array of bytes.
-
- typedef boost::array< unsigned char, 16 > bytes_type;
-
-
-
-
-[endsect]
-
-
-[section:from_string ip::address_v6::from_string]
-
-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);
-
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
-
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload3 from_string]``(
- const std::string & str);
-
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
-
-
-[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]
-
-Determine whether the address is link local.
-
- bool is_link_local() const;
-
-
-
-[endsect]
-
-
-
-[section:is_loopback ip::address_v6::is_loopback]
-
-Determine whether the address is a loopback address.
-
- bool is_loopback() const;
-
-
-
-[endsect]
-
-
-
-[section:is_multicast ip::address_v6::is_multicast]
-
-Determine whether the address is a multicast address.
-
- bool is_multicast() const;
-
+ [
+ [[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]]
-[endsect]
+ [
+ [[link boost_asio.reference.raw_socket_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+]
-[section:is_multicast_global ip::address_v6::is_multicast_global]
+[section:assign raw_socket_service::assign]
-Determine whether the address is a global multicast address.
+[indexterm2 assign..raw_socket_service] Assign an existing native socket to a raw socket.
- bool is_multicast_global() const;
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
@@ -26222,11 +46384,16 @@
-[section:is_multicast_link_local ip::address_v6::is_multicast_link_local]
+[section:async_connect raw_socket_service::async_connect]
-Determine whether the address is a link-local multicast address.
+[indexterm2 async_connect..raw_socket_service] Start an asynchronous connect.
- bool is_multicast_link_local() const;
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
@@ -26234,11 +46401,18 @@
-[section:is_multicast_node_local ip::address_v6::is_multicast_node_local]
+[section:async_receive raw_socket_service::async_receive]
-Determine whether the address is a node-local multicast address.
+[indexterm2 async_receive..raw_socket_service] Start an asynchronous receive.
- bool is_multicast_node_local() const;
+ 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);
@@ -26246,11 +46420,19 @@
-[section:is_multicast_org_local ip::address_v6::is_multicast_org_local]
+[section:async_receive_from raw_socket_service::async_receive_from]
-Determine whether the address is a org-local multicast address.
+[indexterm2 async_receive_from..raw_socket_service] Start an asynchronous receive that will get the endpoint of the sender.
- bool is_multicast_org_local() const;
+ 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);
@@ -26258,11 +46440,18 @@
-[section:is_multicast_site_local ip::address_v6::is_multicast_site_local]
+[section:async_send raw_socket_service::async_send]
-Determine whether the address is a site-local multicast address.
+[indexterm2 async_send..raw_socket_service] Start an asynchronous send.
- bool is_multicast_site_local() const;
+ 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);
@@ -26270,11 +46459,19 @@
-[section:is_site_local ip::address_v6::is_site_local]
+[section:async_send_to raw_socket_service::async_send_to]
-Determine whether the address is site local.
+[indexterm2 async_send_to..raw_socket_service] Start an asynchronous send.
- bool is_site_local() const;
+ 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);
@@ -26282,11 +46479,13 @@
-[section:is_unspecified ip::address_v6::is_unspecified]
+[section:at_mark raw_socket_service::at_mark]
-Determine whether the address is unspecified.
+[indexterm2 at_mark..raw_socket_service] Determine whether the socket is at the out-of-band data mark.
- bool is_unspecified() const;
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -26294,11 +46493,13 @@
-[section:is_v4_compatible ip::address_v6::is_v4_compatible]
+[section:available raw_socket_service::available]
-Determine whether the address is an IPv4-compatible address.
+[indexterm2 available..raw_socket_service] Determine the number of bytes available for reading.
- bool is_v4_compatible() const;
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -26306,11 +46507,14 @@
-[section:is_v4_mapped ip::address_v6::is_v4_mapped]
+[section:bind raw_socket_service::bind]
-Determine whether the address is a mapped IPv4 address.
+[indexterm2 bind..raw_socket_service]
- bool is_v4_mapped() const;
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
@@ -26318,11 +46522,13 @@
-[section:loopback ip::address_v6::loopback]
+[section:cancel raw_socket_service::cancel]
-Obtain an address object that represents the loopback address.
+[indexterm2 cancel..raw_socket_service] Cancel all asynchronous operations associated with the socket.
- static address_v6 loopback();
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -26330,13 +46536,13 @@
-[section:operator_not__eq_ ip::address_v6::operator!=]
+[section:close raw_socket_service::close]
-Compare two addresses for inequality.
+[indexterm2 close..raw_socket_service] Close a raw socket implementation.
- friend bool operator!=(
- const address_v6 & a1,
- const address_v6 & a2);
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -26344,13 +46550,14 @@
-[section:operator_lt_ ip::address_v6::operator<]
+[section:connect raw_socket_service::connect]
-Compare addresses for ordering.
+[indexterm2 connect..raw_socket_service] Connect the raw socket to the specified endpoint.
- friend bool operator<(
- const address_v6 & a1,
- const address_v6 & a2);
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
@@ -26358,13 +46565,12 @@
-[section:operator_lt__eq_ ip::address_v6::operator<=]
+[section:construct raw_socket_service::construct]
-Compare addresses for ordering.
+[indexterm2 construct..raw_socket_service] Construct a new raw socket implementation.
- friend bool operator<=(
- const address_v6 & a1,
- const address_v6 & a2);
+ void construct(
+ implementation_type & impl);
@@ -26372,12 +46578,12 @@
-[section:operator_eq_ ip::address_v6::operator=]
+[section:destroy raw_socket_service::destroy]
-Assign from another address.
+[indexterm2 destroy..raw_socket_service] Destroy a raw socket implementation.
- address_v6 & operator=(
- const address_v6 & other);
+ void destroy(
+ implementation_type & impl);
@@ -26385,114 +46591,101 @@
-[section:operator_eq__eq_ ip::address_v6::operator==]
-
-Compare two addresses for equality.
-
- friend bool operator==(
- const address_v6 & a1,
- const address_v6 & a2);
+[section:endpoint_type raw_socket_service::endpoint_type]
+[indexterm2 endpoint_type..raw_socket_service] The endpoint type.
+ typedef Protocol::endpoint endpoint_type;
-[endsect]
-[section:operator_gt_ ip::address_v6::operator>]
+[endsect]
-Compare addresses for ordering.
- friend bool operator>(
- const address_v6 & a1,
- const address_v6 & a2);
+[section:get_io_service raw_socket_service::get_io_service]
-[endsect]
+['Inherited from io_service.]
+[indexterm2 get_io_service..raw_socket_service] Get the io_service object that owns the service.
+ boost::asio::io_service & get_io_service();
-[section:operator_gt__eq_ ip::address_v6::operator>=]
-Compare addresses for ordering.
- friend bool operator>=(
- const address_v6 & a1,
- const address_v6 & a2);
+[endsect]
-[endsect]
+[section:get_option raw_socket_service::get_option]
+[indexterm2 get_option..raw_socket_service] Get a socket option.
-[section:scope_id ip::address_v6::scope_id]
+ 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;
-The scope ID of the address.
- unsigned long ``[link boost_asio.reference.ip__address_v6.scope_id.overload1 scope_id]``() const;
- void ``[link boost_asio.reference.ip__address_v6.scope_id.overload2 scope_id]``(
- unsigned long id);
+[endsect]
-[section:overload1 ip::address_v6::scope_id (1 of 2 overloads)]
-The scope ID of the address.
+[section:id raw_socket_service::id]
- unsigned long scope_id() const;
+[indexterm2 id..raw_socket_service] The unique service identifier.
+ static boost::asio::io_service::id id;
-Returns the scope ID associated with the IPv6 address.
[endsect]
-[section:overload2 ip::address_v6::scope_id (2 of 2 overloads)]
+[section:implementation_type raw_socket_service::implementation_type]
-The scope ID of the address.
+[indexterm2 implementation_type..raw_socket_service] The type of a raw socket.
- void scope_id(
- unsigned long id);
+ typedef implementation_defined implementation_type;
-Modifies the scope ID associated with the IPv6 address.
[endsect]
-[endsect]
-
-[section:to_bytes ip::address_v6::to_bytes]
+[section:io_control raw_socket_service::io_control]
-Get the address in bytes.
+[indexterm2 io_control..raw_socket_service] Perform an IO control command on the socket.
- bytes_type to_bytes() const;
+ 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]
-[section:to_string ip::address_v6::to_string]
-
-Get the address as a string.
-
- std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload1 to_string]``() const;
- std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
+[section:io_service raw_socket_service::io_service]
-[section:overload1 ip::address_v6::to_string (1 of 2 overloads)]
+['Inherited from io_service.]
-Get the address as a string.
+[indexterm2 io_service..raw_socket_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
- std::string to_string() const;
+ boost::asio::io_service & io_service();
@@ -26500,26 +46693,26 @@
-[section:overload2 ip::address_v6::to_string (2 of 2 overloads)]
+[section:is_open raw_socket_service::is_open]
-Get the address as a string.
+[indexterm2 is_open..raw_socket_service] Determine whether the socket is open.
- std::string to_string(
- boost::system::error_code & ec) const;
+ bool is_open(
+ const implementation_type & impl) const;
[endsect]
-[endsect]
-
-[section:to_v4 ip::address_v6::to_v4]
+[section:local_endpoint raw_socket_service::local_endpoint]
-Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
+[indexterm2 local_endpoint..raw_socket_service] Get the local endpoint.
- address_v4 to_v4() const;
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -26527,12 +46720,12 @@
-[section:v4_compatible ip::address_v6::v4_compatible]
+[section:native raw_socket_service::native]
-Create an IPv4-compatible IPv6 address.
+[indexterm2 native..raw_socket_service] Get the native socket implementation.
- static address_v6 v4_compatible(
- const address_v4 & addr);
+ native_type native(
+ implementation_type & impl);
@@ -26540,12 +46733,12 @@
-[section:v4_mapped ip::address_v6::v4_mapped]
+[section:native_type raw_socket_service::native_type]
-Create an IPv4-mapped IPv6 address.
+[indexterm2 native_type..raw_socket_service] The native socket type.
+
+ typedef implementation_defined native_type;
- static address_v6 v4_mapped(
- const address_v4 & addr);
@@ -26553,135 +46746,58 @@
-[endsect]
+[section:open raw_socket_service::open]
-[section:ip__basic_endpoint ip::basic_endpoint]
+[indexterm2 open..raw_socket_service]
-Describes an endpoint for a version-independent IP socket.
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_endpoint
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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. ]
-
- ]
- [
+[section:protocol_type raw_socket_service::protocol_type]
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+[indexterm2 protocol_type..raw_socket_service] The protocol type.
-]
+ typedef Protocol protocol_type;
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default 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. ]
- ]
-
- [
- [[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_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
-]
+[endsect]
-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.
+[section:raw_socket_service raw_socket_service::raw_socket_service]
-[*Shared] [*objects:] Unsafe.
+[indexterm2 raw_socket_service..raw_socket_service] Construct a new raw socket service for the specified io_service.
+ raw_socket_service(
+ boost::asio::io_service & io_service);
-[section:address ip::basic_endpoint::address]
-Get the IP address associated with the endpoint.
- boost::asio::ip::address ``[link boost_asio.reference.ip__basic_endpoint.address.overload1 address]``() const;
+[endsect]
- void ``[link boost_asio.reference.ip__basic_endpoint.address.overload2 address]``(
- const boost::asio::ip::address & addr);
-[section:overload1 ip::basic_endpoint::address (1 of 2 overloads)]
+[section:receive raw_socket_service::receive]
-Get the IP address associated with the endpoint.
+[indexterm2 receive..raw_socket_service] Receive some data from the peer.
- boost::asio::ip::address address() const;
+ 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);
@@ -26689,74 +46805,86 @@
-[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);
+[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);
-[endsect]
[endsect]
-[section:basic_endpoint ip::basic_endpoint::basic_endpoint]
-Default constructor.
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
+[section:remote_endpoint raw_socket_service::remote_endpoint]
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
- const InternetProtocol & protocol,
- unsigned short port_num);
+[indexterm2 remote_endpoint..raw_socket_service] Get the remote endpoint.
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
- const boost::asio::ip::address & addr,
- unsigned short port_num);
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
- ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
- const basic_endpoint & other);
-[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+[endsect]
-Default constructor.
- basic_endpoint();
+[section:send raw_socket_service::send]
+[indexterm2 send..raw_socket_service] Send the given data to the peer.
-[endsect]
+ 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);
-[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+[endsect]
-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 & protocol,
- unsigned short port_num);
+[section:send_to raw_socket_service::send_to]
+[indexterm2 send_to..raw_socket_service] Send raw data to the specified endpoint.
-[heading Examples]
-
-To initialise an IPv4 TCP endpoint for port 1234, use:
+ 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);
- boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), 1234);
+[endsect]
-To specify an IPv6 UDP endpoint for port 9876, use:
- boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
+[section:set_option raw_socket_service::set_option]
+[indexterm2 set_option..raw_socket_service] Set a socket option.
+ 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);
@@ -26764,13 +46892,14 @@
-[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)]
+[section:shutdown raw_socket_service::shutdown]
-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 shutdown..raw_socket_service] Disable sends or receives on the socket.
- basic_endpoint(
- const boost::asio::ip::address & addr,
- unsigned short port_num);
+ boost::system::error_code shutdown(
+ implementation_type & impl,
+ socket_base::shutdown_type what,
+ boost::system::error_code & ec);
@@ -26778,87 +46907,144 @@
-[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)]
-
-Copy constructor.
-
- basic_endpoint(
- const basic_endpoint & other);
+[section:shutdown_service raw_socket_service::shutdown_service]
+[indexterm2 shutdown_service..raw_socket_service] Destroy all user-defined handler objects owned by the service.
+ void shutdown_service();
-[endsect]
[endsect]
-[section:capacity ip::basic_endpoint::capacity]
-
-Get the capacity of the endpoint in the native type.
-
- std::size_t capacity() const;
-
-
[endsect]
+[section:read read]
-[section:data ip::basic_endpoint::data]
+[indexterm1 read] 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]``>
+ std::size_t ``[link boost_asio.reference.read.overload1 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers);
-Get the underlying endpoint in the native type.
+ 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]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition);
- data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload1 data]``();
+ 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,
+ boost::system::error_code & ec);
- const data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload2 data]``() const;
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.read.overload4 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b);
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload5 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
-[section:overload1 ip::basic_endpoint::data (1 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.read.overload6 read]``(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
-Get the underlying endpoint in the native type.
- data_type * data();
+[section:overload1 read (1 of 6 overloads)]
+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]``>
+ std::size_t read(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers);
-[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:
-[section:overload2 ip::basic_endpoint::data (2 of 2 overloads)]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
-Get the underlying endpoint in the native type.
+* An error occurred.
- const data_type * data() const;
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
+[heading Parameters]
+
-[endsect]
+[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]
+]
+[heading Return Value]
+
+The number of bytes transferred.
-[section:data_type ip::basic_endpoint::data_type]
+[heading Exceptions]
+
-The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
- typedef implementation_defined data_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));
-[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.
+[heading Remarks]
+
+This overload is equivalent to calling:
+ boost::asio::read(
+ s, buffers,
+ boost::asio::transfer_all());
-[section:operator_not__eq_ ip::basic_endpoint::operator!=]
-Compare two endpoints for inequality.
- friend bool operator!=(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
@@ -26866,88 +47052,137 @@
-[section:operator_lt_ ip::basic_endpoint::operator<]
-
-Compare endpoints for ordering.
+[section:overload2 read (2 of 6 overloads)]
- friend bool operator<(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+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);
-[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:operator_eq_ ip::basic_endpoint::operator=]
+* The completion_condition function object returns true.
-Assign from another endpoint.
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
- basic_endpoint & operator=(
- const basic_endpoint & other);
+[heading Parameters]
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[endsect]
+[[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:
+``
+ bool completion_condition(
+ const boost::system::error_code& error, // Result of latest read_some
+ // operation.
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
+``
+A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
-[section:operator_eq__eq_ ip::basic_endpoint::operator==]
+]
-Compare two endpoints for equality.
+[heading Return Value]
+
+The number of bytes transferred.
- friend bool operator==(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[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));
-[section:port ip::basic_endpoint::port]
-Get the port associated with the endpoint. The port number is always in the host's byte order.
+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.
- unsigned short ``[link boost_asio.reference.ip__basic_endpoint.port.overload1 port]``() const;
- void ``[link boost_asio.reference.ip__basic_endpoint.port.overload2 port]``(
- unsigned short port_num);
+[endsect]
-[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;
+[section:overload3 read (3 of 6 overloads)]
+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,
+ 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:
-[section:overload2 ip::basic_endpoint::port (2 of 2 overloads)]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
-Set the port associated with the endpoint. The port number is always in the host's byte order.
+* The completion_condition function object returns true.
- void port(
- unsigned short port_num);
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
+[heading Parameters]
+
-[endsect]
+[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:
+``
+ bool completion_condition(
+ const boost::system::error_code& error, // Result of latest read_some
+ // operation.
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
+``
+A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
-[section:protocol ip::basic_endpoint::protocol]
+[[ec][Set to indicate what error occurred, if any.]]
-The protocol associated with the endpoint.
+]
- protocol_type protocol() const;
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
@@ -26955,180 +47190,152 @@
-[section:protocol_type ip::basic_endpoint::protocol_type]
-
-The protocol type associated with the endpoint.
+[section:overload4 read (4 of 6 overloads)]
- typedef InternetProtocol protocol_type;
+Attempt to read a certain amount of data from a stream before returning.
+ 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 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 one or more calls to the stream's read\_some function.
-[section:resize ip::basic_endpoint::resize]
-Set the underlying size of the endpoint in the native type.
+[heading Parameters]
+
- void resize(
- std::size_t size);
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[[b][The basic\_streambuf object into which the data will be read.]]
+]
-[endsect]
+[heading Return Value]
+
+The number of bytes transferred.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[section:size ip::basic_endpoint::size]
+]
-Get the underlying size of the endpoint in the native type.
+[heading Remarks]
+
+This overload is equivalent to calling:
- std::size_t size() const;
+ boost::asio::read(
+ s, b,
+ boost::asio::transfer_all());
-[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 >
+[section:overload5 read (5 of 6 overloads)]
+Attempt to read a certain amount of data from a stream before returning.
-[heading Types]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
- [
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+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:
- [
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+* The completion_condition function object returns true.
- [
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
+[variablelist
- ]
-
- [
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
-
- ]
+[[b][The 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:
+``
+ bool completion_condition(
+ const boost::system::error_code& error, // Result of latest read_some
+ // 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. ]
-
- ]
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
+``
+A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+The number of bytes transferred.
- [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously resolve a query 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]]]
- [Resolve a query to a list of entries. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
-]
+[[boost::system::system_error][Thrown on failure. ]]
-The 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.
+[endsect]
-[section:async_resolve ip::basic_resolver::async_resolve]
-Asynchronously resolve a query to a list of entries.
+[section:overload6 read (6 of 6 overloads)]
- 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);
+Attempt to read a certain amount of data from a stream before returning.
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);
-
+ 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);
-[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)]
-Asynchronously resolve a query to a list of entries.
+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:
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const query & q,
- ResolveHandler handler);
+* The completion_condition function object returns true.
-This function is used to asynchronously resolve a query into a list of endpoint entries.
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
[heading Parameters]
@@ -27136,189 +47343,314 @@
[variablelist
-[[q][A query object that determines what endpoints will be returned.]]
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[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:
+[[b][The 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:
``
- 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.
- );
+ bool completion_condition(
+ const boost::system::error_code& error, // Result of latest read_some
+ // operation.
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
``
-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().]]
+A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Remarks]
+[heading Return Value]
-A default constructed iterator represents the end of the list.
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
-A successful resolve operation is guaranteed to pass at least one entry to the handler.
[endsect]
+[endsect]
-[section:overload2 ip::basic_resolver::async_resolve (2 of 2 overloads)]
+[section:read_at read_at]
-Asynchronously resolve an endpoint to a list of entries.
+[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);
template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const endpoint_type & e,
- ResolveHandler handler);
+ 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);
+ 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);
-This function is used to asynchronously resolve an endpoint into a list of endpoint entries.
+ 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);
+ 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);
-[heading Parameters]
-
+ 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);
-[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.
- );
+[section:overload1 read_at (1 of 6 overloads)]
-``
-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().]]
+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);
-[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.
+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:
-[endsect]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+* An error occurred.
-[endsect]
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-[section:basic_resolver ip::basic_resolver::basic_resolver]
+[heading Parameters]
+
-Constructor.
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
- basic_resolver(
- boost::asio::io_service & io_service);
+[[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.]]
-This constructor creates a basic_resolver.
+]
+[heading Return Value]
+
+The number of bytes transferred.
-[heading Parameters]
+[heading Exceptions]
[variablelist
-[[io_service][The io\_service object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[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));
-[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.
+[heading Remarks]
+
+This overload is equivalent to calling:
-[section:cancel ip::basic_resolver::cancel]
+ boost::asio::read_at(
+ d, 42, buffers,
+ boost::asio::transfer_all());
-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]
+[section:overload2 read_at (2 of 6 overloads)]
-The endpoint type.
+Attempt to read a certain amount of data at the specified offset before returning.
- typedef InternetProtocol::endpoint endpoint_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);
+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:
-[endsect]
+* 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 true.
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-[section:get_io_service ip::basic_resolver::get_io_service]
+[heading Parameters]
+
-['Inherited from basic_io_object.]
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
-Get the io_service associated with the object.
+[[offset][The offset at which the data will be read.]]
- boost::asio::io_service & get_io_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.]]
+[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest read_some_at operation.
+ const boost::system::error_code& error,
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the read operation is complete. False indicates that further calls to the device's read\_some\_at function are required.]]
+]
[heading Return Value]
-A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+The number of bytes transferred.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[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),
+ boost::asio::transfer_at_least(32));
-[section:implementation_type ip::basic_resolver::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.
-['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
- typedef service_type::implementation_type implementation_type;
+[endsect]
+[section:overload3 read_at (3 of 6 overloads)]
-[endsect]
+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]``,
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
-[section:io_service ip::basic_resolver::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:
-['Inherited from basic_io_object.]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+* The completion_condition function object returns true.
- boost::asio::io_service & io_service();
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[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.]]
+
+[[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:
+``
+ bool completion_condition(
+ const boost::system::error_code& error, // Result of latest read_some_at
+ // operation.
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
+``
+A return value of true indicates that the read operation is complete. False indicates that further calls to the device's read\_some\_at function are required.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
[heading Return Value]
-A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
@@ -27326,72 +47658,91 @@
-[section:iterator ip::basic_resolver::iterator]
-
-The iterator type.
-
- typedef InternetProtocol::resolver_iterator iterator;
+[section:overload4 read_at (4 of 6 overloads)]
+Attempt to read a certain amount of data at the specified offset before returning.
+ 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);
-[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:
+* An error occurred.
-[section:protocol_type ip::basic_resolver::protocol_type]
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-The protocol type.
- typedef InternetProtocol protocol_type;
+[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 basic\_streambuf object into which the data will be read.]]
-[endsect]
+]
+[heading Return Value]
+
+The number of bytes transferred.
+[heading Exceptions]
+
-[section:query ip::basic_resolver::query]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-The query type.
+]
- typedef InternetProtocol::resolver_query query;
+[heading Remarks]
+
+This overload is equivalent to calling:
+ boost::asio::read_at(
+ d, 42, b,
+ boost::asio::transfer_all());
-[endsect]
-[section:resolve ip::basic_resolver::resolve]
-Resolve a query to a list of entries.
+[endsect]
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
- const query & q);
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload2 resolve]``(
- const query & q,
- boost::system::error_code & ec);
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload3 resolve]``(
- const endpoint_type & e);
+[section:overload5 read_at (5 of 6 overloads)]
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload4 resolve]``(
- const endpoint_type & e,
- boost::system::error_code & ec);
+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);
-[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)]
-Resolve a query to a list of entries.
+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:
- iterator resolve(
- const query & q);
+* The completion_condition function object returns true.
-This function is used to resolve a query into a list of endpoint entries.
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
[heading Parameters]
@@ -27399,44 +47750,67 @@
[variablelist
-[[q][A query object that determines what endpoints will be returned.]]
+[[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 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:
+``
+ bool 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 true indicates that the read operation is complete. False indicates that further calls to the device's read\_some\_at function are required.]]
]
[heading Return Value]
-A forward-only iterator that can be used to traverse the list of endpoint entries.
+The number of bytes transferred.
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[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)]
+[section:overload6 read_at (6 of 6 overloads)]
-Resolve a query to a list of entries.
+Attempt to read a certain amount of data at the specified offset before returning.
- iterator resolve(
- const query & q,
+ 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 & ec);
-This function is used to resolve a query into a list of endpoint entries.
+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 true.
+
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
[heading Parameters]
@@ -27444,7 +47818,23 @@
[variablelist
-[[q][A query object that determines what endpoints will be returned.]]
+[[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 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:
+``
+ bool 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 true indicates that the read operation is complete. False indicates that further calls to the device's read\_some\_at function are required.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -27452,28 +47842,113 @@
[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.
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
-[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: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);
-[section:overload3 ip::basic_resolver::resolve (3 of 4 overloads)]
+ 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);
-Resolve an endpoint to a list of entries.
+ 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);
- iterator resolve(
- const endpoint_type & e);
+ 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);
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+
+[section:overload1 read_until (1 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,
+ char 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:
-This function is used to resolve an endpoint into a list of endpoint entries.
+
+* 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]
@@ -27481,13 +47956,17 @@
[variablelist
-[[e][An endpoint object that determines what endpoints will be returned.]]
+[[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.]]
]
[heading Return Value]
-A forward-only iterator that can be used to traverse the list of endpoint entries.
+The number of bytes in the streambuf's get area up to and including the delimiter.
[heading Exceptions]
@@ -27500,25 +47979,49 @@
[heading Remarks]
-A default constructed iterator represents the end of the list.
+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:
+
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, '\n');
+ std::istream is(&b);
+ std::string line;
+ std::getline(is, line);
+
+
+
-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 read_until (2 of 8 overloads)]
-Resolve an endpoint to a list of entries.
+Read data into a streambuf until it contains a specified delimiter.
- iterator resolve(
- const endpoint_type & e,
+ 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,
boost::system::error_code & ec);
-This function is used to resolve an endpoint into a list of endpoint entries.
+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]
@@ -27526,7 +48029,11 @@
[variablelist
-[[e][An endpoint object that determines what endpoints will be returned.]]
+[[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.]]
@@ -27534,181 +48041,208 @@
[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.
+The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
[heading Remarks]
-A default constructed iterator represents the end of the list.
+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.
-A successful call to this function is guaranteed to return at least one entry.
[endsect]
-[endsect]
+[section:overload3 read_until (3 of 8 overloads)]
-[section:service_type ip::basic_resolver::service_type]
+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);
-['Inherited from basic_io_object.]
+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 type of the service that will be used to provide I/O operations.
- typedef ResolverService service_type;
+* 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.
-[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.]]
-[endsect]
+[[delim][The delimiter string.]]
-[section:ip__basic_resolver_entry ip::basic_resolver_entry]
+]
-An entry produced by a resolver.
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the delimiter.
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_entry
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[heading Types]
-[table
- [[Name][Description]]
+]
- [
+[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.
- [[link boost_asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]]
- [The endpoint type associated with the endpoint entry. ]
+[heading Example]
- ]
+To read data into a streambuf until a newline is encountered:
- [
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, "\r\n");
+ std::istream is(&b);
+ std::string line;
+ std::getline(is, line);
- [[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. ]
- ]
-
- [
- [[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.
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:overload4 read_until (4 of 8 overloads)]
-[section:basic_resolver_entry ip::basic_resolver_entry::basic_resolver_entry]
+Read data into a streambuf until it contains a specified delimiter.
-Default constructor.
+ 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);
- ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 basic_resolver_entry]``();
- ``[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);
+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:
-[section:overload1 ip::basic_resolver_entry::basic_resolver_entry (1 of 2 overloads)]
+* The get area of the streambuf contains the specified delimiter.
-Default constructor.
+* An error occurred.
- basic_resolver_entry();
+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]
+
-[endsect]
+[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.]]
-[section:overload2 ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads)]
+[[ec][Set to indicate what error occurred, if any.]]
-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);
+[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]
-[endsect]
+[section:overload5 read_until (5 of 8 overloads)]
-[section:endpoint ip::basic_resolver_entry::endpoint]
+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);
-Get the endpoint associated with the entry.
- endpoint_type endpoint() const;
+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:
+* A substring of the streambuf's get area matches the regular expression.
-[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 data that matches the regular expression, the function returns immediately.
-[section:endpoint_type ip::basic_resolver_entry::endpoint_type]
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-The endpoint type associated with the endpoint entry.
+[[b][A streambuf object into which the data will be read.]]
- typedef InternetProtocol::endpoint endpoint_type;
+[[expr][The regular expression.]]
+]
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression.
+[heading Exceptions]
+
-[endsect]
+[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.
+
+[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);
-[section:host_name ip::basic_resolver_entry::host_name]
-Get the host name associated with the entry.
- std::string host_name() const;
@@ -27716,24 +48250,52 @@
-[section:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type]
+[section:overload6 read_until (6 of 8 overloads)]
-Convert to the endpoint associated with the entry.
+Read data into a streambuf until some part of the data it contains matches a regular expression.
- operator endpoint_type() 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.
+
+* 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.
-[section:protocol_type ip::basic_resolver_entry::protocol_type]
-The protocol type associated with the endpoint entry.
+[heading Parameters]
+
- typedef InternetProtocol protocol_type;
+[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.]]
+
+[[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 substring that matches the regular expression. Returns 0 if an error occurred.
+[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.
@@ -27741,117 +48303,191 @@
-[section:service_name ip::basic_resolver_entry::service_name]
+[section:overload7 read_until (7 of 8 overloads)]
-Get the service name associated with the entry.
+Read data into a streambuf until a function object indicates a match.
- std::string service_name() const;
+ 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:
-[endsect]
+* The match condition function object returns a std::pair where the second element evaluates to true.
+* 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.
-[section:ip__basic_resolver_iterator ip::basic_resolver_iterator]
-An iterator over the entries produced by a resolver.
+[heading Parameters]
+
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_iterator
+[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.]]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[[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 Return Value]
+
+The number of bytes in the streambuf's get area that have been fully consumed by the match function.
- [
- [[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. ]
- ]
+[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.
+[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
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+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.
- const basic_resolver_entry<InternetProtocol>
+[heading Examples]
+
+To read data into a streambuf until whitespace is encountered:
+ 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);
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+To read data into a streambuf until a matching character is found:
+ 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);
+ }
-[section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator]
+ private:
+ char c_;
+ };
+
+ 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'));
-Default constructor creates an end iterator.
- basic_resolver_iterator();
[endsect]
-[section:create ip::basic_resolver_iterator::create]
-Create an iterator from an addrinfo list returned by getaddrinfo.
+[section:overload8 read_until (8 of 8 overloads)]
- 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);
+Read data into a streambuf until a function object indicates a match.
- 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);
+ 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);
-[section:overload1 ip::basic_resolver_iterator::create (1 of 2 overloads)]
+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:
-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);
+* The match condition function object returns a std::pair where the second element evaluates to true.
+* 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.
-[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:overload2 ip::basic_resolver_iterator::create (2 of 2 overloads)]
+[[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.]]
-Create an iterator from an endpoint, host name and service name.
+[[ec][Set to indicate what error occurred, if any.]]
- static basic_resolver_iterator create(
- const typename InternetProtocol::endpoint & endpoint,
- const std::string & host_name,
- const std::string & service_name);
+]
+
+[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]
+
+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.
-[endsect]
[endsect]
@@ -27859,14 +48495,12 @@
[endsect]
-[section:ip__basic_resolver_query ip::basic_resolver_query]
-An query to be passed to a resolver.
+[section:serial_port serial_port]
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_query :
- public ip::resolver_query_base
+[indexterm1 serial_port] Typedef for the typical usage of a serial port.
+
+ typedef basic_serial_port serial_port;
[heading Types]
@@ -27875,8 +48509,29 @@
[
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
+ [[link boost_asio.reference.basic_serial_port.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_serial_port.native_type [*native_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. ]
]
@@ -27887,70 +48542,109 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
- [Construct with specified service name for any protocol. ]
+ [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
+ [Assign an existing native serial port to the serial port. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
+ [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver_query.host_name [*host_name]]]
- [Get the host name associated with the query. ]
+ [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
+ [[link boost_asio.reference.basic_serial_port.basic_serial_port [*basic_serial_port]]]
+ [Construct a basic_serial_port without opening it. ]
]
-]
-
-[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.basic_serial_port.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the serial port. ]
]
-
+
[
- [[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.basic_serial_port.close [*close]]]
+ [Close the serial port. ]
]
-
+
[
- [[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.basic_serial_port.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
]
-
+
[
- [[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.basic_serial_port.get_option [*get_option]]]
+ [Get an option from the serial port. ]
]
-
+
[
- [[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.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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_serial_port.lowest_layer [*lowest_layer]]]
+ [Get a 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]]
[
- [[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.basic_serial_port.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
[
- [[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.basic_serial_port.service [*service]]]
+ [The service associated with the I/O object. ]
]
]
-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.
+The basic_serial_port class template provides functionality that is common to all serial ports.
[heading Thread Safety]
@@ -27961,82 +48655,75 @@
-[section:address_configured ip::basic_resolver_query::address_configured]
-
-
-['Inherited from 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 int address_configured = implementation_defined;
-
-
[endsect]
+[section:serial_port_base serial_port_base]
-[section:all_matching ip::basic_resolver_query::all_matching]
-
-
-['Inherited from ip::resolver_query_base.]
-
-If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
-
- static const int all_matching = implementation_defined;
-
-
+The serial_port_base class is used as a base for the basic_serial_port class template so that we have a common place to define the serial port options.
-[endsect]
+ class serial_port_base
-[section:basic_resolver_query ip::basic_resolver_query::basic_resolver_query]
+[heading Types]
+[table
+ [[Name][Description]]
-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_name,
- int flags = passive|address_configured);
+ [[link boost_asio.reference.serial_port_base__baud_rate [*baud_rate]]]
+ [Serial port option to permit changing the baud rate. ]
+
+ ]
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload2 basic_resolver_query]``(
- const protocol_type & protocol,
- const std::string & service_name,
- int flags = passive|address_configured);
+ [
- ``[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,
- int flags = address_configured);
+ [[link boost_asio.reference.serial_port_base__character_size [*character_size]]]
+ [Serial port option to permit changing the character size. ]
+
+ ]
- ``[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,
- int flags = address_configured);
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control [*flow_control]]]
+ [Serial port option to permit changing the flow control. ]
+
+ ]
-[section:overload1 ip::basic_resolver_query::basic_resolver_query (1 of 4 overloads)]
+ [
-Construct with specified service name for any protocol.
+ [[link boost_asio.reference.serial_port_base__parity [*parity]]]
+ [Serial port option to permit changing the parity. ]
+
+ ]
- basic_resolver_query(
- const std::string & service_name,
- int flags = passive|address_configured);
+ [
+ [[link boost_asio.reference.serial_port_base__stop_bits [*stop_bits]]]
+ [Serial port option to permit changing the number of stop bits. ]
+
+ ]
+]
-[endsect]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.serial_port_base._serial_port_base [*~serial_port_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
-[section:overload2 ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads)]
+[section:_serial_port_base serial_port_base::~serial_port_base]
-Construct with specified service name for a given protocol.
+[indexterm2 ~serial_port_base..serial_port_base] Protected destructor to prevent deletion through this type.
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & service_name,
- int flags = passive|address_configured);
+ ~serial_port_base();
@@ -28044,47 +48731,64 @@
-[section:overload3 ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads)]
-
-Construct with specified host name and service name for any protocol.
+[endsect]
- basic_resolver_query(
- const std::string & host_name,
- const std::string & service_name,
- int flags = address_configured);
+[section:serial_port_base__baud_rate serial_port_base::baud_rate]
+Serial port option to permit changing the baud rate.
+ class baud_rate
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.serial_port_base__baud_rate.baud_rate [*baud_rate]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__baud_rate.load [*load]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__baud_rate.store [*store]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__baud_rate.value [*value]]]
+ []
+ ]
+
+]
-[section:overload4 ip::basic_resolver_query::basic_resolver_query (4 of 4 overloads)]
+Implements changing the baud rate for a given serial port.
-Construct with specified host name and service name for a given protocol.
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & host_name,
- const std::string & service_name,
- int flags = address_configured);
+[section:baud_rate serial_port_base::baud_rate::baud_rate]
+[indexterm2 baud_rate..serial_port_base::baud_rate]
+ baud_rate(
+ unsigned int rate = 0);
-[endsect]
[endsect]
-[section:canonical_name ip::basic_resolver_query::canonical_name]
-
-['Inherited from ip::resolver_query_base.]
+[section:load serial_port_base::baud_rate::load]
-Determine the canonical name of the host specified in the query.
+[indexterm2 load..serial_port_base::baud_rate]
- static const int canonical_name = implementation_defined;
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
@@ -28092,11 +48796,13 @@
-[section:hints ip::basic_resolver_query::hints]
+[section:store serial_port_base::baud_rate::store]
-Get the hints associated with the query.
+[indexterm2 store..serial_port_base::baud_rate]
- const boost::asio::detail::addrinfo_type & hints() const;
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
@@ -28104,11 +48810,11 @@
-[section:host_name ip::basic_resolver_query::host_name]
+[section:value serial_port_base::baud_rate::value]
-Get the host name associated with the query.
+[indexterm2 value..serial_port_base::baud_rate]
- std::string host_name() const;
+ unsigned int value() const;
@@ -28116,29 +48822,50 @@
-[section:numeric_host ip::basic_resolver_query::numeric_host]
-
-
-['Inherited from 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.
+[endsect]
- static const int numeric_host = implementation_defined;
+[section:serial_port_base__character_size serial_port_base::character_size]
+Serial port option to permit changing the character size.
+ class character_size
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.serial_port_base__character_size.character_size [*character_size]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__character_size.load [*load]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__character_size.store [*store]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__character_size.value [*value]]]
+ []
+ ]
+
+]
-[section:numeric_service ip::basic_resolver_query::numeric_service]
+Implements changing the character size for a given serial port.
-['Inherited from ip::resolver_query_base.]
+[section:character_size serial_port_base::character_size::character_size]
-Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
+[indexterm2 character_size..serial_port_base::character_size]
- static const int numeric_service = implementation_defined;
+ character_size(
+ unsigned int t = 8);
@@ -28146,14 +48873,13 @@
-[section:passive ip::basic_resolver_query::passive]
-
-
-['Inherited from ip::resolver_query_base.]
+[section:load serial_port_base::character_size::load]
-Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+[indexterm2 load..serial_port_base::character_size]
- static const int passive = implementation_defined;
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
@@ -28161,12 +48887,13 @@
-[section:protocol_type ip::basic_resolver_query::protocol_type]
-
-The protocol type associated with the endpoint query.
+[section:store serial_port_base::character_size::store]
- typedef InternetProtocol protocol_type;
+[indexterm2 store..serial_port_base::character_size]
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
@@ -28174,11 +48901,11 @@
-[section:service_name ip::basic_resolver_query::service_name]
+[section:value serial_port_base::character_size::value]
-Get the service name associated with the query.
+[indexterm2 value..serial_port_base::character_size]
- std::string service_name() const;
+ unsigned int value() const;
@@ -28186,38 +48913,63 @@
-[section:v4_mapped ip::basic_resolver_query::v4_mapped]
-
-
-['Inherited from ip::resolver_query_base.]
-
-If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
+[endsect]
- static const int v4_mapped = implementation_defined;
+[section:serial_port_base__flow_control serial_port_base::flow_control]
+Serial port option to permit changing the flow control.
+ class flow_control
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[link boost_asio.reference.serial_port_base__flow_control.type [*type]]]
+ []
+
+ ]
-[section:ip__host_name ip::host_name]
+]
-Get the current host name.
+[heading Member Functions]
+[table
+ [[Name][Description]]
- std::string ``[link boost_asio.reference.ip__host_name.overload1 host_name]``();
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control.flow_control [*flow_control]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control.load [*load]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control.store [*store]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control.value [*value]]]
+ []
+ ]
+
+]
- std::string ``[link boost_asio.reference.ip__host_name.overload2 host_name]``(
- boost::system::error_code & ec);
+Implements changing the flow control for a given serial port.
-[section:overload1 ip::host_name (1 of 2 overloads)]
+[section:flow_control serial_port_base::flow_control::flow_control]
-Get the current host name.
+[indexterm2 flow_control..serial_port_base::flow_control]
- std::string host_name();
+ flow_control(
+ type t = none);
@@ -28225,11 +48977,12 @@
-[section:overload2 ip::host_name (2 of 2 overloads)]
+[section:load serial_port_base::flow_control::load]
-Get the current host name.
+[indexterm2 load..serial_port_base::flow_control]
- std::string host_name(
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
boost::system::error_code & ec);
@@ -28237,42 +48990,46 @@
[endsect]
-[endsect]
-
-
-[section:ip__multicast__enable_loopback 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.
+[section:store serial_port_base::flow_control::store]
- typedef implementation_defined enable_loopback;
+[indexterm2 store..serial_port_base::flow_control]
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
-Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option.
+[endsect]
-[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);
+[section:type serial_port_base::flow_control::type]
+[indexterm2 type..serial_port_base::flow_control]
+ enum type
-Getting the current option value:
+[heading Values]
+[variablelist
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::enable_loopback option;
- socket.get_option(option);
- bool is_set = option.value();
+ [
+ [none]
+ []
+ ]
+ [
+ [software]
+ []
+ ]
+ [
+ [hardware]
+ []
+ ]
+]
@@ -28280,101 +49037,103 @@
-[section:ip__multicast__hops 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);
-
-
-
+[section:value serial_port_base::flow_control::value]
-Getting the current option value:
+[indexterm2 value..serial_port_base::flow_control]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+ type value() const;
+[endsect]
[endsect]
+[section:serial_port_base__parity serial_port_base::parity]
+Serial port option to permit changing the parity.
-[section:ip__multicast__join_group ip::multicast::join_group]
+ class parity
-Socket option to join a multicast group on a specified interface.
- typedef implementation_defined join_group;
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.serial_port_base__parity.type [*type]]]
+ []
+
+ ]
-Implements the IPPROTO\_IP/IP\_ADD\_MEMBERSHIP socket option.
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[heading Examples]
+ [
+ [[link boost_asio.reference.serial_port_base__parity.load [*load]]]
+ []
+ ]
-Setting the option to join a multicast group:
+ [
+ [[link boost_asio.reference.serial_port_base__parity.parity [*parity]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__parity.store [*store]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_base__parity.value [*value]]]
+ []
+ ]
+
+]
- 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);
+Implements changing the parity for a given serial port.
+[section:load serial_port_base::parity::load]
+[indexterm2 load..serial_port_base::parity]
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
-[endsect]
+[endsect]
-[section:ip__multicast__leave_group ip::multicast::leave_group]
-Socket option to leave a multicast group on a specified interface.
+[section:parity serial_port_base::parity::parity]
- typedef implementation_defined leave_group;
+[indexterm2 parity..serial_port_base::parity]
+ parity(
+ type t = none);
-Implements the IPPROTO\_IP/IP\_DROP\_MEMBERSHIP socket option.
+[endsect]
-[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);
+[section:store serial_port_base::parity::store]
+[indexterm2 store..serial_port_base::parity]
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
@@ -28382,102 +49141,108 @@
-[section:ip__multicast__outbound_interface ip::multicast::outbound_interface]
+[section:type serial_port_base::parity::type]
-Socket option for local interface to use for outgoing multicast packets.
+[indexterm2 type..serial_port_base::parity]
- typedef implementation_defined outbound_interface;
+ enum type
+[heading Values]
+[variablelist
+ [
+ [none]
+ []
+ ]
-Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option.
+ [
+ [odd]
+ []
+ ]
+ [
+ [even]
+ []
+ ]
-[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);
+
+
+[endsect]
+[section:value serial_port_base::parity::value]
+
+[indexterm2 value..serial_port_base::parity]
+
+ type value() const;
[endsect]
-[section:ip__resolver_query_base ip::resolver_query_base]
-The resolver_query_base class is used as a base for the basic_resolver_query class templates to provide a common place to define the flag constants.
+[endsect]
- class resolver_query_base
+[section:serial_port_base__stop_bits serial_port_base::stop_bits]
+Serial port option to permit changing the number of stop bits.
-[heading Data Members]
+ class stop_bits
+
+
+[heading Types]
[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.serial_port_base__stop_bits.type [*type]]]
+ []
+
]
- [
- [[link boost_asio.reference.ip__resolver_query_base.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
- [[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.serial_port_base__stop_bits.load [*load]]]
+ []
]
-
+
[
- [[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.serial_port_base__stop_bits.stop_bits [*stop_bits]]]
+ []
]
-
+
[
- [[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.serial_port_base__stop_bits.store [*store]]]
+ []
]
-
+
[
- [[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. ]
+ [[link boost_asio.reference.serial_port_base__stop_bits.value [*value]]]
+ []
]
-
+
]
-
-[section:address_configured ip::resolver_query_base::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.
-
- static const int address_configured = implementation_defined;
-
-
-
-[endsect]
-
+Implements changing the number of stop bits for a given serial port.
-[section:all_matching ip::resolver_query_base::all_matching]
+[section:load serial_port_base::stop_bits::load]
-If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
+[indexterm2 load..serial_port_base::stop_bits]
- static const int all_matching = implementation_defined;
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
@@ -28485,11 +49250,12 @@
-[section:canonical_name ip::resolver_query_base::canonical_name]
+[section:stop_bits serial_port_base::stop_bits::stop_bits]
-Determine the canonical name of the host specified in the query.
+[indexterm2 stop_bits..serial_port_base::stop_bits]
- static const int canonical_name = implementation_defined;
+ stop_bits(
+ type t = one);
@@ -28497,11 +49263,13 @@
-[section:numeric_host ip::resolver_query_base::numeric_host]
+[section:store serial_port_base::stop_bits::store]
-Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
+[indexterm2 store..serial_port_base::stop_bits]
- static const int numeric_host = implementation_defined;
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
@@ -28509,23 +49277,31 @@
-[section:numeric_service ip::resolver_query_base::numeric_service]
-
-Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
-
- static const int numeric_service = implementation_defined;
-
+[section:type serial_port_base::stop_bits::type]
+[indexterm2 type..serial_port_base::stop_bits]
-[endsect]
+ enum type
+[heading Values]
+[variablelist
+ [
+ [one]
+ []
+ ]
-[section:passive ip::resolver_query_base::passive]
+ [
+ [onepointfive]
+ []
+ ]
-Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+ [
+ [two]
+ []
+ ]
- static const int passive = implementation_defined;
+]
@@ -28533,11 +49309,11 @@
-[section:v4_mapped ip::resolver_query_base::v4_mapped]
+[section:value serial_port_base::stop_bits::value]
-If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
+[indexterm2 value..serial_port_base::stop_bits]
- static const int v4_mapped = implementation_defined;
+ type value() const;
@@ -28547,13 +49323,11 @@
[endsect]
-[section:ip__resolver_service ip::resolver_service]
+[section:serial_port_service serial_port_service]
-Default service implementation for a resolver.
+Default service implementation for a serial port.
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class resolver_service :
+ class serial_port_service :
public io_service::service
@@ -28563,90 +49337,119 @@
[
- [[link boost_asio.reference.ip__resolver_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.serial_port_service.implementation_type [*implementation_type]]]
+ [The type of a serial port implementation. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.implementation_type [*implementation_type]]]
- [The type of a resolver implementation. ]
+ [[link boost_asio.reference.serial_port_service.native_type [*native_type]]]
+ [The native handle type. ]
]
- [
+]
- [[link boost_asio.reference.ip__resolver_service.iterator_type [*iterator_type]]]
- [The iterator type. ]
-
- ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
-
- [[link boost_asio.reference.ip__resolver_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
+ [[link boost_asio.reference.serial_port_service.assign [*assign]]]
+ [Assign an existing native handle to a serial port. ]
]
-
+
[
-
- [[link boost_asio.reference.ip__resolver_service.query_type [*query_type]]]
- [The query type. ]
+ [[link boost_asio.reference.serial_port_service.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+ [
+ [[link boost_asio.reference.serial_port_service.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
-
-]
-
-[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. ]
+ [[link boost_asio.reference.serial_port_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.cancel [*cancel]]]
- [Cancel pending asynchronous operations. ]
+ [[link boost_asio.reference.serial_port_service.close [*close]]]
+ [Close a serial port implementation. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.construct [*construct]]]
- [Construct a new resolver implementation. ]
+ [[link boost_asio.reference.serial_port_service.construct [*construct]]]
+ [Construct a new serial port implementation. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.destroy [*destroy]]]
- [Destroy a resolver implementation. ]
+ [[link boost_asio.reference.serial_port_service.destroy [*destroy]]]
+ [Destroy a serial port implementation. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.serial_port_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]]]
+ [[link boost_asio.reference.serial_port_service.get_option [*get_option]]]
+ [Get a serial port option. ]
+ ]
+
+ [
+ [[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.ip__resolver_service.resolve [*resolve]]]
- [Resolve a query to a list of entries. ]
+ [[link boost_asio.reference.serial_port_service.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[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.serial_port_service.native [*native]]]
+ [Get the native handle implementation. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.shutdown_service [*shutdown_service]]]
+ [[link boost_asio.reference.serial_port_service.open [*open]]]
+ [Open a serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.read_some [*read_some]]]
+ [Read some data from the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.send_break [*send_break]]]
+ [Send a break sequence to the serial port. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.serial_port_service [*serial_port_service]]]
+ [Construct a new serial port service for the specified io_service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.set_option [*set_option]]]
+ [Set a serial port option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.serial_port_service.shutdown_service [*shutdown_service]]]
[Destroy all user-defined handler objects owned by the service. ]
]
+ [
+ [[link boost_asio.reference.serial_port_service.write_some [*write_some]]]
+ [Write the given data to the stream. ]
+ ]
+
]
[heading Data Members]
@@ -28654,41 +49457,39 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__resolver_service.id [*id]]]
+ [[link boost_asio.reference.serial_port_service.id [*id]]]
[The unique service identifier. ]
]
]
-[section:async_resolve ip::resolver_service::async_resolve]
-Asynchronously resolve a query to a list of entries.
+[section:assign serial_port_service::assign]
- 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);
+[indexterm2 assign..serial_port_service] Assign an existing native handle to a serial port.
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void ``[link boost_asio.reference.ip__resolver_service.async_resolve.overload2 async_resolve]``(
+ boost::system::error_code assign(
implementation_type & impl,
- const endpoint_type & endpoint,
- ResolveHandler handler);
+ const native_type & native_handle,
+ boost::system::error_code & ec);
-[section:overload1 ip::resolver_service::async_resolve (1 of 2 overloads)]
-Asynchronously resolve a query to a list of entries.
+[endsect]
+
+
+
+[section:async_read_some serial_port_service::async_read_some]
+
+[indexterm2 async_read_some..serial_port_service] Start an asynchronous read.
template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void async_resolve(
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
implementation_type & impl,
- const query_type & query,
- Handler handler);
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
@@ -28696,31 +49497,45 @@
-[section:overload2 ip::resolver_service::async_resolve (2 of 2 overloads)]
+[section:async_write_some serial_port_service::async_write_some]
-Asynchronously resolve an endpoint to a list of entries.
+[indexterm2 async_write_some..serial_port_service] Start an asynchronous write.
template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
implementation_type & impl,
- const endpoint_type & endpoint,
- ResolveHandler handler);
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
[endsect]
+
+[section:cancel serial_port_service::cancel]
+
+[indexterm2 cancel..serial_port_service] Cancel all asynchronous operations associated with the handle.
+
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
[endsect]
-[section:cancel ip::resolver_service::cancel]
-Cancel pending asynchronous operations.
+[section:close serial_port_service::close]
- void cancel(
- implementation_type & impl);
+[indexterm2 close..serial_port_service] Close a serial port implementation.
+
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -28728,9 +49543,9 @@
-[section:construct ip::resolver_service::construct]
+[section:construct serial_port_service::construct]
-Construct a new resolver implementation.
+[indexterm2 construct..serial_port_service] Construct a new serial port implementation.
void construct(
implementation_type & impl);
@@ -28741,9 +49556,9 @@
-[section:destroy ip::resolver_service::destroy]
+[section:destroy serial_port_service::destroy]
-Destroy a resolver implementation.
+[indexterm2 destroy..serial_port_service] Destroy a serial port implementation.
void destroy(
implementation_type & impl);
@@ -28754,27 +49569,31 @@
-[section:endpoint_type ip::resolver_service::endpoint_type]
-
-The endpoint type.
+[section:get_io_service serial_port_service::get_io_service]
- typedef InternetProtocol::endpoint endpoint_type;
+['Inherited from io_service.]
+[indexterm2 get_io_service..serial_port_service] Get the io_service object that owns the service.
+ boost::asio::io_service & get_io_service();
-[endsect]
+[endsect]
-[section:get_io_service ip::resolver_service::get_io_service]
-['Inherited from io_service.]
+[section:get_option serial_port_service::get_option]
-Get the io_service object that owns the service.
+[indexterm2 get_option..serial_port_service] Get a serial port option.
- boost::asio::io_service & get_io_service();
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ boost::system::error_code get_option(
+ const implementation_type & impl,
+ GettableSerialPortOption & option,
+ boost::system::error_code & ec) const;
@@ -28782,9 +49601,9 @@
-[section:id ip::resolver_service::id]
+[section:id serial_port_service::id]
-The unique service identifier.
+[indexterm2 id..serial_port_service] The unique service identifier.
static boost::asio::io_service::id id;
@@ -28794,9 +49613,9 @@
-[section:implementation_type ip::resolver_service::implementation_type]
+[section:implementation_type serial_port_service::implementation_type]
-The type of a resolver implementation.
+[indexterm2 implementation_type..serial_port_service] The type of a serial port implementation.
typedef implementation_defined implementation_type;
@@ -28807,12 +49626,12 @@
-[section:io_service ip::resolver_service::io_service]
+[section:io_service serial_port_service::io_service]
['Inherited from io_service.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[indexterm2 io_service..serial_port_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
boost::asio::io_service & io_service();
@@ -28822,12 +49641,12 @@
-[section:iterator_type ip::resolver_service::iterator_type]
-
-The iterator type.
+[section:is_open serial_port_service::is_open]
- typedef InternetProtocol::resolver_iterator iterator_type;
+[indexterm2 is_open..serial_port_service] Determine whether the handle is open.
+ bool is_open(
+ const implementation_type & impl) const;
@@ -28835,12 +49654,12 @@
-[section:protocol_type ip::resolver_service::protocol_type]
-
-The protocol type.
+[section:native serial_port_service::native]
- typedef InternetProtocol protocol_type;
+[indexterm2 native..serial_port_service] Get the native handle implementation.
+ native_type native(
+ implementation_type & impl);
@@ -28848,11 +49667,11 @@
-[section:query_type ip::resolver_service::query_type]
+[section:native_type serial_port_service::native_type]
-The query type.
+[indexterm2 native_type..serial_port_service] The native handle type.
- typedef InternetProtocol::resolver_query query_type;
+ typedef implementation_defined native_type;
@@ -28860,28 +49679,31 @@
[endsect]
-[section:resolve ip::resolver_service::resolve]
-Resolve a query to a list of entries.
+[section:open serial_port_service::open]
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload1 resolve]``(
- implementation_type & impl,
- const query_type & query,
- boost::system::error_code & ec);
+[indexterm2 open..serial_port_service] Open a serial port.
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload2 resolve]``(
+ boost::system::error_code open(
implementation_type & impl,
- const endpoint_type & endpoint,
+ const std::string & device,
boost::system::error_code & ec);
-[section:overload1 ip::resolver_service::resolve (1 of 2 overloads)]
-Resolve a query to a list of entries.
+[endsect]
- iterator_type resolve(
+
+
+[section:read_some serial_port_service::read_some]
+
+[indexterm2 read_some..serial_port_service] Read some data from the stream.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
implementation_type & impl,
- const query_type & query,
+ const MutableBufferSequence & buffers,
boost::system::error_code & ec);
@@ -28890,13 +49712,12 @@
-[section:overload2 ip::resolver_service::resolve (2 of 2 overloads)]
+[section:send_break serial_port_service::send_break]
-Resolve an endpoint to a list of entries.
+[indexterm2 send_break..serial_port_service] Send a break sequence to the serial port.
- iterator_type resolve(
+ boost::system::error_code send_break(
implementation_type & impl,
- const endpoint_type & endpoint,
boost::system::error_code & ec);
@@ -28904,14 +49725,12 @@
[endsect]
-[endsect]
-
-[section:resolver_service ip::resolver_service::resolver_service]
+[section:serial_port_service serial_port_service::serial_port_service]
-Construct a new resolver service for the specified io_service.
+[indexterm2 serial_port_service..serial_port_service] Construct a new serial port service for the specified io_service.
- resolver_service(
+ serial_port_service(
boost::asio::io_service & io_service);
@@ -28920,11 +49739,16 @@
-[section:shutdown_service ip::resolver_service::shutdown_service]
+[section:set_option serial_port_service::set_option]
-Destroy all user-defined handler objects owned by the service.
+[indexterm2 set_option..serial_port_service] Set a serial port option.
- void shutdown_service();
+ template<
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ boost::system::error_code set_option(
+ implementation_type & impl,
+ const SettableSerialPortOption & option,
+ boost::system::error_code & ec);
@@ -28932,284 +49756,109 @@
-[endsect]
-
-[section:ip__tcp ip::tcp]
-
-Encapsulates the flags needed for TCP.
+[section:shutdown_service serial_port_service::shutdown_service]
- class tcp
+[indexterm2 shutdown_service..serial_port_service] Destroy all user-defined handler objects owned by the service.
+ void shutdown_service();
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[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:write_some serial_port_service::write_some]
- [[link boost_asio.reference.ip__tcp.iostream [*iostream]]]
- [The TCP iostream type. ]
-
- ]
+[indexterm2 write_some..serial_port_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);
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.ip__tcp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.ip__tcp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
-
- ]
+[section:service_already_exists service_already_exists]
- [
+Exception thrown when trying to add a duplicate service to an io_service.
- [[link boost_asio.reference.ip__tcp.socket [*socket]]]
- [The TCP socket type. ]
-
- ]
+ class service_already_exists
-]
[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. ]
+ [[link boost_asio.reference.service_already_exists.service_already_exists [*service_already_exists]]]
+ []
]
]
-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.
-
-
-
-[section:acceptor ip::tcp::acceptor]
-
-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. ]
-
- ]
+[section:service_already_exists service_already_exists::service_already_exists]
- [
+[indexterm2 service_already_exists..service_already_exists]
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
+ service_already_exists();
- [
- [[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. ]
-
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+[endsect]
- [
+[section:socket_acceptor_service socket_acceptor_service]
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+Default service implementation for a socket acceptor.
- [
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class socket_acceptor_service :
+ public io_service::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. ]
-
- ]
+
+[heading Types]
+[table
+ [[Name][Description]]
[
- [[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.socket_acceptor_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.socket_acceptor_service.implementation_type [*implementation_type]]]
+ [The native type of the socket acceptor. ]
]
[
- [[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.socket_acceptor_service.native_type [*native_type]]]
+ [The native acceptor type. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
]
@@ -29220,83 +49869,103 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [[link boost_asio.reference.socket_acceptor_service.accept [*accept]]]
[Accept a new connection. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
- [Assigns an existing native acceptor to the acceptor. ]
+ [[link boost_asio.reference.socket_acceptor_service.assign [*assign]]]
+ [Assign an existing native acceptor to a socket acceptor. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [[link boost_asio.reference.socket_acceptor_service.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. ]
+ [[link boost_asio.reference.socket_acceptor_service.bind [*bind]]]
+ [Bind the socket acceptor to the specified local endpoint. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
- [Bind the acceptor to the given local endpoint. ]
+ [[link boost_asio.reference.socket_acceptor_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
+ [[link boost_asio.reference.socket_acceptor_service.close [*close]]]
+ [Close a socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.close [*close]]]
- [Close the acceptor. ]
+ [[link boost_asio.reference.socket_acceptor_service.construct [*construct]]]
+ [Construct a new socket acceptor implementation. ]
]
[
- [[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.socket_acceptor_service.destroy [*destroy]]]
+ [Destroy a socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
- [Get an option from the acceptor. ]
+ [[link boost_asio.reference.socket_acceptor_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[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.socket_acceptor_service.get_option [*get_option]]]
+ [Get a socket option. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [[link boost_asio.reference.socket_acceptor_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[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. ]
]
[
- [[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.socket_acceptor_service.listen [*listen]]]
+ [Place the socket 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.socket_acceptor_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
- [Get the native acceptor representation. ]
+ [[link boost_asio.reference.socket_acceptor_service.native [*native]]]
+ [Get the native acceptor implementation. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
- [Open the acceptor using the specified protocol. ]
+ [[link boost_asio.reference.socket_acceptor_service.open [*open]]]
+ [Open a new socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
- [Set an option on the acceptor. ]
+ [[link boost_asio.reference.socket_acceptor_service.set_option [*set_option]]]
+ [Set a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.socket_acceptor_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.socket_acceptor_service.socket_acceptor_service [*socket_acceptor_service]]]
+ [Construct a new socket acceptor service for the specified io_service. ]
]
]
@@ -29306,50 +49975,40 @@
[[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.socket_acceptor_service.id [*id]]]
+ [The unique service identifier. ]
]
- [
- [[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. ]
- ]
-]
+[section:accept socket_acceptor_service::accept]
-The basic_socket_acceptor class template is used for accepting new socket connections.
+[indexterm2 accept..socket_acceptor_service] Accept a new connection.
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
+ implementation_type & impl,
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type * peer_endpoint,
+ boost::system::error_code & ec);
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+[endsect]
- 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();
+[section:assign socket_acceptor_service::assign]
+[indexterm2 assign..socket_acceptor_service] 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,
+ boost::system::error_code & ec);
@@ -29357,115 +50016,47 @@
-[section:endpoint ip::tcp::endpoint]
+[section:async_accept socket_acceptor_service::async_accept]
-The type of a TCP endpoint.
+[indexterm2 async_accept..socket_acceptor_service] Start an asynchronous accept.
- typedef basic_endpoint< tcp > endpoint;
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void async_accept(
+ implementation_type & impl,
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type * peer_endpoint,
+ AcceptHandler handler);
-[heading Types]
-[table
- [[Name][Description]]
- [
+[endsect]
- [[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. ]
-
- ]
+[section:bind socket_acceptor_service::bind]
-]
+[indexterm2 bind..socket_acceptor_service] Bind the socket acceptor to the specified local endpoint.
-[heading Member Functions]
-[table
- [[Name][Description]]
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default 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. ]
- ]
-
- [
- [[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_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
-
-]
+[endsect]
-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.
+[section:cancel socket_acceptor_service::cancel]
-[*Shared] [*objects:] Unsafe.
+[indexterm2 cancel..socket_acceptor_service] Cancel all asynchronous operations associated with the acceptor.
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -29473,11 +50064,13 @@
-[section:family ip::tcp::family]
+[section:close socket_acceptor_service::close]
-Obtain an identifier for the protocol family.
+[indexterm2 close..socket_acceptor_service] Close a socket acceptor implementation.
- int family() const;
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -29485,78 +50078,53 @@
-[section:iostream ip::tcp::iostream]
+[section:construct socket_acceptor_service::construct]
-The TCP iostream type.
+[indexterm2 construct..socket_acceptor_service] Construct a new socket acceptor implementation.
- typedef basic_socket_iostream< tcp > iostream;
+ void construct(
+ implementation_type & impl);
-[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. ]
- ]
-
- [
- [[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. ]
- ]
-
-]
+[endsect]
-[endsect]
+[section:destroy socket_acceptor_service::destroy]
+[indexterm2 destroy..socket_acceptor_service] Destroy a socket acceptor implementation.
+ void destroy(
+ implementation_type & impl);
-[section:no_delay ip::tcp::no_delay]
-Socket option for disabling the Nagle algorithm.
- typedef implementation_defined no_delay;
+[endsect]
-Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
+[section:endpoint_type socket_acceptor_service::endpoint_type]
+[indexterm2 endpoint_type..socket_acceptor_service] The endpoint type.
-[heading Examples]
-
-Setting the option:
+ typedef protocol_type::endpoint endpoint_type;
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
+[endsect]
-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();
+[section:get_io_service socket_acceptor_service::get_io_service]
+
+
+['Inherited from io_service.]
+[indexterm2 get_io_service..socket_acceptor_service] Get the io_service object that owns the service.
+ boost::asio::io_service & get_io_service();
@@ -29564,13 +50132,16 @@
-[section:operator_not__eq_ ip::tcp::operator!=]
+[section:get_option socket_acceptor_service::get_option]
-Compare two protocols for inequality.
+[indexterm2 get_option..socket_acceptor_service] Get a socket option.
- friend bool operator!=(
- const tcp & p1,
- const tcp & p2);
+ 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;
@@ -29578,13 +50149,11 @@
-[section:operator_eq__eq_ ip::tcp::operator==]
+[section:id socket_acceptor_service::id]
-Compare two protocols for equality.
+[indexterm2 id..socket_acceptor_service] The unique service identifier.
- friend bool operator==(
- const tcp & p1,
- const tcp & p2);
+ static boost::asio::io_service::id id;
@@ -29592,11 +50161,12 @@
-[section:protocol ip::tcp::protocol]
+[section:implementation_type socket_acceptor_service::implementation_type]
-Obtain an identifier for the protocol.
+[indexterm2 implementation_type..socket_acceptor_service] The native type of the socket acceptor.
+
+ typedef implementation_defined implementation_type;
- int protocol() const;
@@ -29604,106 +50174,59 @@
-[section:resolver ip::tcp::resolver]
+[section:io_control socket_acceptor_service::io_control]
-The TCP resolver type.
+[indexterm2 io_control..socket_acceptor_service] Perform an IO control command on the socket.
- typedef basic_resolver< tcp > resolver;
+ 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 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:io_service socket_acceptor_service::io_service]
- [
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
+['Inherited from io_service.]
- [
+[indexterm2 io_service..socket_acceptor_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+ boost::asio::io_service & io_service();
- [
- [[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. ]
-
- ]
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:is_open socket_acceptor_service::is_open]
- [
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously resolve a query 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]]]
- [Resolve a query to a list of entries. ]
- ]
-
-]
+[indexterm2 is_open..socket_acceptor_service] Determine whether the acceptor is open.
-The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
+ bool is_open(
+ const implementation_type & impl) const;
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
+
+
+
+[section:listen socket_acceptor_service::listen]
+
+[indexterm2 listen..socket_acceptor_service] Place the socket acceptor into the state where it will listen for new connections.
+ boost::system::error_code listen(
+ implementation_type & impl,
+ int backlog,
+ boost::system::error_code & ec);
@@ -29711,46 +50234,54 @@
-[section:resolver_iterator ip::tcp::resolver_iterator]
+[section:local_endpoint socket_acceptor_service::local_endpoint]
-The type of a resolver iterator.
+[indexterm2 local_endpoint..socket_acceptor_service] Get the local endpoint.
- typedef basic_resolver_iterator< tcp > resolver_iterator;
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
-[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. ]
- ]
-
-]
+[endsect]
+
+
+
+[section:native socket_acceptor_service::native]
+
+[indexterm2 native..socket_acceptor_service] Get the native acceptor implementation.
+
+ native_type native(
+ implementation_type & impl);
+
-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:native_type socket_acceptor_service::native_type]
+[indexterm2 native_type..socket_acceptor_service] The native acceptor type.
+ typedef implementation_defined native_type;
+
+
+
+
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:open socket_acceptor_service::open]
+
+[indexterm2 open..socket_acceptor_service] Open a new socket acceptor implementation.
+
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
@@ -29758,103 +50289,54 @@
-[section:resolver_query ip::tcp::resolver_query]
+[section:protocol_type socket_acceptor_service::protocol_type]
-The type of a resolver query.
+[indexterm2 protocol_type..socket_acceptor_service] The protocol type.
- typedef basic_resolver_query< tcp > resolver_query;
+ typedef Protocol protocol_type;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
+[endsect]
-]
-[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. ]
- ]
-
- [
- [[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:set_option socket_acceptor_service::set_option]
-[heading Data Members]
-[table
- [[Name][Description]]
+[indexterm2 set_option..socket_acceptor_service] Set a socket option.
- [
- [[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. ]
- ]
+ 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);
- [
- [[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. ]
- ]
+[endsect]
- [
- [[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. ]
- ]
+[section:shutdown_service socket_acceptor_service::shutdown_service]
-]
+[indexterm2 shutdown_service..socket_acceptor_service] Destroy all user-defined handler objects owned by the service.
-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 shutdown_service();
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
+
+
+[section:socket_acceptor_service socket_acceptor_service::socket_acceptor_service]
+
+[indexterm2 socket_acceptor_service..socket_acceptor_service] Construct a new socket acceptor service for the specified io_service.
+
+ socket_acceptor_service(
+ boost::asio::io_service & io_service);
@@ -29862,11 +50344,13 @@
-[section:socket ip::tcp::socket]
+[endsect]
+
+[section:socket_base socket_base]
-The TCP socket type.
+The socket_base class is used as a base for the basic_stream_socket and basic_datagram_socket class templates so that we have a common place to define the shutdown_type and enum.
- typedef basic_stream_socket< tcp > socket;
+ class socket_base
[heading Types]
@@ -29875,338 +50359,412 @@
[
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [[link boost_asio.reference.socket_base.broadcast [*broadcast]]]
[Socket option to permit sending of broadcast messages. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.debug [*debug]]]
[Socket option to enable socket-level debugging. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.keep_alive [*keep_alive]]]
[Socket option to send keep-alives. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.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. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [[link boost_asio.reference.socket_base.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. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.receive_low_watermark [*receive_low_watermark]]]
[Socket option for the receive low watermark. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.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]]]
+ [[link boost_asio.reference.socket_base.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
]
-[heading Member Functions]
+[heading Protected 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. ]
- ]
-
- [
- [[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. ]
+ [[link boost_asio.reference.socket_base._socket_base [*~socket_base]]]
+ [Protected destructor to prevent deletion through this type. ]
]
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.basic_stream_socket.native [*native]]]
- [Get the native socket representation. ]
+ [[link boost_asio.reference.socket_base.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
]
-
+
[
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.socket_base.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.read_some [*read_some]]]
- [Read some data from the socket. ]
+ [[link boost_asio.reference.socket_base.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
]
-
+
[
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the socket. ]
+ [[link boost_asio.reference.socket_base.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
]
+
+]
+
+
+[section:broadcast socket_base::broadcast]
+
+[indexterm2 broadcast..socket_base] Socket option to permit sending of broadcast messages.
+
+ typedef implementation_defined broadcast;
+
+
+
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+
+
+[heading Examples]
- [
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
+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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:bytes_readable socket_base::bytes_readable]
+
+[indexterm2 bytes_readable..socket_base] 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.basic_stream_socket.send [*send]]]
- [Send some data on the socket. ]
- ]
+
+
+ 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:debug socket_base::debug]
+
+[indexterm2 debug..socket_base] Socket option to enable socket-level debugging.
+
+ typedef implementation_defined debug;
+
+
+
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+
+
+[heading Examples]
- [
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
+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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:do_not_route socket_base::do_not_route]
+
+[indexterm2 do_not_route..socket_base] Socket option to prevent routing, use local interfaces only.
+
+ typedef implementation_defined do_not_route;
+
+
+
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+
+
+[heading Examples]
- [
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
+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();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:enable_connection_aborted socket_base::enable_connection_aborted]
+
+[indexterm2 enable_connection_aborted..socket_base] Socket option to report aborted connections on accept.
+
+ 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]
- [
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
- ]
+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::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:keep_alive socket_base::keep_alive]
+
+[indexterm2 keep_alive..socket_base] Socket option to send keep-alives.
+
+ typedef implementation_defined keep_alive;
+
+
+
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+
+
+[heading Examples]
-]
+Setting the option:
-[heading Data Members]
-[table
- [[Name][Description]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
- [
- [[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. ]
- ]
+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();
-The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
-[heading Thread Safety]
+
+
+
+[endsect]
+
+
+
+[section:linger socket_base::linger]
+
+[indexterm2 linger..socket_base] 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]
-[*Distinct] [*objects:] Safe.
+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();
+
-[*Shared] [*objects:] Unsafe.
@@ -30215,11 +50773,11 @@
-[section:type ip::tcp::type]
+[section:max_connections socket_base::max_connections]
-Obtain an identifier for the type of the protocol.
+[indexterm2 max_connections..socket_base] The maximum length of the queue of pending incoming connections.
- int type() const;
+ static const int max_connections = implementation_defined;
@@ -30227,11 +50785,11 @@
-[section:v4 ip::tcp::v4]
+[section:message_do_not_route socket_base::message_do_not_route]
-Construct to represent the IPv4 TCP protocol.
+[indexterm2 message_do_not_route..socket_base] Specify that the data should not be subject to routing.
- static tcp v4();
+ static const int message_do_not_route = implementation_defined;
@@ -30239,11 +50797,12 @@
-[section:v6 ip::tcp::v6]
+[section:message_flags socket_base::message_flags]
-Construct to represent the IPv6 TCP protocol.
+[indexterm2 message_flags..socket_base] Bitmask type for flags that can be passed to send and receive operations.
+
+ typedef int message_flags;
- static tcp v6();
@@ -30251,223 +50810,171 @@
+[section:message_out_of_band socket_base::message_out_of_band]
+
+[indexterm2 message_out_of_band..socket_base] Process out-of-band data.
+
+ static const int message_out_of_band = implementation_defined;
+
+
+
[endsect]
-[section:ip__udp ip::udp]
-Encapsulates the flags needed for UDP.
- class udp
+[section:message_peek socket_base::message_peek]
+[indexterm2 message_peek..socket_base] Peek at incoming data without removing it from the input queue.
-[heading Types]
-[table
- [[Name][Description]]
+ static const int message_peek = implementation_defined;
- [
- [[link boost_asio.reference.ip__udp.endpoint [*endpoint]]]
- [The type of a UDP endpoint. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.ip__udp.resolver [*resolver]]]
- [The UDP resolver type. ]
-
- ]
- [
- [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
-
- ]
+[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.
- [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
-
- ]
+ typedef implementation_defined non_blocking_io;
- [
- [[link boost_asio.reference.ip__udp.socket [*socket]]]
- [The UDP socket type. ]
-
- ]
-]
+Implements the FIONBIO IO control command.
-[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 Example]
-]
-[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. ]
- ]
-
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
-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.
+[endsect]
-[section:endpoint ip::udp::endpoint]
-The type of a UDP endpoint.
- typedef basic_endpoint< udp > endpoint;
+[section:receive_buffer_size socket_base::receive_buffer_size]
+[indexterm2 receive_buffer_size..socket_base] Socket option for the receive buffer size of a socket.
-[heading Types]
-[table
- [[Name][Description]]
+ typedef implementation_defined receive_buffer_size;
- [
- [[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. ]
-
- ]
- [
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
+
+[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);
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default 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. ]
- ]
-
- [
- [[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_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
- ]
+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:receive_low_watermark socket_base::receive_low_watermark]
+
+[indexterm2 receive_low_watermark..socket_base] Socket option for the receive low watermark.
+
+ typedef implementation_defined receive_low_watermark;
+
+
+
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+
+
+[heading Examples]
-]
+Setting the option:
-The
-[link boost_asio.reference.ip__basic_endpoint ip::basic_endpoint] class template describes an endpoint that may be associated with a particular socket.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
-[heading Thread Safety]
+
+
+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]
+
+
+
+[section:reuse_address socket_base::reuse_address]
+
+[indexterm2 reuse_address..socket_base] Socket option to allow the socket to be bound to an address that is already in use.
+
+ typedef implementation_defined reuse_address;
+
+
+
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+
+
+[heading Examples]
-[*Distinct] [*objects:] Safe.
+Setting the option:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
+
+
+
+
+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();
+
-[*Shared] [*objects:] Unsafe.
@@ -30476,11 +50983,39 @@
-[section:family ip::udp::family]
+[section:send_buffer_size socket_base::send_buffer_size]
+
+[indexterm2 send_buffer_size..socket_base] Socket option for the send buffer size of a socket.
+
+ typedef implementation_defined send_buffer_size;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+
+
+[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);
+
+
+
+
+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();
+
-Obtain an identifier for the protocol family.
- int family() const;
@@ -30488,13 +51023,39 @@
-[section:operator_not__eq_ ip::udp::operator!=]
+[section:send_low_watermark socket_base::send_low_watermark]
+
+[indexterm2 send_low_watermark..socket_base] Socket option for the send low watermark.
+
+ typedef implementation_defined send_low_watermark;
+
+
+
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+
+
+[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);
+
+
+
+
+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();
+
-Compare two protocols for inequality.
- friend bool operator!=(
- const udp & p1,
- const udp & p2);
@@ -30502,13 +51063,31 @@
-[section:operator_eq__eq_ ip::udp::operator==]
+[section:shutdown_type socket_base::shutdown_type]
-Compare two protocols for equality.
+[indexterm2 shutdown_type..socket_base] Different ways a socket may be shutdown.
- friend bool operator==(
- const udp & p1,
- const udp & p2);
+ enum shutdown_type
+
+[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. ]
+ ]
+
+]
@@ -30516,11 +51095,11 @@
-[section:protocol ip::udp::protocol]
+[section:_socket_base socket_base::~socket_base]
-Obtain an identifier for the protocol.
+[indexterm2 ~socket_base..socket_base] Protected destructor to prevent deletion through this type.
- int protocol() const;
+ ~socket_base();
@@ -30528,11 +51107,16 @@
-[section:resolver ip::udp::resolver]
+[endsect]
-The UDP resolver type.
+[section:ssl__basic_context ssl::basic_context]
- typedef basic_resolver< udp > resolver;
+SSL context.
+
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ class basic_context :
+ public ssl::context_base
[heading Types]
@@ -30541,43 +51125,50 @@
[
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.ssl__basic_context.file_format [*file_format]]]
+ [File format types. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+ [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
+ [The native implementation type of the locking dispatcher. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
+ [[link boost_asio.reference.ssl__basic_context.method [*method]]]
+ [Different methods supported by a context. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.ssl__basic_context.options [*options]]]
+ [Bitmask type for SSL options. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__basic_context.password_purpose [*password_purpose]]]
+ [Purpose of PEM password. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
+ [[link boost_asio.reference.ssl__basic_context.service_type [*service_type]]]
+ [The type of the service that will be used to provide context operations. ]
]
[
- [[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.ssl__basic_context.verify_mode [*verify_mode]]]
+ [Bitmask type for peer verification. ]
]
@@ -30588,93 +51179,163 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
- [Asynchronously resolve a query to a list of entries. ]
+ [[link boost_asio.reference.ssl__basic_context.add_verify_path [*add_verify_path]]]
+ [Add a directory containing certificate authority files to be used for performing verification. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [[link boost_asio.reference.ssl__basic_context.basic_context [*basic_context]]]
[Constructor. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
+ [[link boost_asio.reference.ssl__basic_context.impl [*impl]]]
+ [Get the underlying implementation in the native type. ]
]
[
- [[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.ssl__basic_context.load_verify_file [*load_verify_file]]]
+ [Load a certification authority file for performing verification. ]
]
[
- [[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.ssl__basic_context.set_options [*set_options]]]
+ [Set options on the context. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Resolve a query to a list of entries. ]
+ [[link boost_asio.reference.ssl__basic_context.set_password_callback [*set_password_callback]]]
+ [Set the password callback. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.set_verify_mode [*set_verify_mode]]]
+ [Set the peer verification mode. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file [*use_certificate_chain_file]]]
+ [Use a certificate chain from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_certificate_file [*use_certificate_file]]]
+ [Use a certificate from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_private_key_file [*use_private_key_file]]]
+ [Use a private key from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file [*use_rsa_private_key_file]]]
+ [Use an RSA private key from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file [*use_tmp_dh_file]]]
+ [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context._basic_context [*~basic_context]]]
+ [Destructor. ]
]
]
-The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
+[heading Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__basic_context.default_workarounds [*default_workarounds]]]
+ [Implement various bug workarounds. ]
+ ]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_sslv2 [*no_sslv2]]]
+ [Disable SSL v2. ]
+ ]
-[*Shared] [*objects:] Unsafe.
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_sslv3 [*no_sslv3]]]
+ [Disable SSL v3. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_tlsv1 [*no_tlsv1]]]
+ [Disable TLS v1. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.single_dh_use [*single_dh_use]]]
+ [Always create a new key when using tmp_dh parameters. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_client_once [*verify_client_once]]]
+ [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
+ [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_none [*verify_none]]]
+ [No verification. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_peer [*verify_peer]]]
+ [Verify the peer. ]
+ ]
-[section:resolver_iterator ip::udp::resolver_iterator]
+]
-The type of a resolver iterator.
+[section:add_verify_path ssl::basic_context::add_verify_path]
- typedef basic_resolver_iterator< udp > resolver_iterator;
+[indexterm2 add_verify_path..ssl::basic_context] Add a directory containing certificate authority files to be used for performing verification.
+ void ``[link boost_asio.reference.ssl__basic_context.add_verify_path.overload1 add_verify_path]``(
+ const std::string & path);
-[heading Member Functions]
-[table
- [[Name][Description]]
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.add_verify_path.overload2 add_verify_path]``(
+ const std::string & path,
+ boost::system::error_code & ec);
- [
- [[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
-[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 ssl::basic_context::add_verify_path (1 of 2 overloads)]
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+Add a directory containing certificate authority files to be used for performing verification.
- const basic_resolver_entry<InternetProtocol>
+ void add_verify_path(
+ const std::string & path);
+This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".
+[heading Parameters]
+
-[heading Thread Safety]
+[variablelist
-[*Distinct] [*objects:] Safe.
+[[path][The name of a directory containing the certificates.]]
-[*Shared] [*objects:] Unsafe.
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -30682,468 +51343,303 @@
-[section:resolver_query ip::udp::resolver_query]
+[section:overload2 ssl::basic_context::add_verify_path (2 of 2 overloads)]
-The type of a resolver query.
+Add a directory containing certificate authority files to be used for performing verification.
- typedef basic_resolver_query< udp > resolver_query;
+ boost::system::error_code add_verify_path(
+ const std::string & path,
+ boost::system::error_code & ec);
-[heading Types]
-[table
- [[Name][Description]]
+This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".
- [
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[path][The name of a directory containing the certificates.]]
+
+[[ec][Set to indicate what error occurred, if any. ]]
]
-[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. ]
- ]
-
- [
- [[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]]
+[endsect]
- [
- [[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. ]
- ]
+[endsect]
- [
- [[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. ]
- ]
+[section:basic_context ssl::basic_context::basic_context]
- [
- [[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. ]
- ]
+[indexterm2 basic_context..ssl::basic_context] Constructor.
- [
- [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
- [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
- ]
+ basic_context(
+ boost::asio::io_service & io_service,
+ method m);
- [
- [[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.
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:default_workarounds ssl::basic_context::default_workarounds]
+['Inherited from ssl::context_base.]
+[indexterm2 default_workarounds..ssl::basic_context] Implement various bug workarounds.
-[endsect]
+ static const int default_workarounds = implementation_defined;
-[section:socket ip::udp::socket]
+[endsect]
-The UDP socket type.
- typedef basic_datagram_socket< udp > socket;
+[section:file_format ssl::basic_context::file_format]
-[heading Types]
-[table
- [[Name][Description]]
- [
+['Inherited from ssl::context_base.]
- [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+[indexterm2 file_format..ssl::basic_context] File format types.
- [
+ enum file_format
- [[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 Values]
+[variablelist
[
-
- [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
+ [asn1]
+ [ASN.1 file. ]
]
[
-
- [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
+ [pem]
+ [PEM file. ]
]
- [
+]
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
- [
+[section:impl ssl::basic_context::impl]
- [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[indexterm2 impl..ssl::basic_context] Get the underlying implementation in the native type.
- [
+ impl_type impl();
- [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
- [
+This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided.
- [[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. ]
-
- ]
- [
- [[link boost_asio.reference.basic_datagram_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+[section:impl_type ssl::basic_context::impl_type]
- [
+[indexterm2 impl_type..ssl::basic_context] The native implementation type of the locking dispatcher.
- [[link boost_asio.reference.basic_datagram_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+ typedef service_type::impl_type impl_type;
- [
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_datagram_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+[section:load_verify_file ssl::basic_context::load_verify_file]
- [
+[indexterm2 load_verify_file..ssl::basic_context] Load a certification authority file for performing verification.
- [[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. ]
-
- ]
+ void ``[link boost_asio.reference.ssl__basic_context.load_verify_file.overload1 load_verify_file]``(
+ const std::string & filename);
- [
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.load_verify_file.overload2 load_verify_file]``(
+ const std::string & filename,
+ boost::system::error_code & ec);
- [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
- [
+[section:overload1 ssl::basic_context::load_verify_file (1 of 2 overloads)]
- [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+Load a certification authority file for performing verification.
- [
+ void load_verify_file(
+ const std::string & filename);
- [[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. ]
-
- ]
- [
+This function is used to load one or more trusted certification authorities from a file.
- [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+
+[heading Parameters]
+
+
+[variablelist
- ]
+[[filename][The name of a file containing certification authority certificates in PEM format.]]
]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Exceptions]
+
- [
- [[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. ]
- ]
-
- [
- [[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. ]
- ]
+[variablelist
- [
- [[link boost_asio.reference.basic_datagram_socket.native [*native]]]
- [Get the native socket representation. ]
- ]
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 ssl::basic_context::load_verify_file (2 of 2 overloads)]
+
+Load a certification authority file for performing verification.
+
+ boost::system::error_code load_verify_file(
+ const std::string & filename,
+ boost::system::error_code & ec);
+
+
+This function is used to load the certificates for one or more trusted certification authorities from a file.
+
+
+[heading Parameters]
+
+
+[variablelist
+[[filename][The name of a file containing certification authority certificates in PEM format.]]
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:method ssl::basic_context::method]
+
+
+['Inherited from ssl::context_base.]
+
+[indexterm2 method..ssl::basic_context] Different methods supported by a context.
+
+ enum method
+
+[heading Values]
+[variablelist
+
[
- [[link boost_asio.reference.basic_datagram_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [sslv2]
+ [Generic SSL version 2. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.receive [*receive]]]
- [Receive some data on a connected socket. ]
+ [sslv2_client]
+ [SSL version 2 client. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.receive_from [*receive_from]]]
- [Receive a datagram with the endpoint of the sender. ]
+ [sslv2_server]
+ [SSL version 2 server. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ [sslv3]
+ [Generic SSL version 3. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
- [Send some data on a connected socket. ]
+ [sslv3_client]
+ [SSL version 3 client. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [sslv3_server]
+ [SSL version 3 server. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [tlsv1]
+ [Generic TLS version 1. ]
]
-
+
[
- [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [tlsv1_client]
+ [TLS version 1 client. ]
]
-
-]
-
-[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. ]
+ [tlsv1_server]
+ [TLS version 1 server. ]
]
[
- [[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. ]
+ [sslv23]
+ [Generic SSL/TLS. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
+ [sslv23_client]
+ [SSL/TLS client. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
+ [sslv23_server]
+ [SSL/TLS server. ]
]
]
-The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
-[*Shared] [*objects:] Unsafe.
+[section:no_sslv2 ssl::basic_context::no_sslv2]
+
+
+['Inherited from ssl::context_base.]
+
+[indexterm2 no_sslv2..ssl::basic_context] Disable SSL v2.
+
+ static const int no_sslv2 = implementation_defined;
+
[endsect]
-[section:type ip::udp::type]
+[section:no_sslv3 ssl::basic_context::no_sslv3]
-Obtain an identifier for the type of the protocol.
- int type() const;
+['Inherited from ssl::context_base.]
+
+[indexterm2 no_sslv3..ssl::basic_context] Disable SSL v3.
+
+ static const int no_sslv3 = implementation_defined;
@@ -31151,11 +51647,14 @@
-[section:v4 ip::udp::v4]
+[section:no_tlsv1 ssl::basic_context::no_tlsv1]
-Construct to represent the IPv4 UDP protocol.
- static udp v4();
+['Inherited from ssl::context_base.]
+
+[indexterm2 no_tlsv1..ssl::basic_context] Disable TLS v1.
+
+ static const int no_tlsv1 = implementation_defined;
@@ -31163,53 +51662,57 @@
-[section:v6 ip::udp::v6]
+[section:options ssl::basic_context::options]
-Construct to represent the IPv6 UDP protocol.
- static udp v6();
+['Inherited from ssl::context_base.]
+[indexterm2 options..ssl::basic_context] Bitmask type for SSL options.
+ typedef int options;
-[endsect]
[endsect]
-[section:ip__unicast__hops ip::unicast::hops]
-Socket option for time-to-live associated with outgoing unicast packets.
+[section:password_purpose ssl::basic_context::password_purpose]
- typedef implementation_defined hops;
+['Inherited from ssl::context_base.]
+[indexterm2 password_purpose..ssl::basic_context] Purpose of PEM password.
-Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
+ enum password_purpose
+[heading Values]
+[variablelist
-[heading Examples]
-
-Setting the option:
+ [
+ [for_reading]
+ [The password is needed for reading/decryption. ]
+ ]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::unicast::hops option(4);
- socket.set_option(option);
+ [
+ [for_writing]
+ [The password is needed for writing/encryption. ]
+ ]
+]
-Getting the current option value:
+[endsect]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::unicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+[section:service_type ssl::basic_context::service_type]
+
+[indexterm2 service_type..ssl::basic_context] The type of the service that will be used to provide context operations.
+
+ typedef Service service_type;
@@ -31217,299 +51720,396 @@
[endsect]
+[section:set_options ssl::basic_context::set_options]
-[section:ip__v6_only ip::v6_only]
+[indexterm2 set_options..ssl::basic_context] Set options on the context.
-Socket option for determining whether an IPv6 socket supports IPv6 communication only.
+ void ``[link boost_asio.reference.ssl__basic_context.set_options.overload1 set_options]``(
+ options o);
- typedef implementation_defined v6_only;
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_options.overload2 set_options]``(
+ options o,
+ boost::system::error_code & ec);
+[section:overload1 ssl::basic_context::set_options (1 of 2 overloads)]
-Implements the IPPROTO\_IPV6/IP\_V6ONLY socket option.
+Set options on the context.
+
+ void set_options(
+ options o);
-[heading Examples]
+This function may be used to configure the SSL options used by the context.
+
+
+[heading Parameters]
+
+
+[variablelist
-Setting the option:
+[[o][A bitmask of options. The available option values are defined in the context\_base class. The options are bitwise-ored with any existing value for the options.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::v6_only option(true);
- socket.set_option(option);
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-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();
+
+[endsect]
+
+
+
+[section:overload2 ssl::basic_context::set_options (2 of 2 overloads)]
+
+Set options on the context.
+
+ boost::system::error_code set_options(
+ options o,
+ boost::system::error_code & ec);
+
+
+This function may be used to configure the SSL options used by the context.
+[heading Parameters]
+
+
+[variablelist
+
+[[o][A bitmask of options. The available option values are defined in the context\_base class. The options are bitwise-ored with any existing value for the options.]]
+
+[[ec][Set to indicate what error occurred, if any. ]]
+]
[endsect]
-[section:is_read_buffered is_read_buffered]
+[endsect]
-The is_read_buffered class is a traits class that may be used to determine whether a stream type supports buffering of read data.
+[section:set_password_callback ssl::basic_context::set_password_callback]
+
+[indexterm2 set_password_callback..ssl::basic_context] Set the password callback.
template<
- typename Stream>
- class is_read_buffered
+ typename PasswordCallback>
+ void ``[link boost_asio.reference.ssl__basic_context.set_password_callback.overload1 set_password_callback]``(
+ PasswordCallback callback);
+ template<
+ typename PasswordCallback>
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_password_callback.overload2 set_password_callback]``(
+ PasswordCallback callback,
+ boost::system::error_code & ec);
-[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. ]
- ]
+[section:overload1 ssl::basic_context::set_password_callback (1 of 2 overloads)]
-]
+Set the password callback.
+
+ template<
+ typename PasswordCallback>
+ void set_password_callback(
+ PasswordCallback callback);
-[section:value is_read_buffered::value]
+This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
-The value member is true only if the Stream type supports buffering of read data.
- static const bool value;
+[heading Parameters]
+
+
+[variablelist
+
+[[callback][The function object to be used for obtaining the password. The function signature of the handler must be:
+``
+ std::string password_callback(
+ std::size_t max_length, // The maximum size for a password.
+ password_purpose purpose // Whether password is for reading or writing.
+ );
+``
+The return value of the callback is a string containing the password.]]
+
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[endsect]
+]
[endsect]
-[section:is_write_buffered is_write_buffered]
-The is_write_buffered class is a traits class that may be used to determine whether a stream type supports buffering of written data.
+
+[section:overload2 ssl::basic_context::set_password_callback (2 of 2 overloads)]
+
+Set the password callback.
template<
- typename Stream>
- class is_write_buffered
+ typename PasswordCallback>
+ boost::system::error_code set_password_callback(
+ PasswordCallback callback,
+ boost::system::error_code & ec);
-[heading Data Members]
-[table
- [[Name][Description]]
+This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
- [
- [[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 Parameters]
+
+
+[variablelist
+
+[[callback][The function object to be used for obtaining the password. The function signature of the handler must be:
+``
+ std::string password_callback(
+ std::size_t max_length, // The maximum size for a password.
+ password_purpose purpose // Whether password is for reading or writing.
+ );
+``
+The return value of the callback is a string containing the password.]]
+[[ec][Set to indicate what error occurred, if any. ]]
-[section:value is_write_buffered::value]
+]
-The value member is true only if the Stream type supports buffering of written data.
- static const bool value;
+[endsect]
[endsect]
+[section:set_verify_mode ssl::basic_context::set_verify_mode]
+[indexterm2 set_verify_mode..ssl::basic_context] Set the peer verification mode.
-[endsect]
+ void ``[link boost_asio.reference.ssl__basic_context.set_verify_mode.overload1 set_verify_mode]``(
+ verify_mode v);
-[section:mutable_buffer mutable_buffer]
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_verify_mode.overload2 set_verify_mode]``(
+ verify_mode v,
+ boost::system::error_code & ec);
-Holds a buffer that can be modified.
- class mutable_buffer
+[section:overload1 ssl::basic_context::set_verify_mode (1 of 2 overloads)]
+Set the peer verification mode.
-[heading Member Functions]
-[table
- [[Name][Description]]
+ void set_verify_mode(
+ verify_mode v);
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer. ]
- ]
+
+This function may be used to configure the peer verification mode used by the context.
+
+
+[heading Parameters]
+
+
+[variablelist
+[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
+
]
-[heading Friends]
-[table
- [[Name][Description]]
+[heading Exceptions]
+
- [
- [[link boost_asio.reference.mutable_buffer.buffer_cast_helper [*buffer_cast_helper]]]
- []
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.buffer_size_helper [*buffer_size_helper]]]
- []
- ]
+[variablelist
+[[boost::system::system_error][Thrown on failure. ]]
+
]
-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.
-[section:buffer_cast_helper mutable_buffer::buffer_cast_helper]
+[endsect]
- friend void * buffer_cast_helper(
- const mutable_buffer & b);
+[section:overload2 ssl::basic_context::set_verify_mode (2 of 2 overloads)]
+Set the peer verification mode.
+ boost::system::error_code set_verify_mode(
+ verify_mode v,
+ boost::system::error_code & ec);
-[endsect]
+This function may be used to configure the peer verification mode used by the context.
-[section:buffer_size_helper mutable_buffer::buffer_size_helper]
+[heading Parameters]
+
+[variablelist
+
+[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
+[[ec][Set to indicate what error occurred, if any. ]]
- friend std::size_t buffer_size_helper(
- const mutable_buffer & b);
+]
[endsect]
-[section:mutable_buffer mutable_buffer::mutable_buffer]
-
-Construct an empty buffer.
+[endsect]
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 mutable_buffer]``();
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 mutable_buffer]``(
- void * data,
- std::size_t size);
+[section:single_dh_use ssl::basic_context::single_dh_use]
-[section:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
+['Inherited from ssl::context_base.]
-Construct an empty buffer.
+[indexterm2 single_dh_use..ssl::basic_context] Always create a new key when using tmp_dh parameters.
- mutable_buffer();
+ static const int single_dh_use = implementation_defined;
[endsect]
+[section:use_certificate_chain_file ssl::basic_context::use_certificate_chain_file]
-[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
+[indexterm2 use_certificate_chain_file..ssl::basic_context] Use a certificate chain from a file.
-Construct a buffer to represent a given memory range.
+ void ``[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file.overload1 use_certificate_chain_file]``(
+ const std::string & filename);
- mutable_buffer(
- void * data,
- std::size_t size);
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file.overload2 use_certificate_chain_file]``(
+ const std::string & filename,
+ boost::system::error_code & ec);
+[section:overload1 ssl::basic_context::use_certificate_chain_file (1 of 2 overloads)]
-[endsect]
+Use a certificate chain from a file.
+
+ void use_certificate_chain_file(
+ const std::string & filename);
-[endsect]
+This function is used to load a certificate chain into the context from a file.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[filename][The name of the file containing the certificate. The file must use the PEM format.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
[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
+[section:overload2 ssl::basic_context::use_certificate_chain_file (2 of 2 overloads)]
+Use a certificate chain from a file.
-[heading Types]
-[table
- [[Name][Description]]
+ boost::system::error_code use_certificate_chain_file(
+ const std::string & filename,
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
-
- ]
+This function is used to load a certificate chain into the context from a file.
- [
- [[link boost_asio.reference.mutable_buffers_1.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[filename][The name of the file containing the certificate. The file must use the PEM format.]]
+
+[[ec][Set to indicate what error occurred, if any. ]]
]
-[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 single modifiable buffer. ]
- ]
-
-]
+[endsect]
-[section:begin mutable_buffers_1::begin]
-Get a random-access iterator to the first element.
+[endsect]
- const_iterator begin() const;
+[section:use_certificate_file ssl::basic_context::use_certificate_file]
+[indexterm2 use_certificate_file..ssl::basic_context] Use a certificate from a file.
+ void ``[link boost_asio.reference.ssl__basic_context.use_certificate_file.overload1 use_certificate_file]``(
+ const std::string & filename,
+ file_format format);
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_certificate_file.overload2 use_certificate_file]``(
+ const std::string & filename,
+ file_format format,
+ boost::system::error_code & ec);
+[section:overload1 ssl::basic_context::use_certificate_file (1 of 2 overloads)]
-[section:const_iterator mutable_buffers_1::const_iterator]
+Use a certificate from a file.
-A random-access iterator type that may be used to read elements.
+ void use_certificate_file(
+ const std::string & filename,
+ file_format format);
- typedef const mutable_buffer * const_iterator;
+This function is used to load a certificate into the context from a file.
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[filename][The name of the file containing the certificate.]]
+[[format][The file format (ASN.1 or PEM).]]
+]
-[section:end mutable_buffers_1::end]
+[heading Exceptions]
+
-Get a random-access iterator for one past the last element.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- const_iterator end() const;
+]
@@ -31517,81 +52117,84 @@
-[section:mutable_buffers_1 mutable_buffers_1::mutable_buffers_1]
-
-Construct to represent a single modifiable buffer.
+[section:overload2 ssl::basic_context::use_certificate_file (2 of 2 overloads)]
- mutable_buffers_1(
- const mutable_buffer & b);
+Use a certificate from a file.
+ boost::system::error_code use_certificate_file(
+ const std::string & filename,
+ file_format format,
+ boost::system::error_code & ec);
-[endsect]
+This function is used to load a certificate into the context from a file.
+[heading Parameters]
+
-[section:value_type mutable_buffers_1::value_type]
+[variablelist
+
+[[filename][The name of the file containing the certificate.]]
-The type for each element in the list of buffers.
+[[format][The file format (ASN.1 or PEM).]]
- typedef mutable_buffer value_type;
+[[ec][Set to indicate what error occurred, if any. ]]
+]
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer. ]
- ]
-
-]
-[heading Friends]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[link boost_asio.reference.mutable_buffer.buffer_cast_helper [*buffer_cast_helper]]]
- []
- ]
-
- [
- [[link boost_asio.reference.mutable_buffer.buffer_size_helper [*buffer_size_helper]]]
- []
- ]
-
-]
-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.
+[endsect]
+[section:use_private_key_file ssl::basic_context::use_private_key_file]
+[indexterm2 use_private_key_file..ssl::basic_context] Use a private key from a file.
-[endsect]
+ void ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload1 use_private_key_file]``(
+ const std::string & filename,
+ file_format format);
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload2 use_private_key_file]``(
+ const std::string & filename,
+ file_format format,
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 ssl::basic_context::use_private_key_file (1 of 2 overloads)]
+Use a private key from a file.
-[section:placeholders__bytes_transferred placeholders::bytes_transferred]
+ void use_private_key_file(
+ const std::string & filename,
+ file_format format);
-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;
+This function is used to load a private key into the context from a file.
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[filename][The name of the file containing the private key.]]
+[[format][The file format (ASN.1 or PEM).]]
+]
-[section:placeholders__error placeholders::error]
+[heading Exceptions]
+
-An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- unspecified error;
+]
@@ -31599,94 +52202,63 @@
-[section:placeholders__iterator placeholders::iterator]
+[section:overload2 ssl::basic_context::use_private_key_file (2 of 2 overloads)]
-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.
+Use a private key from a file.
- unspecified iterator;
+ boost::system::error_code use_private_key_file(
+ const std::string & filename,
+ file_format format,
+ boost::system::error_code & ec);
+This function is used to load a private key into the context from a file.
-[endsect]
+[heading Parameters]
+
-[section:read read]
+[variablelist
+
+[[filename][The name of the file containing the private key.]]
-Attempt to read a certain amount of data from a stream before returning.
+[[format][The file format (ASN.1 or PEM).]]
- 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);
+[[ec][Set to indicate what error occurred, if any. ]]
- 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]``(
- SyncReadStream & s,
- const MutableBufferSequence & buffers,
- CompletionCondition completion_condition);
+]
- 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,
- boost::system::error_code & ec);
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t ``[link boost_asio.reference.read.overload4 read]``(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b);
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload5 read]``(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
+[endsect]
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t ``[link boost_asio.reference.read.overload6 read]``(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition,
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 read (1 of 6 overloads)]
+[section:use_rsa_private_key_file ssl::basic_context::use_rsa_private_key_file]
-Attempt to read a certain amount of data from a stream before returning.
+[indexterm2 use_rsa_private_key_file..ssl::basic_context] Use an RSA private key from a file.
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read(
- SyncReadStream & s,
- const MutableBufferSequence & buffers);
+ void ``[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file.overload1 use_rsa_private_key_file]``(
+ const std::string & filename,
+ file_format format);
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file.overload2 use_rsa_private_key_file]``(
+ const std::string & filename,
+ file_format format,
+ 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:
+[section:overload1 ssl::basic_context::use_rsa_private_key_file (1 of 2 overloads)]
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+Use an RSA private key from a file.
-* An error occurred.
+ void use_rsa_private_key_file(
+ const std::string & filename,
+ file_format format);
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+
+This function is used to load an RSA private key into the context from a file.
[heading Parameters]
@@ -31694,125 +52266,100 @@
[variablelist
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[[filename][The name of the file containing the RSA private key.]]
-[[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.]]
+[[format][The file format (ASN.1 or PEM).]]
]
-[heading Return Value]
-
-The number of bytes transferred.
-
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
]
-[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.
-[heading Remarks]
-
-This overload is equivalent to calling:
- boost::asio::read(
- s, buffers,
- boost::asio::transfer_all());
+[section:overload2 ssl::basic_context::use_rsa_private_key_file (2 of 2 overloads)]
+Use an RSA private key from a file.
+ boost::system::error_code use_rsa_private_key_file(
+ const std::string & filename,
+ file_format format,
+ boost::system::error_code & ec);
+This function is used to load an RSA private key into the context from a file.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[filename][The name of the file containing the RSA private key.]]
+[[format][The file format (ASN.1 or PEM).]]
-[section:overload2 read (2 of 6 overloads)]
+[[ec][Set to indicate what error occurred, if any. ]]
-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);
-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.
+[endsect]
-* The completion_condition function object returns true.
+[section:use_tmp_dh_file ssl::basic_context::use_tmp_dh_file]
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+[indexterm2 use_tmp_dh_file..ssl::basic_context] Use the specified file to obtain the temporary Diffie-Hellman parameters.
+ void ``[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file.overload1 use_tmp_dh_file]``(
+ const std::string & filename);
-[heading Parameters]
-
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file.overload2 use_tmp_dh_file]``(
+ const std::string & filename,
+ boost::system::error_code & ec);
-[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.]]
+[section:overload1 ssl::basic_context::use_tmp_dh_file (1 of 2 overloads)]
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- bool completion_condition(
- const boost::system::error_code& error, // Result of latest read_some
- // operation.
+Use the specified file to obtain the temporary Diffie-Hellman parameters.
- std::size_t bytes_transferred // Number of bytes transferred
- // so far.
- );
+ void use_tmp_dh_file(
+ const std::string & filename);
-``
-A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
-]
+This function is used to load Diffie-Hellman parameters into the context from a file.
-[heading Return Value]
-
-The number of bytes transferred.
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
]
-[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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-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.
+]
@@ -31820,29 +52367,16 @@
-[section:overload3 read (3 of 6 overloads)]
+[section:overload2 ssl::basic_context::use_tmp_dh_file (2 of 2 overloads)]
-Attempt to read a certain amount of data from a stream before returning.
+Use the specified file to obtain the temporary Diffie-Hellman parameters.
- 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,
+ boost::system::error_code use_tmp_dh_file(
+ const std::string & filename,
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:
-
-
-* 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 true.
-
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+This function is used to load Diffie-Hellman parameters into the context from a file.
[heading Parameters]
@@ -31850,90 +52384,58 @@
[variablelist
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
-[[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.]]
+[[ec][Set to indicate what error occurred, if any. ]]
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- bool completion_condition(
- const boost::system::error_code& error, // Result of latest read_some
- // operation.
+]
- std::size_t bytes_transferred // Number of bytes transferred
- // so far.
- );
-``
-A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
-[[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.
+[endsect]
+[section:verify_client_once ssl::basic_context::verify_client_once]
-[endsect]
+['Inherited from ssl::context_base.]
+[indexterm2 verify_client_once..ssl::basic_context] Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
-[section:overload4 read (4 of 6 overloads)]
+ static const int verify_client_once = implementation_defined;
-Attempt to read a certain amount of data from a stream before returning.
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b);
+[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:
-* An error occurred.
+[section:verify_fail_if_no_peer_cert ssl::basic_context::verify_fail_if_no_peer_cert]
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+['Inherited from ssl::context_base.]
-[heading Parameters]
-
+[indexterm2 verify_fail_if_no_peer_cert..ssl::basic_context] Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+ static const int verify_fail_if_no_peer_cert = implementation_defined;
-[[b][The basic\_streambuf object into which the data will be read.]]
-]
-[heading Return Value]
-
-The number of bytes transferred.
+[endsect]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
+[section:verify_mode ssl::basic_context::verify_mode]
-[heading Remarks]
-
-This overload is equivalent to calling:
- boost::asio::read(
- s, b,
- boost::asio::transfer_all());
+['Inherited from ssl::context_base.]
+[indexterm2 verify_mode..ssl::basic_context] Bitmask type for peer verification.
+ typedef int verify_mode;
@@ -31942,64 +52444,41 @@
-[section:overload5 read (5 of 6 overloads)]
+[section:verify_none ssl::basic_context::verify_none]
-Attempt to read a certain amount of data from a stream before returning.
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator,
- typename CompletionCondition>
- std::size_t read(
- SyncReadStream & s,
- basic_streambuf< Allocator > & b,
- CompletionCondition completion_condition);
+['Inherited from ssl::context_base.]
+[indexterm2 verify_none..ssl::basic_context] No verification.
-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:
+ static const int verify_none = implementation_defined;
-* The completion_condition function object returns true.
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[section:verify_peer ssl::basic_context::verify_peer]
-[[b][The 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:
-``
- bool completion_condition(
- const boost::system::error_code& error, // Result of latest read_some
- // operation.
+['Inherited from ssl::context_base.]
- std::size_t bytes_transferred // Number of bytes transferred
- // so far.
- );
+[indexterm2 verify_peer..ssl::basic_context] Verify the peer.
-``
-A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
+ static const int verify_peer = implementation_defined;
-]
-[heading Return Value]
-
-The number of bytes transferred.
-[heading Exceptions]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+
+[section:_basic_context ssl::basic_context::~basic_context]
+
+[indexterm2 ~basic_context..ssl::basic_context] Destructor.
+
+ ~basic_context();
@@ -32007,232 +52486,341 @@
-[section:overload6 read (6 of 6 overloads)]
+[endsect]
-Attempt to read a certain amount of data from a stream before returning.
- template<
- 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);
+[section:ssl__context ssl::context]
+[indexterm1 ssl::context] Typedef for the typical usage of context.
-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:
+ typedef basic_context< context_service > context;
-* The completion_condition function object returns true.
+[heading Types]
+[table
+ [[Name][Description]]
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+ [
+
+ [[link boost_asio.reference.ssl__basic_context.file_format [*file_format]]]
+ [File format types. ]
+
+ ]
+ [
-[heading Parameters]
-
+ [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
+ [The native implementation type of the locking dispatcher. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__basic_context.method [*method]]]
+ [Different methods supported by a context. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__basic_context.options [*options]]]
+ [Bitmask type for SSL options. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__basic_context.password_purpose [*password_purpose]]]
+ [Purpose of PEM password. ]
+
+ ]
+
+ [
-[variablelist
+ [[link boost_asio.reference.ssl__basic_context.service_type [*service_type]]]
+ [The type of the service that will be used to provide context operations. ]
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-
-[[b][The 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:
-``
- bool completion_condition(
- const boost::system::error_code& error, // Result of latest read_some
- // operation.
+ [
- std::size_t bytes_transferred // Number of bytes transferred
- // so far.
- );
+ [[link boost_asio.reference.ssl__basic_context.verify_mode [*verify_mode]]]
+ [Bitmask type for peer verification. ]
+
+ ]
-``
-A return value of true indicates that the read operation is complete. False indicates that further calls to the stream's read\_some function are required.]]
+]
-[[ec][Set to indicate what error occurred, if any.]]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__basic_context.add_verify_path [*add_verify_path]]]
+ [Add a directory containing certificate authority files to be used for performing verification. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.basic_context [*basic_context]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.impl [*impl]]]
+ [Get the underlying implementation in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.load_verify_file [*load_verify_file]]]
+ [Load a certification authority file for performing verification. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.set_options [*set_options]]]
+ [Set options on the context. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.set_password_callback [*set_password_callback]]]
+ [Set the password callback. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.set_verify_mode [*set_verify_mode]]]
+ [Set the peer verification mode. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file [*use_certificate_chain_file]]]
+ [Use a certificate chain from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_certificate_file [*use_certificate_file]]]
+ [Use a certificate from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_private_key_file [*use_private_key_file]]]
+ [Use a private key from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file [*use_rsa_private_key_file]]]
+ [Use an RSA private key from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file [*use_tmp_dh_file]]]
+ [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context._basic_context [*~basic_context]]]
+ [Destructor. ]
+ ]
+
]
-[heading Return Value]
-
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ssl__basic_context.default_workarounds [*default_workarounds]]]
+ [Implement various bug workarounds. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_sslv2 [*no_sslv2]]]
+ [Disable SSL v2. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_sslv3 [*no_sslv3]]]
+ [Disable SSL v3. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_tlsv1 [*no_tlsv1]]]
+ [Disable TLS v1. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.single_dh_use [*single_dh_use]]]
+ [Always create a new key when using tmp_dh parameters. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_client_once [*verify_client_once]]]
+ [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
+ ]
-[section:read_until read_until]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
+ [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
+ ]
-Read data into a streambuf until a delimiter is encountered.
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_none [*verify_none]]]
+ [No verification. ]
+ ]
- 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);
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_peer [*verify_peer]]]
+ [Verify the peer. ]
+ ]
- 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);
+]
- 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);
- 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);
- 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);
+[endsect]
- 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);
+[section:ssl__context_base ssl::context_base]
-[section:overload1 read_until (1 of 6 overloads)]
+The context_base class is used as a base for the basic_context class template so that we have a common place to define various enums.
-Read data into a streambuf until a delimiter is encountered.
+ class context_base
- 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);
+[heading Types]
+[table
+ [[Name][Description]]
-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:
+ [
+ [[link boost_asio.reference.ssl__context_base.file_format [*file_format]]]
+ [File format types. ]
+
+ ]
-* The get area of the streambuf contains the specified delimiter.
+ [
-* An error occurred.
+ [[link boost_asio.reference.ssl__context_base.method [*method]]]
+ [Different methods supported by a context. ]
+
+ ]
-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.
+ [
+ [[link boost_asio.reference.ssl__context_base.options [*options]]]
+ [Bitmask type for SSL options. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.ssl__context_base.password_purpose [*password_purpose]]]
+ [Purpose of PEM password. ]
-[[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.]]
+ [[link boost_asio.reference.ssl__context_base.verify_mode [*verify_mode]]]
+ [Bitmask type for peer verification. ]
+
+ ]
]
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
-
-[heading Exceptions]
-
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+ [[link boost_asio.reference.ssl__context_base._context_base [*~context_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
-[[boost::system::system_error][Thrown on failure.]]
-
]
-[heading Example]
-
-To read data into a streambuf until a newline is encountered:
+[heading Data Members]
+[table
+ [[Name][Description]]
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, '\n');
- std::istream is(&b);
- std::string line;
- std::getline(is, line);
+ [
+ [[link boost_asio.reference.ssl__context_base.default_workarounds [*default_workarounds]]]
+ [Implement various bug workarounds. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.no_sslv2 [*no_sslv2]]]
+ [Disable SSL v2. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.no_sslv3 [*no_sslv3]]]
+ [Disable SSL v3. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.no_tlsv1 [*no_tlsv1]]]
+ [Disable TLS v1. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.single_dh_use [*single_dh_use]]]
+ [Always create a new key when using tmp_dh parameters. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.verify_client_once [*verify_client_once]]]
+ [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ssl__context_base.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
+ [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.verify_none [*verify_none]]]
+ [No verification. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__context_base.verify_peer [*verify_peer]]]
+ [Verify the peer. ]
+ ]
-[section:overload2 read_until (2 of 6 overloads)]
+]
-Read data into a streambuf until a delimiter is encountered.
- 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,
- boost::system::error_code & ec);
+[section:default_workarounds ssl::context_base::default_workarounds]
+[indexterm2 default_workarounds..ssl::context_base] Implement various bug workarounds.
-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:
+ static const int default_workarounds = implementation_defined;
-* The get area of the streambuf contains the specified delimiter.
-* 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 the delimiter, the function returns immediately.
-[heading Parameters]
-
+[section:file_format ssl::context_base::file_format]
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[indexterm2 file_format..ssl::context_base] File format types.
-[[b][A streambuf object into which the data will be read.]]
+ enum file_format
-[[delim][The delimiter character.]]
+[heading Values]
+[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+ [
+ [asn1]
+ [ASN.1 file. ]
+ ]
-]
+ [
+ [pem]
+ [PEM file. ]
+ ]
-[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.
+]
@@ -32240,67 +52828,88 @@
-[section:overload3 read_until (3 of 6 overloads)]
+[section:method ssl::context_base::method]
-Read data into a streambuf until a delimiter is encountered.
+[indexterm2 method..ssl::context_base] Different methods supported by a context.
- 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);
+ enum method
+[heading Values]
+[variablelist
-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:
+ [
+ [sslv2]
+ [Generic SSL version 2. ]
+ ]
+ [
+ [sslv2_client]
+ [SSL version 2 client. ]
+ ]
-* The get area of the streambuf contains the specified delimiter.
+ [
+ [sslv2_server]
+ [SSL version 2 server. ]
+ ]
-* An error occurred.
+ [
+ [sslv3]
+ [Generic SSL version 3. ]
+ ]
-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.
+ [
+ [sslv3_client]
+ [SSL version 3 client. ]
+ ]
+ [
+ [sslv3_server]
+ [SSL version 3 server. ]
+ ]
-[heading Parameters]
-
+ [
+ [tlsv1]
+ [Generic TLS version 1. ]
+ ]
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+ [
+ [tlsv1_client]
+ [TLS version 1 client. ]
+ ]
-[[b][A streambuf object into which the data will be read.]]
+ [
+ [tlsv1_server]
+ [TLS version 1 server. ]
+ ]
-[[delim][The delimiter string.]]
+ [
+ [sslv23]
+ [Generic SSL/TLS. ]
+ ]
-]
+ [
+ [sslv23_client]
+ [SSL/TLS client. ]
+ ]
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
+ [
+ [sslv23_server]
+ [SSL/TLS server. ]
+ ]
-[heading Exceptions]
-
+]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[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);
+[section:no_sslv2 ssl::context_base::no_sslv2]
+[indexterm2 no_sslv2..ssl::context_base] Disable SSL v2.
+ static const int no_sslv2 = implementation_defined;
@@ -32308,116 +52917,87 @@
-[section:overload4 read_until (4 of 6 overloads)]
+[section:no_sslv3 ssl::context_base::no_sslv3]
-Read data into a streambuf until a delimiter is encountered.
+[indexterm2 no_sslv3..ssl::context_base] Disable SSL v3.
- 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);
+ static const int no_sslv3 = implementation_defined;
-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:
+[endsect]
-* 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.
+[section:no_tlsv1 ssl::context_base::no_tlsv1]
+[indexterm2 no_tlsv1..ssl::context_base] Disable TLS v1.
-[heading Parameters]
-
+ static const int no_tlsv1 = implementation_defined;
-[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.]]
+[endsect]
-[[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.
+[section:options ssl::context_base::options]
+[indexterm2 options..ssl::context_base] Bitmask type for SSL options.
+ typedef int options;
-[endsect]
-[section:overload5 read_until (5 of 6 overloads)]
+[endsect]
-Read data into a streambuf until a regular expression is located.
- 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);
+[section:password_purpose ssl::context_base::password_purpose]
-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:
+[indexterm2 password_purpose..ssl::context_base] Purpose of PEM password.
+ enum password_purpose
-* A substring of the streambuf's get area matches the regular expression.
+[heading Values]
+[variablelist
-* An error occurred.
+ [
+ [for_reading]
+ [The password is needed for reading/decryption. ]
+ ]
-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.
+ [
+ [for_writing]
+ [The password is needed for writing/encryption. ]
+ ]
+]
-[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.]]
+[endsect]
-[[expr][The regular expression.]]
-]
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the substring that matches the regular expression.
+[section:single_dh_use ssl::context_base::single_dh_use]
-[heading Exceptions]
-
+[indexterm2 single_dh_use..ssl::context_base] Always create a new key when using tmp_dh parameters.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+ static const int single_dh_use = implementation_defined;
-]
-[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);
+[endsect]
+[section:verify_client_once ssl::context_base::verify_client_once]
+
+[indexterm2 verify_client_once..ssl::context_base] Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
+
+ static const int verify_client_once = implementation_defined;
@@ -32425,80 +53005,60 @@
-[section:overload6 read_until (6 of 6 overloads)]
+[section:verify_fail_if_no_peer_cert ssl::context_base::verify_fail_if_no_peer_cert]
-Read data into a streambuf until a regular expression is located.
+[indexterm2 verify_fail_if_no_peer_cert..ssl::context_base] Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
- 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);
+ static const int verify_fail_if_no_peer_cert = implementation_defined;
-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.
-* 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.
+[section:verify_mode ssl::context_base::verify_mode]
+[indexterm2 verify_mode..ssl::context_base] Bitmask type for peer verification.
-[heading Parameters]
-
+ typedef int verify_mode;
-[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.]]
-[[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:verify_none ssl::context_base::verify_none]
+[indexterm2 verify_none..ssl::context_base] No verification.
+
+ static const int verify_none = implementation_defined;
-[endsect]
[endsect]
-[section:service_already_exists service_already_exists]
-Exception thrown when trying to add a duplicate service to an io_service.
- class service_already_exists
+[section:verify_peer ssl::context_base::verify_peer]
+[indexterm2 verify_peer..ssl::context_base] Verify the peer.
-[heading Member Functions]
-[table
- [[Name][Description]]
+ static const int verify_peer = implementation_defined;
- [
- [[link boost_asio.reference.service_already_exists.service_already_exists [*service_already_exists]]]
- []
- ]
-
-]
-[section:service_already_exists service_already_exists::service_already_exists]
+[endsect]
- service_already_exists();
+[section:_context_base ssl::context_base::~context_base]
+
+[indexterm2 ~context_base..ssl::context_base] Protected destructor to prevent deletion through this type.
+
+ ~context_base();
@@ -32508,13 +53068,11 @@
[endsect]
-[section:socket_acceptor_service socket_acceptor_service]
+[section:ssl__context_service ssl::context_service]
-Default service implementation for a socket acceptor.
+Default service implementation for a context.
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class socket_acceptor_service :
+ class context_service :
public io_service::service
@@ -32524,29 +53082,8 @@
[
- [[link boost_asio.reference.socket_acceptor_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.socket_acceptor_service.implementation_type [*implementation_type]]]
- [The native type of the socket acceptor. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.socket_acceptor_service.native_type [*native_type]]]
- [The native acceptor type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.ssl__context_service.impl_type [*impl_type]]]
+ [The type of the context. ]
]
@@ -32557,103 +53094,88 @@
[[Name][Description]]
[
- [[link boost_asio.reference.socket_acceptor_service.accept [*accept]]]
- [Accept a new connection. ]
- ]
-
- [
- [[link boost_asio.reference.socket_acceptor_service.assign [*assign]]]
- [Assign an existing native acceptor to a socket acceptor. ]
- ]
-
- [
- [[link boost_asio.reference.socket_acceptor_service.async_accept [*async_accept]]]
- [Start an asynchronous accept. ]
- ]
-
- [
- [[link boost_asio.reference.socket_acceptor_service.bind [*bind]]]
- [Bind the socket acceptor to the specified local endpoint. ]
+ [[link boost_asio.reference.ssl__context_service.add_verify_path [*add_verify_path]]]
+ [Add a directory containing certification authority files to be used for performing verification. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the acceptor. ]
+ [[link boost_asio.reference.ssl__context_service.context_service [*context_service]]]
+ [Constructor. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.close [*close]]]
- [Close a socket acceptor implementation. ]
+ [[link boost_asio.reference.ssl__context_service.create [*create]]]
+ [Create a new context implementation. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.construct [*construct]]]
- [Construct a new socket acceptor implementation. ]
+ [[link boost_asio.reference.ssl__context_service.destroy [*destroy]]]
+ [Destroy a context implementation. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.destroy [*destroy]]]
- [Destroy a socket acceptor implementation. ]
+ [[link boost_asio.reference.ssl__context_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[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.socket_acceptor_service.get_option [*get_option]]]
- [Get a socket option. ]
+ [[link boost_asio.reference.ssl__context_service.load_verify_file [*load_verify_file]]]
+ [Load a certification authority file for performing verification. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.ssl__context_service.null [*null]]]
+ [Return a null context implementation. ]
]
[
- [[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.ssl__context_service.set_options [*set_options]]]
+ [Set options on the context. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.is_open [*is_open]]]
- [Determine whether the acceptor is open. ]
+ [[link boost_asio.reference.ssl__context_service.set_password_callback [*set_password_callback]]]
+ [Set the password callback. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.listen [*listen]]]
- [Place the socket acceptor into the state where it will listen for new connections. ]
+ [[link boost_asio.reference.ssl__context_service.set_verify_mode [*set_verify_mode]]]
+ [Set peer verification mode. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[link boost_asio.reference.ssl__context_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.native [*native]]]
- [Get the native acceptor implementation. ]
+ [[link boost_asio.reference.ssl__context_service.use_certificate_chain_file [*use_certificate_chain_file]]]
+ [Use a certificate chain from a file. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.open [*open]]]
- [Open a new socket acceptor implementation. ]
+ [[link boost_asio.reference.ssl__context_service.use_certificate_file [*use_certificate_file]]]
+ [Use a certificate from a file. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[link boost_asio.reference.ssl__context_service.use_private_key_file [*use_private_key_file]]]
+ [Use a private key from a file. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.ssl__context_service.use_rsa_private_key_file [*use_rsa_private_key_file]]]
+ [Use an RSA private key from a file. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.socket_acceptor_service [*socket_acceptor_service]]]
- [Construct a new socket acceptor service for the specified io_service. ]
+ [[link boost_asio.reference.ssl__context_service.use_tmp_dh_file [*use_tmp_dh_file]]]
+ [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
]
]
@@ -32663,23 +53185,20 @@
[[Name][Description]]
[
- [[link boost_asio.reference.socket_acceptor_service.id [*id]]]
+ [[link boost_asio.reference.ssl__context_service.id [*id]]]
[The unique service identifier. ]
]
]
-[section:accept socket_acceptor_service::accept]
+[section:add_verify_path ssl::context_service::add_verify_path]
-Accept a new connection.
+[indexterm2 add_verify_path..ssl::context_service] Add a directory containing certification authority files to be used for performing verification.
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- implementation_type & impl,
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type * peer_endpoint,
+ boost::system::error_code add_verify_path(
+ impl_type & impl,
+ const std::string & path,
boost::system::error_code & ec);
@@ -32688,14 +53207,108 @@
-[section:assign socket_acceptor_service::assign]
+[section:context_service ssl::context_service::context_service]
-Assign an existing native acceptor to a socket acceptor.
+[indexterm2 context_service..ssl::context_service] Constructor.
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_acceptor,
+ context_service(
+ boost::asio::io_service & io_service);
+
+
+
+[endsect]
+
+
+
+[section:create ssl::context_service::create]
+
+[indexterm2 create..ssl::context_service] Create a new context implementation.
+
+ void create(
+ impl_type & impl,
+ context_base::method m);
+
+
+
+[endsect]
+
+
+
+[section:destroy ssl::context_service::destroy]
+
+[indexterm2 destroy..ssl::context_service] Destroy a context implementation.
+
+ void destroy(
+ impl_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:get_io_service ssl::context_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..ssl::context_service] Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:id ssl::context_service::id]
+
+[indexterm2 id..ssl::context_service] The unique service identifier.
+
+ static boost::asio::io_service::id id;
+
+
+
+[endsect]
+
+
+
+[section:impl_type ssl::context_service::impl_type]
+
+[indexterm2 impl_type..ssl::context_service] The type of the context.
+
+ typedef implementation_defined impl_type;
+
+
+
+
+[endsect]
+
+
+
+[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 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] Load a certification authority file for performing verification.
+
+ boost::system::error_code load_verify_file(
+ impl_type & impl,
+ const std::string & filename,
boost::system::error_code & ec);
@@ -32704,18 +53317,11 @@
-[section:async_accept socket_acceptor_service::async_accept]
+[section:null ssl::context_service::null]
-Start an asynchronous accept.
+[indexterm2 null..ssl::context_service] Return a null context implementation.
- template<
- typename ``[link boost_asio.reference.SocketService SocketService]``,
- typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
- void async_accept(
- implementation_type & impl,
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type * peer_endpoint,
- AcceptHandler handler);
+ impl_type null() const;
@@ -32723,13 +53329,13 @@
-[section:bind socket_acceptor_service::bind]
+[section:set_options ssl::context_service::set_options]
-Bind the socket acceptor to the specified local endpoint.
+[indexterm2 set_options..ssl::context_service] Set options on the context.
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
+ boost::system::error_code set_options(
+ impl_type & impl,
+ context_base::options o,
boost::system::error_code & ec);
@@ -32738,12 +53344,15 @@
-[section:cancel socket_acceptor_service::cancel]
+[section:set_password_callback ssl::context_service::set_password_callback]
-Cancel all asynchronous operations associated with the acceptor.
+[indexterm2 set_password_callback..ssl::context_service] Set the password callback.
- boost::system::error_code cancel(
- implementation_type & impl,
+ template<
+ typename PasswordCallback>
+ boost::system::error_code set_password_callback(
+ impl_type & impl,
+ PasswordCallback callback,
boost::system::error_code & ec);
@@ -32752,12 +53361,13 @@
-[section:close socket_acceptor_service::close]
+[section:set_verify_mode ssl::context_service::set_verify_mode]
-Close a socket acceptor implementation.
+[indexterm2 set_verify_mode..ssl::context_service] Set peer verification mode.
- boost::system::error_code close(
- implementation_type & impl,
+ boost::system::error_code set_verify_mode(
+ impl_type & impl,
+ context_base::verify_mode v,
boost::system::error_code & ec);
@@ -32766,12 +53376,11 @@
-[section:construct socket_acceptor_service::construct]
+[section:shutdown_service ssl::context_service::shutdown_service]
-Construct a new socket acceptor implementation.
+[indexterm2 shutdown_service..ssl::context_service] Destroy all user-defined handler objects owned by the service.
- void construct(
- implementation_type & impl);
+ void shutdown_service();
@@ -32779,12 +53388,14 @@
-[section:destroy socket_acceptor_service::destroy]
+[section:use_certificate_chain_file ssl::context_service::use_certificate_chain_file]
-Destroy a socket acceptor implementation.
+[indexterm2 use_certificate_chain_file..ssl::context_service] Use a certificate chain from a file.
- void destroy(
- implementation_type & impl);
+ boost::system::error_code use_certificate_chain_file(
+ impl_type & impl,
+ const std::string & filename,
+ boost::system::error_code & ec);
@@ -32792,69 +53403,266 @@
-[section:endpoint_type socket_acceptor_service::endpoint_type]
+[section:use_certificate_file ssl::context_service::use_certificate_file]
-The endpoint type.
+[indexterm2 use_certificate_file..ssl::context_service] Use a certificate from a file.
- typedef protocol_type::endpoint endpoint_type;
+ boost::system::error_code use_certificate_file(
+ impl_type & impl,
+ const std::string & filename,
+ context_base::file_format format,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:use_private_key_file ssl::context_service::use_private_key_file]
+
+[indexterm2 use_private_key_file..ssl::context_service] Use a private key from a file.
+
+ boost::system::error_code use_private_key_file(
+ impl_type & impl,
+ const std::string & filename,
+ context_base::file_format format,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+[section:use_rsa_private_key_file ssl::context_service::use_rsa_private_key_file]
+
+[indexterm2 use_rsa_private_key_file..ssl::context_service] Use an RSA private key from a file.
+
+ boost::system::error_code use_rsa_private_key_file(
+ impl_type & impl,
+ const std::string & filename,
+ context_base::file_format format,
+ boost::system::error_code & ec);
+
+
[endsect]
-[section:get_io_service socket_acceptor_service::get_io_service]
+[section:use_tmp_dh_file ssl::context_service::use_tmp_dh_file]
+[indexterm2 use_tmp_dh_file..ssl::context_service] Use the specified file to obtain the temporary Diffie-Hellman parameters.
-['Inherited from io_service.]
+ boost::system::error_code use_tmp_dh_file(
+ impl_type & impl,
+ const std::string & filename,
+ boost::system::error_code & ec);
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+
+[endsect]
[endsect]
+[section:ssl__stream ssl::stream]
+
+Provides stream-oriented functionality using SSL.
+
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.Service Service]`` = stream_service>
+ class stream :
+ public ssl::stream_base
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ssl__stream.handshake_type [*handshake_type]]]
+ [Different handshake types. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__stream.impl_type [*impl_type]]]
+ [The native implementation type of the stream. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ssl__stream.service_type [*service_type]]]
+ [The type of the service that will be used to provide stream operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ssl__stream.async_handshake [*async_handshake]]]
+ [Start an asynchronous SSL handshake. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.async_shutdown [*async_shutdown]]]
+ [Asynchronously shut down SSL on the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.handshake [*handshake]]]
+ [Perform SSL handshaking. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.impl [*impl]]]
+ [Get the underlying implementation in the native type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.next_layer [*next_layer]]]
+ [Get a reference to the next layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.peek [*peek]]]
+ [Peek at the incoming data on the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.read_some [*read_some]]]
+ [Read some data from the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.shutdown [*shutdown]]]
+ [Shut down SSL on the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.stream [*stream]]]
+ [Construct a stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream.write_some [*write_some]]]
+ [Write some data to the stream. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__stream._stream [*~stream]]]
+ [Destructor. ]
+ ]
+
+]
+The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
-[section:get_option socket_acceptor_service::get_option]
-Get a socket option.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- 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;
+[*Shared] [*objects:] Unsafe.
+[heading Example]
+
+To use the SSL stream template with an ip::tcp::socket, you would write:
+ boost::asio::io_service io_service;
+ boost::asio::ssl::context context(io_service, boost::asio::ssl::context::sslv23);
+ boost::asio::ssl::stream<boost::asio::ip::tcp::socket> sock(io_service, context);
-[endsect]
-[section:id socket_acceptor_service::id]
-The unique service identifier.
- static boost::asio::io_service::id id;
+[section:async_handshake ssl::stream::async_handshake]
+[indexterm2 async_handshake..ssl::stream] Start an asynchronous SSL handshake.
+ template<
+ typename HandshakeHandler>
+ void async_handshake(
+ handshake_type type,
+ HandshakeHandler handler);
-[endsect]
+This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
-[section:implementation_type socket_acceptor_service::implementation_type]
+[heading Parameters]
+
-The native type of the socket acceptor.
+[variablelist
+
+[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
- typedef implementation_defined implementation_type;
+[[handler][The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation.
+ );
+``
+]]
+]
@@ -32862,44 +53670,43 @@
-[section:io_control socket_acceptor_service::io_control]
+[section:async_read_some ssl::stream::async_read_some]
-Perform an IO control command on the socket.
+[indexterm2 async_read_some..ssl::stream] Start an asynchronous read.
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]
-
-
-
-[section:io_service socket_acceptor_service::io_service]
-
-
-['Inherited from io_service.]
-
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
-
- boost::asio::io_service & io_service();
+ 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 read one or more bytes of data from the stream. The function call always returns immediately.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-[section:is_open socket_acceptor_service::is_open]
+[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The equivalent 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.
+ );
+``
+]]
-Determine whether the acceptor is open.
+]
- bool is_open(
- const implementation_type & impl) const;
+[heading Remarks]
+
+The async\_read\_some 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.
@@ -32907,28 +53714,33 @@
-[section:listen socket_acceptor_service::listen]
-
-Place the socket acceptor into the state where it will listen for new connections.
-
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
+[section:async_shutdown ssl::stream::async_shutdown]
+[indexterm2 async_shutdown..ssl::stream] Asynchronously shut down SSL on the stream.
+ template<
+ typename ShutdownHandler>
+ void async_shutdown(
+ ShutdownHandler handler);
-[endsect]
+This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
-[section:local_endpoint socket_acceptor_service::local_endpoint]
+[heading Parameters]
+
-Get the local endpoint.
+[variablelist
+
+[[handler][The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation.
+ );
+``
+]]
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+]
@@ -32936,25 +53748,43 @@
-[section:native socket_acceptor_service::native]
-
-Get the native acceptor implementation.
+[section:async_write_some ssl::stream::async_write_some]
- native_type native(
- implementation_type & impl);
+[indexterm2 async_write_some..ssl::stream] 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);
-[endsect]
+This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
+[heading Parameters]
+
-[section:native_type socket_acceptor_service::native_type]
+[variablelist
+
+[[buffers][The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-The native acceptor type.
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The equivalent 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.
+ );
+``
+]]
- typedef implementation_defined native_type;
+]
+[heading Remarks]
+
+The async\_write\_some 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 blocking operation completes.
@@ -32962,255 +53792,149 @@
-[section:open socket_acceptor_service::open]
-
-Open a new socket acceptor implementation.
-
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
-
-
-
-[endsect]
+[section:get_io_service ssl::stream::get_io_service]
+[indexterm2 get_io_service..ssl::stream] Get the io_service associated with the object.
+ boost::asio::io_service & get_io_service();
-[section:protocol_type socket_acceptor_service::protocol_type]
-The protocol type.
+This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
- typedef Protocol protocol_type;
+[heading Return Value]
+
+A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
[endsect]
+[section:handshake ssl::stream::handshake]
-[section:set_option socket_acceptor_service::set_option]
+[indexterm2 handshake..ssl::stream] Perform SSL handshaking.
-Set a socket option.
+ void ``[link boost_asio.reference.ssl__stream.handshake.overload1 handshake]``(
+ handshake_type type);
- 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.ssl__stream.handshake.overload2 handshake]``(
+ handshake_type type,
boost::system::error_code & ec);
+[section:overload1 ssl::stream::handshake (1 of 2 overloads)]
-[endsect]
-
-
-
-[section:shutdown_service socket_acceptor_service::shutdown_service]
-
-Destroy all user-defined handler objects owned by the service.
-
- void shutdown_service();
-
-
-
-[endsect]
-
-
-
-[section:socket_acceptor_service socket_acceptor_service::socket_acceptor_service]
-
-Construct a new socket acceptor service for the specified io_service.
-
- socket_acceptor_service(
- boost::asio::io_service & io_service);
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:socket_base socket_base]
-
-The socket_base class is used as a base for the basic_stream_socket and basic_datagram_socket class templates so that we have a common place to define the shutdown_type and enum.
-
- class socket_base
+Perform SSL handshaking.
+ void handshake(
+ handshake_type type);
-[heading Types]
-[table
- [[Name][Description]]
- [
+This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
- [[link boost_asio.reference.socket_base.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.socket_base.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
+[variablelist
- ]
-
- [
+[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
- [[link boost_asio.reference.socket_base.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+]
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.socket_base.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure. ]]
- [
+]
- [[link boost_asio.reference.socket_base.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
- [
- [[link boost_asio.reference.socket_base.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.socket_base.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
- [
+[section:overload2 ssl::stream::handshake (2 of 2 overloads)]
- [[link boost_asio.reference.socket_base.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+Perform SSL handshaking.
- [
+ boost::system::error_code handshake(
+ handshake_type type,
+ boost::system::error_code & ec);
- [[link boost_asio.reference.socket_base.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
- [
+This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
- [[link boost_asio.reference.socket_base.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.socket_base.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
+[variablelist
- ]
+[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
- [
+[[ec][Set to indicate what error occurred, if any. ]]
- [[link boost_asio.reference.socket_base.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.socket_base.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.socket_base.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.socket_base.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
-]
+[section:handshake_type ssl::stream::handshake_type]
-[heading Data Members]
-[table
- [[Name][Description]]
+[indexterm2 handshake_type..ssl::stream] Different handshake types.
- [
- [[link boost_asio.reference.socket_base.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+ enum handshake_type
- [
- [[link boost_asio.reference.socket_base.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
+[heading Values]
+[variablelist
[
- [[link boost_asio.reference.socket_base.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
+ [client]
+ [Perform handshaking as a client. ]
]
[
- [[link boost_asio.reference.socket_base.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
+ [server]
+ [Perform handshaking as a server. ]
]
]
-[section:broadcast socket_base::broadcast]
-Socket option to permit sending of broadcast messages.
+[endsect]
- typedef implementation_defined broadcast;
+[section:impl ssl::stream::impl]
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[indexterm2 impl..ssl::stream] Get the underlying implementation in the native type.
+ impl_type impl();
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+This function may be used to obtain the underlying implementation of the context. This is intended to allow access to stream functionality that is not otherwise provided.
+[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:impl_type ssl::stream::impl_type]
+[indexterm2 impl_type..ssl::stream] The native implementation type of the stream.
+ typedef service_type::impl_type impl_type;
@@ -33218,30 +53942,38 @@
[endsect]
+[section:in_avail ssl::stream::in_avail]
-[section:bytes_readable socket_base::bytes_readable]
+[indexterm2 in_avail..ssl::stream] Determine the amount of data that may be read without blocking.
-IO control command to get the amount of data that can be read without blocking.
+ std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload1 in_avail]``();
- typedef implementation_defined bytes_readable;
+ std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
+[section:overload1 ssl::stream::in_avail (1 of 2 overloads)]
-Implements the FIONREAD IO control command.
+Determine the amount of data that may be read without blocking.
+ std::size_t in_avail();
-[heading Example]
-
+This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
- 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 Return Value]
+
+The number of bytes of data that can be read without blocking.
+
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -33249,79 +53981,51 @@
-[section:debug socket_base::debug]
+[section:overload2 ssl::stream::in_avail (2 of 2 overloads)]
-Socket option to enable socket-level debugging.
+Determine the amount of data that may be read without blocking.
- typedef implementation_defined debug;
+ std::size_t in_avail(
+ boost::system::error_code & ec);
+This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
-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();
-
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Return Value]
+
+The number of bytes of data that can be read without blocking.
[endsect]
-
-[section:do_not_route socket_base::do_not_route]
-
-Socket option to prevent routing, use local interfaces only.
-
- typedef implementation_defined do_not_route;
-
-
-
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-
-
-[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:io_service ssl::stream::io_service]
+[indexterm2 io_service..ssl::stream] (Deprecated: use get_io_service().) Get the io_service associated with the object.
-Getting the current option value:
+ boost::asio::io_service & io_service();
- 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();
+This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
+[heading Return Value]
+
+A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -33329,38 +54033,31 @@
-[section:enable_connection_aborted socket_base::enable_connection_aborted]
-
-Socket option to report aborted connections on accept.
+[section:lowest_layer ssl::stream::lowest_layer]
- typedef implementation_defined enable_connection_aborted;
+[indexterm2 lowest_layer..ssl::stream] Get a reference to the lowest layer.
+ lowest_layer_type & 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.
+This function returns a reference to the lowest layer in a stack of stream layers.
-[heading Examples]
-
-Setting the option:
+[heading Return Value]
+
+A reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+[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:lowest_layer_type ssl::stream::lowest_layer_type]
+[indexterm2 lowest_layer_type..ssl::stream] The type of the lowest layer.
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
@@ -33369,38 +54066,31 @@
-[section:keep_alive socket_base::keep_alive]
-
-Socket option to send keep-alives.
+[section:next_layer ssl::stream::next_layer]
- typedef implementation_defined keep_alive;
+[indexterm2 next_layer..ssl::stream] Get a reference to the next layer.
+ next_layer_type & next_layer();
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+This function returns a reference to the next layer in a stack of stream layers.
-[heading Examples]
-
-Setting the option:
+[heading Return Value]
+
+A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+[endsect]
-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();
+[section:next_layer_type ssl::stream::next_layer_type]
+[indexterm2 next_layer_type..ssl::stream] The type of the next layer.
+ typedef boost::remove_reference< Stream >::type next_layer_type;
@@ -33408,41 +54098,56 @@
[endsect]
+[section:peek ssl::stream::peek]
-[section:linger socket_base::linger]
+[indexterm2 peek..ssl::stream] Peek at the incoming data on the stream.
-Socket option to specify whether the socket lingers on close if unsent data is present.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
- typedef implementation_defined linger;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload2 peek]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+[section:overload1 ssl::stream::peek (1 of 2 overloads)]
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+Peek at the incoming data on the stream.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
-[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 peek at the incoming data on the stream, without removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read.]]
-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 Return Value]
+
+The number of bytes read.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -33450,60 +54155,97 @@
-[section:max_connections socket_base::max_connections]
+[section:overload2 ssl::stream::peek (2 of 2 overloads)]
-The maximum length of the queue of pending incoming connections.
+Peek at the incoming data on the stream.
- static const int max_connections = implementation_defined;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+This function is used to peek at the incoming data on the stream, withoutxi removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read.]]
-[section:message_do_not_route socket_base::message_do_not_route]
+[[ec][Set to indicate what error occurred, if any.]]
-Specify that the data should not be subject to routing.
+]
- static const int message_do_not_route = implementation_defined;
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
[endsect]
+[endsect]
-[section:message_flags socket_base::message_flags]
-
-Bitmask type for flags that can be passed to send and receive operations.
+[section:read_some ssl::stream::read_some]
- typedef int message_flags;
+[indexterm2 read_some..ssl::stream] Read some data from the stream.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 ssl::stream::read_some (1 of 2 overloads)]
+Read some data from the stream.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
-[section:message_out_of_band socket_base::message_out_of_band]
-Process out-of-band data.
+This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
- static const int message_out_of_band = implementation_defined;
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read.]]
-[endsect]
+]
+[heading Return Value]
+
+The number of bytes read.
+[heading Exceptions]
+
-[section:message_peek socket_base::message_peek]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-Peek at incoming data without removing it from the input queue.
+]
- static const int message_peek = implementation_defined;
+[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.
@@ -33511,257 +54253,321 @@
-[section:non_blocking_io socket_base::non_blocking_io]
+[section:overload2 ssl::stream::read_some (2 of 2 overloads)]
-IO control command to set the blocking mode of the socket.
+Read some data from the stream.
- typedef implementation_defined non_blocking_io;
+ 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. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
-Implements the FIONBIO IO control command.
+[heading Parameters]
+
-[heading Example]
+[variablelist
+[[buffers][The buffers into which the data will be read.]]
+[[ec][Set to indicate what error occurred, if any.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
-
+]
+[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.
[endsect]
+[endsect]
-[section:receive_buffer_size socket_base::receive_buffer_size]
-Socket option for the receive buffer size of a socket.
+[section:service_type ssl::stream::service_type]
- typedef implementation_defined receive_buffer_size;
+[indexterm2 service_type..ssl::stream] The type of the service that will be used to provide stream operations.
+ typedef Service service_type;
-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);
+[section:shutdown ssl::stream::shutdown]
+[indexterm2 shutdown..ssl::stream] Shut down SSL on the stream.
+ void ``[link boost_asio.reference.ssl__stream.shutdown.overload1 shutdown]``();
-Getting the current option value:
+ boost::system::error_code ``[link boost_asio.reference.ssl__stream.shutdown.overload2 shutdown]``(
+ boost::system::error_code & ec);
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+[section:overload1 ssl::stream::shutdown (1 of 2 overloads)]
+Shut down SSL on the stream.
+ void shutdown();
+This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
-[endsect]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[section:receive_low_watermark socket_base::receive_low_watermark]
+]
-Socket option for the receive low watermark.
- typedef implementation_defined receive_low_watermark;
+[endsect]
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+[section:overload2 ssl::stream::shutdown (2 of 2 overloads)]
-[heading Examples]
-
-Setting the option:
+Shut down SSL on the stream.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+ boost::system::error_code shutdown(
+ boost::system::error_code & ec);
+This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
-Getting the current option value:
+[heading Parameters]
+
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+]
+[endsect]
[endsect]
+[section:stream ssl::stream::stream]
-[section:reuse_address socket_base::reuse_address]
-
-Socket option to allow the socket to be bound to an address that is already in use.
+[indexterm2 stream..ssl::stream] Construct a stream.
- typedef implementation_defined reuse_address;
+ template<
+ typename Arg,
+ typename Context_Service>
+ stream(
+ Arg & arg,
+ basic_context< Context_Service > & context);
+This constructor creates a stream and initialises the underlying stream object.
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[arg][The argument to be passed to initialise the underlying stream.]]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[[context][The SSL context to be used for the stream. ]]
+]
-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();
+[section:write_some ssl::stream::write_some]
+[indexterm2 write_some..ssl::stream] Write some data to the stream.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 ssl::stream::write_some (1 of 2 overloads)]
+Write some data to the stream.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-[section:send_buffer_size socket_base::send_buffer_size]
-Socket option for the send buffer size of a socket.
+This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
- typedef implementation_defined send_buffer_size;
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The data to be written.]]
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+]
+
+[heading Return Value]
+
+The number of bytes written.
+[heading Exceptions]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[boost::system::system_error][Thrown on failure.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
+]
+[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.
-Getting the current option value:
+[endsect]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option;
- socket.get_option(option);
- int size = option.value();
+[section:overload2 ssl::stream::write_some (2 of 2 overloads)]
+Write some data to the stream.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
-[endsect]
+This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
+[heading Parameters]
+
-[section:send_low_watermark socket_base::send_low_watermark]
+[variablelist
+
+[[buffers][The data to be written to the stream.]]
-Socket option for the send low watermark.
+[[ec][Set to indicate what error occurred, if any.]]
- typedef implementation_defined send_low_watermark;
+]
+[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.
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
-[heading Examples]
-
-Setting the option:
+[endsect]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option(1024);
- socket.set_option(option);
+[endsect]
+[section:_stream ssl::stream::~stream]
-Getting the current option value:
+[indexterm2 ~stream..ssl::stream] Destructor.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+ ~stream();
+[endsect]
[endsect]
+[section:ssl__stream_base ssl::stream_base]
+The stream_base class is used as a base for the boost::asio::ssl::stream class template so that we have a common place to define various enums.
-[section:shutdown_type socket_base::shutdown_type]
+ class stream_base
-Different ways a socket may be shutdown.
- enum shutdown_type
+[heading Types]
+[table
+ [[Name][Description]]
-[heading Values]
-[variablelist
+ [
+
+ [[link boost_asio.reference.ssl__stream_base.handshake_type [*handshake_type]]]
+ [Different handshake types. ]
+
+ ]
+
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
[
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
+ [[link boost_asio.reference.ssl__stream_base._stream_base [*~stream_base]]]
+ [Protected destructor to prevent deletion through this type. ]
]
+
+]
+
+
+[section:handshake_type ssl::stream_base::handshake_type]
+
+[indexterm2 handshake_type..ssl::stream_base] Different handshake types.
+
+ enum handshake_type
+
+[heading Values]
+[variablelist
[
- [shutdown_send]
- [Shutdown the send side of the socket. ]
+ [client]
+ [Perform handshaking as a client. ]
]
[
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
+ [server]
+ [Perform handshaking as a server. ]
]
]
@@ -33772,16 +54578,26 @@
+[section:_stream_base ssl::stream_base::~stream_base]
+
+[indexterm2 ~stream_base..ssl::stream_base] Protected destructor to prevent deletion through this type.
+
+ ~stream_base();
+
+
+
[endsect]
-[section:ssl__basic_context ssl::basic_context]
-SSL context.
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- class basic_context :
- public ssl::context_base
+[endsect]
+
+[section:ssl__stream_service ssl::stream_service]
+
+Default service implementation for an SSL stream.
+
+ class stream_service :
+ public io_service::service
[heading Types]
@@ -33790,122 +54606,100 @@
[
- [[link boost_asio.reference.ssl__basic_context.file_format [*file_format]]]
- [File format types. ]
+ [[link boost_asio.reference.ssl__stream_service.impl_type [*impl_type]]]
+ [The type of a stream implementation. ]
]
- [
+]
- [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
- [The native implementation type of the locking dispatcher. ]
-
- ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
-
- [[link boost_asio.reference.ssl__basic_context.method [*method]]]
- [Different methods supported by a context. ]
-
+ [[link boost_asio.reference.ssl__stream_service.async_handshake [*async_handshake]]]
+ [Start an asynchronous SSL handshake. ]
]
-
- [
-
- [[link boost_asio.reference.ssl__basic_context.options [*options]]]
- [Bitmask type for SSL options. ]
- ]
-
[
-
- [[link boost_asio.reference.ssl__basic_context.password_purpose [*password_purpose]]]
- [Purpose of PEM password. ]
-
+ [[link boost_asio.reference.ssl__stream_service.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
-
- [
-
- [[link boost_asio.reference.ssl__basic_context.service_type [*service_type]]]
- [The type of the service that will be used to provide context operations. ]
- ]
-
[
-
- [[link boost_asio.reference.ssl__basic_context.verify_mode [*verify_mode]]]
- [Bitmask type for peer verification. ]
+ [[link boost_asio.reference.ssl__stream_service.async_shutdown [*async_shutdown]]]
+ [Asynchronously shut down SSL on the stream. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__stream_service.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
[
- [[link boost_asio.reference.ssl__basic_context.add_verify_path [*add_verify_path]]]
- [Add a directory containing certificate authority files to be used for performing verification. ]
+ [[link boost_asio.reference.ssl__stream_service.create [*create]]]
+ [Create a new stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.basic_context [*basic_context]]]
- [Constructor. ]
+ [[link boost_asio.reference.ssl__stream_service.destroy [*destroy]]]
+ [Destroy a stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.impl [*impl]]]
- [Get the underlying implementation in the native type. ]
+ [[link boost_asio.reference.ssl__stream_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.load_verify_file [*load_verify_file]]]
- [Load a certification authority file for performing verification. ]
+ [[link boost_asio.reference.ssl__stream_service.handshake [*handshake]]]
+ [Perform SSL handshaking. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.set_options [*set_options]]]
- [Set options on the context. ]
+ [[link boost_asio.reference.ssl__stream_service.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.set_password_callback [*set_password_callback]]]
- [Set the password callback. ]
+ [[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__basic_context.set_verify_mode [*set_verify_mode]]]
- [Set the peer verification mode. ]
+ [[link boost_asio.reference.ssl__stream_service.null [*null]]]
+ [Return a null stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file [*use_certificate_chain_file]]]
- [Use a certificate chain from a file. ]
+ [[link boost_asio.reference.ssl__stream_service.peek [*peek]]]
+ [Peek at the incoming data on the stream. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_certificate_file [*use_certificate_file]]]
- [Use a certificate from a file. ]
+ [[link boost_asio.reference.ssl__stream_service.read_some [*read_some]]]
+ [Read some data from the stream. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_private_key_file [*use_private_key_file]]]
- [Use a private key from a file. ]
+ [[link boost_asio.reference.ssl__stream_service.shutdown [*shutdown]]]
+ [Shut down SSL on the stream. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file [*use_rsa_private_key_file]]]
- [Use an RSA private key from a file. ]
+ [[link boost_asio.reference.ssl__stream_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file [*use_tmp_dh_file]]]
- [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
+ [[link boost_asio.reference.ssl__stream_service.stream_service [*stream_service]]]
+ [Construct a new stream service for the specified io_service. ]
]
[
- [[link boost_asio.reference.ssl__basic_context._basic_context [*~basic_context]]]
- [Destructor. ]
+ [[link boost_asio.reference.ssl__stream_service.write_some [*write_some]]]
+ [Write some data to the stream. ]
]
]
@@ -33915,92 +54709,83 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__basic_context.default_workarounds [*default_workarounds]]]
- [Implement various bug workarounds. ]
+ [[link boost_asio.reference.ssl__stream_service.id [*id]]]
+ [The unique service identifier. ]
]
- [
- [[link boost_asio.reference.ssl__basic_context.no_sslv2 [*no_sslv2]]]
- [Disable SSL v2. ]
- ]
+]
- [
- [[link boost_asio.reference.ssl__basic_context.no_sslv3 [*no_sslv3]]]
- [Disable SSL v3. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.no_tlsv1 [*no_tlsv1]]]
- [Disable TLS v1. ]
- ]
+[section:async_handshake ssl::stream_service::async_handshake]
- [
- [[link boost_asio.reference.ssl__basic_context.single_dh_use [*single_dh_use]]]
- [Always create a new key when using tmp_dh parameters. ]
- ]
+[indexterm2 async_handshake..ssl::stream_service] Start an asynchronous SSL handshake.
- [
- [[link boost_asio.reference.ssl__basic_context.verify_client_once [*verify_client_once]]]
- [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
- ]
+ template<
+ typename Stream,
+ typename HandshakeHandler>
+ void async_handshake(
+ impl_type & impl,
+ Stream & next_layer,
+ stream_base::handshake_type type,
+ HandshakeHandler handler);
- [
- [[link boost_asio.reference.ssl__basic_context.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
- [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.verify_none [*verify_none]]]
- [No verification. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.verify_peer [*verify_peer]]]
- [Verify the peer. ]
- ]
+[endsect]
-]
-[section:add_verify_path ssl::basic_context::add_verify_path]
-Add a directory containing certificate authority files to be used for performing verification.
+[section:async_read_some ssl::stream_service::async_read_some]
- void ``[link boost_asio.reference.ssl__basic_context.add_verify_path.overload1 add_verify_path]``(
- const std::string & path);
+[indexterm2 async_read_some..ssl::stream_service] Start an asynchronous read.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.add_verify_path.overload2 add_verify_path]``(
- const std::string & path,
- boost::system::error_code & ec);
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ impl_type & impl,
+ Stream & next_layer,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
-[section:overload1 ssl::basic_context::add_verify_path (1 of 2 overloads)]
-Add a directory containing certificate authority files to be used for performing verification.
+[endsect]
- void add_verify_path(
- const std::string & path);
-This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".
+[section:async_shutdown ssl::stream_service::async_shutdown]
+[indexterm2 async_shutdown..ssl::stream_service] Asynchronously shut down SSL on the stream.
-[heading Parameters]
-
+ template<
+ typename Stream,
+ typename ShutdownHandler>
+ void async_shutdown(
+ impl_type & impl,
+ Stream & next_layer,
+ ShutdownHandler handler);
-[variablelist
-
-[[path][The name of a directory containing the certificates.]]
-]
-[heading Exceptions]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+
+[section:async_write_some ssl::stream_service::async_write_some]
+
+[indexterm2 async_write_some..ssl::stream_service] Start an asynchronous write.
+
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ impl_type & impl,
+ Stream & next_layer,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
@@ -34008,44 +54793,48 @@
-[section:overload2 ssl::basic_context::add_verify_path (2 of 2 overloads)]
+[section:create ssl::stream_service::create]
-Add a directory containing certificate authority files to be used for performing verification.
+[indexterm2 create..ssl::stream_service] Create a new stream implementation.
- boost::system::error_code add_verify_path(
- const std::string & path,
- boost::system::error_code & ec);
+ template<
+ typename Stream,
+ typename Context_Service>
+ void create(
+ impl_type & impl,
+ Stream & next_layer,
+ basic_context< Context_Service > & context);
-This function is used to specify the name of a directory containing certification authority certificates. Each file in the directory must contain a single certificate. The files must be named using the subject name's hash and an extension of ".0".
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[path][The name of a directory containing the certificates.]]
-[[ec][Set to indicate what error occurred, if any. ]]
+[section:destroy ssl::stream_service::destroy]
-]
+[indexterm2 destroy..ssl::stream_service] Destroy a stream implementation.
+
+ template<
+ typename Stream>
+ void destroy(
+ impl_type & impl,
+ Stream & next_layer);
[endsect]
-[endsect]
+
+[section:get_io_service ssl::stream_service::get_io_service]
-[section:basic_context ssl::basic_context::basic_context]
+['Inherited from io_service.]
-Constructor.
+[indexterm2 get_io_service..ssl::stream_service] Get the io_service object that owns the service.
- basic_context(
- boost::asio::io_service & io_service,
- method m);
+ boost::asio::io_service & get_io_service();
@@ -34053,14 +54842,29 @@
-[section:default_workarounds ssl::basic_context::default_workarounds]
+[section:handshake ssl::stream_service::handshake]
+[indexterm2 handshake..ssl::stream_service] Perform SSL handshaking.
-['Inherited from ssl::context_base.]
+ template<
+ typename Stream>
+ boost::system::error_code handshake(
+ impl_type & impl,
+ Stream & next_layer,
+ stream_base::handshake_type type,
+ boost::system::error_code & ec);
-Implement various bug workarounds.
- static const int default_workarounds = implementation_defined;
+
+[endsect]
+
+
+
+[section:id ssl::stream_service::id]
+
+[indexterm2 id..ssl::stream_service] The unique service identifier.
+
+ static boost::asio::io_service::id id;
@@ -34068,29 +54872,29 @@
-[section:file_format ssl::basic_context::file_format]
+[section:impl_type ssl::stream_service::impl_type]
+[indexterm2 impl_type..ssl::stream_service] The type of a stream implementation.
-['Inherited from ssl::context_base.]
+ typedef implementation_defined impl_type;
-File format types.
- enum file_format
-[heading Values]
-[variablelist
- [
- [asn1]
- [ASN.1 file. ]
- ]
+[endsect]
- [
- [pem]
- [PEM file. ]
- ]
-]
+
+[section:in_avail ssl::stream_service::in_avail]
+
+[indexterm2 in_avail..ssl::stream_service] Determine the amount of data that may be read without blocking.
+
+ template<
+ typename Stream>
+ std::size_t in_avail(
+ impl_type & impl,
+ Stream & next_layer,
+ boost::system::error_code & ec);
@@ -34098,72 +54902,93 @@
-[section:impl ssl::basic_context::impl]
+[section:io_service ssl::stream_service::io_service]
-Get the underlying implementation in the native type.
- impl_type impl();
+['Inherited from io_service.]
+[indexterm2 io_service..ssl::stream_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
-This function may be used to obtain the underlying implementation of the context. This is intended to allow access to context functionality that is not otherwise provided.
[endsect]
-[section:impl_type ssl::basic_context::impl_type]
+[section:null ssl::stream_service::null]
+
+[indexterm2 null..ssl::stream_service] Return a null stream implementation.
+
+ impl_type null() const;
+
+
+
+[endsect]
-The native implementation type of the locking dispatcher.
- typedef service_type::impl_type impl_type;
+[section:peek ssl::stream_service::peek]
+
+[indexterm2 peek..ssl::stream_service] Peek at the incoming data on the stream.
+
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ impl_type & impl,
+ Stream & next_layer,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
[endsect]
-[section:load_verify_file ssl::basic_context::load_verify_file]
-Load a certification authority file for performing verification.
+[section:read_some ssl::stream_service::read_some]
- void ``[link boost_asio.reference.ssl__basic_context.load_verify_file.overload1 load_verify_file]``(
- const std::string & filename);
+[indexterm2 read_some..ssl::stream_service] Read some data from the stream.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.load_verify_file.overload2 load_verify_file]``(
- const std::string & filename,
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ impl_type & impl,
+ Stream & next_layer,
+ const MutableBufferSequence & buffers,
boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::load_verify_file (1 of 2 overloads)]
-Load a certification authority file for performing verification.
+[endsect]
- void load_verify_file(
- const std::string & filename);
-This function is used to load one or more trusted certification authorities from a file.
+[section:shutdown ssl::stream_service::shutdown]
+[indexterm2 shutdown..ssl::stream_service] Shut down SSL on the stream.
-[heading Parameters]
-
+ template<
+ typename Stream>
+ boost::system::error_code shutdown(
+ impl_type & impl,
+ Stream & next_layer,
+ boost::system::error_code & ec);
-[variablelist
-
-[[filename][The name of a file containing certification authority certificates in PEM format.]]
-]
-[heading Exceptions]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+
+[section:shutdown_service ssl::stream_service::shutdown_service]
+
+[indexterm2 shutdown_service..ssl::stream_service] Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
@@ -34171,125 +54996,310 @@
-[section:overload2 ssl::basic_context::load_verify_file (2 of 2 overloads)]
+[section:stream_service ssl::stream_service::stream_service]
-Load a certification authority file for performing verification.
+[indexterm2 stream_service..ssl::stream_service] Construct a new stream service for the specified io_service.
- boost::system::error_code load_verify_file(
- const std::string & filename,
- boost::system::error_code & ec);
+ stream_service(
+ boost::asio::io_service & io_service);
-This function is used to load the certificates for one or more trusted certification authorities from a file.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of a file containing certification authority certificates in PEM format.]]
-[[ec][Set to indicate what error occurred, if any. ]]
+[section:write_some ssl::stream_service::write_some]
-]
+[indexterm2 write_some..ssl::stream_service] Write some data to the stream.
+
+ template<
+ typename Stream,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ impl_type & impl,
+ Stream & next_layer,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
[endsect]
+
[endsect]
-[section:method ssl::basic_context::method]
+[section:strand strand]
+[indexterm1 strand] Typedef for backwards compatibility.
-['Inherited from ssl::context_base.]
+ typedef boost::asio::io_service::strand strand;
-Different methods supported by a context.
- enum method
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[heading Values]
-[variablelist
+ [
+ [[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 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]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+
+[endsect]
+
+
+[section:stream_socket_service stream_socket_service]
+
+Default service implementation for a stream socket.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class stream_socket_service :
+ public io_service::service
+
+
+[heading Types]
+[table
+ [[Name][Description]]
[
- [sslv2]
- [Generic SSL version 2. ]
+
+ [[link boost_asio.reference.stream_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
]
[
- [sslv2_client]
- [SSL version 2 client. ]
+
+ [[link boost_asio.reference.stream_socket_service.implementation_type [*implementation_type]]]
+ [The type of a stream socket implementation. ]
+
]
[
- [sslv2_server]
- [SSL version 2 server. ]
+
+ [[link boost_asio.reference.stream_socket_service.native_type [*native_type]]]
+ [The native socket type. ]
+
]
[
- [sslv3]
- [Generic SSL version 3. ]
+
+ [[link boost_asio.reference.stream_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
]
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
[
- [sslv3_client]
- [SSL version 3 client. ]
+ [[link boost_asio.reference.stream_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a stream socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.bind [*bind]]]
+ [Bind the stream socket to the specified local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.close [*close]]]
+ [Close a stream socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.connect [*connect]]]
+ [Connect the stream socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.construct [*construct]]]
+ [Construct a new stream socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.destroy [*destroy]]]
+ [Destroy a stream socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.native [*native]]]
+ [Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.open [*open]]]
+ [Open a stream socket. ]
]
-
+
[
- [sslv3_server]
- [SSL version 3 server. ]
+ [[link boost_asio.reference.stream_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
]
-
+
[
- [tlsv1]
- [Generic TLS version 1. ]
+ [[link boost_asio.reference.stream_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
]
-
+
[
- [tlsv1_client]
- [TLS version 1 client. ]
+ [[link boost_asio.reference.stream_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
]
-
+
[
- [tlsv1_server]
- [TLS version 1 server. ]
+ [[link boost_asio.reference.stream_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
]
-
+
[
- [sslv23]
- [Generic SSL/TLS. ]
+ [[link boost_asio.reference.stream_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
]
-
+
[
- [sslv23_client]
- [SSL/TLS client. ]
+ [[link boost_asio.reference.stream_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
-
+
[
- [sslv23_server]
- [SSL/TLS server. ]
+ [[link boost_asio.reference.stream_socket_service.stream_socket_service [*stream_socket_service]]]
+ [Construct a new stream socket service for the specified io_service. ]
]
-
+
]
+[heading Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.stream_socket_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
-[endsect]
-
-
-
-[section:no_sslv2 ssl::basic_context::no_sslv2]
+]
-['Inherited from ssl::context_base.]
+[section:assign stream_socket_service::assign]
-Disable SSL v2.
+[indexterm2 assign..stream_socket_service] Assign an existing native socket to a stream socket.
- static const int no_sslv2 = implementation_defined;
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
@@ -34297,14 +55307,16 @@
-[section:no_sslv3 ssl::basic_context::no_sslv3]
-
-
-['Inherited from ssl::context_base.]
+[section:async_connect stream_socket_service::async_connect]
-Disable SSL v3.
+[indexterm2 async_connect..stream_socket_service] Start an asynchronous connect.
- static const int no_sslv3 = implementation_defined;
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
@@ -34312,14 +55324,18 @@
-[section:no_tlsv1 ssl::basic_context::no_tlsv1]
-
-
-['Inherited from ssl::context_base.]
+[section:async_receive stream_socket_service::async_receive]
-Disable TLS v1.
+[indexterm2 async_receive..stream_socket_service] Start an asynchronous receive.
- static const int no_tlsv1 = implementation_defined;
+ 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);
@@ -34327,45 +55343,46 @@
-[section:options ssl::basic_context::options]
-
+[section:async_send stream_socket_service::async_send]
-['Inherited from ssl::context_base.]
+[indexterm2 async_send..stream_socket_service] Start an asynchronous send.
-Bitmask type for SSL options.
+ 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 int options;
+[endsect]
-[endsect]
+[section:at_mark stream_socket_service::at_mark]
+[indexterm2 at_mark..stream_socket_service] Determine whether the socket is at the out-of-band data mark.
-[section:password_purpose ssl::basic_context::password_purpose]
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
-['Inherited from ssl::context_base.]
-Purpose of PEM password.
+[endsect]
- enum password_purpose
-[heading Values]
-[variablelist
- [
- [for_reading]
- [The password is needed for reading/decryption. ]
- ]
+[section:available stream_socket_service::available]
- [
- [for_writing]
- [The password is needed for writing/encryption. ]
- ]
+[indexterm2 available..stream_socket_service] Determine the number of bytes available for reading.
-]
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -34373,58 +55390,42 @@
-[section:service_type ssl::basic_context::service_type]
-
-The type of the service that will be used to provide context operations.
+[section:bind stream_socket_service::bind]
- typedef Service service_type;
+[indexterm2 bind..stream_socket_service] Bind the stream socket to the specified local endpoint.
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
[endsect]
-[section:set_options ssl::basic_context::set_options]
-Set options on the context.
+[section:cancel stream_socket_service::cancel]
- void ``[link boost_asio.reference.ssl__basic_context.set_options.overload1 set_options]``(
- options o);
+[indexterm2 cancel..stream_socket_service] Cancel all asynchronous operations associated with the socket.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_options.overload2 set_options]``(
- options o,
+ boost::system::error_code cancel(
+ implementation_type & impl,
boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::set_options (1 of 2 overloads)]
-
-Set options on the context.
-
- void set_options(
- options o);
-
-
-This function may be used to configure the SSL options used by the context.
-
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[o][A bitmask of options. The available option values are defined in the context\_base class. The options are bitwise-ored with any existing value for the options.]]
-]
-[heading Exceptions]
-
+[section:close stream_socket_service::close]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 close..stream_socket_service] Close a stream socket implementation.
-]
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -34432,90 +55433,53 @@
-[section:overload2 ssl::basic_context::set_options (2 of 2 overloads)]
+[section:connect stream_socket_service::connect]
-Set options on the context.
+[indexterm2 connect..stream_socket_service] Connect the stream socket to the specified endpoint.
- boost::system::error_code set_options(
- options o,
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-This function may be used to configure the SSL options used by the context.
-
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[o][A bitmask of options. The available option values are defined in the context\_base class. The options are bitwise-ored with any existing value for the options.]]
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:construct stream_socket_service::construct]
+[indexterm2 construct..stream_socket_service] Construct a new stream socket implementation.
+ void construct(
+ implementation_type & impl);
-[endsect]
[endsect]
-[section:set_password_callback ssl::basic_context::set_password_callback]
-
-Set the password callback.
-
- template<
- typename PasswordCallback>
- void ``[link boost_asio.reference.ssl__basic_context.set_password_callback.overload1 set_password_callback]``(
- PasswordCallback callback);
-
- template<
- typename PasswordCallback>
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_password_callback.overload2 set_password_callback]``(
- PasswordCallback callback,
- boost::system::error_code & ec);
-
-[section:overload1 ssl::basic_context::set_password_callback (1 of 2 overloads)]
-Set the password callback.
+[section:destroy stream_socket_service::destroy]
- template<
- typename PasswordCallback>
- void set_password_callback(
- PasswordCallback callback);
+[indexterm2 destroy..stream_socket_service] Destroy a stream socket implementation.
+ void destroy(
+ implementation_type & impl);
-This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[callback][The function object to be used for obtaining the password. The function signature of the handler must be:
-``
- std::string password_callback(
- std::size_t max_length, // The maximum size for a password.
- password_purpose purpose // Whether password is for reading or writing.
- );
-``
-The return value of the callback is a string containing the password.]]
-]
+[section:endpoint_type stream_socket_service::endpoint_type]
-[heading Exceptions]
-
+[indexterm2 endpoint_type..stream_socket_service] The endpoint type.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef Protocol::endpoint endpoint_type;
-]
@@ -34523,86 +55487,56 @@
-[section:overload2 ssl::basic_context::set_password_callback (2 of 2 overloads)]
+[section:get_io_service stream_socket_service::get_io_service]
-Set the password callback.
- template<
- typename PasswordCallback>
- boost::system::error_code set_password_callback(
- PasswordCallback callback,
- boost::system::error_code & ec);
+['Inherited from io_service.]
+[indexterm2 get_io_service..stream_socket_service] Get the io_service object that owns the service.
-This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
+ boost::asio::io_service & get_io_service();
-[heading Parameters]
-
-[variablelist
-
-[[callback][The function object to be used for obtaining the password. The function signature of the handler must be:
-``
- std::string password_callback(
- std::size_t max_length, // The maximum size for a password.
- password_purpose purpose // Whether password is for reading or writing.
- );
+[endsect]
-``
-The return value of the callback is a string containing the password.]]
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:get_option stream_socket_service::get_option]
+[indexterm2 get_option..stream_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;
-[endsect]
[endsect]
-[section:set_verify_mode ssl::basic_context::set_verify_mode]
-
-Set the peer verification mode.
-
- void ``[link boost_asio.reference.ssl__basic_context.set_verify_mode.overload1 set_verify_mode]``(
- verify_mode v);
-
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_verify_mode.overload2 set_verify_mode]``(
- verify_mode v,
- boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::set_verify_mode (1 of 2 overloads)]
+[section:id stream_socket_service::id]
-Set the peer verification mode.
+[indexterm2 id..stream_socket_service] The unique service identifier.
- void set_verify_mode(
- verify_mode v);
+ static boost::asio::io_service::id id;
-This function may be used to configure the peer verification mode used by the context.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
-]
+[section:implementation_type stream_socket_service::implementation_type]
-[heading Exceptions]
-
+[indexterm2 implementation_type..stream_socket_service] The type of a stream socket implementation.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef implementation_defined implementation_type;
-]
@@ -34610,91 +55544,58 @@
-[section:overload2 ssl::basic_context::set_verify_mode (2 of 2 overloads)]
+[section:io_control stream_socket_service::io_control]
-Set the peer verification mode.
+[indexterm2 io_control..stream_socket_service] Perform an IO control command on the socket.
- boost::system::error_code set_verify_mode(
- verify_mode v,
+ template<
+ 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 may be used to configure the peer verification mode used by the context.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
-
-[[ec][Set to indicate what error occurred, if any. ]]
-
-]
-
-
[endsect]
-[endsect]
-
-[section:single_dh_use ssl::basic_context::single_dh_use]
+[section:io_service stream_socket_service::io_service]
-['Inherited from ssl::context_base.]
+['Inherited from io_service.]
-Always create a new key when using tmp_dh parameters.
+[indexterm2 io_service..stream_socket_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
- static const int single_dh_use = implementation_defined;
+ boost::asio::io_service & io_service();
[endsect]
-[section:use_certificate_chain_file ssl::basic_context::use_certificate_chain_file]
-
-Use a certificate chain from a file.
-
- void ``[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file.overload1 use_certificate_chain_file]``(
- const std::string & filename);
-
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file.overload2 use_certificate_chain_file]``(
- const std::string & filename,
- boost::system::error_code & ec);
-
-
-[section:overload1 ssl::basic_context::use_certificate_chain_file (1 of 2 overloads)]
-Use a certificate chain from a file.
+[section:is_open stream_socket_service::is_open]
- void use_certificate_chain_file(
- const std::string & filename);
+[indexterm2 is_open..stream_socket_service] Determine whether the socket is open.
+ bool is_open(
+ const implementation_type & impl) const;
-This function is used to load a certificate chain into the context from a file.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[filename][The name of the file containing the certificate. The file must use the PEM format.]]
-]
-[heading Exceptions]
-
+[section:local_endpoint stream_socket_service::local_endpoint]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 local_endpoint..stream_socket_service] Get the local endpoint.
-]
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -34702,81 +55603,53 @@
-[section:overload2 ssl::basic_context::use_certificate_chain_file (2 of 2 overloads)]
+[section:native stream_socket_service::native]
-Use a certificate chain from a file.
+[indexterm2 native..stream_socket_service] Get the native socket implementation.
- boost::system::error_code use_certificate_chain_file(
- const std::string & filename,
- boost::system::error_code & ec);
+ native_type native(
+ implementation_type & impl);
-This function is used to load a certificate chain into the context from a file.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of the file containing the certificate. The file must use the PEM format.]]
-[[ec][Set to indicate what error occurred, if any. ]]
+[section:native_type stream_socket_service::native_type]
-]
+[indexterm2 native_type..stream_socket_service] The native socket type.
+ typedef implementation_defined native_type;
-[endsect]
[endsect]
-[section:use_certificate_file ssl::basic_context::use_certificate_file]
-
-Use a certificate from a file.
-
- void ``[link boost_asio.reference.ssl__basic_context.use_certificate_file.overload1 use_certificate_file]``(
- const std::string & filename,
- file_format format);
-
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_certificate_file.overload2 use_certificate_file]``(
- const std::string & filename,
- file_format format,
- boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::use_certificate_file (1 of 2 overloads)]
-
-Use a certificate from a file.
+[section:open stream_socket_service::open]
- void use_certificate_file(
- const std::string & filename,
- file_format format);
+[indexterm2 open..stream_socket_service] Open a stream socket.
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
-This function is used to load a certificate into the context from a file.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[filename][The name of the file containing the certificate.]]
-[[format][The file format (ASN.1 or PEM).]]
-]
+[section:protocol_type stream_socket_service::protocol_type]
-[heading Exceptions]
-
+[indexterm2 protocol_type..stream_socket_service] The protocol type.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef Protocol protocol_type;
-]
@@ -34784,84 +55657,66 @@
-[section:overload2 ssl::basic_context::use_certificate_file (2 of 2 overloads)]
+[section:receive stream_socket_service::receive]
-Use a certificate from a file.
+[indexterm2 receive..stream_socket_service] Receive some data from the peer.
- boost::system::error_code use_certificate_file(
- const std::string & filename,
- file_format format,
+ 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);
-This function is used to load a certificate into the context from a file.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of the file containing the certificate.]]
-[[format][The file format (ASN.1 or PEM).]]
+[section:remote_endpoint stream_socket_service::remote_endpoint]
-[[ec][Set to indicate what error occurred, if any. ]]
+[indexterm2 remote_endpoint..stream_socket_service] Get the remote endpoint.
-]
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
[endsect]
-[endsect]
-
-[section:use_private_key_file ssl::basic_context::use_private_key_file]
-Use a private key from a file.
+[section:send stream_socket_service::send]
- void ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload1 use_private_key_file]``(
- const std::string & filename,
- file_format format);
+[indexterm2 send..stream_socket_service] Send the given data to the peer.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload2 use_private_key_file]``(
- const std::string & filename,
- file_format format,
+ 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);
-[section:overload1 ssl::basic_context::use_private_key_file (1 of 2 overloads)]
-
-Use a private key from a file.
-
- void use_private_key_file(
- const std::string & filename,
- file_format format);
-
-
-This function is used to load a private key into the context from a file.
-
-
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of the file containing the private key.]]
+[endsect]
-[[format][The file format (ASN.1 or PEM).]]
-]
-[heading Exceptions]
-
+[section:set_option stream_socket_service::set_option]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 set_option..stream_socket_service] Set a socket option.
-]
+ 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);
@@ -34869,83 +55724,136 @@
-[section:overload2 ssl::basic_context::use_private_key_file (2 of 2 overloads)]
+[section:shutdown stream_socket_service::shutdown]
-Use a private key from a file.
+[indexterm2 shutdown..stream_socket_service] Disable sends or receives on the socket.
- boost::system::error_code use_private_key_file(
- const std::string & filename,
- file_format format,
+ boost::system::error_code shutdown(
+ implementation_type & impl,
+ socket_base::shutdown_type what,
boost::system::error_code & ec);
-This function is used to load a private key into the context from a file.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of the file containing the private key.]]
-[[format][The file format (ASN.1 or PEM).]]
+[section:shutdown_service stream_socket_service::shutdown_service]
-[[ec][Set to indicate what error occurred, if any. ]]
+[indexterm2 shutdown_service..stream_socket_service] Destroy all user-defined handler objects owned by the service.
-]
+ void shutdown_service();
[endsect]
-[endsect]
-[section:use_rsa_private_key_file ssl::basic_context::use_rsa_private_key_file]
+[section:stream_socket_service stream_socket_service::stream_socket_service]
-Use an RSA private key from a file.
+[indexterm2 stream_socket_service..stream_socket_service] Construct a new stream socket service for the specified io_service.
- void ``[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file.overload1 use_rsa_private_key_file]``(
- const std::string & filename,
- file_format format);
+ stream_socket_service(
+ boost::asio::io_service & io_service);
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file.overload2 use_rsa_private_key_file]``(
- const std::string & filename,
- file_format format,
- boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::use_rsa_private_key_file (1 of 2 overloads)]
+[endsect]
-Use an RSA private key from a file.
- void use_rsa_private_key_file(
- const std::string & filename,
- file_format format);
+[endsect]
-This function is used to load an RSA private key into the context from a file.
+[section:streambuf streambuf]
-[heading Parameters]
-
+[indexterm1 streambuf] Typedef for the typical usage of basic_streambuf.
-[variablelist
+ typedef basic_streambuf streambuf;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
+ [The type used to represent the get area as a list of buffers. ]
-[[filename][The name of the file containing the RSA private key.]]
+ ]
-[[format][The file format (ASN.1 or PEM).]]
+ [
+
+ [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
+ [The type used to represent the put area as a list of buffers. ]
+
+ ]
]
-[heading Exceptions]
-
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+ [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
+ [Construct a buffer with a specified maximum size. ]
+ ]
-[[boost::system::system_error][Thrown on failure. ]]
+ [
+ [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
+ [Move the start of the put area by the specified number of characters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
+ [Move the start of the get area by the specified number of characters. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.data [*data]]]
+ [Get a list of buffers that represents the get area. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
+ [Return the maximum size of the buffer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
+ [Get a list of buffers that represents the put area, with the given size. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.size [*size]]]
+ [Return the size of the get area in characters. ]
+ ]
+
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
+ []
+ ]
+
]
@@ -34953,80 +55861,100 @@
[endsect]
+[section:time_traits_lt__ptime__gt_ time_traits< boost::posix_time::ptime >]
-[section:overload2 ssl::basic_context::use_rsa_private_key_file (2 of 2 overloads)]
+Time traits specialised for posix_time.
-Use an RSA private key from a file.
+ template<>
+ struct time_traits< boost::posix_time::ptime >
- boost::system::error_code use_rsa_private_key_file(
- const std::string & filename,
- file_format format,
- boost::system::error_code & ec);
+[heading Types]
+[table
+ [[Name][Description]]
-This function is used to load an RSA private key into the context from a file.
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.time_type [*time_type]]]
+ [The time type. ]
-[[filename][The name of the file containing the RSA private key.]]
+ ]
-[[format][The file format (ASN.1 or PEM).]]
+]
-[[ec][Set to indicate what error occurred, if any. ]]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.add [*add]]]
+ [Add a duration to a time. ]
+ ]
+
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.less_than [*less_than]]]
+ [Test whether one time is less than another. ]
+ ]
+
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.now [*now]]]
+ [Get the current time. ]
+ ]
+
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.subtract [*subtract]]]
+ [Subtract one time from another. ]
+ ]
+
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.to_posix_duration [*to_posix_duration]]]
+ [Convert to POSIX duration type. ]
+ ]
+
]
+[section:add time_traits< boost::posix_time::ptime >::add]
-[endsect]
-
+[indexterm2 add..time_traits< boost::posix_time::ptime >] Add a duration to a time.
-[endsect]
+ static time_type add(
+ const time_type & t,
+ const duration_type & d);
-[section:use_tmp_dh_file ssl::basic_context::use_tmp_dh_file]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
- void ``[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file.overload1 use_tmp_dh_file]``(
- const std::string & filename);
+[endsect]
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file.overload2 use_tmp_dh_file]``(
- const std::string & filename,
- boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::use_tmp_dh_file (1 of 2 overloads)]
+[section:duration_type time_traits< boost::posix_time::ptime >::duration_type]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+[indexterm2 duration_type..time_traits< boost::posix_time::ptime >] The duration type.
- void use_tmp_dh_file(
- const std::string & filename);
+ typedef boost::posix_time::time_duration duration_type;
-This function is used to load Diffie-Hellman parameters into the context from a file.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
-]
-[heading Exceptions]
-
+[section:less_than time_traits< boost::posix_time::ptime >::less_than]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[indexterm2 less_than..time_traits< boost::posix_time::ptime >] Test whether one time is less than another.
-]
+ static bool less_than(
+ const time_type & t1,
+ const time_type & t2);
@@ -35034,45 +55962,38 @@
-[section:overload2 ssl::basic_context::use_tmp_dh_file (2 of 2 overloads)]
-
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+[section:now time_traits< boost::posix_time::ptime >::now]
- boost::system::error_code use_tmp_dh_file(
- const std::string & filename,
- boost::system::error_code & ec);
+[indexterm2 now..time_traits< boost::posix_time::ptime >] Get the current time.
+ static time_type now();
-This function is used to load Diffie-Hellman parameters into the context from a file.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:subtract time_traits< boost::posix_time::ptime >::subtract]
+[indexterm2 subtract..time_traits< boost::posix_time::ptime >] Subtract one time from another.
+ static duration_type subtract(
+ const time_type & t1,
+ const time_type & t2);
-[endsect]
[endsect]
-[section:verify_client_once ssl::basic_context::verify_client_once]
+[section:time_type time_traits< boost::posix_time::ptime >::time_type]
-['Inherited from ssl::context_base.]
+[indexterm2 time_type..time_traits< boost::posix_time::ptime >] The time type.
-Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
+ typedef boost::posix_time::ptime time_type;
- static const int verify_client_once = implementation_defined;
@@ -35080,60 +56001,90 @@
-[section:verify_fail_if_no_peer_cert ssl::basic_context::verify_fail_if_no_peer_cert]
+[section:to_posix_duration time_traits< boost::posix_time::ptime >::to_posix_duration]
+[indexterm2 to_posix_duration..time_traits< boost::posix_time::ptime >] Convert to POSIX duration type.
-['Inherited from ssl::context_base.]
+ static boost::posix_time::time_duration to_posix_duration(
+ const duration_type & d);
-Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
- static const int verify_fail_if_no_peer_cert = implementation_defined;
+
+[endsect]
[endsect]
+[section:transfer_all transfer_all]
-[section:verify_mode ssl::basic_context::verify_mode]
+[indexterm1 transfer_all] Return a completion condition function object that indicates that a read or write operation should continue until all of the data has been transferred, or until an error occurs.
+ unspecified transfer_all();
-['Inherited from ssl::context_base.]
-Bitmask type for peer verification.
+This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
- typedef int verify_mode;
+[heading Example]
+
+Reading until a buffer is full:
+ 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_all(), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ // n == 128
+ }
-[endsect]
-[section:verify_none ssl::basic_context::verify_none]
+[endsect]
-['Inherited from ssl::context_base.]
-No verification.
- static const int verify_none = implementation_defined;
+[section:transfer_at_least transfer_at_least]
+[indexterm1 transfer_at_least] Return a completion condition function object that indicates that a read or write operation should continue until a minimum number of bytes has been transferred, or until an error occurs.
+ unspecified transfer_at_least(
+ std::size_t minimum);
-[endsect]
+This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
-[section:verify_peer ssl::basic_context::verify_peer]
+[heading Example]
+
+Reading until a buffer is full or contains at least 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_at_least(64), ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+ else
+ {
+ // n >= 64 && n <= 128
+ }
-['Inherited from ssl::context_base.]
-Verify the peer.
- static const int verify_peer = implementation_defined;
@@ -35141,78 +56092,76 @@
-[section:_basic_context ssl::basic_context::~basic_context]
-
-Destructor.
-
- ~basic_context();
+[section:use_service use_service]
+[indexterm1 use_service]
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ Service & use_service(
+ io_service & ios);
-[endsect]
+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 io_service will create a new instance of the service.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
-[section:ssl__context ssl::context]
+]
-Typedef for the typical usage of context.
+[heading Return Value]
+
+The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
- typedef basic_context< context_service > context;
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[link boost_asio.reference.ssl__basic_context.file_format [*file_format]]]
- [File format types. ]
-
- ]
+[section:windows__basic_handle windows::basic_handle]
- [
+Provides Windows handle functionality.
- [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
- [The native implementation type of the locking dispatcher. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.HandleService HandleService]``>
+ class basic_handle :
+ public basic_io_object< HandleService >
- [
- [[link boost_asio.reference.ssl__basic_context.method [*method]]]
- [Different methods supported by a context. ]
-
- ]
+[heading Types]
+[table
+ [[Name][Description]]
[
- [[link boost_asio.reference.ssl__basic_context.options [*options]]]
- [Bitmask type for SSL options. ]
+ [[link boost_asio.reference.windows__basic_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.password_purpose [*password_purpose]]]
- [Purpose of PEM password. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.service_type [*service_type]]]
- [The type of the service that will be used to provide context operations. ]
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.verify_mode [*verify_mode]]]
- [Bitmask type for peer verification. ]
+ [[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. ]
]
@@ -35223,120 +56172,232 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__basic_context.add_verify_path [*add_verify_path]]]
- [Add a directory containing certificate authority files to be used for performing verification. ]
+ [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.basic_context [*basic_context]]]
- [Constructor. ]
+ [[link boost_asio.reference.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.impl [*impl]]]
- [Get the underlying implementation in the native type. ]
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.load_verify_file [*load_verify_file]]]
- [Load a certification authority file for performing verification. ]
+ [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [Close the handle. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.set_options [*set_options]]]
- [Set options on the context. ]
+ [[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.ssl__basic_context.set_password_callback [*set_password_callback]]]
- [Set the password callback. ]
+ [[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.ssl__basic_context.set_verify_mode [*set_verify_mode]]]
- [Set the peer verification mode. ]
+ [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file [*use_certificate_chain_file]]]
- [Use a certificate chain from a file. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__basic_context.use_certificate_file [*use_certificate_file]]]
- [Use a certificate from a file. ]
+ [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
]
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__basic_context.use_private_key_file [*use_private_key_file]]]
- [Use a private key from a file. ]
+ [[link boost_asio.reference.windows__basic_handle._basic_handle [*~basic_handle]]]
+ [Protected destructor to prevent deletion through this type. ]
]
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__basic_context.use_rsa_private_key_file [*use_rsa_private_key_file]]]
- [Use an RSA private key from a file. ]
+ [[link boost_asio.reference.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file [*use_tmp_dh_file]]]
- [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
]
+
+]
+
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
+
+
+[heading Thread Safety]
- [
- [[link boost_asio.reference.ssl__basic_context._basic_context [*~basic_context]]]
- [Destructor. ]
- ]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[section:assign windows::basic_handle::assign]
+
+[indexterm2 assign..windows::basic_handle] Assign an existing native handle to the handle.
+
+ void ``[link boost_asio.reference.windows__basic_handle.assign.overload1 assign]``(
+ const native_type & native_handle);
+
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.assign.overload2 assign]``(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+
+
+[section:overload1 windows::basic_handle::assign (1 of 2 overloads)]
+
+Assign an existing native handle to the handle.
+
+ void assign(
+ const native_type & native_handle);
+
+
+
+[endsect]
+
+
+
+[section:overload2 windows::basic_handle::assign (2 of 2 overloads)]
+
+Assign an existing native handle to the handle.
+
+ boost::system::error_code assign(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_handle windows::basic_handle::basic_handle]
+
+[indexterm2 basic_handle..windows::basic_handle] Construct a basic_handle without opening it.
+
+ ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload1 basic_handle]``(
+ boost::asio::io_service & io_service);
+
+ ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload2 basic_handle]``(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
+
+
+[section:overload1 windows::basic_handle::basic_handle (1 of 2 overloads)]
+
+Construct a basic_handle without opening it.
+
+ basic_handle(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a handle without opening it.
+
+
+[heading Parameters]
+
+
+[variablelist
+[[io_service][The io\_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
+
]
-[heading Data Members]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ssl__basic_context.default_workarounds [*default_workarounds]]]
- [Implement various bug workarounds. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.no_sslv2 [*no_sslv2]]]
- [Disable SSL v2. ]
- ]
+[endsect]
+
+
+
+[section:overload2 windows::basic_handle::basic_handle (2 of 2 overloads)]
+
+Construct a basic_handle on an existing native handle.
+
+ basic_handle(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
+
+
+This constructor creates a handle object to hold an existing native handle.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
+
+[[native_handle][A native handle.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:cancel windows::basic_handle::cancel]
+
+[indexterm2 cancel..windows::basic_handle] Cancel all asynchronous operations associated with the handle.
+
+ void ``[link boost_asio.reference.windows__basic_handle.cancel.overload1 cancel]``();
+
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+
- [
- [[link boost_asio.reference.ssl__basic_context.no_sslv3 [*no_sslv3]]]
- [Disable SSL v3. ]
- ]
+[section:overload1 windows::basic_handle::cancel (1 of 2 overloads)]
- [
- [[link boost_asio.reference.ssl__basic_context.no_tlsv1 [*no_tlsv1]]]
- [Disable TLS v1. ]
- ]
+Cancel all asynchronous operations associated with the handle.
- [
- [[link boost_asio.reference.ssl__basic_context.single_dh_use [*single_dh_use]]]
- [Always create a new key when using tmp_dh parameters. ]
- ]
+ void cancel();
- [
- [[link boost_asio.reference.ssl__basic_context.verify_client_once [*verify_client_once]]]
- [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
- [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
- ]
+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.
- [
- [[link boost_asio.reference.ssl__basic_context.verify_none [*verify_none]]]
- [No verification. ]
- ]
- [
- [[link boost_asio.reference.ssl__basic_context.verify_peer [*verify_peer]]]
- [Verify the peer. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -35345,215 +56406,128 @@
[endsect]
-[section:ssl__context_base ssl::context_base]
-The context_base class is used as a base for the basic_context class template so that we have a common place to define various enums.
+[section:overload2 windows::basic_handle::cancel (2 of 2 overloads)]
- class context_base
+Cancel all asynchronous operations associated with the handle.
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-[heading Types]
-[table
- [[Name][Description]]
- [
+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.
- [[link boost_asio.reference.ssl__context_base.file_format [*file_format]]]
- [File format types. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.ssl__context_base.method [*method]]]
- [Different methods supported by a context. ]
+[variablelist
- ]
+[[ec][Set to indicate what error occurred, if any. ]]
- [
+]
- [[link boost_asio.reference.ssl__context_base.options [*options]]]
- [Bitmask type for SSL options. ]
-
- ]
- [
- [[link boost_asio.reference.ssl__context_base.password_purpose [*password_purpose]]]
- [Purpose of PEM password. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.ssl__context_base.verify_mode [*verify_mode]]]
- [Bitmask type for peer verification. ]
-
- ]
+[endsect]
-]
+[section:close windows::basic_handle::close]
-[heading Data Members]
-[table
- [[Name][Description]]
+[indexterm2 close..windows::basic_handle] Close the handle.
- [
- [[link boost_asio.reference.ssl__context_base.default_workarounds [*default_workarounds]]]
- [Implement various bug workarounds. ]
- ]
+ void ``[link boost_asio.reference.windows__basic_handle.close.overload1 close]``();
- [
- [[link boost_asio.reference.ssl__context_base.no_sslv2 [*no_sslv2]]]
- [Disable SSL v2. ]
- ]
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.close.overload2 close]``(
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.ssl__context_base.no_sslv3 [*no_sslv3]]]
- [Disable SSL v3. ]
- ]
- [
- [[link boost_asio.reference.ssl__context_base.no_tlsv1 [*no_tlsv1]]]
- [Disable TLS v1. ]
- ]
+[section:overload1 windows::basic_handle::close (1 of 2 overloads)]
- [
- [[link boost_asio.reference.ssl__context_base.single_dh_use [*single_dh_use]]]
- [Always create a new key when using tmp_dh parameters. ]
- ]
+Close the handle.
- [
- [[link boost_asio.reference.ssl__context_base.verify_client_once [*verify_client_once]]]
- [Do not request client certificate on renegotiation. Ignored unless verify_peer is set. ]
- ]
+ void close();
- [
- [[link boost_asio.reference.ssl__context_base.verify_fail_if_no_peer_cert [*verify_fail_if_no_peer_cert]]]
- [Fail verification if the peer has no certificate. Ignored unless verify_peer is set. ]
- ]
- [
- [[link boost_asio.reference.ssl__context_base.verify_none [*verify_none]]]
- [No verification. ]
- ]
+This function is used to close the handle. 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.ssl__context_base.verify_peer [*verify_peer]]]
- [Verify the peer. ]
- ]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
]
-[section:default_workarounds ssl::context_base::default_workarounds]
-Implement various bug workarounds.
+[endsect]
- static const int default_workarounds = implementation_defined;
+[section:overload2 windows::basic_handle::close (2 of 2 overloads)]
-[endsect]
+Close the handle.
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-[section:file_format ssl::context_base::file_format]
+This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
-File format types.
- enum file_format
+[heading Parameters]
+
-[heading Values]
[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
- [
- [asn1]
- [ASN.1 file. ]
- ]
+]
- [
- [pem]
- [PEM file. ]
- ]
-]
+[endsect]
[endsect]
+[section:get_io_service windows::basic_handle::get_io_service]
-[section:method ssl::context_base::method]
-Different methods supported by a context.
+['Inherited from basic_io_object.]
- enum method
+[indexterm2 get_io_service..windows::basic_handle] Get the io_service associated with the object.
-[heading Values]
-[variablelist
+ boost::asio::io_service & get_io_service();
- [
- [sslv2]
- [Generic SSL version 2. ]
- ]
- [
- [sslv2_client]
- [SSL version 2 client. ]
- ]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
- [
- [sslv2_server]
- [SSL version 2 server. ]
- ]
- [
- [sslv3]
- [Generic SSL version 3. ]
- ]
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
- [
- [sslv3_client]
- [SSL version 3 client. ]
- ]
- [
- [sslv3_server]
- [SSL version 3 server. ]
- ]
- [
- [tlsv1]
- [Generic TLS version 1. ]
- ]
+[endsect]
- [
- [tlsv1_client]
- [TLS version 1 client. ]
- ]
- [
- [tlsv1_server]
- [TLS version 1 server. ]
- ]
- [
- [sslv23]
- [Generic SSL/TLS. ]
- ]
+[section:implementation windows::basic_handle::implementation]
- [
- [sslv23_client]
- [SSL/TLS client. ]
- ]
- [
- [sslv23_server]
- [SSL/TLS server. ]
- ]
+['Inherited from basic_io_object.]
-]
+[indexterm2 implementation..windows::basic_handle] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
@@ -35561,11 +56535,15 @@
-[section:no_sslv2 ssl::context_base::no_sslv2]
+[section:implementation_type windows::basic_handle::implementation_type]
-Disable SSL v2.
- static const int no_sslv2 = implementation_defined;
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation_type..windows::basic_handle] The underlying implementation type of I/O object.
+
+ typedef service_type::implementation_type implementation_type;
+
@@ -35573,11 +56551,22 @@
-[section:no_sslv3 ssl::context_base::no_sslv3]
+[section:io_service windows::basic_handle::io_service]
-Disable SSL v3.
- static const int no_sslv3 = implementation_defined;
+['Inherited from basic_io_object.]
+
+[indexterm2 io_service..windows::basic_handle] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -35585,11 +56574,11 @@
-[section:no_tlsv1 ssl::context_base::no_tlsv1]
+[section:is_open windows::basic_handle::is_open]
-Disable TLS v1.
+[indexterm2 is_open..windows::basic_handle] Determine whether the handle is open.
- static const int no_tlsv1 = implementation_defined;
+ bool is_open() const;
@@ -35597,12 +56586,19 @@
-[section:options ssl::context_base::options]
+[section:lowest_layer windows::basic_handle::lowest_layer]
-Bitmask type for SSL options.
+[indexterm2 lowest_layer..windows::basic_handle] 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 basic_handle cannot contain any further layers, it simply returns a reference to itself.
- typedef int options;
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
@@ -35610,38 +56606,134 @@
-[section:password_purpose ssl::context_base::password_purpose]
+[section:lowest_layer_type windows::basic_handle::lowest_layer_type]
-Purpose of PEM password.
+[indexterm2 lowest_layer_type..windows::basic_handle] A basic_handle is always the lowest layer.
- enum password_purpose
+ typedef basic_handle< HandleService > lowest_layer_type;
-[heading Values]
-[variablelist
+
+[heading Types]
+[table
+ [[Name][Description]]
[
- [for_reading]
- [The password is needed for reading/decryption. ]
+
+ [[link boost_asio.reference.windows__basic_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
]
[
- [for_writing]
- [The password is needed for writing/encryption. ]
+
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_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. ]
+
]
]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [Close the handle. ]
+ ]
+
+ [
+ [[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.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
+ ]
+
+]
-[endsect]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_handle._basic_handle [*~basic_handle]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[section:single_dh_use ssl::context_base::single_dh_use]
+ [
+ [[link boost_asio.reference.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-Always create a new key when using tmp_dh parameters.
+ [
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
- static const int single_dh_use = implementation_defined;
@@ -35649,23 +56741,26 @@
-[section:verify_client_once ssl::context_base::verify_client_once]
+[section:native windows::basic_handle::native]
-Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
+[indexterm2 native..windows::basic_handle] Get the native handle representation.
+
+ native_type native();
- static const int verify_client_once = implementation_defined;
+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:verify_fail_if_no_peer_cert ssl::context_base::verify_fail_if_no_peer_cert]
+[section:native_type windows::basic_handle::native_type]
-Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
+[indexterm2 native_type..windows::basic_handle] The native representation of a handle.
+
+ typedef HandleService::native_type native_type;
- static const int verify_fail_if_no_peer_cert = implementation_defined;
@@ -35673,12 +56768,14 @@
-[section:verify_mode ssl::context_base::verify_mode]
+[section:service windows::basic_handle::service]
-Bitmask type for peer verification.
- typedef int verify_mode;
+['Inherited from basic_io_object.]
+[indexterm2 service..windows::basic_handle] The service associated with the I/O object.
+
+ service_type & service;
@@ -35686,11 +56783,15 @@
-[section:verify_none ssl::context_base::verify_none]
+[section:service_type windows::basic_handle::service_type]
-No verification.
- static const int verify_none = implementation_defined;
+['Inherited from basic_io_object.]
+
+[indexterm2 service_type..windows::basic_handle] The type of the service that will be used to provide I/O operations.
+
+ typedef HandleService service_type;
+
@@ -35698,11 +56799,11 @@
-[section:verify_peer ssl::context_base::verify_peer]
+[section:_basic_handle windows::basic_handle::~basic_handle]
-Verify the peer.
+[indexterm2 ~basic_handle..windows::basic_handle] Protected destructor to prevent deletion through this type.
- static const int verify_peer = implementation_defined;
+ ~basic_handle();
@@ -35712,12 +56813,14 @@
[endsect]
-[section:ssl__context_service ssl::context_service]
+[section:windows__basic_random_access_handle windows::basic_random_access_handle]
-Default service implementation for a context.
+Provides random-access handle functionality.
- class context_service :
- public io_service::service
+ template<
+ typename ``[link boost_asio.reference.RandomAccessHandleService RandomAccessHandleService]`` = random_access_handle_service>
+ class basic_random_access_handle :
+ public windows::basic_handle< RandomAccessHandleService >
[heading Types]
@@ -35726,8 +56829,29 @@
[
- [[link boost_asio.reference.ssl__context_service.impl_type [*impl_type]]]
- [The type of the context. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.windows__basic_random_access_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_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. ]
]
@@ -35738,139 +56862,291 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__context_service.add_verify_path [*add_verify_path]]]
- [Add a directory containing certification authority files to be used for performing verification. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.ssl__context_service.context_service [*context_service]]]
- [Constructor. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.async_read_some_at [*async_read_some_at]]]
+ [Start an asynchronous read at the specified offset. ]
]
[
- [[link boost_asio.reference.ssl__context_service.create [*create]]]
- [Create a new context implementation. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.async_write_some_at [*async_write_some_at]]]
+ [Start an asynchronous write at the specified offset. ]
]
[
- [[link boost_asio.reference.ssl__context_service.destroy [*destroy]]]
- [Destroy a context implementation. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.basic_random_access_handle [*basic_random_access_handle]]]
+ [Construct a basic_random_access_handle without opening it. ]
]
[
- [[link boost_asio.reference.ssl__context_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[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.windows__basic_random_access_handle.close [*close]]]
+ [Close the handle. ]
]
[
- [[link boost_asio.reference.ssl__context_service.load_verify_file [*load_verify_file]]]
- [Load a certification authority file for performing verification. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.ssl__context_service.null [*null]]]
- [Return a null context implementation. ]
+ [[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.ssl__context_service.set_options [*set_options]]]
- [Set options on the context. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.ssl__context_service.set_password_callback [*set_password_callback]]]
- [Set the password callback. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__context_service.set_verify_mode [*set_verify_mode]]]
- [Set peer verification mode. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
+ [Get the native handle representation. ]
]
[
- [[link boost_asio.reference.ssl__context_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.read_some_at [*read_some_at]]]
+ [Read some data from the handle at the specified offset. ]
]
[
- [[link boost_asio.reference.ssl__context_service.use_certificate_chain_file [*use_certificate_chain_file]]]
- [Use a certificate chain from a file. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.write_some_at [*write_some_at]]]
+ [Write some data to the handle at the specified offset. ]
]
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__context_service.use_certificate_file [*use_certificate_file]]]
- [Use a certificate from a file. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ssl__context_service.use_private_key_file [*use_private_key_file]]]
- [Use a private key from a file. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.service [*service]]]
+ [The service associated with the I/O object. ]
]
+
+]
+
+The windows::basic_random_access_handle class template provides asynchronous and blocking random-access handle functionality.
+
+
+[heading Thread Safety]
- [
- [[link boost_asio.reference.ssl__context_service.use_rsa_private_key_file [*use_rsa_private_key_file]]]
- [Use an RSA private key from a file. ]
- ]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[section:assign windows::basic_random_access_handle::assign]
+
+[indexterm2 assign..windows::basic_random_access_handle] Assign an existing native handle to the handle.
+
+ void ``[link boost_asio.reference.windows__basic_random_access_handle.assign.overload1 assign]``(
+ const native_type & native_handle);
+
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.assign.overload2 assign]``(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+
+
+[section:overload1 windows::basic_random_access_handle::assign (1 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
+
+Assign an existing native handle to the handle.
+
+ void assign(
+ const native_type & native_handle);
+
+
+
+[endsect]
+
+
+
+[section:overload2 windows::basic_random_access_handle::assign (2 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
+
+Assign an existing native handle to the handle.
+
+ boost::system::error_code assign(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:async_read_some_at windows::basic_random_access_handle::async_read_some_at]
+
+[indexterm2 async_read_some_at..windows::basic_random_access_handle] Start an asynchronous read at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some_at(
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+
+
+This function is used to asynchronously read data from the random-access handle. The function call always returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
- [
- [[link boost_asio.reference.ssl__context_service.use_tmp_dh_file [*use_tmp_dh_file]]]
- [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
- ]
+[[offset][The offset at which the data will be read.]]
+
+[[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_at async_read_at] 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:
+
+ handle.async_read_some_at(42, 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_at windows::basic_random_access_handle::async_write_some_at]
+
+[indexterm2 async_write_some_at..windows::basic_random_access_handle] Start an asynchronous write at the specified offset.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some_at(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
+
+
+This function is used to asynchronously write data to the random-access handle. The function call always returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
-]
+[[offset][The offset at which the data will be written.]]
-[heading Data Members]
-[table
- [[Name][Description]]
+[[buffers][One or more data buffers to be written to the handle. 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.]]
- [
- [[link boost_asio.reference.ssl__context_service.id [*id]]]
- [The unique service identifier. ]
- ]
+[[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 Remarks]
+
+The write operation may not transmit all of the data to the peer. Consider using the
+[link boost_asio.reference.async_write_at async_write_at] function if you need to ensure that all data is written before the asynchronous operation completes.
-[section:add_verify_path ssl::context_service::add_verify_path]
+[heading Example]
+
+To write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
-Add a directory containing certification authority files to be used for performing verification.
+ handle.async_write_some_at(42, boost::asio::buffer(data, size), handler);
- boost::system::error_code add_verify_path(
- impl_type & impl,
- const std::string & path,
- boost::system::error_code & 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.
-[endsect]
+[endsect]
-[section:context_service ssl::context_service::context_service]
+[section:basic_random_access_handle windows::basic_random_access_handle::basic_random_access_handle]
-Constructor.
+[indexterm2 basic_random_access_handle..windows::basic_random_access_handle] Construct a basic_random_access_handle without opening it.
- context_service(
+ ``[link boost_asio.reference.windows__basic_random_access_handle.basic_random_access_handle.overload1 basic_random_access_handle]``(
boost::asio::io_service & io_service);
+ ``[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);
-[endsect]
+[section:overload1 windows::basic_random_access_handle::basic_random_access_handle (1 of 2 overloads)]
+Construct a basic_random_access_handle without opening it.
+ basic_random_access_handle(
+ boost::asio::io_service & io_service);
-[section:create ssl::context_service::create]
-Create a new context implementation.
+This constructor creates a random-access handle without opening it. The handle needs to be opened before data can be written to or or read from it.
- void create(
- impl_type & impl,
- context_base::method m);
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
+
+]
@@ -35878,52 +57154,76 @@
-[section:destroy ssl::context_service::destroy]
+[section:overload2 windows::basic_random_access_handle::basic_random_access_handle (2 of 2 overloads)]
-Destroy a context implementation.
+Construct a basic_random_access_handle on an existing native handle.
- void destroy(
- impl_type & impl);
+ basic_random_access_handle(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
+This constructor creates a random-access handle object to hold an existing native handle.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[io_service][The io\_service object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
-[section:get_io_service ssl::context_service::get_io_service]
+[[native_handle][The new underlying handle implementation.]]
+]
-['Inherited from io_service.]
+[heading Exceptions]
+
-Get the io_service object that owns the service.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- boost::asio::io_service & get_io_service();
+]
[endsect]
+[endsect]
-[section:id ssl::context_service::id]
+[section:cancel windows::basic_random_access_handle::cancel]
-The unique service identifier.
+[indexterm2 cancel..windows::basic_random_access_handle] Cancel all asynchronous operations associated with the handle.
- static boost::asio::io_service::id id;
+ void ``[link boost_asio.reference.windows__basic_random_access_handle.cancel.overload1 cancel]``();
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 windows::basic_random_access_handle::cancel (1 of 2 overloads)]
+['Inherited from windows::basic_handle.]
-[section:impl_type ssl::context_service::impl_type]
+Cancel all asynchronous operations associated with the handle.
-The type of the context.
+ void cancel();
- typedef implementation_defined impl_type;
+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. ]]
+
+]
@@ -35931,56 +57231,67 @@
-[section:io_service ssl::context_service::io_service]
+[section:overload2 windows::basic_random_access_handle::cancel (2 of 2 overloads)]
-['Inherited from io_service.]
+['Inherited from windows::basic_handle.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+Cancel all asynchronous operations associated with the handle.
- boost::asio::io_service & io_service();
+ 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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
-[section:load_verify_file ssl::context_service::load_verify_file]
+]
-Load a certification authority file for performing verification.
- boost::system::error_code load_verify_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+[endsect]
[endsect]
+[section:close windows::basic_random_access_handle::close]
+[indexterm2 close..windows::basic_random_access_handle] Close the handle.
-[section:null ssl::context_service::null]
+ void ``[link boost_asio.reference.windows__basic_random_access_handle.close.overload1 close]``();
-Return a null context implementation.
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.close.overload2 close]``(
+ boost::system::error_code & ec);
- impl_type null() const;
+[section:overload1 windows::basic_random_access_handle::close (1 of 2 overloads)]
-[endsect]
+['Inherited from windows::basic_handle.]
+Close the handle.
+ void close();
-[section:set_options ssl::context_service::set_options]
-Set options on the context.
+This function is used to close the handle. 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 set_options(
- impl_type & impl,
- context_base::options o,
- boost::system::error_code & ec);
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
@@ -35988,43 +57299,53 @@
-[section:set_password_callback ssl::context_service::set_password_callback]
+[section:overload2 windows::basic_random_access_handle::close (2 of 2 overloads)]
-Set the password callback.
- template<
- typename PasswordCallback>
- boost::system::error_code set_password_callback(
- impl_type & impl,
- PasswordCallback callback,
+['Inherited from windows::basic_handle.]
+
+Close the handle.
+
+ boost::system::error_code close(
boost::system::error_code & ec);
+This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
-[section:set_verify_mode ssl::context_service::set_verify_mode]
+]
-Set peer verification mode.
- boost::system::error_code set_verify_mode(
- impl_type & impl,
- context_base::verify_mode v,
- boost::system::error_code & ec);
+[endsect]
[endsect]
+[section:get_io_service windows::basic_random_access_handle::get_io_service]
-[section:shutdown_service ssl::context_service::shutdown_service]
-Destroy all user-defined handler objects owned by the service.
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..windows::basic_random_access_handle] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
- void shutdown_service();
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -36032,14 +57353,14 @@
-[section:use_certificate_chain_file ssl::context_service::use_certificate_chain_file]
+[section:implementation windows::basic_random_access_handle::implementation]
-Use a certificate chain from a file.
- boost::system::error_code use_certificate_chain_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..windows::basic_random_access_handle] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
@@ -36047,15 +57368,15 @@
-[section:use_certificate_file ssl::context_service::use_certificate_file]
+[section:implementation_type windows::basic_random_access_handle::implementation_type]
-Use a certificate from a file.
- boost::system::error_code use_certificate_file(
- impl_type & impl,
- const std::string & filename,
- context_base::file_format format,
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation_type..windows::basic_random_access_handle] The underlying implementation type of I/O object.
+
+ typedef service_type::implementation_type implementation_type;
+
@@ -36063,15 +57384,22 @@
-[section:use_private_key_file ssl::context_service::use_private_key_file]
+[section:io_service windows::basic_random_access_handle::io_service]
-Use a private key from a file.
- boost::system::error_code use_private_key_file(
- impl_type & impl,
- const std::string & filename,
- context_base::file_format format,
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
+
+[indexterm2 io_service..windows::basic_random_access_handle] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+
+ boost::asio::io_service & io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -36079,15 +57407,14 @@
-[section:use_rsa_private_key_file ssl::context_service::use_rsa_private_key_file]
+[section:is_open windows::basic_random_access_handle::is_open]
-Use an RSA private key from a file.
- boost::system::error_code use_rsa_private_key_file(
- impl_type & impl,
- const std::string & filename,
- context_base::file_format format,
- boost::system::error_code & ec);
+['Inherited from windows::basic_handle.]
+
+[indexterm2 is_open..windows::basic_random_access_handle] Determine whether the handle is open.
+
+ bool is_open() const;
@@ -36095,32 +57422,37 @@
-[section:use_tmp_dh_file ssl::context_service::use_tmp_dh_file]
+[section:lowest_layer windows::basic_random_access_handle::lowest_layer]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
- boost::system::error_code use_tmp_dh_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+['Inherited from windows::basic_handle.]
+
+[indexterm2 lowest_layer..windows::basic_random_access_handle] 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 basic_handle 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:ssl__stream ssl::stream]
-Provides stream-oriented functionality using SSL.
- template<
- typename Stream,
- typename ``[link boost_asio.reference.Service Service]`` = stream_service>
- class stream :
- public ssl::stream_base
+[section:lowest_layer_type windows::basic_random_access_handle::lowest_layer_type]
+
+
+['Inherited from windows::basic_handle.]
+
+[indexterm2 lowest_layer_type..windows::basic_random_access_handle] A basic_handle is always the lowest layer.
+
+ typedef basic_handle< RandomAccessHandleService > lowest_layer_type;
[heading Types]
@@ -36129,36 +57461,29 @@
[
- [[link boost_asio.reference.ssl__stream.handshake_type [*handshake_type]]]
- [Different handshake types. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ssl__stream.impl_type [*impl_type]]]
- [The native implementation type of the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
]
[
- [[link boost_asio.reference.ssl__stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
]
[
- [[link boost_asio.reference.ssl__stream.service_type [*service_type]]]
- [The type of the service that will be used to provide stream operations. ]
+ [[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. ]
]
@@ -36169,145 +57494,88 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__stream.async_handshake [*async_handshake]]]
- [Start an asynchronous SSL handshake. ]
+ [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
+ [[link boost_asio.reference.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_shutdown [*async_shutdown]]]
- [Asynchronously shut down SSL on the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
+ [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [Close the handle. ]
]
[
- [[link boost_asio.reference.ssl__stream.get_io_service [*get_io_service]]]
+ [[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.ssl__stream.handshake [*handshake]]]
- [Perform SSL handshaking. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__stream.impl [*impl]]]
- [Get the underlying implementation in the native type. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__stream.io_service [*io_service]]]
+ [[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.ssl__stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__stream.peek [*peek]]]
- [Peek at the incoming data on the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.ssl__stream.read_some [*read_some]]]
- [Read some data from the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__stream.shutdown [*shutdown]]]
- [Shut down SSL on the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
]
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__stream.stream [*stream]]]
- [Construct a stream. ]
+ [[link boost_asio.reference.windows__basic_handle._basic_handle [*~basic_handle]]]
+ [Protected destructor to prevent deletion through this type. ]
]
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__stream.write_some [*write_some]]]
- [Write some data to the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ssl__stream._stream [*~stream]]]
- [Destructor. ]
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
]
-
+
]
-The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
[heading Thread Safety]
[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
-
-[heading Example]
-
-To use the SSL stream template with an ip::tcp::socket, you would write:
-
- boost::asio::io_service io_service;
- boost::asio::ssl::context context(io_service, boost::asio::ssl::context::sslv23);
- boost::asio::ssl::stream<boost::asio::ip::tcp::socket> sock(io_service, context);
-
-
-
-
-
-
-[section:async_handshake ssl::stream::async_handshake]
-
-Start an asynchronous SSL handshake.
-
- template<
- typename HandshakeHandler>
- void async_handshake(
- handshake_type type,
- HandshakeHandler handler);
-
-
-This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
-
-[[handler][The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation.
- );
-
-``
-]]
+[*Shared] [*objects:] Unsafe.
-]
@@ -36315,171 +57583,65 @@
-[section:async_read_some ssl::stream::async_read_some]
-
-Start an asynchronous read.
-
- template<
- 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 read one or more bytes of data from the stream. The function call always returns immediately.
-
+[section:native windows::basic_random_access_handle::native]
-[heading Parameters]
-
-
-[variablelist
-
-[[buffers][The buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The equivalent 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.
- );
+['Inherited from windows::basic_handle.]
-``
-]]
+[indexterm2 native..windows::basic_random_access_handle] Get the native handle representation.
-]
+ native_type native();
-[heading Remarks]
-
-The async\_read\_some 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.
+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:async_shutdown ssl::stream::async_shutdown]
-
-Asynchronously shut down SSL on the stream.
-
- template<
- typename ShutdownHandler>
- void async_shutdown(
- ShutdownHandler handler);
-
+[section:native_type windows::basic_random_access_handle::native_type]
-This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[handler][The handler to be called when the handshake operation completes. Copies will be made of the handler as required. The equivalent function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation.
- );
+[indexterm2 native_type..windows::basic_random_access_handle] The native representation of a handle.
-``
-]]
+ typedef RandomAccessHandleService::native_type native_type;
-]
[endsect]
+[section:read_some_at windows::basic_random_access_handle::read_some_at]
-[section:async_write_some ssl::stream::async_write_some]
-
-Start an asynchronous write.
+[indexterm2 read_some_at..windows::basic_random_access_handle] Read some data from the handle at the specified offset.
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 one or more bytes of data to the stream. The function call always returns immediately.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[buffers][The data to be written to the stream. Although the buffers object may be copied as necessary, ownership of the underlying buffers is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The equivalent 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.
- );
-
-``
-]]
-
-]
-
-[heading Remarks]
-
-The async\_write\_some 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 blocking operation completes.
-
-
-
-[endsect]
-
-
-
-[section:get_io_service ssl::stream::get_io_service]
-
-Get the io_service associated with the object.
-
- boost::asio::io_service & get_io_service();
-
-
-This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
-
-
-[heading Return Value]
-
-A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-[endsect]
-
-
-[section:handshake ssl::stream::handshake]
-
-Perform SSL handshaking.
-
- void ``[link boost_asio.reference.ssl__stream.handshake.overload1 handshake]``(
- handshake_type type);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_random_access_handle.read_some_at.overload1 read_some_at]``(
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers);
- boost::system::error_code ``[link boost_asio.reference.ssl__stream.handshake.overload2 handshake]``(
- handshake_type type,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_random_access_handle.read_some_at.overload2 read_some_at]``(
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
boost::system::error_code & ec);
-[section:overload1 ssl::stream::handshake (1 of 2 overloads)]
+[section:overload1 windows::basic_random_access_handle::read_some_at (1 of 2 overloads)]
-Perform SSL handshaking.
+Read some data from the handle at the specified offset.
- void handshake(
- handshake_type type);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some_at(
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers);
-This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
+This function is used to read data from the random-access handle. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
[heading Parameters]
@@ -36487,35 +57649,60 @@
[variablelist
-[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
+[[offset][The offset at which the data will be read.]]
+
+[[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_at read_at] 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:
+
+ handle.read_some_at(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]
-[section:overload2 ssl::stream::handshake (2 of 2 overloads)]
+[section:overload2 windows::basic_random_access_handle::read_some_at (2 of 2 overloads)]
-Perform SSL handshaking.
+Read some data from the handle at the specified offset.
- boost::system::error_code handshake(
- handshake_type type,
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some_at(
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
boost::system::error_code & ec);
-This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
+This function is used to read data from the random-access handle. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
[heading Parameters]
@@ -36523,40 +57710,39 @@
[variablelist
-[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
+[[offset][The offset at which the data will be read.]]
-[[ec][Set to indicate what error occurred, if any. ]]
+[[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 Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the
+[link boost_asio.reference.read_at read_at] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
-[endsect]
[endsect]
-[section:handshake_type ssl::stream::handshake_type]
+[endsect]
-Different handshake types.
- enum handshake_type
+[section:service windows::basic_random_access_handle::service]
-[heading Values]
-[variablelist
- [
- [client]
- [Perform handshaking as a client. ]
- ]
+['Inherited from basic_io_object.]
- [
- [server]
- [Perform handshaking as a server. ]
- ]
+[indexterm2 service..windows::basic_random_access_handle] The service associated with the I/O object.
-]
+ service_type & service;
@@ -36564,80 +57750,112 @@
-[section:impl ssl::stream::impl]
-
-Get the underlying implementation in the native type.
-
- impl_type impl();
-
+[section:service_type windows::basic_random_access_handle::service_type]
-This function may be used to obtain the underlying implementation of the context. This is intended to allow access to stream functionality that is not otherwise provided.
+['Inherited from basic_io_object.]
-[endsect]
+[indexterm2 service_type..windows::basic_random_access_handle] The type of the service that will be used to provide I/O operations.
+ typedef RandomAccessHandleService service_type;
-[section:impl_type ssl::stream::impl_type]
-The native implementation type of the stream.
- typedef service_type::impl_type impl_type;
+[endsect]
+[section:write_some_at windows::basic_random_access_handle::write_some_at]
+[indexterm2 write_some_at..windows::basic_random_access_handle] Write some data to the handle at the specified offset.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_random_access_handle.write_some_at.overload1 write_some_at]``(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_random_access_handle.write_some_at.overload2 write_some_at]``(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
-[section:in_avail ssl::stream::in_avail]
-Determine the amount of data that may be read without blocking.
+[section:overload1 windows::basic_random_access_handle::write_some_at (1 of 2 overloads)]
- std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload1 in_avail]``();
+Write some data to the handle at the specified offset.
- std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some_at(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers);
-[section:overload1 ssl::stream::in_avail (1 of 2 overloads)]
+This function is used to write data to the random-access handle. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
-Determine the amount of data that may be read without blocking.
- std::size_t in_avail();
+[heading Parameters]
+
+[variablelist
+
+[[offset][The offset at which the data will be written.]]
-This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
+[[buffers][One or more data buffers to be written to the handle.]]
+]
[heading Return Value]
-The number of bytes of data that can be read without blocking.
+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 Remarks]
+
+The write\_some\_at operation may not write all of the data. Consider using the
+[link boost_asio.reference.write_at write_at] 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:
+
+ handle.write_some_at(42, 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.
+
[endsect]
-[section:overload2 ssl::stream::in_avail (2 of 2 overloads)]
+[section:overload2 windows::basic_random_access_handle::write_some_at (2 of 2 overloads)]
-Determine the amount of data that may be read without blocking.
+Write some data to the handle at the specified offset.
- std::size_t in_avail(
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some_at(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
boost::system::error_code & ec);
-This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
+This function is used to write data to the random-access handle. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
[heading Parameters]
@@ -36645,13 +57863,22 @@
[variablelist
+[[offset][The offset at which the data will be written.]]
+
+[[buffers][One or more data buffers to be written to the handle.]]
+
[[ec][Set to indicate what error occurred, if any.]]
]
[heading Return Value]
-The number of bytes of data that can be read without blocking.
+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_at write_at] function if you need to ensure that all data is written before the blocking operation completes.
@@ -36661,118 +57888,209 @@
[endsect]
-[section:io_service ssl::stream::io_service]
-
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[endsect]
- boost::asio::io_service & io_service();
+[section:windows__basic_stream_handle windows::basic_stream_handle]
+Provides stream-oriented handle functionality.
-This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
+ template<
+ typename ``[link boost_asio.reference.StreamHandleService StreamHandleService]`` = stream_handle_service>
+ class basic_stream_handle :
+ public windows::basic_handle< StreamHandleService >
-[heading Return Value]
-
-A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
+
+ ]
+ [
-[section:lowest_layer ssl::stream::lowest_layer]
+ [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
+
+ ]
-Get a reference to the lowest layer.
+ [
- lowest_layer_type & lowest_layer();
+ [[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. ]
+
+ ]
+]
-This function returns a reference to the lowest layer in a stack of stream layers.
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.basic_stream_handle [*basic_stream_handle]]]
+ [Construct a basic_stream_handle without opening it. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.close [*close]]]
+ [Close the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.native [*native]]]
+ [Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.read_some [*read_some]]]
+ [Read some data from the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.write_some [*write_some]]]
+ [Write some data to the handle. ]
+ ]
+
+]
-[heading Return Value]
-
-A reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[endsect]
+]
+The windows::basic_stream_handle class template provides asynchronous and blocking stream-oriented handle functionality.
-[section:lowest_layer_type ssl::stream::lowest_layer_type]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-The type of the lowest layer.
+[*Shared] [*objects:] Unsafe.
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[section:assign windows::basic_stream_handle::assign]
+[indexterm2 assign..windows::basic_stream_handle] Assign an existing native handle to the handle.
+ void ``[link boost_asio.reference.windows__basic_stream_handle.assign.overload1 assign]``(
+ const native_type & native_handle);
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_stream_handle.assign.overload2 assign]``(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+[section:overload1 windows::basic_stream_handle::assign (1 of 2 overloads)]
-[section:next_layer ssl::stream::next_layer]
-Get a reference to the next layer.
+['Inherited from windows::basic_handle.]
- next_layer_type & next_layer();
+Assign an existing native handle to the handle.
+ void assign(
+ const native_type & native_handle);
-This function returns a reference to the next layer in a stack of stream layers.
-[heading Return Value]
-
-A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
+[endsect]
-[endsect]
+[section:overload2 windows::basic_stream_handle::assign (2 of 2 overloads)]
+['Inherited from windows::basic_handle.]
-[section:next_layer_type ssl::stream::next_layer_type]
+Assign an existing native handle to the handle.
-The type of the next layer.
+ boost::system::error_code assign(
+ const native_type & native_handle,
+ boost::system::error_code & ec);
- typedef boost::remove_reference< Stream >::type next_layer_type;
+[endsect]
[endsect]
-[section:peek ssl::stream::peek]
-
-Peek at the incoming data on the stream.
+[section:async_read_some windows::basic_stream_handle::async_read_some]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
+[indexterm2 async_read_some..windows::basic_stream_handle] Start an asynchronous read.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload2 peek]``(
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
-
-
-[section:overload1 ssl::stream::peek (1 of 2 overloads)]
-
-Peek at the incoming data on the stream.
-
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+ ReadHandler handler);
-This function is used to peek at the incoming data on the stream, without removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
+This function is used to asynchronously read data from the stream handle. The function call always returns immediately.
[heading Parameters]
@@ -36780,22 +58098,34 @@
[variablelist
-[[buffers][The buffers into which the data will be read.]]
+[[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 Return Value]
+[heading Remarks]
-The number of bytes read.
-
-[heading Exceptions]
-
+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.
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure. ]]
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
-]
+ handle.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.
@@ -36803,18 +58133,19 @@
-[section:overload2 ssl::stream::peek (2 of 2 overloads)]
+[section:async_write_some windows::basic_stream_handle::async_write_some]
-Peek at the incoming data on the stream.
+[indexterm2 async_write_some..windows::basic_stream_handle] Start an asynchronous write.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ 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 peek at the incoming data on the stream, withoutxi removing it from the input queue. The function call will block until data has been read successfully or an error occurs.
+This function is used to asynchronously write data to the stream handle. The function call always returns immediately.
[heading Parameters]
@@ -36822,97 +58153,88 @@
[variablelist
-[[buffers][The buffers into which the data will be read.]]
+[[buffers][One or more data buffers to be written to the handle. 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.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[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]
-The number of bytes read. Returns 0 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:
-[endsect]
+ handle.async_write_some(boost::asio::buffer(data, size), handler);
-[endsect]
+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:read_some ssl::stream::read_some]
-Read some data from the stream.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
+[endsect]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:basic_stream_handle windows::basic_stream_handle::basic_stream_handle]
-[section:overload1 ssl::stream::read_some (1 of 2 overloads)]
+[indexterm2 basic_stream_handle..windows::basic_stream_handle] Construct a basic_stream_handle without opening it.
-Read some data from the stream.
+ ``[link boost_asio.reference.windows__basic_stream_handle.basic_stream_handle.overload1 basic_stream_handle]``(
+ boost::asio::io_service & io_service);
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+ ``[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);
-This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+[section:overload1 windows::basic_stream_handle::basic_stream_handle (1 of 2 overloads)]
+Construct a basic_stream_handle without opening it.
-[heading Parameters]
-
+ basic_stream_handle(
+ boost::asio::io_service & io_service);
-[variablelist
-
-[[buffers][The buffers into which the data will be read.]]
-]
+This constructor creates a stream handle without opening it. The handle needs to be opened and then connected or accepted before data can be sent or received on it.
-[heading Return Value]
-
-The number of bytes read.
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[io_service][The io\_service object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
]
-[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]
-[section:overload2 ssl::stream::read_some (2 of 2 overloads)]
+[section:overload2 windows::basic_stream_handle::basic_stream_handle (2 of 2 overloads)]
-Read some data from the stream.
+Construct a basic_stream_handle on an existing native handle.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ basic_stream_handle(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
-This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+This constructor creates a stream handle object to hold an existing native handle.
[heading Parameters]
@@ -36920,59 +58242,49 @@
[variablelist
-[[buffers][The buffers into which the data will be read.]]
+[[io_service][The io\_service object that the stream handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[native_handle][The new underlying handle implementation.]]
]
-[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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-[endsect]
[endsect]
-[section:service_type ssl::stream::service_type]
-
-The type of the service that will be used to provide stream operations.
-
- typedef Service service_type;
-
-
-
-
[endsect]
+[section:cancel windows::basic_stream_handle::cancel]
-[section:shutdown ssl::stream::shutdown]
-
-Shut down SSL on the stream.
+[indexterm2 cancel..windows::basic_stream_handle] Cancel all asynchronous operations associated with the handle.
- void ``[link boost_asio.reference.ssl__stream.shutdown.overload1 shutdown]``();
+ void ``[link boost_asio.reference.windows__basic_stream_handle.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.ssl__stream.shutdown.overload2 shutdown]``(
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_stream_handle.cancel.overload2 cancel]``(
boost::system::error_code & ec);
-[section:overload1 ssl::stream::shutdown (1 of 2 overloads)]
+[section:overload1 windows::basic_stream_handle::cancel (1 of 2 overloads)]
-Shut down SSL on the stream.
- void shutdown();
+['Inherited from windows::basic_handle.]
+Cancel all asynchronous operations associated with the handle.
-This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
+ 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]
@@ -36990,15 +58302,18 @@
-[section:overload2 ssl::stream::shutdown (2 of 2 overloads)]
+[section:overload2 windows::basic_stream_handle::cancel (2 of 2 overloads)]
-Shut down SSL on the stream.
- boost::system::error_code shutdown(
+['Inherited from windows::basic_handle.]
+
+Cancel all asynchronous operations associated with the handle.
+
+ boost::system::error_code cancel(
boost::system::error_code & ec);
-This function is used to shut down SSL on the stream. The function call will block until SSL has been shut down or an error occurs.
+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]
@@ -37017,30 +58332,35 @@
[endsect]
+[section:close windows::basic_stream_handle::close]
-[section:stream ssl::stream::stream]
+[indexterm2 close..windows::basic_stream_handle] Close the handle.
-Construct a stream.
+ void ``[link boost_asio.reference.windows__basic_stream_handle.close.overload1 close]``();
- template<
- typename Arg,
- typename Context_Service>
- stream(
- Arg & arg,
- basic_context< Context_Service > & context);
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_stream_handle.close.overload2 close]``(
+ boost::system::error_code & ec);
-This constructor creates a stream and initialises the underlying stream object.
+[section:overload1 windows::basic_stream_handle::close (1 of 2 overloads)]
-[heading Parameters]
+['Inherited from windows::basic_handle.]
+
+Close the handle.
+
+ void close();
+
+
+This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
+
+
+[heading Exceptions]
[variablelist
-[[arg][The argument to be passed to initialise the underlying stream.]]
-
-[[context][The SSL context to be used for the stream. ]]
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -37049,33 +58369,19 @@
[endsect]
-[section:write_some ssl::stream::write_some]
-
-Write some data to the stream.
-
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.write_some.overload1 write_some]``(
- const ConstBufferSequence & buffers);
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.write_some.overload2 write_some]``(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:overload2 windows::basic_stream_handle::close (2 of 2 overloads)]
-[section:overload1 ssl::stream::write_some (1 of 2 overloads)]
+['Inherited from windows::basic_handle.]
-Write some data to the stream.
+Close the handle.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
+This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
[heading Parameters]
@@ -37083,81 +58389,88 @@
[variablelist
-[[buffers][The data to be written.]]
+[[ec][Set to indicate what error occurred, if any. ]]
]
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service windows::basic_stream_handle::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 get_io_service..windows::basic_stream_handle] Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
+
+
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+
+
[heading Return Value]
-The number of bytes written.
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
+[endsect]
-[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:implementation windows::basic_stream_handle::implementation]
+
+
+['Inherited from basic_io_object.]
+
+[indexterm2 implementation..windows::basic_stream_handle] The underlying implementation of the I/O object.
+
+ implementation_type implementation;
-[endsect]
+[endsect]
-[section:overload2 ssl::stream::write_some (2 of 2 overloads)]
-Write some data to the stream.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:implementation_type windows::basic_stream_handle::implementation_type]
-This function is used to write data on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
+['Inherited from basic_io_object.]
+[indexterm2 implementation_type..windows::basic_stream_handle] The underlying implementation type of I/O object.
-[heading Parameters]
-
+ typedef service_type::implementation_type implementation_type;
-[variablelist
-
-[[buffers][The data to be written to the stream.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
+[endsect]
-[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:io_service windows::basic_stream_handle::io_service]
-[endsect]
+['Inherited from basic_io_object.]
-[endsect]
+[indexterm2 io_service..windows::basic_stream_handle] (Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-[section:_stream ssl::stream::~stream]
-Destructor.
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
- ~stream();
+
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
@@ -37165,319 +58478,277 @@
-[endsect]
-
-[section:ssl__stream_base ssl::stream_base]
+[section:is_open windows::basic_stream_handle::is_open]
-The stream_base class is used as a base for the boost::asio::ssl::stream class template so that we have a common place to define various enums.
- class stream_base
+['Inherited from windows::basic_handle.]
+[indexterm2 is_open..windows::basic_stream_handle] Determine whether the handle is open.
-[heading Types]
-[table
- [[Name][Description]]
+ bool is_open() const;
- [
- [[link boost_asio.reference.ssl__stream_base.handshake_type [*handshake_type]]]
- [Different handshake types. ]
-
- ]
-]
+[endsect]
-[section:handshake_type ssl::stream_base::handshake_type]
-Different handshake types.
+[section:lowest_layer windows::basic_stream_handle::lowest_layer]
- enum handshake_type
-[heading Values]
-[variablelist
+['Inherited from windows::basic_handle.]
- [
- [client]
- [Perform handshaking as a client. ]
- ]
+[indexterm2 lowest_layer..windows::basic_stream_handle] Get a reference to the lowest layer.
- [
- [server]
- [Perform handshaking as a server. ]
- ]
+ lowest_layer_type & lowest_layer();
-]
+This function returns a reference to the lowest layer in a stack of layers. Since a basic_handle 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.
[endsect]
-[section:ssl__stream_service ssl::stream_service]
-Default service implementation for an SSL stream.
- class stream_service :
- public io_service::service
+[section:lowest_layer_type windows::basic_stream_handle::lowest_layer_type]
-[heading Types]
-[table
- [[Name][Description]]
+['Inherited from windows::basic_handle.]
- [
+[indexterm2 lowest_layer_type..windows::basic_stream_handle] A basic_handle is always the lowest layer.
- [[link boost_asio.reference.ssl__stream_service.impl_type [*impl_type]]]
- [The type of a stream implementation. ]
-
- ]
+ typedef basic_handle< StreamHandleService > lowest_layer_type;
-]
-[heading Member Functions]
+[heading Types]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__stream_service.async_handshake [*async_handshake]]]
- [Start an asynchronous SSL handshake. ]
- ]
+
+ [[link boost_asio.reference.windows__basic_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
- [
- [[link boost_asio.reference.ssl__stream_service.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
]
-
+
[
- [[link boost_asio.reference.ssl__stream_service.async_shutdown [*async_shutdown]]]
- [Asynchronously shut down SSL on the stream. ]
- ]
+
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
- [
- [[link boost_asio.reference.ssl__stream_service.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
]
-
+
[
- [[link boost_asio.reference.ssl__stream_service.create [*create]]]
- [Create a new stream implementation. ]
- ]
+
+ [[link boost_asio.reference.windows__basic_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
- [
- [[link boost_asio.reference.ssl__stream_service.destroy [*destroy]]]
- [Destroy a stream implementation. ]
]
-
+
[
- [[link boost_asio.reference.ssl__stream_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
- ]
+
+ [[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. ]
- [
- [[link boost_asio.reference.ssl__stream_service.handshake [*handshake]]]
- [Perform SSL handshaking. ]
]
-
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.ssl__stream_service.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
+ [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[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.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.null [*null]]]
- [Return a null stream implementation. ]
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.peek [*peek]]]
- [Peek at the incoming data on the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [Close the handle. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.read_some [*read_some]]]
- [Read some data from the stream. ]
+ [[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.ssl__stream_service.shutdown [*shutdown]]]
- [Shut down SSL on the stream. ]
+ [[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.ssl__stream_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.stream_service [*stream_service]]]
- [Construct a new stream service for the specified io_service. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.write_some [*write_some]]]
- [Write some data to the stream. ]
+ [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
]
]
-[heading Data Members]
+[heading Protected Member Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__stream_service.id [*id]]]
- [The unique service identifier. ]
+ [[link boost_asio.reference.windows__basic_handle._basic_handle [*~basic_handle]]]
+ [Protected destructor to prevent deletion through this type. ]
]
-
+
]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
-[section:async_handshake ssl::stream_service::async_handshake]
+ [
+ [[link boost_asio.reference.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-Start an asynchronous SSL handshake.
+ [
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
- template<
- typename Stream,
- typename HandshakeHandler>
- void async_handshake(
- impl_type & impl,
- Stream & next_layer,
- stream_base::handshake_type type,
- HandshakeHandler handler);
+]
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
-[endsect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[section:async_read_some ssl::stream_service::async_read_some]
-Start an asynchronous read.
- template<
- typename Stream,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- impl_type & impl,
- Stream & next_layer,
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+[endsect]
-[endsect]
+[section:native windows::basic_stream_handle::native]
+['Inherited from windows::basic_handle.]
-[section:async_shutdown ssl::stream_service::async_shutdown]
+[indexterm2 native..windows::basic_stream_handle] Get the native handle representation.
-Asynchronously shut down SSL on the stream.
+ native_type native();
- template<
- typename Stream,
- typename ShutdownHandler>
- void async_shutdown(
- impl_type & impl,
- Stream & next_layer,
- ShutdownHandler handler);
+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:async_write_some ssl::stream_service::async_write_some]
+[section:native_type windows::basic_stream_handle::native_type]
-Start an asynchronous write.
+[indexterm2 native_type..windows::basic_stream_handle] The native representation of a handle.
- template<
- typename Stream,
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- impl_type & impl,
- Stream & next_layer,
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ typedef StreamHandleService::native_type native_type;
-[endsect]
+[endsect]
-[section:create ssl::stream_service::create]
+[section:read_some windows::basic_stream_handle::read_some]
-Create a new stream implementation.
+[indexterm2 read_some..windows::basic_stream_handle] Read some data from the handle.
template<
- typename Stream,
- typename Context_Service>
- void create(
- impl_type & impl,
- Stream & next_layer,
- basic_context< Context_Service > & context);
-
-
-
-[endsect]
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_stream_handle.read_some.overload1 read_some]``(
+ const MutableBufferSequence & buffers);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_stream_handle.read_some.overload2 read_some]``(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
-[section:destroy ssl::stream_service::destroy]
+[section:overload1 windows::basic_stream_handle::read_some (1 of 2 overloads)]
-Destroy a stream implementation.
+Read some data from the handle.
template<
- typename Stream>
- void destroy(
- impl_type & impl,
- Stream & next_layer);
-
-
-
-[endsect]
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
+This function is used to read data from the stream handle. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
-[section:get_io_service ssl::stream_service::get_io_service]
+[heading Parameters]
+
-['Inherited from io_service.]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
-Get the io_service object that owns the service.
+]
- boost::asio::io_service & get_io_service();
+[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.]]
-[endsect]
+]
+[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:
-[section:handshake ssl::stream_service::handshake]
+ handle.read_some(boost::asio::buffer(data, size));
-Perform SSL handshaking.
- template<
- typename Stream>
- boost::system::error_code handshake(
- impl_type & impl,
- Stream & next_layer,
- stream_base::handshake_type type,
- boost::system::error_code & ec);
+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.
@@ -37485,56 +58756,56 @@
-[section:id ssl::stream_service::id]
+[section:overload2 windows::basic_stream_handle::read_some (2 of 2 overloads)]
-The unique service identifier.
+Read some data from the handle.
- static boost::asio::io_service::id id;
+ 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 handle. 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:impl_type ssl::stream_service::impl_type]
+[[ec][Set to indicate what error occurred, if any.]]
-The type of a stream implementation.
+]
- typedef implementation_defined impl_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.
[endsect]
-
-[section:in_avail ssl::stream_service::in_avail]
-
-Determine the amount of data that may be read without blocking.
-
- template<
- typename Stream>
- std::size_t in_avail(
- impl_type & impl,
- Stream & next_layer,
- boost::system::error_code & ec);
-
-
-
[endsect]
-
-[section:io_service ssl::stream_service::io_service]
+[section:service windows::basic_stream_handle::service]
-['Inherited from io_service.]
+['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[indexterm2 service..windows::basic_stream_handle] The service associated with the I/O object.
- boost::asio::io_service & io_service();
+ service_type & service;
@@ -37542,91 +58813,87 @@
-[section:null ssl::stream_service::null]
-
-Return a null stream implementation.
-
- impl_type null() const;
-
-
-
-[endsect]
+[section:service_type windows::basic_stream_handle::service_type]
+['Inherited from basic_io_object.]
-[section:peek ssl::stream_service::peek]
+[indexterm2 service_type..windows::basic_stream_handle] The type of the service that will be used to provide I/O operations.
-Peek at the incoming data on the stream.
+ typedef StreamHandleService service_type;
- template<
- typename Stream,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- impl_type & impl,
- Stream & next_layer,
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
[endsect]
+[section:write_some windows::basic_stream_handle::write_some]
-[section:read_some ssl::stream_service::read_some]
+[indexterm2 write_some..windows::basic_stream_handle] Write some data to the handle.
-Read some data from the stream.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_stream_handle.write_some.overload1 write_some]``(
+ const ConstBufferSequence & buffers);
template<
- typename Stream,
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- impl_type & impl,
- Stream & next_layer,
- const MutableBufferSequence & buffers,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.windows__basic_stream_handle.write_some.overload2 write_some]``(
+ const ConstBufferSequence & buffers,
boost::system::error_code & ec);
+[section:overload1 windows::basic_stream_handle::write_some (1 of 2 overloads)]
-[endsect]
-
-
-
-[section:shutdown ssl::stream_service::shutdown]
-
-Shut down SSL on the stream.
+Write some data to the handle.
template<
- typename Stream>
- boost::system::error_code shutdown(
- impl_type & impl,
- Stream & next_layer,
- boost::system::error_code & ec);
-
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-[endsect]
+This function is used to write data to the stream handle. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+[heading Parameters]
+
-[section:shutdown_service ssl::stream_service::shutdown_service]
+[variablelist
+
+[[buffers][One or more data buffers to be written to the handle.]]
-Destroy all user-defined handler objects owned by the service.
+]
- void shutdown_service();
+[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.]]
-[endsect]
+]
+[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:
-[section:stream_service ssl::stream_service::stream_service]
+ handle.write_some(boost::asio::buffer(data, size));
-Construct a new stream service for the specified io_service.
- stream_service(
- boost::asio::io_service & io_service);
+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.
@@ -37634,99 +58901,56 @@
-[section:write_some ssl::stream_service::write_some]
+[section:overload2 windows::basic_stream_handle::write_some (2 of 2 overloads)]
-Write some data to the stream.
+Write some data to the handle.
template<
- typename Stream,
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
std::size_t write_some(
- impl_type & impl,
- Stream & next_layer,
const ConstBufferSequence & buffers,
boost::system::error_code & ec);
+This function is used to write data to the stream handle. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
-[endsect]
-
-
-
-[endsect]
-
-
-[section:strand strand]
-
-Typedef for backwards compatibility.
- typedef boost::asio::io_service::strand strand;
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the handle.]]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[[ec][Set to indicate what error occurred, if any.]]
- [
- [[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 io_service::strand class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently.
+[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.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Safe.
+[endsect]
+[endsect]
[endsect]
-[section:stream_socket_service stream_socket_service]
+[section:windows__random_access_handle windows::random_access_handle]
-Default service implementation for a stream socket.
+[indexterm1 windows::random_access_handle] Typedef for the typical usage of a random-access handle.
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class stream_socket_service :
- public io_service::service
+ typedef basic_random_access_handle random_access_handle;
[heading Types]
@@ -37735,29 +58959,29 @@
[
- [[link boost_asio.reference.stream_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
]
[
- [[link boost_asio.reference.stream_socket_service.implementation_type [*implementation_type]]]
- [The type of a stream socket implementation. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
]
[
- [[link boost_asio.reference.stream_socket_service.native_type [*native_type]]]
- [The native socket type. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[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. ]
]
@@ -37768,138 +58992,208 @@
[[Name][Description]]
[
- [[link boost_asio.reference.stream_socket_service.assign [*assign]]]
- [Assign an existing native socket to a stream socket. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.async_read_some_at [*async_read_some_at]]]
+ [Start an asynchronous read at the specified offset. ]
]
[
- [[link boost_asio.reference.stream_socket_service.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.async_write_some_at [*async_write_some_at]]]
+ [Start an asynchronous write at the specified offset. ]
]
[
- [[link boost_asio.reference.stream_socket_service.async_send [*async_send]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.basic_random_access_handle [*basic_random_access_handle]]]
+ [Construct a basic_random_access_handle without opening it. ]
]
[
- [[link boost_asio.reference.stream_socket_service.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.close [*close]]]
+ [Close the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[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. ]
]
[
- [[link boost_asio.reference.stream_socket_service.bind [*bind]]]
- [Bind the stream socket to the specified local endpoint. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.stream_socket_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
+ [Get the native handle representation. ]
]
[
- [[link boost_asio.reference.stream_socket_service.close [*close]]]
- [Close a stream socket implementation. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.read_some_at [*read_some_at]]]
+ [Read some data from the handle at the specified offset. ]
]
[
- [[link boost_asio.reference.stream_socket_service.connect [*connect]]]
- [Connect the stream socket to the specified endpoint. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.write_some_at [*write_some_at]]]
+ [Write some data to the handle at the specified offset. ]
]
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.stream_socket_service.construct [*construct]]]
- [Construct a new stream socket implementation. ]
+ [[link boost_asio.reference.windows__basic_random_access_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The windows::basic_random_access_handle class template provides asynchronous and blocking random-access handle functionality.
+
+
+[heading Thread Safety]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+[section:windows__random_access_handle_service windows::random_access_handle_service]
+
+Default service implementation for a random-access handle.
+
+ class random_access_handle_service :
+ public io_service::service
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.stream_socket_service.destroy [*destroy]]]
- [Destroy a stream socket implementation. ]
+
+ [[link boost_asio.reference.windows__random_access_handle_service.implementation_type [*implementation_type]]]
+ [The type of a random-access handle implementation. ]
+
]
+
+ [
+
+ [[link boost_asio.reference.windows__random_access_handle_service.native_type [*native_type]]]
+ [The native handle type. ]
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.stream_socket_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.assign [*assign]]]
+ [Assign an existing native handle to a random-access handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.get_option [*get_option]]]
- [Get a socket option. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.async_read_some_at [*async_read_some_at]]]
+ [Start an asynchronous read at the specified offset. ]
]
[
- [[link boost_asio.reference.stream_socket_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.async_write_some_at [*async_write_some_at]]]
+ [Start an asynchronous write at the specified offset. ]
]
[
- [[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.windows__random_access_handle_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.close [*close]]]
+ [Close a random-access handle implementation. ]
]
[
- [[link boost_asio.reference.stream_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.construct [*construct]]]
+ [Construct a new random-access handle implementation. ]
]
[
- [[link boost_asio.reference.stream_socket_service.native [*native]]]
- [Get the native socket implementation. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.destroy [*destroy]]]
+ [Destroy a random-access handle implementation. ]
]
[
- [[link boost_asio.reference.stream_socket_service.open [*open]]]
- [Open a stream socket. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.stream_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[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.stream_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.stream_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.native [*native]]]
+ [Get the native handle implementation. ]
]
[
- [[link boost_asio.reference.stream_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.random_access_handle_service [*random_access_handle_service]]]
+ [Construct a new random-access handle service for the specified io_service. ]
]
[
- [[link boost_asio.reference.stream_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.read_some_at [*read_some_at]]]
+ [Read some data from the specified offset. ]
]
[
- [[link boost_asio.reference.stream_socket_service.shutdown_service [*shutdown_service]]]
+ [[link boost_asio.reference.windows__random_access_handle_service.shutdown_service [*shutdown_service]]]
[Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.stream_socket_service.stream_socket_service [*stream_socket_service]]]
- [Construct a new stream socket service for the specified io_service. ]
+ [[link boost_asio.reference.windows__random_access_handle_service.write_some_at [*write_some_at]]]
+ [Write the given data at the specified offset. ]
]
]
@@ -37909,21 +59203,20 @@
[[Name][Description]]
[
- [[link boost_asio.reference.stream_socket_service.id [*id]]]
+ [[link boost_asio.reference.windows__random_access_handle_service.id [*id]]]
[The unique service identifier. ]
]
]
-[section:assign stream_socket_service::assign]
+[section:assign windows::random_access_handle_service::assign]
-Assign an existing native socket to a stream socket.
+[indexterm2 assign..windows::random_access_handle_service] Assign an existing native handle to a random-access handle.
boost::system::error_code assign(
implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_socket,
+ const native_type & native_handle,
boost::system::error_code & ec);
@@ -37932,34 +59225,17 @@
-[section:async_connect stream_socket_service::async_connect]
-
-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:async_receive stream_socket_service::async_receive]
+[section:async_read_some_at windows::random_access_handle_service::async_read_some_at]
-Start an asynchronous receive.
+[indexterm2 async_read_some_at..windows::random_access_handle_service] Start an asynchronous read at the specified offset.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
+ void async_read_some_at(
implementation_type & impl,
+ boost::uint64_t offset,
const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
ReadHandler handler);
@@ -37968,17 +59244,17 @@
-[section:async_send stream_socket_service::async_send]
+[section:async_write_some_at windows::random_access_handle_service::async_write_some_at]
-Start an asynchronous send.
+[indexterm2 async_write_some_at..windows::random_access_handle_service] Start an asynchronous write at the specified offset.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
+ void async_write_some_at(
implementation_type & impl,
+ boost::uint64_t offset,
const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
WriteHandler handler);
@@ -37987,52 +59263,9 @@
-[section:at_mark stream_socket_service::at_mark]
-
-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;
-
-
-
-[endsect]
-
-
-
-[section:available stream_socket_service::available]
-
-Determine the number of bytes available for reading.
-
- std::size_t available(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
-
-
-
-[endsect]
-
-
-
-[section:bind stream_socket_service::bind]
-
-Bind the stream socket to the specified local endpoint.
-
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:cancel stream_socket_service::cancel]
+[section:cancel windows::random_access_handle_service::cancel]
-Cancel all asynchronous operations associated with the socket.
+[indexterm2 cancel..windows::random_access_handle_service] Cancel all asynchronous operations associated with the handle.
boost::system::error_code cancel(
implementation_type & impl,
@@ -38044,9 +59277,9 @@
-[section:close stream_socket_service::close]
+[section:close windows::random_access_handle_service::close]
-Close a stream socket implementation.
+[indexterm2 close..windows::random_access_handle_service] Close a random-access handle implementation.
boost::system::error_code close(
implementation_type & impl,
@@ -38058,24 +59291,9 @@
-[section:connect stream_socket_service::connect]
-
-Connect the stream socket to the specified endpoint.
-
- boost::system::error_code connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:construct stream_socket_service::construct]
+[section:construct windows::random_access_handle_service::construct]
-Construct a new stream socket implementation.
+[indexterm2 construct..windows::random_access_handle_service] Construct a new random-access handle implementation.
void construct(
implementation_type & impl);
@@ -38086,9 +59304,9 @@
-[section:destroy stream_socket_service::destroy]
+[section:destroy windows::random_access_handle_service::destroy]
-Destroy a stream socket implementation.
+[indexterm2 destroy..windows::random_access_handle_service] Destroy a random-access handle implementation.
void destroy(
implementation_type & impl);
@@ -38099,25 +59317,12 @@
-[section:endpoint_type stream_socket_service::endpoint_type]
-
-The endpoint type.
-
- typedef Protocol::endpoint endpoint_type;
-
-
-
-
-[endsect]
-
-
-
-[section:get_io_service stream_socket_service::get_io_service]
+[section:get_io_service windows::random_access_handle_service::get_io_service]
['Inherited from io_service.]
-Get the io_service object that owns the service.
+[indexterm2 get_io_service..windows::random_access_handle_service] Get the io_service object that owns the service.
boost::asio::io_service & get_io_service();
@@ -38127,26 +59332,9 @@
-[section:get_option stream_socket_service::get_option]
-
-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;
-
-
-
-[endsect]
-
-
-
-[section:id stream_socket_service::id]
+[section:id windows::random_access_handle_service::id]
-The unique service identifier.
+[indexterm2 id..windows::random_access_handle_service] The unique service identifier.
static boost::asio::io_service::id id;
@@ -38156,9 +59344,9 @@
-[section:implementation_type stream_socket_service::implementation_type]
+[section:implementation_type windows::random_access_handle_service::implementation_type]
-The type of a stream socket implementation.
+[indexterm2 implementation_type..windows::random_access_handle_service] The type of a random-access handle implementation.
typedef implementation_defined implementation_type;
@@ -38169,29 +59357,12 @@
-[section:io_control stream_socket_service::io_control]
-
-Perform an IO control command on the socket.
-
- 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]
-
-
-
-[section:io_service stream_socket_service::io_service]
+[section:io_service windows::random_access_handle_service::io_service]
['Inherited from io_service.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[indexterm2 io_service..windows::random_access_handle_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
boost::asio::io_service & io_service();
@@ -38201,9 +59372,9 @@
-[section:is_open stream_socket_service::is_open]
+[section:is_open windows::random_access_handle_service::is_open]
-Determine whether the socket is open.
+[indexterm2 is_open..windows::random_access_handle_service] Determine whether the handle is open.
bool is_open(
const implementation_type & impl) const;
@@ -38214,23 +59385,9 @@
-[section:local_endpoint stream_socket_service::local_endpoint]
-
-Get the local endpoint.
-
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
-
-
-
-[endsect]
-
-
-
-[section:native stream_socket_service::native]
+[section:native windows::random_access_handle_service::native]
-Get the native socket implementation.
+[indexterm2 native..windows::random_access_handle_service] Get the native handle implementation.
native_type native(
implementation_type & impl);
@@ -38241,9 +59398,9 @@
-[section:native_type stream_socket_service::native_type]
+[section:native_type windows::random_access_handle_service::native_type]
-The native socket type.
+[indexterm2 native_type..windows::random_access_handle_service] The native handle type.
typedef implementation_defined native_type;
@@ -38254,27 +59411,12 @@
-[section:open stream_socket_service::open]
-
-Open a stream socket.
-
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:protocol_type stream_socket_service::protocol_type]
-
-The protocol type.
+[section:random_access_handle_service windows::random_access_handle_service::random_access_handle_service]
- typedef Protocol protocol_type;
+[indexterm2 random_access_handle_service..windows::random_access_handle_service] Construct a new random-access handle service for the specified io_service.
+ random_access_handle_service(
+ boost::asio::io_service & io_service);
@@ -38282,16 +59424,16 @@
-[section:receive stream_socket_service::receive]
+[section:read_some_at windows::random_access_handle_service::read_some_at]
-Receive some data from the peer.
+[indexterm2 read_some_at..windows::random_access_handle_service] Read some data from the specified offset.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
+ std::size_t read_some_at(
implementation_type & impl,
+ boost::uint64_t offset,
const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
boost::system::error_code & ec);
@@ -38300,13 +59442,11 @@
-[section:remote_endpoint stream_socket_service::remote_endpoint]
+[section:shutdown_service windows::random_access_handle_service::shutdown_service]
-Get the remote endpoint.
+[indexterm2 shutdown_service..windows::random_access_handle_service] Destroy all user-defined handler objects owned by the service.
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ void shutdown_service();
@@ -38314,16 +59454,16 @@
-[section:send stream_socket_service::send]
+[section:write_some_at windows::random_access_handle_service::write_some_at]
-Send the given data to the peer.
+[indexterm2 write_some_at..windows::random_access_handle_service] Write the given data at the specified offset.
template<
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
+ std::size_t write_some_at(
implementation_type & impl,
+ boost::uint64_t offset,
const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
boost::system::error_code & ec);
@@ -38332,71 +59472,158 @@
-[section:set_option stream_socket_service::set_option]
-
-Set a socket option.
-
- 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);
-
+[endsect]
-[endsect]
+[section:windows__stream_handle windows::stream_handle]
+[indexterm1 windows::stream_handle] Typedef for the typical usage of a stream-oriented handle.
+ typedef basic_stream_handle stream_handle;
-[section:shutdown stream_socket_service::shutdown]
-Disable sends or receives on the socket.
+[heading Types]
+[table
+ [[Name][Description]]
- boost::system::error_code shutdown(
- implementation_type & impl,
- socket_base::shutdown_type what,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.windows__basic_stream_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
+
+ ]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
+
+ ]
-[section:shutdown_service stream_socket_service::shutdown_service]
+ [
-Destroy all user-defined handler objects owned by the service.
+ [[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. ]
+
+ ]
- void shutdown_service();
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.basic_stream_handle [*basic_stream_handle]]]
+ [Construct a basic_stream_handle without opening it. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.close [*close]]]
+ [Close the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.native [*native]]]
+ [Get the native handle representation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.read_some [*read_some]]]
+ [Read some data from the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.write_some [*write_some]]]
+ [Write some data to the handle. ]
+ ]
+
+]
-[endsect]
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+ [
+ [[link boost_asio.reference.windows__basic_stream_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[section:stream_socket_service stream_socket_service::stream_socket_service]
+]
-Construct a new stream socket service for the specified io_service.
+The windows::basic_stream_handle class template provides asynchronous and blocking stream-oriented handle functionality.
- stream_socket_service(
- boost::asio::io_service & io_service);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
[endsect]
-[section:streambuf streambuf]
+[section:windows__stream_handle_service windows::stream_handle_service]
-Typedef for the typical usage of basic_streambuf.
+Default service implementation for a stream handle.
- typedef basic_streambuf streambuf;
+ class stream_handle_service :
+ public io_service::service
[heading Types]
@@ -38405,15 +59632,15 @@
[
- [[link boost_asio.reference.basic_streambuf.const_buffers_type [*const_buffers_type]]]
- [The type used to represent the get area as a list of buffers. ]
+ [[link boost_asio.reference.windows__stream_handle_service.implementation_type [*implementation_type]]]
+ [The type of a stream handle implementation. ]
]
[
- [[link boost_asio.reference.basic_streambuf.mutable_buffers_type [*mutable_buffers_type]]]
- [The type used to represent the put area as a list of buffers. ]
+ [[link boost_asio.reference.windows__stream_handle_service.native_type [*native_type]]]
+ [The native handle type. ]
]
@@ -38424,127 +59651,179 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
- [Construct a buffer with a specified maximum size. ]
+ [[link boost_asio.reference.windows__stream_handle_service.assign [*assign]]]
+ [Assign an existing native handle to a stream handle. ]
]
[
- [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
- [Move the start of the put area by the specified number of characters. ]
+ [[link boost_asio.reference.windows__stream_handle_service.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.basic_streambuf.consume [*consume]]]
- [Move the start of the get area by the specified number of characters. ]
+ [[link boost_asio.reference.windows__stream_handle_service.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[link boost_asio.reference.basic_streambuf.data [*data]]]
- [Get a list of buffers that represents the get area. ]
+ [[link boost_asio.reference.windows__stream_handle_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
- [Return the maximum size of the buffer. ]
+ [[link boost_asio.reference.windows__stream_handle_service.close [*close]]]
+ [Close a stream handle implementation. ]
]
[
- [[link boost_asio.reference.basic_streambuf.prepare [*prepare]]]
- [Get a list of buffers that represents the put area, with the given size. ]
+ [[link boost_asio.reference.windows__stream_handle_service.construct [*construct]]]
+ [Construct a new stream handle implementation. ]
]
[
- [[link boost_asio.reference.basic_streambuf.size [*size]]]
- [Return the size of the get area in characters. ]
+ [[link boost_asio.reference.windows__stream_handle_service.destroy [*destroy]]]
+ [Destroy a stream handle implementation. ]
]
-]
-
-
-
-[endsect]
-
-
-[section:time_traits_lt__ptime__gt_ time_traits< boost::posix_time::ptime >]
-
-Time traits specialised for posix_time.
-
- template<>
- struct time_traits< boost::posix_time::ptime >
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
[
-
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.duration_type [*duration_type]]]
- [The duration type. ]
-
+ [[link boost_asio.reference.windows__stream_handle_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
-
+
[
-
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.time_type [*time_type]]]
- [The time type. ]
+ [[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. ]
]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
+
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.add [*add]]]
- [Add a duration to a time. ]
+ [[link boost_asio.reference.windows__stream_handle_service.native [*native]]]
+ [Get the native handle implementation. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.less_than [*less_than]]]
- [Test whether one time is less than another. ]
+ [[link boost_asio.reference.windows__stream_handle_service.read_some [*read_some]]]
+ [Read some data from the stream. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.now [*now]]]
- [Get the current time. ]
+ [[link boost_asio.reference.windows__stream_handle_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.subtract [*subtract]]]
- [Subtract one time from another. ]
+ [[link boost_asio.reference.windows__stream_handle_service.stream_handle_service [*stream_handle_service]]]
+ [Construct a new stream handle service for the specified io_service. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.to_posix_duration [*to_posix_duration]]]
- [Convert to POSIX duration type. ]
+ [[link boost_asio.reference.windows__stream_handle_service.write_some [*write_some]]]
+ [Write the given data to the stream. ]
]
]
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.windows__stream_handle_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+
+]
+
+
+[section:assign windows::stream_handle_service::assign]
+
+[indexterm2 assign..windows::stream_handle_service] 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);
+
+
+
+[endsect]
+
+
+
+[section:async_read_some windows::stream_handle_service::async_read_some]
+
+[indexterm2 async_read_some..windows::stream_handle_service] Start an asynchronous read.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:async_write_some windows::stream_handle_service::async_write_some]
+
+[indexterm2 async_write_some..windows::stream_handle_service] Start an asynchronous write.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:cancel windows::stream_handle_service::cancel]
+
+[indexterm2 cancel..windows::stream_handle_service] Cancel all asynchronous operations associated with the handle.
+
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
-[section:add time_traits< boost::posix_time::ptime >::add]
-Add a duration to a time.
+[endsect]
- static time_type add(
- const time_type & t,
- const duration_type & d);
+[section:close windows::stream_handle_service::close]
-[endsect]
+[indexterm2 close..windows::stream_handle_service] Close a stream handle implementation.
+
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
-[section:duration_type time_traits< boost::posix_time::ptime >::duration_type]
+[endsect]
-The duration type.
- typedef boost::posix_time::time_duration duration_type;
+[section:construct windows::stream_handle_service::construct]
+
+[indexterm2 construct..windows::stream_handle_service] Construct a new stream handle implementation.
+
+ void construct(
+ implementation_type & impl);
@@ -38552,13 +59831,12 @@
-[section:less_than time_traits< boost::posix_time::ptime >::less_than]
+[section:destroy windows::stream_handle_service::destroy]
-Test whether one time is less than another.
+[indexterm2 destroy..windows::stream_handle_service] Destroy a stream handle implementation.
- static bool less_than(
- const time_type & t1,
- const time_type & t2);
+ void destroy(
+ implementation_type & impl);
@@ -38566,11 +59844,14 @@
-[section:now time_traits< boost::posix_time::ptime >::now]
+[section:get_io_service windows::stream_handle_service::get_io_service]
-Get the current time.
- static time_type now();
+['Inherited from io_service.]
+
+[indexterm2 get_io_service..windows::stream_handle_service] Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
@@ -38578,13 +59859,11 @@
-[section:subtract time_traits< boost::posix_time::ptime >::subtract]
+[section:id windows::stream_handle_service::id]
-Subtract one time from another.
+[indexterm2 id..windows::stream_handle_service] The unique service identifier.
- static duration_type subtract(
- const time_type & t1,
- const time_type & t2);
+ static boost::asio::io_service::id id;
@@ -38592,11 +59871,11 @@
-[section:time_type time_traits< boost::posix_time::ptime >::time_type]
+[section:implementation_type windows::stream_handle_service::implementation_type]
-The time type.
+[indexterm2 implementation_type..windows::stream_handle_service] The type of a stream handle implementation.
- typedef boost::posix_time::ptime time_type;
+ typedef implementation_defined implementation_type;
@@ -38605,12 +59884,14 @@
-[section:to_posix_duration time_traits< boost::posix_time::ptime >::to_posix_duration]
+[section:io_service windows::stream_handle_service::io_service]
-Convert to POSIX duration type.
- static boost::posix_time::time_duration to_posix_duration(
- const duration_type & d);
+['Inherited from io_service.]
+
+[indexterm2 io_service..windows::stream_handle_service] (Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
@@ -38618,38 +59899,37 @@
+[section:is_open windows::stream_handle_service::is_open]
+
+[indexterm2 is_open..windows::stream_handle_service] Determine whether the handle is open.
+
+ bool is_open(
+ const implementation_type & impl) const;
+
+
+
[endsect]
-[section:transfer_all transfer_all]
-Return a completion condition function object that indicates that a read or write operation should continue until all of the data has been transferred, or until an error occurs.
+[section:native windows::stream_handle_service::native]
- unspecified transfer_all();
+[indexterm2 native..windows::stream_handle_service] Get the native handle implementation.
+ native_type native(
+ implementation_type & impl);
-This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
-[heading Example]
-
-Reading until a buffer is full:
+[endsect]
+
- 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_all(), ec);
- if (ec)
- {
- // An error occurred.
- }
- else
- {
- // n == 128
- }
+[section:native_type windows::stream_handle_service::native_type]
+[indexterm2 native_type..windows::stream_handle_service] The native handle type.
+
+ typedef implementation_defined native_type;
@@ -38658,37 +59938,28 @@
-[section:transfer_at_least transfer_at_least]
+[section:read_some windows::stream_handle_service::read_some]
-Return a completion condition function object that indicates that a read or write operation should continue until a minimum number of bytes has been transferred, or until an error occurs.
+[indexterm2 read_some..windows::stream_handle_service] Read some data from the stream.
- unspecified transfer_at_least(
- std::size_t minimum);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
-This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
+[endsect]
-[heading Example]
-
-Reading until a buffer is full or contains at least 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_at_least(64), ec);
- if (ec)
- {
- // An error occurred.
- }
- else
- {
- // n >= 64 && n <= 128
- }
+[section:shutdown_service windows::stream_handle_service::shutdown_service]
+[indexterm2 shutdown_service..windows::stream_handle_service] Destroy all user-defined handler objects owned by the service.
+ void shutdown_service();
@@ -38696,41 +59967,42 @@
-[section:use_service use_service]
+[section:stream_handle_service windows::stream_handle_service::stream_handle_service]
+[indexterm2 stream_handle_service..windows::stream_handle_service] Construct a new stream handle service for the specified io_service.
+ stream_handle_service(
+ boost::asio::io_service & io_service);
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- 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 io_service will create a new instance of the service.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ios][The io\_service object that owns the service.]]
+[section:write_some windows::stream_handle_service::write_some]
-]
+[indexterm2 write_some..windows::stream_handle_service] Write the given data to the stream.
-[heading Return Value]
-
-The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
+ 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]
-[section:write write]
-Write all of the supplied data to a stream before returning.
+[endsect]
+
+[section:write write]
+[indexterm1 write] Write a certain amount of data to a stream before returning.
+
template<
typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
@@ -38900,7 +60172,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's write\_some function are required.]]
@@ -38980,7 +60251,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's write\_some function are required.]]
@@ -39000,7 +60270,7 @@
[section:overload4 write (4 of 6 overloads)]
-Write a certain amount of data to a stream before returning.
+Write all of the supplied data to a stream before returning.
template<
typename ``[link boost_asio.reference.SyncWriteStream SyncWriteStream]``,
@@ -39103,7 +60373,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's write\_some function are required.]]
@@ -39171,7 +60440,6 @@
std::size_t bytes_transferred // Number of bytes transferred
// so far.
);
-
``
A return value of true indicates that the write operation is complete. False indicates that further calls to the stream's write\_some function are required.]]
@@ -39190,6 +60458,489 @@
[endsect]
+[section:write_at write_at]
+
+[indexterm1 write_at] Write a certain amount of data at a specified offset before returning.
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.write_at.overload1 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers);
+
+ 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.overload2 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition);
+
+ 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.overload3 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator>
+ std::size_t ``[link boost_asio.reference.write_at.overload4 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b);
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.write_at.overload5 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t ``[link boost_asio.reference.write_at.overload6 write_at]``(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ boost::system::error_code & ec);
+
+
+[section:overload1 write_at (1 of 6 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);
+
+
+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 one 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.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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));
+
+
+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());
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload2 write_at (2 of 6 overloads)]
+
+Write a certain amount of data at a specified offset before returning.
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition);
+
+
+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.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one 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.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's write\_some\_at function are required.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[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),
+ boost::asio::transfer_at_least(32));
+
+
+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:overload3 write_at (3 of 6 overloads)]
+
+Write a certain amount of data at a specified offset before returning.
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename CompletionCondition>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ CompletionCondition completion_condition,
+ 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.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one 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.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's write\_some\_at function are required.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes written. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+
+
+
+[endsect]
+
+
+
+[section:overload4 write_at (4 of 6 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);
+
+
+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 basic_streambuf has been written.
+
+* An error occurred.
+
+This operation is implemented in terms of one 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 basic\_streambuf object from which data will be written.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+
+]
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::write_at(
+ d, 42, b,
+ boost::asio::transfer_all());
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:overload5 write_at (5 of 6 overloads)]
+
+Write a certain amount of data at a specified offset before returning.
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition);
+
+
+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 basic_streambuf has been written.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one 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 basic\_streambuf object from which data will be written.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's write\_some\_at function are required.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes transferred.
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload6 write_at (6 of 6 overloads)]
+
+Write a certain amount of data at a specified offset before returning.
+
+ template<
+ typename ``[link boost_asio.reference.SyncRandomAccessWriteDevice SyncRandomAccessWriteDevice]``,
+ typename Allocator,
+ typename CompletionCondition>
+ std::size_t write_at(
+ SyncRandomAccessWriteDevice & d,
+ boost::uint64_t offset,
+ basic_streambuf< Allocator > & b,
+ CompletionCondition completion_condition,
+ 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 basic_streambuf has been written.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one 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 basic\_streambuf object from which data will be written.]]
+
+[[completion_condition][The function object to be called to determine whether the write operation is complete. The signature of the function object must be:
+``
+ bool completion_condition(
+ // Result of latest write_some_at operation.
+ const boost::system::error_code& error,
+
+ // Number of bytes transferred so far.
+ std::size_t bytes_transferred
+ );
+``
+A return value of true indicates that the write operation is complete. False indicates that further calls to the device's write\_some\_at function are required.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes written. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+
+
+
+[endsect]
+
+
+[endsect]
+
[section:is_error_code_enum_lt__addrinfo_errors__gt_ boost::system::is_error_code_enum< boost::asio::error::addrinfo_errors >]
@@ -39212,7 +60963,7 @@
[section:value boost::system::is_error_code_enum< boost::asio::error::addrinfo_errors >::value]
-
+[indexterm2 value..boost::system::is_error_code_enum< boost::asio::error::addrinfo_errors >]
static const bool value = true;
@@ -39246,7 +60997,7 @@
[section:value boost::system::is_error_code_enum< boost::asio::error::basic_errors >::value]
-
+[indexterm2 value..boost::system::is_error_code_enum< boost::asio::error::basic_errors >]
static const bool value = true;
@@ -39280,7 +61031,7 @@
[section:value boost::system::is_error_code_enum< boost::asio::error::misc_errors >::value]
-
+[indexterm2 value..boost::system::is_error_code_enum< boost::asio::error::misc_errors >]
static const bool value = true;
@@ -39314,7 +61065,7 @@
[section:value boost::system::is_error_code_enum< boost::asio::error::netdb_errors >::value]
-
+[indexterm2 value..boost::system::is_error_code_enum< boost::asio::error::netdb_errors >]
static const bool value = true;
@@ -39348,7 +61099,7 @@
[section:value boost::system::is_error_code_enum< boost::asio::error::ssl_errors >::value]
-
+[indexterm2 value..boost::system::is_error_code_enum< boost::asio::error::ssl_errors >]
static const bool value = true;
Modified: branches/CMake/release/libs/asio/doc/reference.xsl
==============================================================================
--- branches/CMake/release/libs/asio/doc/reference.xsl (original)
+++ branches/CMake/release/libs/asio/doc/reference.xsl 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -259,7 +259,9 @@
<xsl:text>``</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:apply-templates mode="codeline"/>
- <xsl:value-of select="$newline"/>
+ <xsl:if test="substring(., string-length(.)) = $newline">
+ <xsl:value-of select="$newline"/>
+ </xsl:if>
<xsl:text>``</xsl:text>
<xsl:value-of select="$newline"/>
</xsl:template>
@@ -303,6 +305,16 @@
</xsl:template>
+<xsl:template match="computeroutput" mode="markup">
+<xsl:text>`</xsl:text><xsl:value-of select="."/><xsl:text>`</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="computeroutput" mode="markup-nested">
+<xsl:text>`</xsl:text><xsl:value-of select="."/><xsl:text>`</xsl:text>
+</xsl:template>
+
+
<xsl:template match="listitem" mode="markup">
* <xsl:value-of select="."/><xsl:text>
</xsl:text>
@@ -710,6 +722,12 @@
[section:<xsl:value-of select="$id"/><xsl:text> </xsl:text>
<xsl:value-of select="$class-name"/>::<xsl:value-of select="$name"/>]
+<xsl:text>[indexterm2 </xsl:text>
+<xsl:value-of select="$name"/>
+<xsl:text>..</xsl:text>
+<xsl:value-of select="$class-name"/>
+<xsl:text>] </xsl:text>
+
<xsl:value-of select="briefdescription"/><xsl:text>
</xsl:text>
@@ -740,6 +758,14 @@
</xsl:text></xsl:if></xsl:if>
+<xsl:if test="$overload-count = 1">
+ <xsl:text>[indexterm2 </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>..</xsl:text>
+ <xsl:value-of select="$class-name"/>
+ <xsl:text>] </xsl:text>
+</xsl:if>
+
<xsl:value-of select="briefdescription"/><xsl:text>
</xsl:text>
@@ -857,18 +883,33 @@
<xsl:when test="declname = 'Arg'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'BufferSequence'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
+ <xsl:when test="declname = 'ByteType'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
<xsl:when test="declname = 'CompletionCondition'">
<xsl:value-of select="declname"/>
</xsl:when>
<xsl:when test="declname = 'Context_Service'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'Elem'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
+ <xsl:when test="declname = 'ErrorEnum'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
<xsl:when test="declname = 'Function'">
<xsl:value-of select="declname"/>
</xsl:when>
<xsl:when test="declname = 'HandshakeHandler'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'MatchCondition'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
<xsl:when test="declname = 'N'">
<xsl:value-of select="declname"/>
</xsl:when>
@@ -878,9 +919,15 @@
<xsl:when test="declname = 'PodType'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'PointerToPodType'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
<xsl:when test="declname = 'ShutdownHandler'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'SocketService1' or declname = 'SocketService2'">
+ <xsl:value-of select="concat('``[link boost_asio.reference.SocketService ', declname, ']``')"/>
+ </xsl:when>
<xsl:when test="declname = 'Stream'">
<xsl:value-of select="declname"/>
</xsl:when>
@@ -896,6 +943,12 @@
<xsl:when test="declname = 'Time'">
<xsl:value-of select="declname"/>
</xsl:when>
+ <xsl:when test="declname = 'TimeType'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
+ <xsl:when test="declname = 'Traits'">
+ <xsl:value-of select="declname"/>
+ </xsl:when>
<xsl:when test="count(declname) = 0">
</xsl:when>
<xsl:otherwise>
@@ -953,8 +1006,22 @@
<xsl:if test="$overload-count > 1 and $overload-position = 1">
[section:<xsl:value-of select="$id"/><xsl:text> </xsl:text><xsl:value-of select="$name"/>]
-<xsl:value-of select="briefdescription"/><xsl:text>
-</xsl:text>
+<xsl:text>[indexterm1 </xsl:text>
+<xsl:value-of select="$name"/>
+<xsl:text>] </xsl:text>
+
+<xsl:choose>
+ <xsl:when test="count(/doxygen/compounddef[@kind='group' and compoundname=$name]) > 0">
+ <xsl:for-each select="/doxygen/compounddef[@kind='group' and compoundname=$name]">
+ <xsl:value-of select="briefdescription"/><xsl:text>
+ </xsl:text>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="briefdescription"/><xsl:text>
+ </xsl:text>
+ </xsl:otherwise>
+</xsl:choose>
<xsl:for-each select="../memberdef[name = $unqualified-name]">
<xsl:text>
@@ -977,6 +1044,12 @@
<xsl:if test="$overload-count > 1"> (<xsl:value-of
select="$overload-position"/> of <xsl:value-of select="$overload-count"/> overloads)</xsl:if>]
+<xsl:if test="$overload-count = 1">
+ <xsl:text>[indexterm1 </xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>] </xsl:text>
+</xsl:if>
+
<xsl:value-of select="briefdescription"/><xsl:text>
</xsl:text>
Modified: branches/CMake/release/libs/asio/test/Jamfile.v2
==============================================================================
--- branches/CMake/release/libs/asio/test/Jamfile.v2 (original)
+++ branches/CMake/release/libs/asio/test/Jamfile.v2 2008-07-03 10:40:28 EDT (Thu, 03 Jul 2008)
@@ -37,6 +37,8 @@
<library>/boost/thread//boost_thread
<define>BOOST_ALL_NO_LIB=1
<threading>multi
+ <os>LINUX:<define>_XOPEN_SOURCE=600
+ <os>LINUX:<define>_GNU_SOURCE=1
<os>SOLARIS:<define>_XOPEN_SOURCE=500
<os>SOLARIS:<define>__EXTENSIONS__
<os>SOLARIS:<library>socket
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