|
Boost-Commit : |
From: chris_at_[hidden]
Date: 2008-06-18 09:08:27
Author: chris_kohlhoff
Date: 2008-06-18 09:08:21 EDT (Wed, 18 Jun 2008)
New Revision: 46476
URL: http://svn.boost.org/trac/boost/changeset/46476
Log:
Regenerate documentation.
Text files modified:
trunk/libs/asio/doc/reference.qbk | 45370 ++++++++++++++++++++++-----------------
1 files changed, 25940 insertions(+), 19430 deletions(-)
Modified: trunk/libs/asio/doc/reference.qbk
==============================================================================
--- trunk/libs/asio/doc/reference.qbk (original)
+++ trunk/libs/asio/doc/reference.qbk 2008-06-18 09:08:21 EDT (Wed, 18 Jun 2008)
@@ -559,6 +559,364 @@
[endsect]
+[section:async_read_at 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(). ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
[section:async_read_until async_read_until]
Start an asynchronous operation to read data into a streambuf until a delimiter is encountered.
@@ -593,8 +951,20 @@
const boost::regex & expr,
ReadHandler handler);
+ template<
+ typename ``[link boost_asio.reference.AsyncReadStream AsyncReadStream]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.MatchCondition 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)]
+[section:overload1 async_read_until (1 of 4 overloads)]
Start an asynchronous operation to read data into a streambuf until a delimiter is encountered.
@@ -674,7 +1044,7 @@
-[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.
@@ -754,7 +1124,7 @@
-[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.
@@ -835,11 +1205,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 ``[link boost_asio.reference.MatchCondition 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]
+
+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.
+Start an asynchronous operation to write all of the supplied data to a stream.
template<
typename ``[link boost_asio.reference.AsyncWriteStream AsyncWriteStream]``,
@@ -884,7 +1388,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]``,
@@ -1034,7 +1538,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]``,
@@ -1158,166 +1662,503 @@
[endsect]
-[section:basic_datagram_socket basic_datagram_socket]
+[section:async_write_at async_write_at]
-Provides datagram-oriented socket functionality.
+Start an asynchronous operation to write all of the supplied data at the specified offset.
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 ``[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.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);
-[heading Types]
-[table
- [[Name][Description]]
+ 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);
- [
+ 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)]
- [[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 operation to write all of the supplied 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 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.
- [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+* An error occurred.
- [
+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]
+
- [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+[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.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+[[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.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+ // 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.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
+]
+
+[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.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
- [
+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.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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_datagram_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
- [
+[section:overload2 async_write_at (2 of 4 overloads)]
- [[link boost_asio.reference.basic_datagram_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+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_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
- [
+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.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
- [
+* 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.
- [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+* 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.
- [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
- [
+[heading Parameters]
+
- [[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. ]
+[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.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
+[[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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
]
]
@@ -10918,16 +11759,15 @@
[endsect]
-[section:basic_socket basic_socket]
+[section:basic_serial_port basic_serial_port]
-Provides socket functionality.
+Provides serial port 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.SerialPortService SerialPortService]`` = serial_port_service>
+ class basic_serial_port :
+ public basic_io_object< SerialPortService >,
+ public serial_port_base
[heading Types]
@@ -10936,151 +11776,32 @@
[
- [[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]]]
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
[The underlying implementation type of I/O object. ]
]
[
- [[link boost_asio.reference.basic_socket.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_serial_port.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_serial_port is always the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [The native representation of a serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
+ [[link boost_asio.reference.basic_serial_port.service_type [*service_type]]]
[The type of the service that will be used to provide I/O operations. ]
]
- [
-
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
-
]
[heading Member Functions]
@@ -11088,166 +11809,109 @@
[[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_serial_port.assign [*assign]]]
+ [Assign an existing native serial port to the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.basic_socket [*basic_socket]]]
- [Construct a basic_socket without opening it. ]
+ [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.basic_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[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_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.basic_serial_port.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.basic_serial_port.close [*close]]]
+ [Close the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_serial_port.get_io_service [*get_io_service]]]
[Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.basic_socket.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_serial_port.get_option [*get_option]]]
+ [Get an option from the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.io_service [*io_service]]]
+ [[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_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_serial_port.is_open [*is_open]]]
+ [Determine whether the serial port is open. ]
]
[
- [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_serial_port.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_serial_port.native [*native]]]
+ [Get the native serial port representation. ]
]
[
- [[link boost_asio.reference.basic_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.basic_serial_port.open [*open]]]
+ [Open the serial port using the specified device name. ]
]
[
- [[link boost_asio.reference.basic_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
+ [[link boost_asio.reference.basic_serial_port.read_some [*read_some]]]
+ [Read some data from the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.basic_serial_port.send_break [*send_break]]]
+ [Send a break sequence to the serial port. ]
]
[
- [[link boost_asio.reference.basic_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_serial_port.set_option [*set_option]]]
+ [Set an option on the serial port. ]
]
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
-
[
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.basic_serial_port.write_some [*write_some]]]
+ [Write some data to the serial port. ]
]
]
-[heading Data Members]
+[heading Protected 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_serial_port.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
[
- [[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_serial_port.service [*service]]]
+ [The service associated with the I/O object. ]
]
- [
- [[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.
+The basic_serial_port class template provides functionality that is common to all serial ports.
[heading Thread Safety]
@@ -11257,27 +11921,24 @@
[*Shared] [*objects:] Unsafe.
-[section:assign basic_socket::assign]
+[section:assign basic_serial_port::assign]
-Assign an existing native socket to the socket.
+Assign an existing native serial port to the serial port.
- void ``[link boost_asio.reference.basic_socket.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
+ 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_socket.assign.overload2 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket,
+ 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);
-[section:overload1 basic_socket::assign (1 of 2 overloads)]
+[section:overload1 basic_serial_port::assign (1 of 2 overloads)]
-Assign an existing native socket to the socket.
+Assign an existing native serial port to the serial port.
void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
+ const native_type & native_serial_port);
@@ -11285,13 +11946,12 @@
-[section:overload2 basic_socket::assign (2 of 2 overloads)]
+[section:overload2 basic_serial_port::assign (2 of 2 overloads)]
-Assign an existing native socket to the socket.
+Assign an existing native serial port to the serial port.
boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
+ const native_type & native_serial_port,
boost::system::error_code & ec);
@@ -11302,20 +11962,19 @@
[endsect]
-[section:async_connect basic_socket::async_connect]
+[section:async_read_some basic_serial_port::async_read_some]
-Start an asynchronous connect.
+Start an asynchronous read.
template<
- typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
-
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
-This function is used to asynchronously 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 asynchronously read data from the serial port. The function call always returns immediately.
[heading Parameters]
@@ -11323,12 +11982,13 @@
[variablelist
-[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
+[[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 connection 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 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
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes read.
);
``
@@ -11336,133 +11996,120 @@
]
+[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:
-
- 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);
-
+ 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.
[endsect]
-[section:at_mark basic_socket::at_mark]
-
-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;
-
- bool ``[link boost_asio.reference.basic_socket.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
-
-
-[section:overload1 basic_socket::at_mark (1 of 2 overloads)]
-Determine whether the socket is at the out-of-band data mark.
+[section:async_write_some basic_serial_port::async_write_some]
- bool at_mark() const;
+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 check whether the socket input is currently positioned at the out-of-band data mark.
+This function is used to asynchronously write data to the serial port. 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. ]]
-
-]
-
-
-
-[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;
+[[buffers][One or more data buffers to be written to the serial port. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes written.
+ );
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+``
+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 Parameters]
-
+[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]
-[[ec][Set to indicate what error occurred, if any.]]
+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);
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
+
+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:basic_serial_port basic_serial_port::basic_serial_port]
-[section:available basic_socket::available]
+Construct a basic_serial_port without opening it.
-Determine the number of bytes available for reading.
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload1 basic_serial_port]``(
+ boost::asio::io_service & io_service);
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload2 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const char * device);
- std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
- boost::system::error_code & ec) const;
+ ``[link boost_asio.reference.basic_serial_port.basic_serial_port.overload3 basic_serial_port]``(
+ boost::asio::io_service & io_service,
+ const std::string & device);
+ ``[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);
-[section:overload1 basic_socket::available (1 of 2 overloads)]
-Determine the number of bytes available for reading.
+[section:overload1 basic_serial_port::basic_serial_port (1 of 4 overloads)]
- std::size_t available() const;
+Construct a basic_serial_port without opening it.
+ basic_serial_port(
+ boost::asio::io_service & io_service);
-This function is used to determine the number of bytes that may be read without blocking.
+This constructor creates a serial port without opening it.
-[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. ]]
+[[io_service][The io\_service object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port. ]]
]
@@ -11472,15 +12119,16 @@
-[section:overload2 basic_socket::available (2 of 2 overloads)]
+[section:overload2 basic_serial_port::basic_serial_port (2 of 4 overloads)]
-Determine the number of bytes available for reading.
+Construct and open a basic_serial_port.
- std::size_t available(
- boost::system::error_code & ec) const;
+ basic_serial_port(
+ boost::asio::io_service & io_service,
+ const char * device);
-This function is used to determine the number of bytes that may be read without blocking.
+This constructor creates and opens a serial port for the specified device name.
[heading Parameters]
@@ -11488,51 +12136,28 @@
[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.
+[[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. ]]
+]
-[endsect]
[endsect]
-[section:basic_socket 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:overload3 basic_serial_port::basic_serial_port (3 of 4 overloads)]
- ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+Construct and open a basic_serial_port.
- ``[link boost_asio.reference.basic_socket.basic_socket.overload4 basic_socket]``(
+ basic_serial_port(
boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
-
-
-[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
-
-Construct a basic_socket without opening it.
-
- basic_socket(
- boost::asio::io_service & io_service);
+ const std::string & device);
-This constructor creates a socket without opening it.
+This constructor creates and opens a serial port for the specified device name.
[heading Parameters]
@@ -11540,7 +12165,9 @@
[variablelist
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket. ]]
+[[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. ]]
]
@@ -11550,16 +12177,16 @@
-[section:overload2 basic_socket::basic_socket (2 of 4 overloads)]
+[section:overload4 basic_serial_port::basic_serial_port (4 of 4 overloads)]
-Construct and open a basic_socket.
+Construct a basic_serial_port on an existing native serial port.
- basic_socket(
+ basic_serial_port(
boost::asio::io_service & io_service,
- const protocol_type & protocol);
+ const native_type & native_serial_port);
-This constructor creates and opens a socket.
+This constructor creates a serial port object to hold an existing native serial port.
[heading Parameters]
@@ -11567,9 +12194,9 @@
[variablelist
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+[[io_service][The io\_service object that the serial port will use to dispatch handlers for any asynchronous operations performed on the port.]]
-[[protocol][An object specifying protocol parameters to be used.]]
+[[native_serial_port][A native serial port.]]
]
@@ -11587,29 +12214,27 @@
[endsect]
+[endsect]
-[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
+[section:cancel basic_serial_port::cancel]
-Construct a basic_socket, opening it and binding it to the given local endpoint.
+Cancel all asynchronous operations associated with the serial port.
- basic_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+ 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);
-This constructor creates a socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
+[section:overload1 basic_serial_port::cancel (1 of 2 overloads)]
-[heading Parameters]
-
+Cancel all asynchronous operations associated with the serial port.
-[variablelist
-
-[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+ void cancel();
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-]
+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]
@@ -11626,17 +12251,15 @@
-[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
+[section:overload2 basic_serial_port::cancel (2 of 2 overloads)]
-Construct a basic_socket on an existing native socket.
+Cancel all asynchronous operations associated with the serial port.
- basic_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-This constructor creates a socket object to hold an existing native socket.
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
[heading Parameters]
@@ -11644,20 +12267,7 @@
[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.]]
-
-]
-
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+[[ec][Set to indicate what error occurred, if any. ]]
]
@@ -11668,75 +12278,50 @@
[endsect]
-[section:bind basic_socket::bind]
+[section:close basic_serial_port::close]
-Bind the socket to the given local endpoint.
+Close the serial port.
- void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+ void ``[link boost_asio.reference.basic_serial_port.close.overload1 close]``();
- boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket::bind (1 of 2 overloads)]
-
-Bind the socket to the given local endpoint.
-
- void bind(
- const endpoint_type & endpoint);
-
+[section:overload1 basic_serial_port::close (1 of 2 overloads)]
-This function binds the socket to the specified endpoint on the local machine.
+Close the serial port.
+ void close();
-[heading Parameters]
-
-[variablelist
-
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+This function is used to close the serial port. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
-]
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[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_socket::bind (2 of 2 overloads)]
+[section:overload2 basic_serial_port::close (2 of 2 overloads)]
-Bind the socket to the given local endpoint.
+Close the serial port.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ 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 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]
@@ -11744,238 +12329,205 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
+[[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:get_io_service basic_serial_port::get_io_service]
-[endsect]
+['Inherited from basic_io_object.]
+Get the io_service associated with the object.
-[endsect]
+ boost::asio::io_service & get_io_service();
-[section:broadcast basic_socket::broadcast]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-['Inherited from socket_base.]
+[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.
-Socket option to permit sending of broadcast messages.
- typedef implementation_defined broadcast;
+[endsect]
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[section:get_option basic_serial_port::get_option]
+Get an option from the serial port.
-[heading Examples]
-
-Setting the option:
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.get_option.overload1 get_option]``(
+ GettableSerialPortOption & option);
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.get_option.overload2 get_option]``(
+ GettableSerialPortOption & option,
+ boost::system::error_code & ec);
+[section:overload1 basic_serial_port::get_option (1 of 2 overloads)]
+Get an option from the serial port.
-Getting the current option value:
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ void get_option(
+ GettableSerialPortOption & option);
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+This function is used to get the current value of an option on the serial port.
+[heading Parameters]
+
+[variablelist
+
+[[option][The option value to be obtained from the serial port.]]
+]
-[endsect]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[section:bytes_readable basic_socket::bytes_readable]
-['Inherited from socket_base.]
+[endsect]
-IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined bytes_readable;
+[section:overload2 basic_serial_port::get_option (2 of 2 overloads)]
+Get an option from the serial port.
-Implements the FIONREAD IO control command.
+ template<
+ typename ``[link boost_asio.reference.GettableSerialPortOption GettableSerialPortOption]``>
+ boost::system::error_code get_option(
+ GettableSerialPortOption & option,
+ boost::system::error_code & ec);
-[heading Example]
-
+This function is used to get the current value of an option on the 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 Parameters]
+
+[variablelist
+
+[[option][The option value to be obtained from the serial port.]]
+[[ec][Set to indicate what error occured, if any.]]
+]
[endsect]
-[section:cancel basic_socket::cancel]
-
-Cancel all asynchronous operations associated with the socket.
-
- void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
-
- boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 basic_socket::cancel (1 of 2 overloads)]
+[section:implementation basic_serial_port::implementation]
-Cancel all asynchronous operations associated with the socket.
- void cancel();
+['Inherited from basic_io_object.]
+The underlying implementation of the I/O object.
-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.
+ implementation_type implementation;
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[endsect]
-]
-[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.
+[section:implementation_type basic_serial_port::implementation_type]
-* It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed.
-For portable cancellation, consider using one of the following alternatives:
+['Inherited from basic_io_object.]
+The underlying implementation type of I/O object.
-* Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP.
+ typedef service_type::implementation_type implementation_type;
-* 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::cancel (2 of 2 overloads)]
-
-Cancel all asynchronous operations associated with the socket.
+[section:io_service basic_serial_port::io_service]
- boost::system::error_code cancel(
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
-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.
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-]
-[heading Remarks]
+[heading Return Value]
-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.
+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_socket::close]
+[section:is_open basic_serial_port::is_open]
-Close the socket.
+Determine whether the serial port is open.
- void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
+ bool is_open() const;
- boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
- boost::system::error_code & ec);
-[section:overload1 basic_socket::close (1 of 2 overloads)]
+[endsect]
-Close the socket.
- void close();
+[section:lowest_layer basic_serial_port::lowest_layer]
-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.
+Get a reference to the lowest layer.
+ lowest_layer_type & lowest_layer();
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+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 Remarks]
+[heading Return Value]
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
@@ -11983,76 +12535,217 @@
-[section:overload2 basic_socket::close (2 of 2 overloads)]
-
-Close the socket.
+[section:lowest_layer_type basic_serial_port::lowest_layer_type]
- boost::system::error_code close(
- boost::system::error_code & ec);
+A basic_serial_port is always the lowest layer.
+ typedef basic_serial_port< SerialPortService > lowest_layer_type;
-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 Types]
+[table
+ [[Name][Description]]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
-[[ec][Set to indicate what error occurred, if any.]]
+ ]
-]
+ [
-[heading Example]
+ [[link boost_asio.reference.basic_serial_port.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_serial_port is always the lowest layer. ]
+ ]
+ [
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::system::error_code ec;
- socket.close(ec);
- if (ec)
- {
- // An error occurred.
- }
+ [[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. ]
+
+ ]
+]
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
+[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. ]
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+The basic_serial_port class template provides functionality that is common to all serial ports.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:native basic_serial_port::native]
+
+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:native_type basic_serial_port::native_type]
+
+The native representation of a serial port.
+
+ typedef SerialPortService::native_type native_type;
+
+
+
+
[endsect]
-[section:connect basic_socket::connect]
-Connect the socket to the specified endpoint.
+[section:open basic_serial_port::open]
- void ``[link boost_asio.reference.basic_socket.connect.overload1 connect]``(
- const endpoint_type & peer_endpoint);
+Open the serial port using the specified device name.
- boost::system::error_code ``[link boost_asio.reference.basic_socket.connect.overload2 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+ 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::connect (1 of 2 overloads)]
-Connect the socket to the specified endpoint.
+[section:overload1 basic_serial_port::open (1 of 2 overloads)]
- void connect(
- const endpoint_type & peer_endpoint);
+Open the serial port using the specified device name.
+ void open(
+ const std::string & device);
-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.
+This function opens the serial port for the specified device name.
[heading Parameters]
@@ -12060,7 +12753,7 @@
[variablelist
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[[device][The platform-specific device name.]]
]
@@ -12069,40 +12762,26 @@
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[boost::system::system_error][Thrown on failure. ]]
]
-[heading Example]
-
-
-
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- socket.connect(endpoint);
-
-
-
-
[endsect]
-[section:overload2 basic_socket::connect (2 of 2 overloads)]
+[section:overload2 basic_serial_port::open (2 of 2 overloads)]
-Connect the socket to the specified endpoint.
+Open the serial port using the specified device name.
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
+ boost::system::error_code open(
+ const std::string & device,
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.
+This function opens the serial port using the given platform-specific device name.
[heading Parameters]
@@ -12110,172 +12789,204 @@
[variablelist
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[[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::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:read_some basic_serial_port::read_some]
+Read some data from the serial port.
+ 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);
-[endsect]
+ 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);
-[endsect]
+[section:overload1 basic_serial_port::read_some (1 of 2 overloads)]
+Read some data from the serial port.
-[section:debug basic_socket::debug]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
-['Inherited from socket_base.]
+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.
-Socket option to enable socket-level debugging.
- typedef implementation_defined debug;
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
+]
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+[heading Return Value]
+
+The number of bytes read.
+[heading Exceptions]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[boost::system::system_error][Thrown on failure. An error code of boost::asio::error::eof indicates that the connection was closed by the peer.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+]
+[heading Remarks]
+
+The read\_some operation may not read all of the requested number of bytes. Consider using the
+[link boost_asio.reference.read read] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+[heading Example]
+
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+ serial_port.read_some(boost::asio::buffer(data, size));
-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();
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[endsect]
-[endsect]
+[section:overload2 basic_serial_port::read_some (2 of 2 overloads)]
+Read some data from the serial port.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
-[section:do_not_route basic_socket::do_not_route]
+This function is used to read data from the serial port. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
-['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
+[heading Parameters]
+
- typedef implementation_defined do_not_route;
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
+[[ec][Set to indicate what error occurred, if any.]]
+]
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+[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 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]
+[endsect]
-Getting the current option value:
+[section:send_break basic_serial_port::send_break]
- 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();
+Send a break sequence to the serial port.
+ void ``[link boost_asio.reference.basic_serial_port.send_break.overload1 send_break]``();
+ boost::system::error_code ``[link boost_asio.reference.basic_serial_port.send_break.overload2 send_break]``(
+ boost::system::error_code & ec);
+[section:overload1 basic_serial_port::send_break (1 of 2 overloads)]
+Send a break sequence to the serial port.
-[endsect]
+ void send_break();
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
-[section:enable_connection_aborted basic_socket::enable_connection_aborted]
+[heading Exceptions]
+
-['Inherited from socket_base.]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-Socket option to report aborted connections on accept.
+]
- typedef implementation_defined enable_connection_aborted;
+[endsect]
-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:
+[section:overload2 basic_serial_port::send_break (2 of 2 overloads)]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+Send a break sequence to the serial port.
+ boost::system::error_code send_break(
+ boost::system::error_code & ec);
+This function causes a break sequence of platform-specific duration to be sent out the serial port.
-Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+]
+[endsect]
[endsect]
+[section:service basic_serial_port::service]
-[section:endpoint_type basic_socket::endpoint_type]
-The endpoint type.
+['Inherited from basic_io_object.]
- typedef Protocol::endpoint endpoint_type;
+The service associated with the I/O object.
+ service_type & service;
@@ -12283,55 +12994,48 @@
-[section:get_io_service basic_socket::get_io_service]
+[section:service_type basic_serial_port::service_type]
['Inherited from basic_io_object.]
-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.
+The type of the service that will be used to provide I/O operations.
+ typedef SerialPortService service_type;
-[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_socket::get_option]
+[section:set_option basic_serial_port::set_option]
-Get an option from the socket.
+Set an option on the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void ``[link boost_asio.reference.basic_serial_port.set_option.overload1 set_option]``(
+ const SettableSerialPortOption & 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;
+ 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);
-[section:overload1 basic_socket::get_option (1 of 2 overloads)]
+[section:overload1 basic_serial_port::set_option (1 of 2 overloads)]
-Get an option from the socket.
+Set an option on the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option) const;
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ void set_option(
+ const SettableSerialPortOption & option);
-This function is used to get the current value of an option on the socket.
+This function is used to set an option on the serial port.
[heading Parameters]
@@ -12339,7 +13043,7 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
+[[option][The option value to be set on the serial port.]]
]
@@ -12352,37 +13056,24 @@
]
-[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_socket::get_option (2 of 2 overloads)]
+[section:overload2 basic_serial_port::set_option (2 of 2 overloads)]
-Get an option from the socket.
+Set an option on the serial port.
template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+ typename ``[link boost_asio.reference.SettableSerialPortOption SettableSerialPortOption]``>
+ boost::system::error_code set_option(
+ const SettableSerialPortOption & option,
+ boost::system::error_code & ec);
-This function is used to get the current value of an option on the socket.
+This function is used to set an option on the serial port.
[heading Parameters]
@@ -12390,95 +13081,46 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
+[[option][The option value to be set on the serial port.]]
[[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_socket::implementation]
-
-
-['Inherited from basic_io_object.]
-
-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.
-
- typedef service_type::implementation_type implementation_type;
-
-
-
-
[endsect]
+[section:write_some basic_serial_port::write_some]
-[section:io_control basic_socket::io_control]
-
-Perform an IO control command on the socket.
+Write some data to the serial port.
template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void ``[link boost_asio.reference.basic_socket.io_control.overload1 io_control]``(
- IoControlCommand & command);
+ 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);
template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code ``[link boost_asio.reference.basic_socket.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.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::io_control (1 of 2 overloads)]
+[section:overload1 basic_serial_port::write_some (1 of 2 overloads)]
-Perform an IO control command on the socket.
+Write some data to the serial port.
template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-This function is used to execute an IO control command on the socket.
+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]
@@ -12486,31 +13128,38 @@
[variablelist
-[[command][The IO control command to be performed on the socket.]]
+[[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]
-Getting the number of bytes ready to read:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+To write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+ serial_port.write_some(boost::asio::buffer(data, size));
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
@@ -12518,18 +13167,18 @@
-[section:overload2 basic_socket::io_control (2 of 2 overloads)]
+[section:overload2 basic_serial_port::write_some (2 of 2 overloads)]
-Perform an IO control command on the socket.
+Write some data to the serial port.
template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- IoControlCommand & command,
+ 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 execute an IO control command on the socket.
+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]
@@ -12537,29 +13186,20 @@
[variablelist
-[[command][The IO control command to be performed on the socket.]]
+[[buffers][One or more data buffers to be written to the serial port.]]
[[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();
-
-
+[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.
@@ -12569,278 +13209,46 @@
[endsect]
-[section:io_service basic_socket::io_service]
-
+[endsect]
-['Inherited from basic_io_object.]
+[section:basic_socket basic_socket]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+Provides socket functionality.
- boost::asio::io_service & io_service();
+ 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
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[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.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:is_open basic_socket::is_open]
-
-Determine whether the socket is open.
-
- bool is_open() const;
-
-
-
-[endsect]
-
-
-
-[section:keep_alive basic_socket::keep_alive]
-
-
-['Inherited from 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:
-
- 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_socket::linger]
-
-
-['Inherited from 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]
-
-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::local_endpoint]
-
-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_socket.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
-
-
-[section:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
-
-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_socket::local_endpoint (2 of 2 overloads)]
-
-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_socket::lowest_layer]
-
-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::lowest_layer_type]
-
-A basic_socket is always the lowest layer.
-
- typedef basic_socket< Protocol, SocketService > 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. ]
@@ -13142,20 +13550,27 @@
[*Shared] [*objects:] Unsafe.
+[section:assign basic_socket::assign]
+Assign an existing native socket to the socket.
-[endsect]
-
-
+ void ``[link boost_asio.reference.basic_socket.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_socket);
-[section:max_connections basic_socket::max_connections]
+ 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);
-['Inherited from socket_base.]
+[section:overload1 basic_socket::assign (1 of 2 overloads)]
-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);
@@ -13163,146 +13578,202 @@
-[section:message_do_not_route basic_socket::message_do_not_route]
+[section:overload2 basic_socket::assign (2 of 2 overloads)]
+Assign an existing native socket to the socket.
-['Inherited from socket_base.]
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
-Specify that the data should not be subject to routing.
- static const int message_do_not_route = implementation_defined;
+[endsect]
[endsect]
+[section:async_connect basic_socket::async_connect]
-[section:message_flags basic_socket::message_flags]
+Start an asynchronous connect.
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
-['Inherited from socket_base.]
-Bitmask type for flags that can be passed to send and receive operations.
+This function is used to asynchronously connect a socket to the specified remote endpoint. The function call always returns immediately.
- typedef int message_flags;
+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. Copies will be made of the endpoint object as required.]]
-[endsect]
+[[handler][The handler to be called when the connection operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
+]
-[section:message_out_of_band basic_socket::message_out_of_band]
+[heading Example]
+
-['Inherited from socket_base.]
+ 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);
+
-Process out-of-band data.
- static const int message_out_of_band = implementation_defined;
[endsect]
+[section:at_mark basic_socket::at_mark]
-[section:message_peek basic_socket::message_peek]
+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;
-Peek at incoming data without removing it from the input queue.
- static const int message_peek = implementation_defined;
+[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;
-[endsect]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[section:native basic_socket::native]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
-Get the native socket representation.
+[heading Exceptions]
+
- native_type native();
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
[endsect]
-[section:native_type basic_socket::native_type]
+[section:overload2 basic_socket::at_mark (2 of 2 overloads)]
-The native representation of a socket.
+Determine whether the socket is at the out-of-band data mark.
- typedef SocketService::native_type native_type;
+ bool at_mark(
+ boost::system::error_code & ec) const;
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+]
-[section:non_blocking_io basic_socket::non_blocking_io]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
-['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+[endsect]
- typedef implementation_defined non_blocking_io;
+[endsect]
+[section:available basic_socket::available]
-Implements the FIONBIO IO control command.
+Determine the number of bytes available for reading.
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload1 available]``() const;
-[heading Example]
-
+ std::size_t ``[link boost_asio.reference.basic_socket.available.overload2 available]``(
+ boost::system::error_code & ec) const;
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
+[section:overload1 basic_socket::available (1 of 2 overloads)]
+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.
-[endsect]
+[heading Return Value]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
+[heading Exceptions]
+
-[section:open basic_socket::open]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-Open the socket using the specified protocol.
+]
- 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.open.overload2 open]``(
- const protocol_type & protocol,
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 basic_socket::open (1 of 2 overloads)]
-Open the socket using the specified protocol.
- void open(
- const protocol_type & protocol = protocol_type());
+[section:overload2 basic_socket::available (2 of 2 overloads)]
+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(
+ boost::system::error_code & ec) const;
+
+
+This function is used to determine the number of bytes that may be read without blocking.
[heading Parameters]
@@ -13310,45 +13781,51 @@
[variablelist
-[[protocol][An object specifying protocol parameters to be used.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[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);
- socket.open(boost::asio::ip::tcp::v4());
+[endsect]
+[section:basic_socket 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);
-[endsect]
+ ``[link boost_asio.reference.basic_socket.basic_socket.overload3 basic_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+ ``[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);
-[section:overload2 basic_socket::open (2 of 2 overloads)]
+[section:overload1 basic_socket::basic_socket (1 of 4 overloads)]
-Open the socket using the specified protocol.
+Construct a basic_socket without opening it.
- boost::system::error_code open(
- const protocol_type & protocol,
- boost::system::error_code & ec);
+ basic_socket(
+ boost::asio::io_service & io_service);
-This function opens the socket so that it will use the specified protocol.
+This constructor creates a socket without opening it.
[heading Parameters]
@@ -13356,84 +13833,85 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
-
-[[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]
-
- 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]
+[section:overload2 basic_socket::basic_socket (2 of 4 overloads)]
+Construct and open a basic_socket.
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-[endsect]
+This constructor creates and opens a socket.
-[endsect]
+[heading Parameters]
+
-[section:protocol_type basic_socket::protocol_type]
+[variablelist
+
+[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
-The protocol type.
+[[protocol][An object specifying protocol parameters to be used.]]
- typedef Protocol protocol_type;
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-[endsect]
+[endsect]
-[section:receive_buffer_size basic_socket::receive_buffer_size]
-['Inherited from socket_base.]
+[section:overload3 basic_socket::basic_socket (3 of 4 overloads)]
-Socket option for the receive buffer size of a socket.
+Construct a basic_socket, opening it and binding it to the given local endpoint.
- typedef implementation_defined receive_buffer_size;
+ basic_socket(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
+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.
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_buffer_size option(8192);
- socket.set_option(option);
-
-
-
+[[io_service][The io\_service object that the socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
-Getting the current option value:
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
- 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. ]]
+]
@@ -13441,71 +13919,79 @@
-[section:receive_low_watermark basic_socket::receive_low_watermark]
-
-
-['Inherited from socket_base.]
+[section:overload4 basic_socket::basic_socket (4 of 4 overloads)]
-Socket option for the receive low watermark.
+Construct a basic_socket on an existing native socket.
- typedef implementation_defined receive_low_watermark;
+ 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.
-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);
+[[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.]]
+]
-Getting the current option value:
+[heading Exceptions]
+
- 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
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
+[endsect]
[endsect]
+[section:bind basic_socket::bind]
-[section:remote_endpoint basic_socket::remote_endpoint]
+Bind the socket to the given local endpoint.
-Get the remote endpoint of the socket.
+ void ``[link boost_asio.reference.basic_socket.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
- endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
+[section:overload1 basic_socket::bind (1 of 2 overloads)]
-[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
+Bind the socket to the given local endpoint.
-Get the remote endpoint of the socket.
+ void bind(
+ const endpoint_type & endpoint);
- endpoint_type remote_endpoint() const;
+This function binds the socket to the specified endpoint on the local machine.
-This function is used to obtain the remote endpoint of the socket.
+[heading Parameters]
+
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket.
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+
+]
[heading Exceptions]
@@ -13521,8 +14007,9 @@
boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+ socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
@@ -13533,15 +14020,16 @@
-[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
+[section:overload2 basic_socket::bind (2 of 2 overloads)]
-Get the remote endpoint of the socket.
+Bind the socket to the given local endpoint.
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
-This function is used to obtain the remote endpoint of the socket.
+This function binds the socket to the specified endpoint on the local machine.
[heading Parameters]
@@ -13549,22 +14037,21 @@
[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 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);
- ...
+ socket.open(boost::asio::ip::tcp::v4());
boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
if (ec)
{
// An error occurred.
@@ -13581,38 +14068,38 @@
[endsect]
-[section:reuse_address basic_socket::reuse_address]
+[section:broadcast basic_socket::broadcast]
['Inherited from socket_base.]
-Socket option to allow the socket to be bound to an address that is already in use.
+Socket option to permit sending of broadcast messages.
- typedef implementation_defined reuse_address;
+ typedef implementation_defined broadcast;
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
[heading Examples]
Setting the option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
bool is_set = option.value();
@@ -13624,39 +14111,29 @@
-[section:send_buffer_size basic_socket::send_buffer_size]
+[section:bytes_readable basic_socket::bytes_readable]
['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined send_buffer_size;
+ typedef implementation_defined bytes_readable;
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+Implements the FIONREAD IO control command.
-[heading Examples]
+[heading Example]
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
-
-
-
-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();
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
@@ -13666,117 +14143,119 @@
[endsect]
+[section:cancel basic_socket::cancel]
-[section:send_low_watermark basic_socket::send_low_watermark]
+Cancel all asynchronous operations associated with the socket.
+ void ``[link boost_asio.reference.basic_socket.cancel.overload1 cancel]``();
-['Inherited from socket_base.]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
-Socket option for the send low watermark.
- typedef implementation_defined send_low_watermark;
+[section:overload1 basic_socket::cancel (1 of 2 overloads)]
+Cancel all asynchronous operations associated with the socket.
+ void cancel();
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
-[heading 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 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.
-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::send_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:service basic_socket::service]
+[section:overload2 basic_socket::cancel (2 of 2 overloads)]
+Cancel all asynchronous operations associated with the socket.
-['Inherited from basic_io_object.]
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-The service associated with the I/O object.
- service_type & service;
+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]
+
-[endsect]
+[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:
-[section:service_type basic_socket::service_type]
+* 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.
-['Inherited from basic_io_object.]
+For portable cancellation, consider using one of the following alternatives:
-The type of the service that will be used to provide I/O operations.
- typedef SocketService service_type;
+* Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP.
+* Use the close() function to simultaneously cancel the outstanding operations and close the socket.
+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:set_option basic_socket::set_option]
-
-Set an option on 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);
+[endsect]
- 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:close basic_socket::close]
+Close the socket.
-[section:overload1 basic_socket::set_option (1 of 2 overloads)]
+ void ``[link boost_asio.reference.basic_socket.close.overload1 close]``();
-Set an option on the socket.
+ boost::system::error_code ``[link boost_asio.reference.basic_socket.close.overload2 close]``(
+ boost::system::error_code & ec);
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+[section:overload1 basic_socket::close (1 of 2 overloads)]
-This function is used to set an option on the socket.
+Close the socket.
+ void close();
-[heading Parameters]
-
-[variablelist
-
-[[option][The new option value to be set on 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 Exceptions]
@@ -13787,17 +14266,9 @@
]
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
-
-
-
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
@@ -13805,18 +14276,15 @@
-[section:overload2 basic_socket::set_option (2 of 2 overloads)]
+[section:overload2 basic_socket::close (2 of 2 overloads)]
-Set an option on the socket.
+Close the socket.
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
+ boost::system::error_code close(
boost::system::error_code & ec);
-This function is used to set an option on the socket.
+This function is used to close the 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]
@@ -13824,21 +14292,18 @@
[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);
+ socket.close(ec);
if (ec)
{
// An error occurred.
@@ -13847,6 +14312,10 @@
+[heading Remarks]
+
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
+
[endsect]
@@ -13854,27 +14323,29 @@
[endsect]
-[section:shutdown basic_socket::shutdown]
+[section:connect basic_socket::connect]
-Disable sends or receives on the socket.
+Connect the socket to the specified endpoint.
- void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
+ 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.shutdown.overload2 shutdown]``(
- shutdown_type what,
+ 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::shutdown (1 of 2 overloads)]
+[section:overload1 basic_socket::connect (1 of 2 overloads)]
-Disable sends or receives on the socket.
+Connect the socket to the specified endpoint.
- void shutdown(
- shutdown_type what);
+ void connect(
+ const endpoint_type & peer_endpoint);
-This function is used to disable send operations, receive operations, or both.
+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]
@@ -13882,7 +14353,7 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
]
@@ -13897,11 +14368,12 @@
[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);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.connect(endpoint);
@@ -13912,16 +14384,18 @@
-[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
+[section:overload2 basic_socket::connect (2 of 2 overloads)]
-Disable sends or receives on the socket.
+Connect the socket to the specified endpoint.
- boost::system::error_code shutdown(
- shutdown_type what,
+ boost::system::error_code connect(
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-This function is used to disable send operations, receive operations, or both.
+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]
@@ -13929,7 +14403,7 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -13937,12 +14411,13 @@
[heading Example]
-Shutting down the send side of the socket:
+
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.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
+ socket.connect(endpoint, ec);
if (ec)
{
// An error occurred.
@@ -13959,46 +14434,42 @@
[endsect]
-[section:shutdown_type basic_socket::shutdown_type]
+[section:debug basic_socket::debug]
['Inherited from socket_base.]
-Different ways a socket may be shutdown.
+Socket option to enable socket-level debugging.
- enum shutdown_type
+ typedef implementation_defined debug;
-[heading Values]
-[variablelist
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
-]
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
-[endsect]
+Getting the current option value:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[section:_basic_socket basic_socket::~basic_socket]
-Protected destructor to prevent deletion through this type.
- ~basic_socket();
@@ -14006,358 +14477,154 @@
-[endsect]
+[section:do_not_route basic_socket::do_not_route]
-[section:basic_socket_acceptor basic_socket_acceptor]
-Provides the ability to accept new connections.
+['Inherited from socket_base.]
- 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
+Socket option to prevent routing, use local interfaces only.
+ typedef implementation_defined do_not_route;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
- [
- [[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 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);
- [[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. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+ 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();
- [
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
- [
+[section:enable_connection_aborted basic_socket::enable_connection_aborted]
- [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
- [
+['Inherited from socket_base.]
- [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
- [The native representation of an acceptor. ]
-
- ]
+Socket option to report aborted connections on accept.
- [
+ typedef implementation_defined enable_connection_aborted;
- [[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. ]
-
- ]
+Implements a custom socket option that determines whether or not an accept operation is permitted to fail with boost::asio::error::connection\_aborted. By default the option is false.
- [
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
+[heading Examples]
- ]
-
- [
+Setting the option:
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option(true);
+ acceptor.set_option(option);
- [
- [[link boost_asio.reference.basic_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. ]
-
- ]
+Getting the current option value:
- [
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
-]
+[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:endpoint_type basic_socket::endpoint_type]
- [
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+The endpoint type.
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
+ typedef Protocol::endpoint endpoint_type;
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
-]
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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:get_io_service basic_socket::get_io_service]
-The basic_socket_acceptor class template is used for accepting new socket connections.
+['Inherited from basic_io_object.]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+Get the io_service associated with the object.
-[*Shared] [*objects:] Unsafe.
+ boost::asio::io_service & get_io_service();
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
- acceptor.open(endpoint.protocol());
- acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen();
+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.
-[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:get_option basic_socket::get_option]
- 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);
+Get an option from the socket.
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.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket.get_option.overload1 get_option]``(
+ GettableSocketOption & option) const;
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);
+ 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_acceptor::accept (1 of 4 overloads)]
+[section:overload1 basic_socket::get_option (1 of 2 overloads)]
-Accept a new connection.
+Get an option from the socket.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer);
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option) const;
-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 get the current value of an option on the socket.
[heading Parameters]
@@ -14365,7 +14632,7 @@
[variablelist
-[[peer][The socket into which the new connection will be accepted.]]
+[[option][The option value to be obtained from the socket.]]
]
@@ -14380,12 +14647,13 @@
[heading Example]
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
boost::asio::ip::tcp::socket socket(io_service);
- acceptor.accept(socket);
+ ...
+ boost::asio::ip::tcp::socket::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
@@ -14396,18 +14664,18 @@
-[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)]
+[section:overload2 basic_socket::get_option (2 of 2 overloads)]
-Accept a new connection.
+Get an option from the socket.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
- boost::system::error_code & ec);
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
-This function is used to 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 get the current value of an option on the socket.
[heading Parameters]
@@ -14415,7 +14683,7 @@
[variablelist
-[[peer][The socket into which the new connection will be accepted.]]
+[[option][The option value to be obtained from the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -14423,17 +14691,18 @@
[heading Example]
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::soocket socket(io_service);
+ boost::asio::ip::tcp::socket::keep_alive option;
boost::system::error_code ec;
- acceptor.accept(socket, ec);
+ socket.get_option(option, ec);
if (ec)
{
// An error occurred.
}
+ bool is_set = option.get();
@@ -14443,19 +14712,66 @@
[endsect]
+[endsect]
-[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
-Accept a new connection and obtain the endpoint of the peer.
+[section:implementation basic_socket::implementation]
+
+
+['Inherited from basic_io_object.]
+
+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.
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+
+[endsect]
+
+
+[section:io_control basic_socket::io_control]
+
+Perform an IO control command on the socket.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- void accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint);
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void ``[link boost_asio.reference.basic_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]``(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+
+
+[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);
-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 execute an IO control command on the socket.
[heading Parameters]
@@ -14463,9 +14779,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.]]
+[[command][The IO control command to be performed on the socket.]]
]
@@ -14480,13 +14794,13 @@
[heading Example]
+Getting the number of bytes ready to read:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint;
- acceptor.accept(socket, endpoint);
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
@@ -14497,19 +14811,18 @@
-[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)]
+[section:overload2 basic_socket::io_control (2 of 2 overloads)]
-Accept a new connection and obtain the endpoint of the peer.
+Perform an IO control command on the socket.
template<
- typename ``[link boost_asio.reference.SocketService SocketService]``>
- boost::system::error_code accept(
- basic_socket< protocol_type, SocketService > & peer,
- endpoint_type & peer_endpoint,
+ 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 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 execute an IO control command on the socket.
[heading Parameters]
@@ -14517,9 +14830,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.]]
+[[command][The IO control command to be performed on the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -14527,18 +14838,18 @@
[heading Example]
+Getting the number of bytes ready to read:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint;
+ ...
+ boost::asio::ip::tcp::socket::bytes_readable command;
boost::system::error_code ec;
- acceptor.accept(socket, endpoint, ec);
+ socket.io_control(command, ec);
if (ec)
{
// An error occurred.
}
+ std::size_t bytes_readable = command.get();
@@ -14550,121 +14861,75 @@
[endsect]
-[section:assign basic_socket_acceptor::assign]
-Assigns an existing native acceptor to the acceptor.
+[section:io_service basic_socket::io_service]
- void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_acceptor);
- 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);
+['Inherited from basic_io_object.]
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
-[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
+ boost::asio::io_service & io_service();
-Assigns an existing native acceptor to the acceptor.
- void assign(
- const protocol_type & protocol,
- const native_type & native_acceptor);
+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]
+[endsect]
-[section:overload2 basic_socket_acceptor::assign (2 of 2 overloads)]
-Assigns an existing native acceptor to the acceptor.
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_acceptor,
- boost::system::error_code & ec);
+[section:is_open basic_socket::is_open]
+Determine whether the socket is open.
+ bool is_open() const;
-[endsect]
[endsect]
-[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:keep_alive basic_socket::keep_alive]
-[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
+['Inherited from socket_base.]
-Start an asynchronous accept.
+Socket option to send keep-alives.
- 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);
+ typedef implementation_defined keep_alive;
-This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[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.
- );
-
-``
-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().]]
+Setting the option:
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
-[heading Example]
-
- void accept_handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Accept succeeded.
- }
- }
- ...
+Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::socket socket(io_service);
- acceptor.async_accept(socket, accept_handler);
+ boost::asio::socket_base::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.value();
@@ -14675,107 +14940,108 @@
-[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
+[section:linger basic_socket::linger]
-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);
+['Inherited from socket_base.]
+Socket option to specify whether the socket lingers on close if unsent data is present.
-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.
+ typedef implementation_defined linger;
-[heading Parameters]
-
-[variablelist
-
-[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
-[[peer_endpoint][An endpoint object into which the endpoint of the remote peer will be written. Ownership of the peer\_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
-[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error // Result of operation.
- );
+[heading Examples]
+
+Setting the option:
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post(). ]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::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]
[endsect]
-[section:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
-Construct an acceptor without opening it.
+[section:local_endpoint basic_socket::local_endpoint]
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload1 basic_socket_acceptor]``(
- boost::asio::io_service & io_service);
+Get the local endpoint of the socket.
- ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload2 basic_socket_acceptor]``(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload1 local_endpoint]``() const;
- ``[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);
+ endpoint_type ``[link boost_asio.reference.basic_socket.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
- ``[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:overload1 basic_socket::local_endpoint (1 of 2 overloads)]
-[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
+Get the local endpoint of the socket.
-Construct an acceptor without opening it.
+ endpoint_type local_endpoint() const;
- basic_socket_acceptor(
- boost::asio::io_service & io_service);
+This function is used to obtain the locally bound endpoint of the socket.
-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 Return Value]
+
+An object that represents the local endpoint of the socket.
-[heading Parameters]
+[heading Exceptions]
[variablelist
-[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+
+
+
+
[endsect]
-[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
+[section:overload2 basic_socket::local_endpoint (2 of 2 overloads)]
-Construct an open acceptor.
+Get the local endpoint of the socket.
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol);
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
-This constructor creates an acceptor and automatically opens it.
+This function is used to obtain the locally bound endpoint of the socket.
[heading Parameters]
@@ -14783,264 +15049,436 @@
[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.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Exceptions]
-
+[heading Return Value]
+
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure. ]]
-]
+ 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:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
-Construct an acceptor opened on the given endpoint.
+[endsect]
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint,
- bool reuse_addr = true);
+[endsect]
-This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
+[section:lowest_layer basic_socket::lowest_layer]
-[heading Parameters]
-
+Get a reference to the lowest layer.
-[variablelist
-
-[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
+ lowest_layer_type & lowest_layer();
-[[endpoint][An endpoint on the local machine on which the acceptor will listen for new connections.]]
-[[reuse_addr][Whether the constructor should set the socket option socket\_base::reuse\_address.]]
+This function 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 Exceptions]
-
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Remarks]
-
-This constructor is equivalent to the following code:
+[endsect]
- 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);
+[section:lowest_layer_type basic_socket::lowest_layer_type]
+A basic_socket is always the lowest layer.
+ typedef basic_socket< Protocol, SocketService > lowest_layer_type;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
-[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
+ [
-Construct a basic_socket_acceptor on an existing native acceptor.
+ [[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. ]
+
+ ]
- basic_socket_acceptor(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_acceptor);
+ [
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
-This constructor creates an acceptor object to hold an existing native acceptor.
+ [
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
-[[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.]]
+ [
-[[native_acceptor][A native acceptor.]]
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-]
+ [
-[heading Exceptions]
-
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
-[variablelist
+ [
+
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
-[[boost::system::system_error][Thrown on failure. ]]
+ ]
-]
+ [
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
-[section:bind basic_socket_acceptor::bind]
+ [
-Bind the acceptor to the given local endpoint.
+ [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [The native representation of a socket. ]
+
+ ]
- void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+ [
- 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_socket.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the socket. ]
+
+ ]
+ [
-[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
+ [[link boost_asio.reference.basic_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
-Bind the acceptor to the given local endpoint.
+ [
- void bind(
- const endpoint_type & endpoint);
+ [[link boost_asio.reference.basic_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+ [
-This function binds the socket acceptor to the specified endpoint on the local machine.
+ [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+ [
-[heading Parameters]
-
+ [[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. ]
+
+ ]
-[variablelist
+ [
+
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+ ]
-]
+ [
-[heading Exceptions]
-
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-[variablelist
+ [
+
+ [[link boost_asio.reference.basic_socket.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 Example]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+ ]
+]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
- acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
+[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. ]
+ ]
-[endsect]
+ [
+ [[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. ]
+ ]
-[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
+]
-Bind the acceptor to the given local endpoint.
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
- boost::system::error_code bind(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ [
+ [[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. ]
+ ]
-This function binds the socket acceptor to the specified endpoint on the local machine.
+]
+The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
-[heading Parameters]
-
-[variablelist
+[heading Thread Safety]
-[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
+[*Distinct] [*objects:] Safe.
-[[ec][Set to indicate what error occurred, if any.]]
+[*Shared] [*objects:] Unsafe.
-]
-[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]
+[section:max_connections basic_socket::max_connections]
+['Inherited from socket_base.]
-[endsect]
+The maximum length of the queue of pending incoming connections.
+ static const int max_connections = implementation_defined;
-[endsect]
-[section:broadcast basic_socket_acceptor::broadcast]
+[endsect]
-['Inherited from socket_base.]
-Socket option to permit sending of broadcast messages.
+[section:message_do_not_route basic_socket::message_do_not_route]
- typedef implementation_defined broadcast;
+['Inherited from socket_base.]
+Specify that the data should not be subject to routing.
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+ static const int message_do_not_route = implementation_defined;
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+[endsect]
+[section:message_flags basic_socket::message_flags]
-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();
+['Inherited from socket_base.]
+Bitmask type for flags that can be passed to send and receive operations.
+ typedef int message_flags;
@@ -15049,66 +15487,56 @@
-[section:bytes_readable basic_socket_acceptor::bytes_readable]
+[section:message_out_of_band basic_socket::message_out_of_band]
['Inherited from socket_base.]
-IO control command to get the amount of data that can be read without blocking.
+Process out-of-band data.
- typedef implementation_defined bytes_readable;
+ static const int message_out_of_band = implementation_defined;
-Implements the FIONREAD IO control command.
+[endsect]
-[heading Example]
-
+[section:message_peek basic_socket::message_peek]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+['Inherited from socket_base.]
+Peek at incoming data without removing it from the input queue.
+ static const int message_peek = implementation_defined;
[endsect]
-[section:cancel basic_socket_acceptor::cancel]
-Cancel all asynchronous operations associated with the acceptor.
+[section:native basic_socket::native]
- void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
+Get the native socket representation.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
+ native_type native();
-[section:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
-Cancel all asynchronous operations associated with the acceptor.
- void cancel();
+[endsect]
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+[section:native_type basic_socket::native_type]
-[heading Exceptions]
-
+The native representation of a socket.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef SocketService::native_type native_type;
-]
@@ -15116,81 +15544,104 @@
-[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
+[section:non_blocking_io basic_socket::non_blocking_io]
-Cancel all asynchronous operations associated with the acceptor.
- boost::system::error_code cancel(
- boost::system::error_code & ec);
+['Inherited from socket_base.]
+IO control command to set the blocking mode of the socket.
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+ typedef implementation_defined non_blocking_io;
-[heading Parameters]
-
-[variablelist
+Implements the FIONBIO IO control command.
+
+
+[heading Example]
-[[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);
+
-[endsect]
[endsect]
-[section:close basic_socket_acceptor::close]
-Close the acceptor.
+[section:open basic_socket::open]
- void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
+Open the socket using the specified protocol.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
+ 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.open.overload2 open]``(
+ const protocol_type & protocol,
boost::system::error_code & ec);
-[section:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
+[section:overload1 basic_socket::open (1 of 2 overloads)]
-Close the acceptor.
+Open the socket using the specified protocol.
- void close();
+ void open(
+ const protocol_type & protocol = protocol_type());
-This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
+This function opens the socket so that it will use the specified protocol.
-A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.
+[heading Parameters]
+
+
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
+
+]
[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_socket_acceptor::close (2 of 2 overloads)]
+[section:overload2 basic_socket::open (2 of 2 overloads)]
-Close the acceptor.
+Open the socket using the specified protocol.
- boost::system::error_code close(
+ boost::system::error_code open(
+ const protocol_type & protocol,
boost::system::error_code & ec);
-This function is used to close the 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 opens the socket so that it will use the specified protocol.
[heading Parameters]
@@ -15198,6 +15649,8 @@
[variablelist
+[[protocol][An object specifying which protocol is to be used.]]
+
[[ec][Set to indicate what error occurred, if any.]]
]
@@ -15206,10 +15659,9 @@
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
+ boost::asio::ip::tcp::socket socket(io_service);
boost::system::error_code ec;
- acceptor.close(ec);
+ socket.open(boost::asio::ip::tcp::v4(), ec);
if (ec)
{
// An error occurred.
@@ -15226,41 +15678,11 @@
[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();
+[section:protocol_type basic_socket::protocol_type]
+The protocol type.
+ typedef Protocol protocol_type;
@@ -15269,27 +15691,27 @@
-[section:do_not_route basic_socket_acceptor::do_not_route]
+[section:receive_buffer_size basic_socket::receive_buffer_size]
['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
+Socket option for the receive buffer size of a socket.
- typedef implementation_defined do_not_route;
+ typedef implementation_defined receive_buffer_size;
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
[heading Examples]
Setting the option:
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::do_not_route option(true);
+ boost::asio::socket_base::receive_buffer_size option(8192);
socket.set_option(option);
@@ -15297,11 +15719,11 @@
Getting the current option value:
- boost::asio::ip::udp::socket socket(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::do_not_route option;
+ boost::asio::socket_base::receive_buffer_size option;
socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
@@ -15312,39 +15734,39 @@
-[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
+[section:receive_low_watermark basic_socket::receive_low_watermark]
['Inherited from socket_base.]
-Socket option to report aborted connections on accept.
+Socket option for the receive low watermark.
- typedef implementation_defined enable_connection_aborted;
+ typedef implementation_defined receive_low_watermark;
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with boost::asio::error::connection\_aborted. By default the option is false.
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
[heading Examples]
Setting the option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
+ boost::asio::socket_base::receive_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
@@ -15354,79 +15776,29 @@
[endsect]
+[section:remote_endpoint basic_socket::remote_endpoint]
-[section:endpoint_type basic_socket_acceptor::endpoint_type]
-
-The endpoint type.
-
- typedef Protocol::endpoint endpoint_type;
-
-
-
-
-[endsect]
-
+Get the remote endpoint of the socket.
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload1 remote_endpoint]``() const;
-[section:get_io_service basic_socket_acceptor::get_io_service]
+ endpoint_type ``[link boost_asio.reference.basic_socket.remote_endpoint.overload2 remote_endpoint]``(
+ boost::system::error_code & ec) const;
-['Inherited from basic_io_object.]
+[section:overload1 basic_socket::remote_endpoint (1 of 2 overloads)]
-Get the io_service associated with the object.
+Get the remote endpoint of the socket.
- boost::asio::io_service & get_io_service();
+ endpoint_type remote_endpoint() const;
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+This function is used to obtain the remote endpoint of 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:get_option basic_socket_acceptor::get_option]
-
-Get an option from the acceptor.
-
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
- GettableSocketOption & 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,
- boost::system::error_code & ec);
-
-
-[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
-
-Get an option from the acceptor.
-
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- void get_option(
- GettableSocketOption & option);
-
-
-This function is used to get the current value of an option on the acceptor.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[option][The option value to be obtained from the acceptor.]]
-
-]
+An object that represents the remote endpoint of the socket.
[heading Exceptions]
@@ -15439,13 +15811,11 @@
[heading Example]
-Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::acceptor::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.get();
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
@@ -15456,18 +15826,15 @@
-[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
+[section:overload2 basic_socket::remote_endpoint (2 of 2 overloads)]
-Get an option from the acceptor.
+Get the remote endpoint of the socket.
- template<
- typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec);
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
-This function is used to get the current value of an option on the acceptor.
+This function is used to obtain the remote endpoint of the socket.
[heading Parameters]
@@ -15475,26 +15842,26 @@
[variablelist
-[[option][The option value to be obtained from the acceptor.]]
-
[[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]
-Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::acceptor::reuse_address option;
boost::system::error_code ec;
- acceptor.get_option(option, ec);
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
if (ec)
{
// An error occurred.
}
- bool is_set = option.get();
@@ -15507,29 +15874,41 @@
[endsect]
-[section:implementation basic_socket_acceptor::implementation]
+[section:reuse_address basic_socket::reuse_address]
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
-The underlying implementation of the I/O object.
+Socket option to allow the socket to be bound to an address that is already in use.
- implementation_type implementation;
+ typedef implementation_defined reuse_address;
-[endsect]
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Examples]
+
+Setting the option:
-[section:implementation_type basic_socket_acceptor::implementation_type]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
-['Inherited from basic_io_object.]
-The underlying implementation type of I/O object.
- typedef service_type::implementation_type implementation_type;
+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();
+
+
@@ -15538,34 +15917,42 @@
-[section:io_service basic_socket_acceptor::io_service]
+[section:send_buffer_size basic_socket::send_buffer_size]
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+Socket option for the send buffer size of a socket.
- boost::asio::io_service & io_service();
+ typedef implementation_defined send_buffer_size;
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
-[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.
+
+[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);
-[endsect]
+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();
-[section:is_open basic_socket_acceptor::is_open]
-Determine whether the acceptor is open.
- bool is_open() const;
@@ -15573,18 +15960,18 @@
-[section:keep_alive basic_socket_acceptor::keep_alive]
+[section:send_low_watermark basic_socket::send_low_watermark]
['Inherited from socket_base.]
-Socket option to send keep-alives.
+Socket option for the send low watermark.
- typedef implementation_defined keep_alive;
+ typedef implementation_defined send_low_watermark;
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
[heading Examples]
@@ -15593,7 +15980,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option(true);
+ boost::asio::socket_base::send_low_watermark option(1024);
socket.set_option(option);
@@ -15603,9 +15990,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option;
+ boost::asio::socket_base::send_low_watermark option;
socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
@@ -15616,42 +16003,29 @@
-[section:linger basic_socket_acceptor::linger]
-
-
-['Inherited from socket_base.]
-
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[section:service basic_socket::service]
- typedef implementation_defined linger;
+['Inherited from basic_io_object.]
+The service associated with the I/O object.
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+ service_type & service;
-[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);
+[endsect]
+[section:service_type basic_socket::service_type]
-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();
+['Inherited from basic_io_object.]
+The type of the service that will be used to provide I/O operations.
+ typedef SocketService service_type;
@@ -15659,27 +16033,33 @@
[endsect]
-[section:listen basic_socket_acceptor::listen]
+[section:set_option basic_socket::set_option]
-Place the acceptor into the state where it will listen for new connections.
+Set an option on the socket.
- void ``[link boost_asio.reference.basic_socket_acceptor.listen.overload1 listen]``(
- int backlog = socket_base::max_connections);
+ 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_acceptor.listen.overload2 listen]``(
- int backlog,
+ 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_acceptor::listen (1 of 2 overloads)]
+[section:overload1 basic_socket::set_option (1 of 2 overloads)]
-Place the acceptor into the state where it will listen for new connections.
+Set an option on the socket.
- void listen(
- int backlog = socket_base::max_connections);
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
-This function puts the socket acceptor into the state where it may accept new connections.
+This function is used to set an option on the socket.
[heading Parameters]
@@ -15687,7 +16067,7 @@
[variablelist
-[[backlog][The maximum length of the queue of pending connections.]]
+[[option][The new option value to be set on the socket.]]
]
@@ -15696,26 +16076,40 @@
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
+
+
+
+
[endsect]
-[section:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
+[section:overload2 basic_socket::set_option (2 of 2 overloads)]
-Place the acceptor into the state where it will listen for new connections.
+Set an option on the socket.
- boost::system::error_code listen(
- int backlog,
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
boost::system::error_code & ec);
-This function puts the socket acceptor into the state where it may accept new connections.
+This function is used to set an option on the socket.
[heading Parameters]
@@ -15723,7 +16117,7 @@
[variablelist
-[[backlog][The maximum length of the queue of pending connections.]]
+[[option][The new option value to be set on the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -15731,12 +16125,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::no_delay option(true);
boost::system::error_code ec;
- acceptor.listen(boost::asio::socket_base::max_connections, ec);
+ socket.set_option(option, ec);
if (ec)
{
// An error occurred.
@@ -15752,29 +16147,37 @@
[endsect]
-[section:local_endpoint basic_socket_acceptor::local_endpoint]
+[section:shutdown basic_socket::shutdown]
-Get the local endpoint of the acceptor.
+Disable sends or receives on the socket.
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
+ void ``[link boost_asio.reference.basic_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
- endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
- boost::system::error_code & ec) const;
+ 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_acceptor::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_socket::shutdown (1 of 2 overloads)]
-Get the local endpoint of the acceptor.
+Disable sends or receives on the socket.
- endpoint_type local_endpoint() const;
+ void shutdown(
+ shutdown_type what);
-This function is used to obtain the locally bound endpoint of the acceptor.
+This function is used to disable send operations, receive operations, or both.
-[heading Return Value]
-
-An object that represents the local endpoint of the acceptor.
+[heading Parameters]
+
+
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
+
+]
[heading Exceptions]
@@ -15787,11 +16190,11 @@
[heading Example]
+Shutting down the send side of the socket:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
@@ -15802,15 +16205,16 @@
-[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_socket::shutdown (2 of 2 overloads)]
-Get the local endpoint of the acceptor.
+Disable sends or receives on the socket.
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
+ boost::system::error_code shutdown(
+ shutdown_type what,
+ boost::system::error_code & ec);
-This function is used to obtain the locally bound endpoint of the acceptor.
+This function is used to disable send operations, receive operations, or both.
[heading Parameters]
@@ -15818,22 +16222,20 @@
[variablelist
+[[what][Determines what types of operation will no longer be allowed.]]
+
[[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]
+Shutting down the send side of the socket:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::socket socket(io_service);
...
boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
if (ec)
{
// An error occurred.
@@ -15850,14 +16252,34 @@
[endsect]
-[section:max_connections basic_socket_acceptor::max_connections]
+[section:shutdown_type basic_socket::shutdown_type]
['Inherited from socket_base.]
-The maximum length of the queue of pending incoming connections.
+Different ways a socket may be shutdown.
- static const int max_connections = implementation_defined;
+ 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. ]
+ ]
+
+]
@@ -15865,146 +16287,370 @@
-[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
+[section:_basic_socket basic_socket::~basic_socket]
+Protected destructor to prevent deletion through this type.
-['Inherited from socket_base.]
+ ~basic_socket();
-Specify that the data should not be subject to routing.
- static const int message_do_not_route = implementation_defined;
+
+[endsect]
[endsect]
+[section:basic_socket_acceptor basic_socket_acceptor]
+Provides the ability to accept new connections.
-[section:message_flags basic_socket_acceptor::message_flags]
+ 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
-['Inherited from socket_base.]
+[heading Types]
+[table
+ [[Name][Description]]
-Bitmask type for flags that can be passed to send and receive operations.
+ [
- typedef int message_flags;
+ [[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. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-['Inherited from socket_base.]
+ [
-Process out-of-band data.
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
- static const int message_out_of_band = implementation_defined;
+ [
+ [[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. ]
+
+ ]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
-[section:message_peek basic_socket_acceptor::message_peek]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
-['Inherited from socket_base.]
+ [
-Peek at incoming data without removing it from the input queue.
+ [[link boost_asio.reference.basic_socket_acceptor.native_type [*native_type]]]
+ [The native representation of an acceptor. ]
+
+ ]
- static const int message_peek = implementation_defined;
+ [
+ [[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. ]
+
+ ]
-[section:native basic_socket_acceptor::native]
+ [
-Get the native acceptor representation.
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
- native_type native();
+ [
+ [[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. ]
+
+ ]
-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.
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+ [
-[section:native_type basic_socket_acceptor::native_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. ]
+
+ ]
-The native representation of an acceptor.
+ [
- typedef SocketAcceptorService::native_type native_type;
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
-[endsect]
+[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. ]
+ ]
-[section:non_blocking_io basic_socket_acceptor::non_blocking_io]
+ [
+ [[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. ]
+ ]
-['Inherited from socket_base.]
+]
-IO control command to set the blocking mode of the socket.
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
- typedef implementation_defined non_blocking_io;
+ [
+ [[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. ]
+ ]
+]
-Implements the FIONBIO IO control command.
+The basic_socket_acceptor class template is used for accepting new socket connections.
-[heading Example]
+[heading Thread Safety]
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::non_blocking_io command(true);
- socket.io_control(command);
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
-[endsect]
+[section:accept basic_socket_acceptor::accept]
+Accept a new connection.
-[section:open basic_socket_acceptor::open]
+ 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);
-Open the acceptor using the specified protocol.
+ 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);
- void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
+ 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);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
- const protocol_type & protocol,
+ 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);
-[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::accept (1 of 4 overloads)]
-Open the acceptor using the specified protocol.
+Accept a new connection.
- void open(
- const protocol_type & protocol = protocol_type());
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer);
-This function opens the socket acceptor so that it will use the specified protocol.
+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]
@@ -16012,7 +16658,7 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
+[[peer][The socket into which the new connection will be accepted.]]
]
@@ -16030,7 +16676,9 @@
boost::asio::ip::tcp::acceptor acceptor(io_service);
- acceptor.open(boost::asio::ip::tcp::v4());
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ acceptor.accept(socket);
@@ -16041,16 +16689,18 @@
-[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
+[section:overload2 basic_socket_acceptor::accept (2 of 4 overloads)]
-Open the acceptor using the specified protocol.
+Accept a new connection.
- boost::system::error_code open(
- const protocol_type & protocol,
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
+ basic_socket< protocol_type, SocketService > & peer,
boost::system::error_code & ec);
-This function opens the socket acceptor so that it will use the specified protocol.
+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]
@@ -16058,7 +16708,7 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
+[[peer][The socket into which the new connection will be accepted.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -16069,8 +16719,10 @@
boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::soocket socket(io_service);
boost::system::error_code ec;
- acceptor.open(boost::asio::ip::tcp::v4(), ec);
+ acceptor.accept(socket, ec);
if (ec)
{
// An error occurred.
@@ -16084,55 +16736,50 @@
[endsect]
-[endsect]
-
-
-[section:protocol_type basic_socket_acceptor::protocol_type]
-
-The protocol type.
-
- typedef Protocol protocol_type;
-
-
-
-
-[endsect]
+[section:overload3 basic_socket_acceptor::accept (3 of 4 overloads)]
+Accept a new connection and obtain the endpoint of the peer.
-[section:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ void accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint);
-['Inherited from socket_base.]
+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.
-Socket option for the receive buffer size of a socket.
- typedef implementation_defined receive_buffer_size;
+[heading Parameters]
+
+[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.]]
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+]
+[heading Exceptions]
+
-[heading Examples]
+[variablelist
-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::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::acceptor acceptor(io_service);
...
- boost::asio::socket_base::receive_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;
+ acceptor.accept(socket, endpoint);
@@ -16143,39 +16790,48 @@
-[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
-
-
-['Inherited from socket_base.]
+[section:overload4 basic_socket_acceptor::accept (4 of 4 overloads)]
-Socket option for the receive low watermark.
+Accept a new connection and obtain the endpoint of the peer.
- typedef implementation_defined receive_low_watermark;
+ template<
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type & peer_endpoint,
+ boost::system::error_code & ec);
+This function 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.
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[peer][The socket into which the new connection will be accepted.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+[[peer_endpoint][An endpoint object which will receive the endpoint of the remote peer.]]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Example]
+
-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::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+ 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.
+ }
@@ -16185,83 +16841,123 @@
[endsect]
+[endsect]
-[section:reuse_address basic_socket_acceptor::reuse_address]
-
-
-['Inherited from socket_base.]
+[section:assign basic_socket_acceptor::assign]
-Socket option to allow the socket to be bound to an address that is already in use.
+Assigns an existing native acceptor to the acceptor.
- typedef implementation_defined reuse_address;
+ void ``[link boost_asio.reference.basic_socket_acceptor.assign.overload1 assign]``(
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
+ 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);
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[section:overload1 basic_socket_acceptor::assign (1 of 2 overloads)]
+Assigns an existing native acceptor to the acceptor.
-[heading Examples]
-
-Setting the option:
+ void assign(
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[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_acceptor::assign (2 of 2 overloads)]
+
+Assigns an existing native acceptor to the acceptor.
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_acceptor,
+ boost::system::error_code & ec);
+[endsect]
[endsect]
+[section:async_accept basic_socket_acceptor::async_accept]
+Start an asynchronous accept.
-[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
+ 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);
-['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+[section:overload1 basic_socket_acceptor::async_accept (1 of 2 overloads)]
- typedef implementation_defined send_buffer_size;
+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);
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+This function is used to asynchronously accept a new connection into a socket. The function call always returns immediately.
-[heading Examples]
+[heading Parameters]
+
+
+[variablelist
-Setting the option:
+[[peer][The socket into which the new connection will be accepted. Ownership of the peer object is retained by the caller, which must guarantee that it is valid until the handler is called.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
+[[handler][The handler to be called when the accept operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error // Result of operation.
+ );
+
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
+]
+[heading Example]
+
-Getting the current option value:
+ void accept_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Accept 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::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ acceptor.async_accept(socket, accept_handler);
@@ -16272,57 +16968,90 @@
-[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
+[section:overload2 basic_socket_acceptor::async_accept (2 of 2 overloads)]
+Start an asynchronous accept.
-['Inherited from socket_base.]
+ 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);
-Socket option for the send low watermark.
- typedef implementation_defined send_low_watermark;
+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]
+
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+[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.]]
-[heading Examples]
-
-Setting the option:
+[[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.
+ );
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_low_watermark option(1024);
- socket.set_option(option);
+``
+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]
-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:basic_socket_acceptor basic_socket_acceptor::basic_socket_acceptor]
+Construct an acceptor without opening it.
+ ``[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);
+ ``[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);
-[endsect]
+ ``[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor.overload4 basic_socket_acceptor]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
+[section:overload1 basic_socket_acceptor::basic_socket_acceptor (1 of 4 overloads)]
-[section:service basic_socket_acceptor::service]
+Construct an acceptor without opening it.
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service);
-['Inherited from basic_io_object.]
-The service associated with the I/O object.
+This constructor creates an acceptor without opening it to listen for new connections. The open() function must be called before the acceptor can accept new socket connections.
- service_type & service;
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor. ]]
+
+]
@@ -16330,48 +17059,55 @@
-[section:service_type basic_socket_acceptor::service_type]
+[section:overload2 basic_socket_acceptor::basic_socket_acceptor (2 of 4 overloads)]
+Construct an open acceptor.
-['Inherited from basic_io_object.]
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
-The type of the service that will be used to provide I/O operations.
- typedef SocketAcceptorService service_type;
+This constructor creates an acceptor and automatically opens it.
+
+
+[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.]]
+[[protocol][An object specifying protocol parameters to be used.]]
+]
-[endsect]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[section:set_option basic_socket_acceptor::set_option]
+]
-Set an option on the acceptor.
- 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);
+[endsect]
-[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
-Set an option on the acceptor.
+[section:overload3 basic_socket_acceptor::basic_socket_acceptor (3 of 4 overloads)]
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- void set_option(
- const SettableSocketOption & option);
+Construct an acceptor opened on the given endpoint.
+
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint,
+ bool reuse_addr = true);
-This function is used to set an option on the acceptor.
+This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
[heading Parameters]
@@ -16379,7 +17115,11 @@
[variablelist
-[[option][The new option value to be set on the acceptor.]]
+[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
+
+[[endpoint][An endpoint on the local machine on which the acceptor will listen for new connections.]]
+
+[[reuse_addr][Whether the constructor should set the socket option socket\_base::reuse\_address.]]
]
@@ -16392,14 +17132,16 @@
]
-[heading Example]
-
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
+[heading Remarks]
+
+This constructor is equivalent to the following code:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::ip::tcp::acceptor::reuse_address option(true);
- acceptor.set_option(option);
+ 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);
@@ -16410,18 +17152,17 @@
-[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
+[section:overload4 basic_socket_acceptor::basic_socket_acceptor (4 of 4 overloads)]
-Set an option on the acceptor.
+Construct a basic_socket_acceptor on an existing native acceptor.
- template<
- typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+ basic_socket_acceptor(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol,
+ const native_type & native_acceptor);
-This function is used to set an option on the acceptor.
+This constructor creates an acceptor object to hold an existing native acceptor.
[heading Parameters]
@@ -16429,153 +17170,127 @@
[variablelist
-[[option][The new option value to be set on the acceptor.]]
+[[io_service][The io\_service object that the acceptor will use to dispatch handlers for any asynchronous operations performed on the acceptor.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[protocol][An object specifying protocol parameters to be used.]]
+
+[[native_acceptor][A native acceptor.]]
]
-[heading Example]
-
-Setting the SOL\_SOCKET/SO\_REUSEADDR option:
+[heading Exceptions]
+
- 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.
- }
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
+[endsect]
[endsect]
+[section:bind basic_socket_acceptor::bind]
-[endsect]
+Bind the acceptor to the given local endpoint.
+ void ``[link boost_asio.reference.basic_socket_acceptor.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
-[section:shutdown_type basic_socket_acceptor::shutdown_type]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.bind.overload2 bind]``(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
-['Inherited from socket_base.]
+[section:overload1 basic_socket_acceptor::bind (1 of 2 overloads)]
-Different ways a socket may be shutdown.
+Bind the acceptor to the given local endpoint.
- enum shutdown_type
+ void bind(
+ const endpoint_type & endpoint);
-[heading Values]
-[variablelist
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+This function binds the socket acceptor to the specified endpoint on the local machine.
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
+[heading Parameters]
+
+
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
]
+[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_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. ]
- ]
-
-]
+[endsect]
-[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]``();
+[section:overload2 basic_socket_acceptor::bind (2 of 2 overloads)]
- template<
- typename T1,
- ... ,
- typename TN>
- ``[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream.overload2 basic_socket_iostream]``(
- T1 t1,
- ... ,
- TN tn);
+Bind the acceptor to the given local endpoint.
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
-[section:overload1 basic_socket_iostream::basic_socket_iostream (1 of 2 overloads)]
-Construct a basic_socket_iostream without establishing a connection.
+This function binds the socket acceptor to the specified endpoint on the local machine.
- basic_socket_iostream();
+[heading Parameters]
+
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket acceptor will be bound.]]
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Example]
+
-[section:overload2 basic_socket_iostream::basic_socket_iostream (2 of 2 overloads)]
-Establish a connection to an endpoint corresponding to a resolver query.
+ 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.
+ }
+
- 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]
@@ -16584,44 +17299,42 @@
[endsect]
-[section:close basic_socket_iostream::close]
-
-Close the connection.
+[section:broadcast basic_socket_acceptor::broadcast]
- void close();
+['Inherited from socket_base.]
+Socket option to permit sending of broadcast messages.
-[endsect]
+ typedef implementation_defined broadcast;
-[section:connect basic_socket_iostream::connect]
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
-Establish a connection to an endpoint corresponding to a resolver query.
- template<
- typename T1,
- ... ,
- typename TN>
- void connect(
- T1 t1,
- ... ,
- TN tn);
+[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 automatically establishes a connection based on the supplied resolver query parameters. The arguments are used to construct a resolver query object.
-[endsect]
+Getting the current option value:
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[section:rdbuf basic_socket_iostream::rdbuf]
-Return a pointer to the underlying streambuf.
- basic_socket_streambuf< Protocol, StreamSocketService > * rdbuf() const;
@@ -16629,422 +17342,148 @@
-[endsect]
+[section:bytes_readable basic_socket_acceptor::bytes_readable]
-[section:basic_socket_streambuf basic_socket_streambuf]
-Iostream streambuf for a socket.
+['Inherited from socket_base.]
- 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 >
+IO control command to get the amount of data that can be read without blocking.
+ typedef implementation_defined bytes_readable;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+Implements the FIONREAD IO control command.
- [
- [[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);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
- [
- [[link boost_asio.reference.basic_socket_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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_streambuf.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+[section:cancel basic_socket_acceptor::cancel]
- [
+Cancel all asynchronous operations associated with the acceptor.
- [[link boost_asio.reference.basic_socket_streambuf.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
-
- ]
+ void ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload1 cancel]``();
- [
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
- [[link boost_asio.reference.basic_socket_streambuf.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
- [
+[section:overload1 basic_socket_acceptor::cancel (1 of 2 overloads)]
- [[link boost_asio.reference.basic_socket_streambuf.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+Cancel all asynchronous operations associated with the acceptor.
- [
+ void cancel();
- [[link boost_asio.reference.basic_socket_streambuf.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
- [
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
- [[link boost_asio.reference.basic_socket_streambuf.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.basic_socket_streambuf.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
+[variablelist
- ]
-
- [
+[[boost::system::system_error][Thrown on failure. ]]
- [[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. ]
-
- ]
- [
+[endsect]
- [[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_streambuf.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+[section:overload2 basic_socket_acceptor::cancel (2 of 2 overloads)]
- [
+Cancel all asynchronous operations associated with the acceptor.
- [[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. ]
-
- ]
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.basic_socket_streambuf.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
+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 Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
- [
- [[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. ]
- ]
+[variablelist
-]
-
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+[[ec][Set to indicate what error occurred, if any. ]]
- [
- [[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]
-[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. ]
- ]
-
-]
-[heading Protected Data Members]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.basic_socket_streambuf.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_streambuf.service [*service]]]
- [The service associated with the I/O object. ]
- ]
-]
+[endsect]
-[section:assign basic_socket_streambuf::assign]
+[section:close basic_socket_acceptor::close]
-Assign an existing native socket to the socket.
+Close the acceptor.
- void ``[link boost_asio.reference.basic_socket_streambuf.assign.overload1 assign]``(
- const protocol_type & protocol,
- const native_type & native_socket);
+ void ``[link boost_asio.reference.basic_socket_acceptor.close.overload1 close]``();
- 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 ``[link boost_asio.reference.basic_socket_acceptor.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::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:overload1 basic_socket_acceptor::close (1 of 2 overloads)]
+Close the acceptor.
+ void close();
-[section:overload2 basic_socket_streambuf::assign (2 of 2 overloads)]
+This function is used to close the acceptor. Any asynchronous accept operations will be cancelled immediately.
-['Inherited from basic_socket.]
+A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.
-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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-[endsect]
[endsect]
-[section:async_connect basic_socket_streambuf::async_connect]
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::close (2 of 2 overloads)]
-Start an asynchronous connect.
+Close the acceptor.
- void async_connect(
- const endpoint_type & peer_endpoint,
- ConnectHandler handler);
+ boost::system::error_code close(
+ 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.
+This function is used to close the acceptor. Any asynchronous accept operations will be cancelled 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.
+A subsequent call to open() is required before the acceptor can again be used to again perform socket accept operations.
[heading Parameters]
@@ -17052,16 +17491,7 @@
[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().]]
+[[ec][Set to indicate what error occurred, if any.]]
]
@@ -17069,64 +17499,62 @@
- void connect_handler(const boost::system::error_code& error)
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::system::error_code ec;
+ acceptor.close(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);
+[endsect]
[endsect]
-[section:at_mark basic_socket_streambuf::at_mark]
+[section:debug basic_socket_acceptor::debug]
-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;
+['Inherited from socket_base.]
- bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
- boost::system::error_code & ec) const;
+Socket option to enable socket-level debugging.
+ typedef implementation_defined debug;
-[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
-['Inherited from basic_socket.]
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
-Determine whether the socket is at the out-of-band data mark.
- bool at_mark() const;
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
-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]
-
+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();
+
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
@@ -17134,152 +17562,154 @@
-[section:overload2 basic_socket_streambuf::at_mark (2 of 2 overloads)]
+[section:do_not_route basic_socket_acceptor::do_not_route]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Determine whether the socket is at the out-of-band data mark.
+Socket option to prevent routing, use local interfaces only.
- bool at_mark(
- boost::system::error_code & ec) const;
+ typedef implementation_defined do_not_route;
-This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[ec][Set to indicate what error occurred, if any.]]
+Setting the option:
-]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
-[heading Return Value]
-
-A bool indicating whether the socket is at the out-of-band data mark.
-[endsect]
+Getting the current option value:
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[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;
+[endsect]
-[section:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:enable_connection_aborted basic_socket_acceptor::enable_connection_aborted]
-Determine the number of bytes available for reading.
- std::size_t available() const;
+['Inherited from socket_base.]
+Socket option to report aborted connections on accept.
-This function is used to determine the number of bytes that may be read without blocking.
+ typedef implementation_defined enable_connection_aborted;
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
-[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);
-[endsect]
+Getting the current option value:
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::enable_connection_aborted option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
-[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
-['Inherited from basic_socket.]
-Determine the number of bytes available for reading.
- std::size_t available(
- boost::system::error_code & ec) const;
+[endsect]
-This function is used to determine the number of bytes that may be read without blocking.
-[heading Parameters]
-
+[section:endpoint_type basic_socket_acceptor::endpoint_type]
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+The endpoint type.
-]
+ typedef Protocol::endpoint endpoint_type;
-[heading Return Value]
-
-The number of bytes that may be read without blocking, or 0 if an error occurs.
[endsect]
-[endsect]
-
-[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
+[section:get_io_service basic_socket_acceptor::get_io_service]
-Construct a basic_socket_streambuf without establishing a connection.
- basic_socket_streambuf();
+['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.
-[section:bind basic_socket_streambuf::bind]
-Bind the socket to the given 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.
- void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
- const endpoint_type & endpoint);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
+[section:get_option basic_socket_acceptor::get_option]
-['Inherited from basic_socket.]
+Get an option from the acceptor.
-Bind the socket to the given local endpoint.
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void ``[link boost_asio.reference.basic_socket_acceptor.get_option.overload1 get_option]``(
+ GettableSocketOption & option);
- void bind(
- const endpoint_type & endpoint);
+ 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);
-This function binds the socket to the specified endpoint on the local machine.
+[section:overload1 basic_socket_acceptor::get_option (1 of 2 overloads)]
+
+Get an option from the acceptor.
+
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ void get_option(
+ GettableSocketOption & option);
+
+
+This function is used to get the current value of an option on the acceptor.
[heading Parameters]
@@ -17287,7 +17717,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[option][The option value to be obtained from the acceptor.]]
]
@@ -17302,12 +17732,13 @@
[heading Example]
+Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
-
- 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::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.get();
@@ -17318,19 +17749,18 @@
-[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::get_option (2 of 2 overloads)]
-Bind the socket to the given local endpoint.
+Get an option from the acceptor.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
boost::system::error_code & ec);
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to get the current value of an option on the acceptor.
[heading Parameters]
@@ -17338,7 +17768,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[option][The option value to be obtained from the acceptor.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -17346,17 +17776,18 @@
[heading Example]
+Getting the value of the SOL\_SOCKET/SO\_REUSEADDR option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::acceptor::reuse_address option;
boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
+ acceptor.get_option(option, ec);
if (ec)
{
// An error occurred.
}
+ bool is_set = option.get();
@@ -17369,41 +17800,29 @@
[endsect]
-[section:broadcast basic_socket_streambuf::broadcast]
-
-
-['Inherited from socket_base.]
-
-Socket option to permit sending of broadcast messages.
+[section:implementation basic_socket_acceptor::implementation]
- typedef implementation_defined broadcast;
+['Inherited from basic_io_object.]
+The underlying implementation of the I/O object.
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+ implementation_type implementation;
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+[endsect]
+[section:implementation_type basic_socket_acceptor::implementation_type]
-Getting the current option value:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+['Inherited from basic_io_object.]
+The underlying implementation type of I/O object.
+ typedef service_type::implementation_type implementation_type;
@@ -17412,178 +17831,184 @@
-[section:bytes_readable basic_socket_streambuf::bytes_readable]
-
-
-['Inherited from socket_base.]
+[section:io_service basic_socket_acceptor::io_service]
-IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined bytes_readable;
+['Inherited from basic_io_object.]
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-Implements the FIONREAD IO control command.
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-[heading Example]
-
+[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.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::bytes_readable command(true);
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+[endsect]
+[section:is_open basic_socket_acceptor::is_open]
-[endsect]
+Determine whether the acceptor is open.
+ bool is_open() const;
-[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]``();
+[endsect]
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
- boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
+[section:keep_alive basic_socket_acceptor::keep_alive]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Cancel all asynchronous operations associated with the socket.
+Socket option to send keep-alives.
- void cancel();
+ typedef implementation_defined keep_alive;
-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\_KEEPALIVE socket option.
-[heading Exceptions]
-
-[variablelist
+[heading Examples]
-[[boost::system::system_error][Thrown on failure.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.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::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option;
+ socket.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:linger basic_socket_acceptor::linger]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Cancel all asynchronous operations associated with the socket.
+Socket option to specify whether the socket lingers on close if unsent data is present.
- boost::system::error_code cancel(
- boost::system::error_code & ec);
+ typedef implementation_defined linger;
-This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
+Setting the 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:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
-* 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:
-* Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP.
+ 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();
-* 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.
+[section:listen basic_socket_acceptor::listen]
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
+Place the acceptor into the state where it will listen for new connections.
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
+ 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);
-[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::listen (1 of 2 overloads)]
-Close the connection.
+Place the acceptor into the state where it will listen for new connections.
- basic_socket_streambuf< Protocol, StreamSocketService > * close();
+ void listen(
+ int backlog = socket_base::max_connections);
+This function puts the socket acceptor into the state where it may accept new connections.
-[heading Return Value]
-
-this if a connection was successfully established, a null pointer otherwise.
+[heading Parameters]
+
+[variablelist
+
+[[backlog][The maximum length of the queue of pending connections.]]
-[endsect]
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[section:overload2 basic_socket_streambuf::close (2 of 2 overloads)]
+]
-['Inherited from basic_socket.]
-Close the socket.
+[endsect]
- boost::system::error_code close(
+
+
+[section:overload2 basic_socket_acceptor::listen (2 of 2 overloads)]
+
+Place the acceptor into the state where it will listen for new connections.
+
+ boost::system::error_code listen(
+ int backlog,
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 puts the socket acceptor into the state where it may accept new connections.
[heading Parameters]
@@ -17591,6 +18016,8 @@
[variablelist
+[[backlog][The maximum length of the queue of pending connections.]]
+
[[ec][Set to indicate what error occurred, if any.]]
]
@@ -17599,10 +18026,10 @@
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
boost::system::error_code ec;
- socket.close(ec);
+ acceptor.listen(boost::asio::socket_base::max_connections, ec);
if (ec)
{
// An error occurred.
@@ -17611,10 +18038,6 @@
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-
[endsect]
@@ -17622,68 +18045,49 @@
[endsect]
-[section:connect basic_socket_streambuf::connect]
-
-Establish a connection.
+[section:local_endpoint basic_socket_acceptor::local_endpoint]
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload1 connect]``(
- const endpoint_type & endpoint);
+Get the local endpoint of the acceptor.
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.connect.overload2 connect]``(
- T1 t1,
- ... ,
- TN tn);
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload1 local_endpoint]``() const;
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.connect.overload3 connect]``(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+ endpoint_type ``[link boost_asio.reference.basic_socket_acceptor.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
-[section:overload1 basic_socket_streambuf::connect (1 of 3 overloads)]
+[section:overload1 basic_socket_acceptor::local_endpoint (1 of 2 overloads)]
-Establish a connection.
+Get the local endpoint of the acceptor.
- basic_socket_streambuf< Protocol, StreamSocketService > * connect(
- const endpoint_type & endpoint);
+ endpoint_type local_endpoint() const;
-This function establishes a connection to the specified endpoint.
+This function is used to obtain the locally bound endpoint of the acceptor.
[heading Return Value]
-this if a connection was successfully established, a null pointer otherwise.
-
-
-
-[endsect]
+An object that represents the local endpoint of the acceptor.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[section:overload2 basic_socket_streambuf::connect (2 of 3 overloads)]
+]
-Establish a connection.
+[heading Example]
+
- template<
- typename T1,
- ... ,
- typename TN>
- basic_socket_streambuf< Protocol, StreamSocketService > * connect(
- T1 t1,
- ... ,
- TN tn);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
-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.
@@ -17691,21 +18095,15 @@
-[section:overload3 basic_socket_streambuf::connect (3 of 3 overloads)]
-
-
-['Inherited from basic_socket.]
-
-Connect the socket to the specified endpoint.
+[section:overload2 basic_socket_acceptor::local_endpoint (2 of 2 overloads)]
- boost::system::error_code connect(
- const endpoint_type & peer_endpoint,
- boost::system::error_code & ec);
+Get the local endpoint of the acceptor.
+ endpoint_type local_endpoint(
+ boost::system::error_code & ec) const;
-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.
+This function is used to obtain the locally bound endpoint of the acceptor.
[heading Parameters]
@@ -17713,21 +18111,22 @@
[variablelist
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-
[[ec][Set to indicate what error occurred, if any.]]
]
+[heading Return Value]
+
+An object that represents the local endpoint of the acceptor. Returns a default-constructed endpoint object if an error occurred and the error handler did not throw an exception.
+
[heading Example]
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
boost::system::error_code ec;
- socket.connect(endpoint, ec);
+ boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(ec);
if (ec)
{
// An error occurred.
@@ -17744,42 +18143,29 @@
[endsect]
-[section:debug basic_socket_streambuf::debug]
+[section:max_connections basic_socket_acceptor::max_connections]
['Inherited from socket_base.]
-Socket option to enable socket-level debugging.
-
- typedef implementation_defined debug;
-
-
-
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+The maximum length of the queue of pending incoming connections.
+ static const int max_connections = implementation_defined;
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+[endsect]
-Getting the current option value:
+[section:message_do_not_route basic_socket_acceptor::message_do_not_route]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option;
- socket.get_option(option);
- bool is_set = option.value();
+['Inherited from socket_base.]
+Specify that the data should not be subject to routing.
+ static const int message_do_not_route = implementation_defined;
@@ -17787,42 +18173,30 @@
-[section:do_not_route basic_socket_streambuf::do_not_route]
+[section:message_flags basic_socket_acceptor::message_flags]
['Inherited from socket_base.]
-Socket option to prevent routing, use local interfaces only.
-
- typedef implementation_defined do_not_route;
-
-
+Bitmask type for flags that can be passed to send and receive operations.
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+ typedef int message_flags;
-[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]
-Getting the current option value:
+[section:message_out_of_band basic_socket_acceptor::message_out_of_band]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option;
- socket.get_option(option);
- bool is_set = option.value();
+['Inherited from socket_base.]
+Process out-of-band data.
+ static const int message_out_of_band = implementation_defined;
@@ -17830,108 +18204,100 @@
-[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
+[section:message_peek basic_socket_acceptor::message_peek]
['Inherited from socket_base.]
-Socket option to report aborted connections on accept.
-
- typedef implementation_defined enable_connection_aborted;
+Peek at incoming data without removing it from the input queue.
+ static const int message_peek = implementation_defined;
-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.
+[endsect]
-[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);
+[section:native basic_socket_acceptor::native]
+Get the native acceptor representation.
+ native_type native();
-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();
+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]
-[endsect]
+The native representation of an acceptor.
+ typedef SocketAcceptorService::native_type native_type;
-[section:endpoint_type basic_socket_streambuf::endpoint_type]
-The endpoint type.
- typedef Protocol::endpoint endpoint_type;
+[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:get_io_service basic_socket_streambuf::get_io_service]
+ typedef implementation_defined non_blocking_io;
-['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+Implements the FIONBIO IO control command.
- boost::asio::io_service & get_io_service();
+[heading Example]
+
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+ 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 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_socket_streambuf::get_option]
+[endsect]
-Get an option from the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload1 get_option]``(
- GettableSocketOption & option) const;
+[section:open basic_socket_acceptor::open]
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.get_option.overload2 get_option]``(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+Open the acceptor using the specified protocol.
+ void ``[link boost_asio.reference.basic_socket_acceptor.open.overload1 open]``(
+ const protocol_type & protocol = protocol_type());
-[section:overload1 basic_socket_streambuf::get_option (1 of 2 overloads)]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_acceptor.open.overload2 open]``(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
-['Inherited from basic_socket.]
+[section:overload1 basic_socket_acceptor::open (1 of 2 overloads)]
-Get an option from the socket.
+Open the acceptor using the specified protocol.
- void get_option(
- GettableSocketOption & option) const;
+ void open(
+ const protocol_type & protocol = protocol_type());
-This function is used to get the current value of an option on the socket.
+This function opens the socket acceptor so that it will use the specified protocol.
[heading Parameters]
@@ -17939,7 +18305,7 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
+[[protocol][An object specifying which protocol is to be used.]]
]
@@ -17954,36 +18320,30 @@
[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();
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ acceptor.open(boost::asio::ip::tcp::v4());
-[endsect]
+[endsect]
-[section:overload2 basic_socket_streambuf::get_option (2 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::open (2 of 2 overloads)]
-Get an option from the socket.
+Open the acceptor using the specified protocol.
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
-This function is used to get the current value of an option on the socket.
+This function opens the socket acceptor so that it will use the specified protocol.
[heading Parameters]
@@ -17991,7 +18351,7 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
+[[protocol][An object specifying which protocol is to be used.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -17999,18 +18359,15 @@
[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::asio::ip::tcp::acceptor acceptor(io_service);
boost::system::error_code ec;
- socket.get_option(option, ec);
+ acceptor.open(boost::asio::ip::tcp::v4(), ec);
if (ec)
{
// An error occurred.
}
- bool is_set = option.get();
@@ -18023,14 +18380,12 @@
[endsect]
-[section:implementation basic_socket_streambuf::implementation]
-
+[section:protocol_type basic_socket_acceptor::protocol_type]
-['Inherited from basic_io_object.]
+The protocol type.
-The underlying implementation of the I/O object.
+ typedef Protocol protocol_type;
- implementation_type implementation;
@@ -18038,167 +18393,171 @@
-[section:implementation_type basic_socket_streambuf::implementation_type]
+[section:receive_buffer_size basic_socket_acceptor::receive_buffer_size]
-['Inherited from basic_io_object.]
+['Inherited from socket_base.]
-The underlying implementation type of I/O object.
+Socket option for the receive buffer size of a socket.
- typedef service_type::implementation_type implementation_type;
+ typedef implementation_defined receive_buffer_size;
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
-[endsect]
+[heading Examples]
+
+Setting the option:
-[section:io_control basic_socket_streambuf::io_control]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
-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);
+Getting the current option value:
-[section:overload1 basic_socket_streambuf::io_control (1 of 2 overloads)]
+ 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.]
-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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[command][The IO control command to be performed on the socket.]]
+[section:receive_low_watermark basic_socket_acceptor::receive_low_watermark]
-]
-[heading Exceptions]
-
+['Inherited from socket_base.]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+Socket option for the receive low watermark.
-]
+ typedef implementation_defined receive_low_watermark;
-[heading Example]
+
+
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+
+
+[heading Examples]
-Getting the number of bytes ready to read:
+Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
+ 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::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:overload2 basic_socket_streambuf::io_control (2 of 2 overloads)]
-['Inherited from basic_socket.]
+[endsect]
-Perform an IO control command on the socket.
- boost::system::error_code io_control(
- IoControlCommand & command,
- boost::system::error_code & ec);
+[section:reuse_address basic_socket_acceptor::reuse_address]
-This function is used to execute an IO control command on the socket.
+['Inherited from socket_base.]
-[heading Parameters]
-
+Socket option to allow the socket to be bound to an address that is already in use.
-[variablelist
-
-[[command][The IO control command to be performed on the socket.]]
+ typedef implementation_defined reuse_address;
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Example]
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+
+
+[heading Examples]
-Getting the number of bytes ready to read:
+Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- boost::asio::ip::tcp::socket::bytes_readable command;
- boost::system::error_code ec;
- socket.io_control(command, ec);
- if (ec)
- {
- // An error occurred.
- }
- std::size_t bytes_readable = command.get();
+ 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]
[endsect]
-[section:io_service basic_socket_streambuf::io_service]
+[section:send_buffer_size basic_socket_acceptor::send_buffer_size]
-['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+['Inherited from socket_base.]
- boost::asio::io_service & io_service();
+Socket option for the send buffer size of a socket.
+ typedef implementation_defined send_buffer_size;
-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.
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+[heading Examples]
+
+Setting the option:
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
-[section:is_open basic_socket_streambuf::is_open]
+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();
-['Inherited from basic_socket.]
-Determine whether the socket is open.
- bool is_open() const;
@@ -18206,18 +18565,18 @@
-[section:keep_alive basic_socket_streambuf::keep_alive]
+[section:send_low_watermark basic_socket_acceptor::send_low_watermark]
['Inherited from socket_base.]
-Socket option to send keep-alives.
+Socket option for the send low watermark.
- typedef implementation_defined keep_alive;
+ typedef implementation_defined send_low_watermark;
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
[heading Examples]
@@ -18226,7 +18585,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option(true);
+ boost::asio::socket_base::send_low_watermark option(1024);
socket.set_option(option);
@@ -18236,9 +18595,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::keep_alive option;
+ boost::asio::socket_base::send_low_watermark option;
socket.get_option(option);
- bool is_set = option.value();
+ int size = option.value();
@@ -18249,42 +18608,29 @@
-[section:linger basic_socket_streambuf::linger]
-
-
-['Inherited from socket_base.]
-
-Socket option to specify whether the socket lingers on close if unsent data is present.
+[section:service basic_socket_acceptor::service]
- typedef implementation_defined linger;
+['Inherited from basic_io_object.]
+The service associated with the I/O object.
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+ service_type & service;
-[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);
+[endsect]
+[section:service_type basic_socket_acceptor::service_type]
-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();
+['Inherited from basic_io_object.]
+The type of the service that will be used to provide I/O operations.
+ typedef SocketAcceptorService service_type;
@@ -18292,32 +18638,43 @@
[endsect]
-[section:local_endpoint basic_socket_streambuf::local_endpoint]
+[section:set_option basic_socket_acceptor::set_option]
-Get the local endpoint of the socket.
+Set an option on the acceptor.
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload1 local_endpoint]``() 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);
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.local_endpoint.overload2 local_endpoint]``(
- 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_streambuf::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_socket_acceptor::set_option (1 of 2 overloads)]
+Set an option on the acceptor.
-['Inherited from basic_socket.]
+ template<
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ void set_option(
+ const SettableSocketOption & option);
-Get the local endpoint of the socket.
- endpoint_type local_endpoint() const;
+This function is used to set an option on the acceptor.
-This function is used to obtain the locally bound endpoint of the socket.
+[heading Parameters]
+
+[variablelist
+
+[[option][The new option value to be set on the acceptor.]]
-[heading Return Value]
-
-An object that represents the local endpoint of the socket.
+]
[heading Exceptions]
@@ -18330,11 +18687,12 @@
[heading Example]
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
-
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
+ acceptor.set_option(option);
@@ -18345,18 +18703,18 @@
-[section:overload2 basic_socket_streambuf::local_endpoint (2 of 2 overloads)]
-
-
-['Inherited from basic_socket.]
+[section:overload2 basic_socket_acceptor::set_option (2 of 2 overloads)]
-Get the local endpoint of the socket.
+Set an option on the acceptor.
- endpoint_type local_endpoint(
- boost::system::error_code & ec) const;
+ 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 obtain the locally bound endpoint of the socket.
+This function is used to set an option on the acceptor.
[heading Parameters]
@@ -18364,22 +18722,21 @@
[variablelist
+[[option][The new option value to be set on the acceptor.]]
+
[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Return Value]
-
-An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
-
[heading Example]
+Setting the SOL\_SOCKET/SO\_REUSEADDR option:
-
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
...
+ boost::asio::ip::tcp::acceptor::reuse_address option(true);
boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ acceptor.set_option(option, ec);
if (ec)
{
// An error occurred.
@@ -18396,22 +18753,34 @@
[endsect]
-[section:lowest_layer basic_socket_streambuf::lowest_layer]
+[section:shutdown_type basic_socket_acceptor::shutdown_type]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Get a reference to the lowest layer.
+Different ways a socket may be shutdown.
- lowest_layer_type & lowest_layer();
+ enum shutdown_type
+[heading Values]
+[variablelist
-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.
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
+
+]
@@ -18419,14 +18788,151 @@
-[section:lowest_layer_type basic_socket_streambuf::lowest_layer_type]
+[endsect]
+[section:basic_socket_iostream basic_socket_iostream]
-['Inherited from basic_socket.]
+Iostream interface for a socket.
-A basic_socket is always the lowest layer.
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.StreamSocketService StreamSocketService]`` = stream_socket_service<Protocol>>
+ class basic_socket_iostream
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_iostream.basic_socket_iostream [*basic_socket_iostream]]]
+ [Construct a basic_socket_iostream without establishing a connection. ]
+ ]
+
+ [
+ [[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]
+
+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]
+
+Close the connection.
+
+ void close();
+
+
+
+[endsect]
+
+
+
+[section:connect basic_socket_iostream::connect]
+
+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]
+
+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]
@@ -18435,147 +18941,147 @@
[
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [[link boost_asio.reference.basic_socket_streambuf.broadcast [*broadcast]]]
[Socket option to permit sending of broadcast messages. ]
]
[
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
+ [[link boost_asio.reference.basic_socket_streambuf.bytes_readable [*bytes_readable]]]
[IO control command to get the amount of data that can be read without blocking. ]
]
[
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket_streambuf.debug [*debug]]]
[Socket option to enable socket-level debugging. ]
]
[
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [[link boost_asio.reference.basic_socket_streambuf.do_not_route [*do_not_route]]]
[Socket option to prevent routing, use local interfaces only. ]
]
[
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [[link boost_asio.reference.basic_socket_streambuf.enable_connection_aborted [*enable_connection_aborted]]]
[Socket option to report aborted connections on accept. ]
]
[
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.implementation_type [*implementation_type]]]
[The underlying implementation type of I/O object. ]
]
[
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [[link boost_asio.reference.basic_socket_streambuf.keep_alive [*keep_alive]]]
[Socket option to send keep-alives. ]
]
[
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [[link boost_asio.reference.basic_socket_streambuf.linger [*linger]]]
[Socket option to specify whether the socket lingers on close if unsent data is present. ]
]
[
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.lowest_layer_type [*lowest_layer_type]]]
[A basic_socket is always the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [[link boost_asio.reference.basic_socket_streambuf.message_flags [*message_flags]]]
[Bitmask type for flags that can be passed to send and receive operations. ]
]
[
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_socket_streambuf.native_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. ]
]
@@ -18587,110 +19093,115 @@
[[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]
@@ -18698,8 +19209,23 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.basic_socket_streambuf.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]]]
+ []
]
]
@@ -18709,22 +19235,22 @@
[[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. ]
]
@@ -18735,26 +19261,41 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket_streambuf.implementation [*implementation]]]
[The underlying implementation of the I/O object. ]
]
[
- [[link boost_asio.reference.basic_socket.service [*service]]]
+ [[link boost_asio.reference.basic_socket_streambuf.service [*service]]]
[The service associated with the I/O object. ]
]
]
-The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+[section:assign basic_socket_streambuf::assign]
+Assign an existing native socket to the socket.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ 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:overload1 basic_socket_streambuf::assign (1 of 2 overloads)]
-[*Shared] [*objects:] Unsafe.
+['Inherited from basic_socket.]
+
+Assign an existing native socket to the socket.
+
+ void assign(
+ const protocol_type & protocol,
+ const native_type & native_socket);
@@ -18762,44 +19303,81 @@
-[section:max_connections basic_socket_streambuf::max_connections]
+[section:overload2 basic_socket_streambuf::assign (2 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;
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
[endsect]
+[endsect]
-[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
+[section:async_connect basic_socket_streambuf::async_connect]
-['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
+['Inherited from basic_socket.]
- static const int message_do_not_route = implementation_defined;
+Start an asynchronous connect.
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
-[endsect]
+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.
-[section:message_flags basic_socket_streambuf::message_flags]
+[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.]]
-['Inherited from socket_base.]
+[[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);
-Bitmask type for flags that can be passed to send and receive operations.
- typedef int message_flags;
@@ -18807,30 +19385,41 @@
[endsect]
+[section:at_mark basic_socket_streambuf::at_mark]
-[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
+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;
-['Inherited from socket_base.]
+ bool ``[link boost_asio.reference.basic_socket_streambuf.at_mark.overload2 at_mark]``(
+ boost::system::error_code & ec) const;
-Process out-of-band data.
- static const int message_out_of_band = implementation_defined;
+[section:overload1 basic_socket_streambuf::at_mark (1 of 2 overloads)]
+['Inherited from basic_socket.]
-[endsect]
+Determine whether the socket is at the out-of-band data mark.
+ bool at_mark() const;
-[section:message_peek basic_socket_streambuf::message_peek]
+This function is used to check whether the socket input is currently positioned at the out-of-band data mark.
-['Inherited from socket_base.]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
-Peek at incoming data without removing it from the input queue.
+[heading Exceptions]
+
- static const int message_peek = implementation_defined;
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
@@ -18838,32 +19427,75 @@
-[section:native basic_socket_streambuf::native]
+[section:overload2 basic_socket_streambuf::at_mark (2 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(
+ boost::system::error_code & ec) 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.
+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_socket_streambuf::available]
-[section:native_type basic_socket_streambuf::native_type]
+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:overload1 basic_socket_streambuf::available (1 of 2 overloads)]
['Inherited from basic_socket.]
-The native representation of a socket.
+Determine the number of bytes available for reading.
- typedef StreamSocketService::native_type native_type;
+ 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. ]]
+]
@@ -18871,61 +19503,76 @@
-[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
+[section:overload2 basic_socket_streambuf::available (2 of 2 overloads)]
-['Inherited from socket_base.]
+['Inherited from basic_socket.]
-IO control command to set the blocking mode of the socket.
+Determine the number of bytes available for reading.
- typedef implementation_defined non_blocking_io;
+ 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.
-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]
+
+The number of bytes that may be read without blocking, or 0 if an error occurs.
+
+
+
+[endsect]
+[endsect]
+
+
+[section:basic_socket_streambuf basic_socket_streambuf::basic_socket_streambuf]
+Construct a basic_socket_streambuf without establishing a connection.
+
+ basic_socket_streambuf();
[endsect]
-[section:open basic_socket_streambuf::open]
+[section:bind basic_socket_streambuf::bind]
-Open the socket using the specified protocol.
+Bind the socket to the given local endpoint.
- void ``[link boost_asio.reference.basic_socket_streambuf.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
+ void ``[link boost_asio.reference.basic_socket_streambuf.bind.overload1 bind]``(
+ const endpoint_type & endpoint);
- boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.open.overload2 open]``(
- const protocol_type & protocol,
+ 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_socket_streambuf::open (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::bind (1 of 2 overloads)]
['Inherited from basic_socket.]
-Open the socket using the specified protocol.
+Bind the socket to the given local endpoint.
- void open(
- const protocol_type & protocol = protocol_type());
+ void bind(
+ const endpoint_type & endpoint);
-This function opens the socket so that it will use the specified protocol.
+This function binds the socket to the specified endpoint on the local machine.
[heading Parameters]
@@ -18933,7 +19580,7 @@
[variablelist
-[[protocol][An object specifying protocol parameters to be used.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
]
@@ -18952,6 +19599,8 @@
boost::asio::ip::tcp::socket socket(io_service);
socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
@@ -18962,19 +19611,19 @@
-[section:overload2 basic_socket_streambuf::open (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::bind (2 of 2 overloads)]
['Inherited from basic_socket.]
-Open the socket using the specified protocol.
+Bind the socket to the given local endpoint.
- boost::system::error_code open(
- const protocol_type & protocol,
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
boost::system::error_code & ec);
-This function opens the socket so that it will use the specified protocol.
+This function binds the socket to the specified endpoint on the local machine.
[heading Parameters]
@@ -18982,7 +19631,7 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -18993,8 +19642,10 @@
boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
boost::system::error_code ec;
- socket.open(boost::asio::ip::tcp::v4(), ec);
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345), ec);
if (ec)
{
// An error occurred.
@@ -19011,56 +19662,27 @@
[endsect]
-[section:overflow basic_socket_streambuf::overflow]
-
-
-
- int_type overflow(
- int_type c);
-
-
-
-[endsect]
-
-
-
-[section:protocol_type basic_socket_streambuf::protocol_type]
-
-
-['Inherited from basic_socket.]
-
-The protocol type.
-
- typedef Protocol protocol_type;
-
-
-
-
-[endsect]
-
-
-
-[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
+[section:broadcast basic_socket_streambuf::broadcast]
['Inherited from socket_base.]
-Socket option for the receive buffer size of a socket.
+Socket option to permit sending of broadcast messages.
- typedef implementation_defined receive_buffer_size;
+ typedef implementation_defined broadcast;
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
[heading Examples]
Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::receive_buffer_size option(8192);
+ boost::asio::socket_base::broadcast option(true);
socket.set_option(option);
@@ -19068,11 +19690,11 @@
Getting the current option value:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::receive_buffer_size option;
+ boost::asio::socket_base::broadcast option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -19083,39 +19705,29 @@
-[section:receive_low_watermark basic_socket_streambuf::receive_low_watermark]
+[section:bytes_readable basic_socket_streambuf::bytes_readable]
['Inherited from socket_base.]
-Socket option for the receive low watermark.
+IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined receive_low_watermark;
+ typedef implementation_defined bytes_readable;
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+Implements the FIONREAD IO control command.
-[heading Examples]
+[heading Example]
-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();
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
@@ -19125,32 +19737,28 @@
[endsect]
-[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
+[section:cancel basic_socket_streambuf::cancel]
-Get the remote endpoint of the socket.
+Cancel all asynchronous operations associated with the socket.
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
+ void ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload1 cancel]``();
- endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
-[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::cancel (1 of 2 overloads)]
['Inherited from basic_socket.]
-Get the remote endpoint of the socket.
-
- endpoint_type remote_endpoint() const;
+Cancel all asynchronous operations associated with the socket.
+ void cancel();
-This function is used to obtain the remote endpoint of the socket.
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
-[heading Return Value]
-
-An object that represents the remote endpoint of the socket.
[heading Exceptions]
@@ -19161,35 +19769,40 @@
]
-[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:
+* It will only cancel asynchronous operations that were initiated in the current thread.
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+* 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_socket_streambuf::remote_endpoint (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::cancel (2 of 2 overloads)]
['Inherited from basic_socket.]
-Get the remote endpoint of the socket.
+Cancel all asynchronous operations associated with the socket.
- endpoint_type remote_endpoint(
- boost::system::error_code & ec) const;
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-This function is used to obtain the remote endpoint of the socket.
+This function causes all outstanding asynchronous connect, send and receive operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
[heading Parameters]
@@ -19201,26 +19814,22 @@
]
-[heading Return Value]
+[heading Remarks]
-An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+Calls to cancel() will always fail with boost::asio::error::operation\_not\_supported when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST\_ASIO\_ENABLE\_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use:
-[heading Example]
-
+* 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::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
- if (ec)
- {
- // An error occurred.
- }
+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]
@@ -19228,62 +19837,218 @@
[endsect]
+[section:close basic_socket_streambuf::close]
-[section:reuse_address basic_socket_streambuf::reuse_address]
+Close the connection.
+ basic_socket_streambuf< Protocol, StreamSocketService > * ``[link boost_asio.reference.basic_socket_streambuf.close.overload1 close]``();
-['Inherited from socket_base.]
+ boost::system::error_code ``[link boost_asio.reference.basic_socket_streambuf.close.overload2 close]``(
+ boost::system::error_code & ec);
-Socket option to allow the socket to be bound to an address that is already in use.
- typedef implementation_defined reuse_address;
+[section:overload1 basic_socket_streambuf::close (1 of 2 overloads)]
+Close the connection.
+ basic_socket_streambuf< Protocol, StreamSocketService > * close();
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
-[heading Examples]
-
-Setting the option:
+[heading Return Value]
+
+this if a connection was successfully established, a null pointer otherwise.
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[endsect]
-Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
+[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::asio::socket_base::reuse_address option;
- acceptor.get_option(option);
- bool is_set = option.value();
+ 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.
-[section:send_buffer_size basic_socket_streambuf::send_buffer_size]
+ 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 for the send buffer size of a socket.
+Socket option to enable socket-level debugging.
- typedef implementation_defined send_buffer_size;
+ typedef implementation_defined debug;
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
[heading Examples]
@@ -19292,7 +20057,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_buffer_size option(8192);
+ boost::asio::socket_base::debug option(true);
socket.set_option(option);
@@ -19302,9 +20067,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_buffer_size option;
+ boost::asio::socket_base::debug option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -19315,27 +20080,27 @@
-[section:send_low_watermark basic_socket_streambuf::send_low_watermark]
+[section:do_not_route basic_socket_streambuf::do_not_route]
['Inherited from socket_base.]
-Socket option for the send low watermark.
+Socket option to prevent routing, use local interfaces only.
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined do_not_route;
-Implements the SOL\_SOCKET/SO\_SNDLOWAT 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_low_watermark option(1024);
+ boost::asio::socket_base::do_not_route option(true);
socket.set_option(option);
@@ -19343,11 +20108,11 @@
Getting the current option value:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::send_low_watermark option;
+ boost::asio::socket_base::do_not_route option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -19358,14 +20123,42 @@
-[section:service basic_socket_streambuf::service]
+[section:enable_connection_aborted basic_socket_streambuf::enable_connection_aborted]
-['Inherited from basic_io_object.]
+['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();
+
-The service associated with the I/O object.
- service_type & service;
@@ -19373,45 +20166,65 @@
-[section:service_type basic_socket_streambuf::service_type]
+[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.]
-The type of the service that will be used to provide I/O operations.
+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.
- typedef StreamSocketService service_type;
+[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_socket_streambuf::set_option]
+[section:get_option basic_socket_streambuf::get_option]
-Set an option on the socket.
+Get an option from the socket.
- void ``[link boost_asio.reference.basic_socket_streambuf.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_socket_streambuf.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_socket_streambuf::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]
@@ -19419,7 +20232,7 @@
[variablelist
-[[option][The new option value to be set on the socket.]]
+[[option][The option value to be obtained from the socket.]]
]
@@ -19434,12 +20247,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();
@@ -19450,19 +20264,19 @@
-[section:overload2 basic_socket_streambuf::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]
@@ -19470,7 +20284,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.]]
@@ -19478,17 +20292,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();
@@ -19501,43 +20316,60 @@
[endsect]
-[section:setbuf basic_socket_streambuf::setbuf]
+[section:implementation basic_socket_streambuf::implementation]
+['Inherited from basic_io_object.]
- std::streambuf * setbuf(
- char_type * s,
- std::streamsize n);
+The underlying implementation of the I/O object.
+
+ implementation_type implementation;
[endsect]
-[section:shutdown basic_socket_streambuf::shutdown]
-Disable sends or receives on the socket.
+[section:implementation_type basic_socket_streambuf::implementation_type]
- 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,
+['Inherited from basic_io_object.]
+
+The underlying implementation type of I/O object.
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+
+[endsect]
+
+
+[section:io_control basic_socket_streambuf::io_control]
+
+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_socket_streambuf::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]
@@ -19545,7 +20377,7 @@
[variablelist
-[[what][Determines what types of operation will no longer be allowed.]]
+[[command][The IO control command to be performed on the socket.]]
]
@@ -19560,11 +20392,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();
@@ -19575,19 +20409,19 @@
-[section:overload2 basic_socket_streambuf::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]
@@ -19595,7 +20429,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.]]
@@ -19603,16 +20437,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();
@@ -19625,34 +20461,22 @@
[endsect]
-[section:shutdown_type basic_socket_streambuf::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
+(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.
@@ -19660,11 +20484,14 @@
-[section:sync basic_socket_streambuf::sync]
+[section:is_open basic_socket_streambuf::is_open]
+['Inherited from basic_socket.]
- int sync();
+Determine whether the socket is open.
+
+ bool is_open() const;
@@ -19672,190 +20499,376 @@
-[section:underflow basic_socket_streambuf::underflow]
+[section:keep_alive basic_socket_streambuf::keep_alive]
+['Inherited from socket_base.]
- int_type underflow();
+Socket option to send keep-alives.
+ typedef implementation_defined keep_alive;
-[endsect]
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
+[heading Examples]
+
+Setting the option:
-Destructor flushes buffered data.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
- virtual ~basic_socket_streambuf();
-[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();
-[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 >
+[endsect]
-[heading Types]
-[table
- [[Name][Description]]
- [
+[section:linger basic_socket_streambuf::linger]
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
- [
+['Inherited from socket_base.]
- [[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. ]
-
- ]
+Socket option to specify whether the socket lingers on close if unsent data is present.
- [
+ typedef implementation_defined linger;
- [[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. ]
-
- ]
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
- [
- [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
+[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);
- [[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. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ 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]
+
+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();
+
+
+
+
+
+
+[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]
+
+
+[endsect]
+
+
+[section:lowest_layer basic_socket_streambuf::lowest_layer]
+
+
+['Inherited from basic_socket.]
+
+Get a reference to the lowest layer.
+
+ lowest_layer_type & lowest_layer();
+
+
+This function returns a reference to the lowest layer in a stack of layers. Since a 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.]
+
+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_stream_socket.linger [*linger]]]
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
[Socket option to specify whether the socket lingers on close if unsent data is present. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
[A basic_socket is always the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
[Bitmask type for flags that can be passed to send and receive operations. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
+ [[link boost_asio.reference.basic_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.basic_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]]]
+ [[link boost_asio.reference.basic_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.basic_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]]]
+ [[link boost_asio.reference.basic_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]]]
+ [[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_stream_socket.send_buffer_size [*send_buffer_size]]]
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
[Socket option for the send buffer size of a socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
[Socket option for the send low watermark. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
+ [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
[The type of the service that will be used to provide I/O operations. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
@@ -19867,148 +20880,119 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_socket.assign [*assign]]]
+ [[link boost_asio.reference.basic_socket.assign [*assign]]]
[Assign an existing native socket to the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.async_connect [*async_connect]]]
+ [[link boost_asio.reference.basic_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]]]
+ [[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_stream_socket.available [*available]]]
+ [[link boost_asio.reference.basic_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_socket.basic_socket [*basic_socket]]]
+ [Construct a basic_socket without opening it. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [[link boost_asio.reference.basic_socket.bind [*bind]]]
[Bind the socket to the given local endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
+ [[link boost_asio.reference.basic_socket.cancel [*cancel]]]
[Cancel all asynchronous operations associated with the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
+ [[link boost_asio.reference.basic_socket.close [*close]]]
[Close the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [[link boost_asio.reference.basic_socket.connect [*connect]]]
[Connect the socket to the specified endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.basic_socket.get_io_service [*get_io_service]]]
[Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
+ [[link boost_asio.reference.basic_socket.get_option [*get_option]]]
[Get an option from the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
+ [[link boost_asio.reference.basic_socket.io_control [*io_control]]]
[Perform an IO control command on the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
+ [[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_stream_socket.is_open [*is_open]]]
+ [[link boost_asio.reference.basic_socket.is_open [*is_open]]]
[Determine whether the socket is open. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.local_endpoint [*local_endpoint]]]
+ [[link boost_asio.reference.basic_socket.local_endpoint [*local_endpoint]]]
[Get the local endpoint of the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_socket.lowest_layer [*lowest_layer]]]
[Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.native [*native]]]
+ [[link boost_asio.reference.basic_socket.native [*native]]]
[Get the native socket representation. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
+ [[link boost_asio.reference.basic_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]]]
+ [[link boost_asio.reference.basic_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]]]
+ [[link boost_asio.reference.basic_socket.set_option [*set_option]]]
[Set an option on the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
+ [[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_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
+ [[link boost_asio.reference.basic_socket._basic_socket [*~basic_socket]]]
+ [Protected destructor to prevent deletion through this type. ]
]
]
@@ -20018,22 +21002,22 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
+ [[link boost_asio.reference.basic_socket.max_connections [*max_connections]]]
[The maximum length of the queue of pending incoming connections. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.message_do_not_route [*message_do_not_route]]]
+ [[link boost_asio.reference.basic_socket.message_do_not_route [*message_do_not_route]]]
[Specify that the data should not be subject to routing. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.message_out_of_band [*message_out_of_band]]]
+ [[link boost_asio.reference.basic_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]]]
+ [[link boost_asio.reference.basic_socket.message_peek [*message_peek]]]
[Peek at incoming data without removing it from the input queue. ]
]
@@ -20044,51 +21028,41 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
[The underlying implementation of the I/O object. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [[link boost_asio.reference.basic_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.
+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.
+[*Shared] [*objects:] Unsafe.
-[section:assign basic_stream_socket::assign]
-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);
+[endsect]
- 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)]
+[section:max_connections basic_socket_streambuf::max_connections]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Assign an existing native socket to the socket.
+The maximum length of the queue of pending incoming connections.
- void assign(
- const protocol_type & protocol,
- const native_type & native_socket);
+ static const int max_connections = implementation_defined;
@@ -20096,234 +21070,155 @@
-[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
+[section:message_do_not_route basic_socket_streambuf::message_do_not_route]
-['Inherited from basic_socket.]
+['Inherited from socket_base.]
-Assign an existing native socket to the socket.
+Specify that the data should not be subject to routing.
- boost::system::error_code assign(
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
+ static const int message_do_not_route = implementation_defined;
[endsect]
-[endsect]
+[section:message_flags basic_socket_streambuf::message_flags]
-[section:async_connect basic_stream_socket::async_connect]
+['Inherited from socket_base.]
-['Inherited from basic_socket.]
+Bitmask type for flags that can be passed to send and receive operations.
-Start an asynchronous connect.
+ typedef int message_flags;
- 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 returned to the closed state.
+[endsect]
-[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.]]
+[section:message_out_of_band basic_socket_streambuf::message_out_of_band]
-[[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_socket_streambuf::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:async_read_some basic_stream_socket::async_read_some]
+[endsect]
-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);
+[section:native basic_socket_streambuf::native]
-This function is used to asynchronously read data from the stream socket. The function call always returns immediately.
+['Inherited from basic_socket.]
-[heading Parameters]
-
+Get the native socket representation.
-[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.]]
+ native_type native();
-[[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().]]
+This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
-]
-[heading Remarks]
-
-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.
+[endsect]
-[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);
+[section:native_type basic_socket_streambuf::native_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_socket.]
+The native representation of a socket.
-[endsect]
+ typedef StreamSocketService::native_type native_type;
-[section:async_receive basic_stream_socket::async_receive]
-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);
+[endsect]
- 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)]
+[section:non_blocking_io basic_socket_streambuf::non_blocking_io]
-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);
+['Inherited from socket_base.]
+IO control command to set the blocking mode of the socket.
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+ typedef implementation_defined non_blocking_io;
-[heading Parameters]
-
-[variablelist
+Implements the FIONBIO IO control command.
+
+
+[heading Example]
-[[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().]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
-]
-[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:open basic_socket_streambuf::open]
-[endsect]
+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:overload2 basic_stream_socket::async_receive (2 of 2 overloads)]
-Start an asynchronous receive.
+[section:overload1 basic_socket_streambuf::open (1 of 2 overloads)]
- 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);
+['Inherited from basic_socket.]
-This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
+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]
@@ -20331,78 +21226,48 @@
[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.]]
+[[protocol][An object specifying protocol parameters to be used.]]
-[[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.
- );
+[heading Exceptions]
+
-``
-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().]]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
]
-[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);
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
-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]
-
-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:overload2 basic_socket_streambuf::open (2 of 2 overloads)]
-[section:overload1 basic_stream_socket::async_send (1 of 2 overloads)]
+['Inherited from basic_socket.]
-Start an asynchronous send.
+Open the socket using the specified protocol.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ boost::system::error_code open(
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
-This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+This function opens the socket so that it will use the specified protocol.
[heading Parameters]
@@ -20410,288 +21275,214 @@
[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.
- );
+[[protocol][An object specifying which protocol is to be used.]]
-``
-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 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.
+ 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]
-[section:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
+[endsect]
-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);
+[endsect]
-This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
+[section:overflow basic_socket_streambuf::overflow]
-[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.]]
+ int_type overflow(
+ int_type c);
-[[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().]]
+[endsect]
-]
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the
-[link boost_asio.reference.async_write async_write] function if you need to ensure that all data is written before the asynchronous operation completes.
-[heading Example]
-
-To send a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+[section:protocol_type basic_socket_streambuf::protocol_type]
- socket.async_send(boost::asio::buffer(data, size), 0, handler);
+['Inherited from basic_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.
+The protocol type.
+ typedef Protocol protocol_type;
-[endsect]
[endsect]
-[section:async_write_some basic_stream_socket::async_write_some]
-
-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);
+[section:receive_buffer_size basic_socket_streambuf::receive_buffer_size]
-This function is used to asynchronously write data to the stream socket. The function call always returns immediately.
+['Inherited from socket_base.]
-[heading Parameters]
-
+Socket option for the receive buffer size of a socket.
-[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.]]
+ typedef implementation_defined receive_buffer_size;
-[[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().]]
-]
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
-[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]
+[heading Examples]
-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]
+Setting the option:
-Determine whether the socket is at the out-of-band data mark.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
- 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)]
+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 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.
+[endsect]
-[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. ]]
+[section:receive_low_watermark basic_socket_streambuf::receive_low_watermark]
-]
+['Inherited from socket_base.]
+Socket option for the receive low watermark.
-[endsect]
+ typedef implementation_defined receive_low_watermark;
-[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
-['Inherited from basic_socket.]
+[heading Examples]
+
+Setting the option:
-Determine whether the socket is at the out-of-band data mark.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
- 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.
+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.]]
-]
-[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]
+[section:remote_endpoint basic_socket_streambuf::remote_endpoint]
-Determine the number of bytes available for reading.
+Get the remote endpoint of the socket.
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload1 available]``() const;
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload1 remote_endpoint]``() const;
- std::size_t ``[link boost_asio.reference.basic_stream_socket.available.overload2 available]``(
+ endpoint_type ``[link boost_asio.reference.basic_socket_streambuf.remote_endpoint.overload2 remote_endpoint]``(
boost::system::error_code & ec) const;
-[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::remote_endpoint (1 of 2 overloads)]
['Inherited from basic_socket.]
-Determine the number of bytes available for reading.
+Get the remote endpoint of the socket.
- std::size_t available() const;
+ endpoint_type remote_endpoint() const;
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to obtain the remote endpoint of the socket.
[heading Return Value]
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+An object that represents the remote endpoint of the socket.
[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);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+
+
+
+
[endsect]
-[section:overload2 basic_stream_socket::available (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::remote_endpoint (2 of 2 overloads)]
['Inherited from basic_socket.]
-Determine the number of bytes available for reading.
+Get the remote endpoint of the socket.
- std::size_t available(
+ endpoint_type remote_endpoint(
boost::system::error_code & ec) const;
-This function is used to determine the number of bytes that may be read without blocking.
+This function is used to obtain the remote endpoint of the socket.
[heading Parameters]
@@ -20705,204 +21496,215 @@
[heading Return Value]
-The number of bytes that may be read without blocking, or 0 if an error occurs.
+An object that represents the remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+[heading Example]
+
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
-[endsect]
-[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);
+[endsect]
- ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
- ``[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)]
+[section:reuse_address basic_socket_streambuf::reuse_address]
-Construct a basic_stream_socket without opening it.
- basic_stream_socket(
- boost::asio::io_service & io_service);
+['Inherited from socket_base.]
+Socket option to allow the socket to be bound to an address that is already in use.
-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.
+ typedef implementation_defined reuse_address;
-[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. ]]
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
-]
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
-[endsect]
-[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
+Getting the current option value:
-Construct and open a basic_stream_socket.
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
- basic_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.]]
+[endsect]
-[[protocol][An object specifying protocol parameters to be used.]]
-]
-[heading Exceptions]
-
+[section:send_buffer_size basic_socket_streambuf::send_buffer_size]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+['Inherited from socket_base.]
+Socket option for the send buffer size of a socket.
+ typedef implementation_defined send_buffer_size;
-[endsect]
+Implements the SOL\_SOCKET/SO\_SNDBUF socket 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.
+[heading Examples]
+
+Setting the option:
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const endpoint_type & endpoint);
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
-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]
-
+Getting the current option value:
-[variablelist
-
-[[io_service][The io\_service object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
-[[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]
-[endsect]
+[section:send_low_watermark basic_socket_streambuf::send_low_watermark]
-[section:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
+['Inherited from socket_base.]
-Construct a basic_stream_socket on an existing native socket.
+Socket option for the send low watermark.
- basic_stream_socket(
- boost::asio::io_service & io_service,
- const protocol_type & protocol,
- const native_type & native_socket);
+ typedef implementation_defined send_low_watermark;
-This constructor creates a stream socket object to hold an existing native socket.
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[io_service][The io\_service object that the stream socket will use to dispatch handlers for any asynchronous operations performed on the socket.]]
+Setting the option:
-[[protocol][An object specifying protocol parameters to be used.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
-[[native_socket][The new underlying socket implementation.]]
-]
-[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]
[endsect]
-[section:bind basic_stream_socket::bind]
-Bind the socket to the given local endpoint.
- void ``[link boost_asio.reference.basic_stream_socket.bind.overload1 bind]``(
- const endpoint_type & endpoint);
+[section:service basic_socket_streambuf::service]
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.bind.overload2 bind]``(
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+['Inherited from basic_io_object.]
-[section:overload1 basic_stream_socket::bind (1 of 2 overloads)]
+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.]
+
+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]
+
+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.]
-Bind the socket to the given local endpoint.
+Set an option on the socket.
- void bind(
- const endpoint_type & endpoint);
+ void set_option(
+ const SettableSocketOption & option);
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to set an option on the socket.
[heading Parameters]
@@ -20910,7 +21712,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[option][The new option value to be set on the socket.]]
]
@@ -20925,12 +21727,12 @@
[heading Example]
-
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
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::no_delay option(true);
+ socket.set_option(option);
@@ -20941,19 +21743,19 @@
-[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::set_option (2 of 2 overloads)]
['Inherited from basic_socket.]
-Bind the socket to the given local endpoint.
+Set an option on the socket.
- boost::system::error_code bind(
- const endpoint_type & endpoint,
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
boost::system::error_code & ec);
-This function binds the socket to the specified endpoint on the local machine.
+This function is used to set an option on the socket.
[heading Parameters]
@@ -20961,7 +21763,7 @@
[variablelist
-[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+[[option][The new option value to be set on the socket.]]
[[ec][Set to indicate what error occurred, if any.]]
@@ -20969,13 +21771,13 @@
[heading Example]
-
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
boost::system::error_code ec;
- socket.bind(boost::asio::ip::tcp::endpoint(
- boost::asio::ip::tcp::v4(), 12345), ec);
+ socket.set_option(option, ec);
if (ec)
{
// An error occurred.
@@ -20992,216 +21794,73 @@
[endsect]
-[section:broadcast basic_stream_socket::broadcast]
-
-
-['Inherited from socket_base.]
-
-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.]
-
-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();
+[section:setbuf basic_socket_streambuf::setbuf]
+ std::streambuf * setbuf(
+ char_type * s,
+ std::streamsize n);
[endsect]
-[section:cancel basic_stream_socket::cancel]
+[section:shutdown basic_socket_streambuf::shutdown]
-Cancel all asynchronous operations associated with the socket.
+Disable sends or receives on the socket.
- void ``[link boost_asio.reference.basic_stream_socket.cancel.overload1 cancel]``();
+ void ``[link boost_asio.reference.basic_socket_streambuf.shutdown.overload1 shutdown]``(
+ shutdown_type what);
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
+ 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_stream_socket::cancel (1 of 2 overloads)]
+[section:overload1 basic_socket_streambuf::shutdown (1 of 2 overloads)]
['Inherited from basic_socket.]
-Cancel all asynchronous operations associated with the socket.
+Disable sends or receives on the socket.
- void cancel();
+ void shutdown(
+ shutdown_type what);
-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 is used to disable send operations, receive operations, or both.
-[heading Exceptions]
+[heading Parameters]
[variablelist
-[[boost::system::system_error][Thrown on failure.]]
+[[what][Determines what types of operation will no longer be allowed.]]
]
-[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]
+[heading Exceptions]
[variablelist
-[[ec][Set to indicate what error occurred, if any.]]
+[[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]
-
-
-[endsect]
-
-[section:close basic_stream_socket::close]
-
-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 Example]
+
+Shutting down the send side of the socket:
-[heading Exceptions]
-
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
-[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.
@@ -21209,18 +21868,19 @@
-[section:overload2 basic_stream_socket::close (2 of 2 overloads)]
+[section:overload2 basic_socket_streambuf::shutdown (2 of 2 overloads)]
['Inherited from basic_socket.]
-Close the socket.
+Disable sends or receives on the socket.
- boost::system::error_code close(
+ boost::system::error_code shutdown(
+ shutdown_type what,
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 disable send operations, receive operations, or both.
[heading Parameters]
@@ -21228,18 +21888,20 @@
[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.close(ec);
+ socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
if (ec)
{
// An error occurred.
@@ -21248,10 +21910,6 @@
-[heading Remarks]
-
-For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-
[endsect]
@@ -21259,258 +21917,471 @@
[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:shutdown_type basic_socket_streambuf::shutdown_type]
-This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
-The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is returned to the closed state.
+['Inherited from socket_base.]
+Different ways a socket may be shutdown.
-[heading Parameters]
-
+ enum shutdown_type
+[heading Values]
[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-]
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
-[heading Exceptions]
-
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
]
-[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:sync basic_socket_streambuf::sync]
-[endsect]
+ int sync();
-[section:overload2 basic_stream_socket::connect (2 of 2 overloads)]
+[endsect]
-['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);
+[section:underflow basic_socket_streambuf::underflow]
-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.
+ int_type underflow();
-[heading Parameters]
-
-[variablelist
-
-[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
+[endsect]
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Example]
-
+[section:_basic_socket_streambuf basic_socket_streambuf::~basic_socket_streambuf]
+Destructor flushes buffered data.
- boost::asio::ip::tcp::socket socket(io_service);
- boost::asio::ip::tcp::endpoint endpoint(
- boost::asio::ip::address::from_string("1.2.3.4"), 12345);
- boost::system::error_code ec;
- socket.connect(endpoint, ec);
- if (ec)
- {
- // An error occurred.
- }
+ virtual ~basic_socket_streambuf();
+[endsect]
[endsect]
+[section:basic_stream_socket basic_stream_socket]
-[endsect]
+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 >
-[section:debug basic_stream_socket::debug]
+[heading Types]
+[table
+ [[Name][Description]]
-['Inherited from socket_base.]
+ [
-Socket option to enable socket-level debugging.
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
- typedef implementation_defined debug;
+ [
+ [[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. ]
+
+ ]
+ [
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+ [
-[heading Examples]
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
-Setting the option:
+ ]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+ [
+ [[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. ]
+
+ ]
-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();
+ [[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. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:do_not_route basic_stream_socket::do_not_route]
+ [
+ [[link boost_asio.reference.basic_stream_socket.native_type [*native_type]]]
+ [The native representation of a socket. ]
+
+ ]
-['Inherited from socket_base.]
+ [
-Socket option to prevent routing, use local interfaces only.
+ [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the socket. ]
+
+ ]
- typedef implementation_defined do_not_route;
+ [
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+ [
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+ [
-[heading Examples]
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
-Setting the option:
+ ]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option(true);
- socket.set_option(option);
+ [
+ [[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. ]
+
+ ]
-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();
-
-
-
+ [
+ [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-['Inherited from socket_base.]
+ [
+ [[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. ]
+ ]
+
+]
-Socket option to report aborted connections on accept.
+[heading Data Members]
+[table
+ [[Name][Description]]
- typedef implementation_defined enable_connection_aborted;
+ [
+ [[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. ]
+ ]
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with boost::asio::error::connection\_aborted. By default the option is false.
+ [
+ [[link boost_asio.reference.basic_stream_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+]
-[heading Examples]
-
-Setting the option:
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+ [
+ [[link boost_asio.reference.basic_stream_socket.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.
-Getting the current option value:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option;
- acceptor.get_option(option);
- bool is_set = option.value();
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
+[section:assign basic_stream_socket::assign]
+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);
-[endsect]
+ 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)]
-[section:endpoint_type basic_stream_socket::endpoint_type]
-The endpoint type.
+['Inherited from basic_socket.]
- typedef Protocol::endpoint endpoint_type;
+Assign an existing native socket to the socket.
+ void assign(
+ const protocol_type & protocol,
+ const native_type & native_socket);
@@ -21518,52 +22389,41 @@
-[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();
+[section:overload2 basic_stream_socket::assign (2 of 2 overloads)]
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+['Inherited from basic_socket.]
+Assign an existing native socket to 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.
+ boost::system::error_code assign(
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
[endsect]
-[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;
-
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.get_option.overload2 get_option]``(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+[endsect]
-[section:overload1 basic_stream_socket::get_option (1 of 2 overloads)]
+[section:async_connect basic_stream_socket::async_connect]
['Inherited from basic_socket.]
-Get an option from the socket.
+Start an asynchronous connect.
- void get_option(
- GettableSocketOption & option) const;
+ void async_connect(
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
-This function is used to get the current value of an option on the socket.
+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.
[heading Parameters]
@@ -21571,51 +22431,60 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
-
-]
+[[peer_endpoint][The remote endpoint to which the socket will be connected. Copies will be made of the endpoint object as required.]]
-[heading Exceptions]
-
+[[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
+ );
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+``
+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 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();
+ void connect_handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Connect succeeded.
+ }
+ }
+
+ ...
+ boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(
+ boost::asio::ip::address::from_string("1.2.3.4"), 12345);
+ socket.async_connect(endpoint, connect_handler);
-[endsect]
+[endsect]
-[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:async_read_some basic_stream_socket::async_read_some]
-Get an option from the socket.
+Start an asynchronous read.
- boost::system::error_code get_option(
- GettableSocketOption & option,
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
-This function is used to get the current value of an option on the socket.
+This function is used to asynchronously read data from the stream socket. The function call always returns immediately.
[heading Parameters]
@@ -21623,92 +22492,131 @@
[variablelist
-[[option][The option value to be obtained from the socket.]]
+[[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.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[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]
-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();
-
-
+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]
[endsect]
-[section:implementation basic_stream_socket::implementation]
-
+[section:async_receive basic_stream_socket::async_receive]
-['Inherited from basic_io_object.]
+Start an asynchronous receive.
-The underlying implementation of the I/O object.
+ 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);
- implementation_type implementation;
+ 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)]
-[endsect]
+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);
-[section:implementation_type basic_stream_socket::implementation_type]
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
-['Inherited from basic_io_object.]
+[heading Parameters]
+
-The underlying implementation type of I/O object.
+[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.]]
- typedef service_type::implementation_type implementation_type;
+[[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.
-[endsect]
+[heading Example]
+
+To receive into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+ socket.async_receive(boost::asio::buffer(data, size), handler);
-[section:io_control basic_stream_socket::io_control]
-Perform an IO control command on the socket.
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
- void ``[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);
+[endsect]
-[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
-['Inherited from basic_socket.]
+[section:overload2 basic_stream_socket::async_receive (2 of 2 overloads)]
-Perform an IO control command on the socket.
+Start an asynchronous receive.
- void io_control(
- IoControlCommand & command);
+ 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 execute an IO control command on the socket.
+This function is used to asynchronously receive data from the stream socket. The function call always returns immediately.
[heading Parameters]
@@ -21716,51 +22624,78 @@
[variablelist
-[[command][The IO control command to be performed on the socket.]]
+[[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.]]
-[heading Exceptions]
-
+[[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.
+ );
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+``
+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]
-Getting the number of bytes ready to read:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::socket::bytes_readable command;
- socket.io_control(command);
- std::size_t bytes_readable = command.get();
+To receive into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+ socket.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:overload2 basic_stream_socket::io_control (2 of 2 overloads)]
-
+[section:async_send basic_stream_socket::async_send]
-['Inherited from basic_socket.]
+Start an asynchronous send.
-Perform an IO control command on the socket.
+ 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);
- boost::system::error_code io_control(
- IoControlCommand & command,
- boost::system::error_code & ec);
+ 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);
-This function is used to execute an IO control command on the socket.
+[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]
@@ -21768,227 +22703,288 @@
[variablelist
-[[command][The IO control command to be 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.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[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]
-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();
+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]
-[endsect]
+[section:overload2 basic_stream_socket::async_send (2 of 2 overloads)]
-[section:io_service basic_stream_socket::io_service]
+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);
-['Inherited from basic_io_object.]
+This function is used to asynchronously send data on the stream socket. The function call always returns immediately.
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
- boost::asio::io_service & io_service();
+[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.]]
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[[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.
+ );
-[heading Return Value]
+``
+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 reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
+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:is_open basic_stream_socket::is_open]
+[section:async_write_some basic_stream_socket::async_write_some]
-['Inherited from basic_socket.]
+Start an asynchronous write.
-Determine whether the socket is open.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
- bool is_open() const;
+This function is used to asynchronously write data to the stream socket. The function call always returns immediately.
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+[[handler][The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes written.
+ );
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
-[section:keep_alive basic_stream_socket::keep_alive]
+]
+[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.
-['Inherited from socket_base.]
+[heading Example]
+
+To write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
-Socket option to send keep-alives.
+ socket.async_write_some(boost::asio::buffer(data, size), handler);
- typedef implementation_defined keep_alive;
+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.
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+[endsect]
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+[section: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;
-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: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.
-[endsect]
+[heading Return Value]
+
+A bool indicating whether the socket is at the out-of-band data mark.
+[heading Exceptions]
+
-[section:linger basic_stream_socket::linger]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-['Inherited from socket_base.]
-Socket option to specify whether the socket lingers on close if unsent data is present.
- typedef implementation_defined linger;
+[endsect]
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+[section:overload2 basic_stream_socket::at_mark (2 of 2 overloads)]
-[heading Examples]
-
-Setting the option:
+['Inherited from basic_socket.]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::linger option(true, 30);
- socket.set_option(option);
+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.
-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 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]
-[section:local_endpoint basic_stream_socket::local_endpoint]
+[endsect]
-Get the local endpoint of the socket.
+[section:available basic_stream_socket::available]
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
+Determine the number of bytes available for reading.
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
+ 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::local_endpoint (1 of 2 overloads)]
+[section:overload1 basic_stream_socket::available (1 of 2 overloads)]
['Inherited from basic_socket.]
-Get the local endpoint of the socket.
+Determine the number of bytes available for reading.
- endpoint_type local_endpoint() const;
+ std::size_t available() const;
-This function is used to obtain the locally bound endpoint of the socket.
+This function is used to determine the number of bytes that may be read without blocking.
[heading Return Value]
-An object that represents the local endpoint of the socket.
+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);
- ...
- boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
-
-
-
-
[endsect]
-[section:overload2 basic_stream_socket::local_endpoint (2 of 2 overloads)]
+[section:overload2 basic_stream_socket::available (2 of 2 overloads)]
['Inherited from basic_socket.]
-Get the local endpoint of the socket.
+Determine the number of bytes available for reading.
- endpoint_type local_endpoint(
+ std::size_t available(
boost::system::error_code & ec) const;
-This function is used to obtain the locally bound endpoint of the socket.
+This function is used to determine the number of bytes that may be read without blocking.
[heading Parameters]
@@ -22002,48 +22998,55 @@
[heading Return Value]
-An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
+The number of bytes that may be read without blocking, or 0 if an error occurs.
-[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: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);
-[endsect]
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload2 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
+ ``[link boost_asio.reference.basic_stream_socket.basic_stream_socket.overload3 basic_stream_socket]``(
+ boost::asio::io_service & io_service,
+ const endpoint_type & endpoint);
-[endsect]
+ ``[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:lowest_layer basic_stream_socket::lowest_layer]
+[section:overload1 basic_stream_socket::basic_stream_socket (1 of 4 overloads)]
+Construct a basic_stream_socket without opening it.
-['Inherited from basic_socket.]
+ basic_stream_socket(
+ boost::asio::io_service & io_service);
-Get a reference to the lowest layer.
- lowest_layer_type & lowest_layer();
+This constructor creates a stream socket without opening it. The socket needs to be opened and then connected or accepted before data can be sent or received on it.
-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 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. ]]
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+]
@@ -22051,447 +23054,272 @@
-[section:lowest_layer_type basic_stream_socket::lowest_layer_type]
-
+[section:overload2 basic_stream_socket::basic_stream_socket (2 of 4 overloads)]
-['Inherited from basic_socket.]
+Construct and open a basic_stream_socket.
-A basic_socket is always the lowest layer.
+ basic_stream_socket(
+ boost::asio::io_service & io_service,
+ const protocol_type & protocol);
- typedef basic_socket< Protocol, StreamSocketService > lowest_layer_type;
+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 Types]
-[table
- [[Name][Description]]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
+[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.]]
- [[link boost_asio.reference.basic_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+]
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.basic_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure. ]]
- [
+]
- [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
- [
- [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
- [
+[section:overload3 basic_stream_socket::basic_stream_socket (3 of 4 overloads)]
- [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+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);
- [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
- [
+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.
- [[link boost_asio.reference.basic_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
- [A basic_socket is always the lowest layer. ]
+[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.]]
- [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+]
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.basic_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure. ]]
- [
+]
- [[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. ]
-
- ]
- [
+[section:overload4 basic_stream_socket::basic_stream_socket (4 of 4 overloads)]
- [[link boost_asio.reference.basic_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+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);
- [[link boost_asio.reference.basic_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
- [
+This constructor creates a stream socket object to hold an existing native socket.
- [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+[variablelist
- ]
+[[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.]]
- [[link boost_asio.reference.basic_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
+[[native_socket][The new underlying socket implementation.]]
- [
+]
- [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+[heading Exceptions]
+
+
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure. ]]
]
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.basic_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[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. ]
- ]
+[endsect]
- [
- [[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]]
+[section:bind basic_stream_socket::bind]
- [
- [[link boost_asio.reference.basic_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+Bind the socket to the given local endpoint.
- [
- [[link boost_asio.reference.basic_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+ 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);
-The basic_socket class template provides functionality that is common to both stream-oriented and datagram-oriented sockets.
+[section:overload1 basic_stream_socket::bind (1 of 2 overloads)]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+['Inherited from basic_socket.]
+Bind the socket to the given local endpoint.
+ void bind(
+ const endpoint_type & endpoint);
-[endsect]
+This function binds the socket to the specified endpoint on the local machine.
+[heading Parameters]
+
-[section:max_connections basic_stream_socket::max_connections]
+[variablelist
+
+[[endpoint][An endpoint on the local machine to which the socket will be bound.]]
+]
-['Inherited from socket_base.]
+[heading Exceptions]
+
-The maximum length of the queue of pending incoming connections.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
- static const int max_connections = implementation_defined;
+]
+[heading Example]
+
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
+ socket.bind(boost::asio::ip::tcp::endpoint(
+ boost::asio::ip::tcp::v4(), 12345));
-[section:message_do_not_route basic_stream_socket::message_do_not_route]
-['Inherited from socket_base.]
-Specify that the data should not be subject to routing.
+[endsect]
- static const int message_do_not_route = implementation_defined;
+[section:overload2 basic_stream_socket::bind (2 of 2 overloads)]
-[endsect]
+['Inherited from basic_socket.]
+Bind the socket to the given local endpoint.
-[section:message_flags basic_stream_socket::message_flags]
+ boost::system::error_code bind(
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
-['Inherited from socket_base.]
+This function binds the socket to the specified endpoint on the local machine.
-Bitmask type for flags that can be passed to send and receive operations.
- typedef int message_flags;
+[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.]]
+]
-[endsect]
+[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.
+ }
-[section:message_out_of_band basic_stream_socket::message_out_of_band]
-['Inherited from socket_base.]
-Process out-of-band data.
- static const int message_out_of_band = implementation_defined;
+[endsect]
[endsect]
-
-[section:message_peek basic_stream_socket::message_peek]
+[section:broadcast basic_stream_socket::broadcast]
['Inherited from socket_base.]
-Peek at incoming data without removing it from the input queue.
-
- static const int message_peek = implementation_defined;
-
-
-
-[endsect]
-
-
+Socket option to permit sending of broadcast messages.
-[section:native basic_stream_socket::native]
+ typedef implementation_defined broadcast;
-['Inherited from basic_socket.]
-Get the native socket representation.
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
- native_type native();
+[heading Examples]
+
+Setting the option:
-This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
-[endsect]
+Getting the current option value:
-[section:native_type basic_stream_socket::native_type]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option;
+ socket.get_option(option);
+ bool is_set = option.value();
-The native representation of a socket.
- typedef StreamSocketService::native_type native_type;
@@ -22500,18 +23328,18 @@
-[section:non_blocking_io basic_stream_socket::non_blocking_io]
+[section:bytes_readable basic_stream_socket::bytes_readable]
['Inherited from socket_base.]
-IO control command to set the blocking mode of the socket.
+IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined non_blocking_io;
+ typedef implementation_defined bytes_readable;
-Implements the FIONBIO IO control command.
+Implements the FIONREAD IO control command.
[heading Example]
@@ -22520,8 +23348,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::non_blocking_io command(true);
+ boost::asio::socket_base::bytes_readable command(true);
socket.io_control(command);
+ std::size_t bytes_readable = command.get();
@@ -22531,40 +23360,28 @@
[endsect]
-[section:open basic_stream_socket::open]
+[section:cancel basic_stream_socket::cancel]
-Open the socket using the specified protocol.
+Cancel all asynchronous operations associated with the socket.
- void ``[link boost_asio.reference.basic_stream_socket.open.overload1 open]``(
- const protocol_type & protocol = protocol_type());
+ void ``[link boost_asio.reference.basic_stream_socket.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.open.overload2 open]``(
- const protocol_type & protocol,
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.cancel.overload2 cancel]``(
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::open (1 of 2 overloads)]
+[section:overload1 basic_stream_socket::cancel (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.
+Cancel all asynchronous operations associated with the socket.
+ void cancel();
-[heading Parameters]
-
-[variablelist
-
-[[protocol][An object specifying protocol parameters to be used.]]
+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]
@@ -22575,35 +23392,40 @@
]
-[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:
+* It will only cancel asynchronous operations that were initiated in the current thread.
- boost::asio::ip::tcp::socket socket(io_service);
- socket.open(boost::asio::ip::tcp::v4());
+* 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::open (2 of 2 overloads)]
+[section:overload2 basic_stream_socket::cancel (2 of 2 overloads)]
['Inherited from basic_socket.]
-Open the socket using the specified protocol.
+Cancel all asynchronous operations associated with the socket.
- boost::system::error_code open(
- const protocol_type & protocol,
+ boost::system::error_code cancel(
boost::system::error_code & ec);
-This function opens the socket so that it will use the specified protocol.
+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]
@@ -22611,132 +23433,87 @@
[variablelist
-[[protocol][An object specifying which protocol is to be used.]]
-
[[ec][Set to indicate what error occurred, if any.]]
]
-[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:
- 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.
- }
+* 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.
-[endsect]
+When running on Windows Vista, Windows Server 2008, and later, the CancelIoEx function is always used. This function does not have the problems described above.
[endsect]
-[section:protocol_type basic_stream_socket::protocol_type]
-
-The protocol type.
-
- typedef Protocol protocol_type;
-
-
-
-
[endsect]
+[section:close basic_stream_socket::close]
-[section:read_some basic_stream_socket::read_some]
-
-Read some data from the socket.
+Close 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);
+ void ``[link boost_asio.reference.basic_stream_socket.close.overload1 close]``();
- 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_stream_socket.close.overload2 close]``(
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);
+[section:overload1 basic_stream_socket::close (1 of 2 overloads)]
-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.
+['Inherited from basic_socket.]
+Close the socket.
-[heading Parameters]
-
+ void close();
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
-]
+This function is used to close the socket. Any asynchronous send, receive or connect operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
-[heading 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));
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
-See the
-[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[endsect]
-[endsect]
+[section:overload2 basic_stream_socket::close (2 of 2 overloads)]
-[section:overload2 basic_stream_socket::read_some (2 of 2 overloads)]
+['Inherited from basic_socket.]
-Read some data from the socket.
+Close the socket.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
+ boost::system::error_code close(
boost::system::error_code & ec);
-This function is used to read data from the 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 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]
@@ -22744,20 +23521,29 @@
[variablelist
-[[buffers][One or more buffers into which the data will be read.]]
-
[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ socket.close(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
+
+
+
[heading Remarks]
-The read\_some operation may not read all of the requested number of bytes. Consider using the
-[link boost_asio.reference.read read] function if you need to ensure that the requested amount of data is read before the blocking operation completes.
+For portable behaviour with respect to graceful closure of a connected socket, call shutdown() before closing the socket.
@@ -22766,40 +23552,32 @@
[endsect]
-[section:receive basic_stream_socket::receive]
-
-Receive some data on the socket.
+[section:connect basic_stream_socket::connect]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload1 receive]``(
- const MutableBufferSequence & buffers);
+Connect the socket to the specified endpoint.
- 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);
+ void ``[link boost_asio.reference.basic_stream_socket.connect.overload1 connect]``(
+ const endpoint_type & peer_endpoint);
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.receive.overload3 receive]``(
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
+ boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.connect.overload2 connect]``(
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
+[section:overload1 basic_stream_socket::connect (1 of 2 overloads)]
-Receive some data on the socket.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive(
- const MutableBufferSequence & buffers);
+['Inherited from basic_socket.]
+Connect the socket to the specified endpoint.
-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.
+ 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 returned to the closed state.
[heading Parameters]
@@ -22807,38 +23585,30 @@
[variablelist
-[[buffers][One or more buffers into which the data will be received.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
]
-[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.]]
+[[boost::system::system_error][Thrown on failure.]]
]
-[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));
+
+ 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);
+
-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.
@@ -22846,18 +23616,21 @@
-[section:overload2 basic_stream_socket::receive (2 of 3 overloads)]
+[section:overload2 basic_stream_socket::connect (2 of 2 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);
+['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 receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
+This function is used to connect a socket to the specified remote endpoint. The function call will block until the connection is successfully made or an error occurs.
+
+The socket is automatically opened if it is not already open. If the connect fails, and the socket was automatically opened, the socket is returned to the closed state.
[heading Parameters]
@@ -22865,113 +23638,101 @@
[variablelist
-[[buffers][One or more buffers into which the data will be received.]]
+[[peer_endpoint][The remote endpoint to which the socket will be connected.]]
-[[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.
-
-[heading Exceptions]
-
-
-[variablelist
+[heading Example]
-[[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.
+ 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 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]
+
[endsect]
+[section:debug basic_stream_socket::debug]
-[section:overload3 basic_stream_socket::receive (3 of 3 overloads)]
-Receive some data on a connected socket.
+['Inherited from socket_base.]
- 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);
+Socket option to enable socket-level debugging.
+ typedef implementation_defined debug;
-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\_DEBUG socket option.
-[variablelist
+
+[heading Examples]
-[[buffers][One or more buffers into which the data will be received.]]
+Setting the option:
-[[flags][Flags specifying how the receive 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 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.
+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:receive_buffer_size basic_stream_socket::receive_buffer_size]
+
+[section:do_not_route basic_stream_socket::do_not_route]
['Inherited from socket_base.]
-Socket option for the receive buffer size of a socket.
+Socket option to prevent routing, use local interfaces only.
- typedef implementation_defined receive_buffer_size;
+ typedef implementation_defined do_not_route;
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
[heading Examples]
Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::receive_buffer_size option(8192);
+ boost::asio::socket_base::do_not_route option(true);
socket.set_option(option);
@@ -22979,11 +23740,11 @@
Getting the current option value:
- boost::asio::ip::tcp::socket socket(io_service);
+ boost::asio::ip::udp::socket socket(io_service);
...
- boost::asio::socket_base::receive_buffer_size option;
+ boost::asio::socket_base::do_not_route option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -22994,39 +23755,39 @@
-[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
+[section:enable_connection_aborted basic_stream_socket::enable_connection_aborted]
['Inherited from socket_base.]
-Socket option for the receive low watermark.
+Socket option to report aborted connections on accept.
- typedef implementation_defined receive_low_watermark;
+ typedef implementation_defined enable_connection_aborted;
-Implements the SOL\_SOCKET/SO\_RCVLOWAT 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::receive_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::receive_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();
@@ -23036,32 +23797,76 @@
[endsect]
-[section:remote_endpoint basic_stream_socket::remote_endpoint]
-Get the remote endpoint of the socket.
+[section:endpoint_type basic_stream_socket::endpoint_type]
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 remote_endpoint]``() const;
+The endpoint type.
- endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload2 remote_endpoint]``(
- boost::system::error_code & ec) const;
+ typedef Protocol::endpoint endpoint_type;
-[section:overload1 basic_stream_socket::remote_endpoint (1 of 2 overloads)]
-['Inherited from basic_socket.]
+[endsect]
-Get the remote endpoint of the socket.
- endpoint_type remote_endpoint() const;
+[section:get_io_service basic_stream_socket::get_io_service]
-This function is used to obtain the remote endpoint of the socket.
+
+['Inherited from basic_io_object.]
+
+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]
-An object that represents the remote endpoint of the socket.
+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]
+
+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]
@@ -23074,11 +23879,13 @@
[heading Example]
-
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
+ boost::asio::ip::tcp::socket::keep_alive option;
+ socket.get_option(option);
+ bool is_set = option.get();
@@ -23089,18 +23896,19 @@
-[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 overloads)]
+[section:overload2 basic_stream_socket::get_option (2 of 2 overloads)]
['Inherited from basic_socket.]
-Get the remote endpoint of the socket.
+Get an option from the socket.
- endpoint_type remote_endpoint(
+ boost::system::error_code get_option(
+ GettableSocketOption & option,
boost::system::error_code & ec) const;
-This function is used to obtain the remote endpoint of the socket.
+This function is used to get the current value of an option on the socket.
[heading Parameters]
@@ -23108,26 +23916,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 remote endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
-
[heading Example]
-
+Getting the value of the SOL\_SOCKET/SO\_KEEPALIVE option:
boost::asio::ip::tcp::socket socket(io_service);
...
+ boost::asio::ip::tcp::socket::keep_alive option;
boost::system::error_code ec;
- boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ socket.get_option(option, ec);
if (ec)
{
// An error occurred.
}
+ bool is_set = option.get();
@@ -23140,41 +23948,29 @@
[endsect]
-[section:reuse_address basic_stream_socket::reuse_address]
-
-
-['Inherited from socket_base.]
-
-Socket option to allow the socket to be bound to an address that is already in use.
+[section:implementation basic_stream_socket::implementation]
- typedef implementation_defined reuse_address;
+['Inherited from basic_io_object.]
+The underlying implementation of the I/O object.
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+ implementation_type implementation;
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+[endsect]
+[section:implementation_type basic_stream_socket::implementation_type]
-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();
+['Inherited from basic_io_object.]
+The underlying implementation type of I/O object.
+ typedef service_type::implementation_type implementation_type;
@@ -23182,40 +23978,30 @@
[endsect]
-[section:send basic_stream_socket::send]
-
-Send some data on the socket.
+[section:io_control basic_stream_socket::io_control]
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t ``[link boost_asio.reference.basic_stream_socket.send.overload1 send]``(
- const ConstBufferSequence & buffers);
+Perform an IO control command on the socket.
- 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);
+ void ``[link boost_asio.reference.basic_stream_socket.io_control.overload1 io_control]``(
+ IoControlCommand & command);
- 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 ``[link boost_asio.reference.basic_stream_socket.io_control.overload2 io_control]``(
+ IoControlCommand & command,
boost::system::error_code & ec);
-[section:overload1 basic_stream_socket::send (1 of 3 overloads)]
+[section:overload1 basic_stream_socket::io_control (1 of 2 overloads)]
-Send some data on the socket.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers);
+['Inherited from basic_socket.]
+Perform an IO control command on the socket.
-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.
+ void io_control(
+ IoControlCommand & command);
+
+
+This function is used to execute an IO control command on the socket.
[heading Parameters]
@@ -23223,14 +24009,10 @@
[variablelist
-[[buffers][One or more data buffers to be sent on the socket.]]
+[[command][The IO control command to be performed on the socket.]]
]
-[heading Return Value]
-
-The number of bytes sent.
-
[heading Exceptions]
@@ -23240,21 +24022,18 @@
]
-[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:
+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();
- 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.
@@ -23262,18 +24041,19 @@
-[section:overload2 basic_stream_socket::send (2 of 3 overloads)]
+[section:overload2 basic_stream_socket::io_control (2 of 2 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);
+['Inherited from basic_socket.]
+Perform an IO control command on the socket.
-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.
+ 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]
@@ -23281,104 +24061,88 @@
[variablelist
-[[buffers][One or more data buffers to be sent on the socket.]]
+[[command][The IO control command to be performed 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.
-
-[heading Exceptions]
-
-
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure.]]
+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();
-[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]
[endsect]
+[section:io_service basic_stream_socket::io_service]
-[section:overload3 basic_stream_socket::send (3 of 3 overloads)]
-Send some data on the socket.
+['Inherited from basic_io_object.]
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t send(
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- boost::system::error_code & ec);
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-[heading Parameters]
-
-[variablelist
-
-[[buffers][One or more data buffers to be sent on the socket.]]
+[heading Return Value]
+
+A reference to the io_service object that the I/O object will use to dispatch handlers. Ownership is not transferred to the caller.
-[[flags][Flags specifying how the send call is to be made.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[endsect]
-[heading Return Value]
-
-The number of bytes sent. Returns 0 if an error occurred.
-[heading Remarks]
-
-The send operation may not transmit all of the data to the peer. Consider using the
-[link boost_asio.reference.write write] function if you need to ensure that all data is written before the blocking operation completes.
+
+[section:is_open basic_stream_socket::is_open]
+['Inherited from basic_socket.]
+
+Determine whether the socket is open.
+
+ bool is_open() const;
-[endsect]
[endsect]
-[section:send_buffer_size basic_stream_socket::send_buffer_size]
+
+[section:keep_alive basic_stream_socket::keep_alive]
['Inherited from socket_base.]
-Socket option for the send buffer size of a socket.
+Socket option to send keep-alives.
- typedef implementation_defined send_buffer_size;
+ typedef implementation_defined keep_alive;
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
[heading Examples]
@@ -23387,7 +24151,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_buffer_size option(8192);
+ boost::asio::socket_base::keep_alive option(true);
socket.set_option(option);
@@ -23397,9 +24161,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_buffer_size option;
+ boost::asio::socket_base::keep_alive option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.value();
@@ -23410,18 +24174,18 @@
-[section:send_low_watermark basic_stream_socket::send_low_watermark]
+[section:linger basic_stream_socket::linger]
['Inherited from socket_base.]
-Socket option for the send low watermark.
+Socket option to specify whether the socket lingers on close if unsent data is present.
- typedef implementation_defined send_low_watermark;
+ typedef implementation_defined linger;
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
[heading Examples]
@@ -23430,7 +24194,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_low_watermark option(1024);
+ boost::asio::socket_base::linger option(true, 30);
socket.set_option(option);
@@ -23440,9 +24204,10 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::socket_base::send_low_watermark option;
+ boost::asio::socket_base::linger option;
socket.get_option(option);
- int size = option.value();
+ bool is_set = option.enabled();
+ unsigned short timeout = option.timeout();
@@ -23452,61 +24217,71 @@
[endsect]
+[section:local_endpoint basic_stream_socket::local_endpoint]
-[section:service basic_stream_socket::service]
+Get the local endpoint of the socket.
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload1 local_endpoint]``() const;
-['Inherited from basic_io_object.]
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.local_endpoint.overload2 local_endpoint]``(
+ boost::system::error_code & ec) const;
-The service associated with the I/O object.
- service_type & service;
+[section:overload1 basic_stream_socket::local_endpoint (1 of 2 overloads)]
+['Inherited from basic_socket.]
-[endsect]
+Get the local endpoint of the socket.
+ endpoint_type local_endpoint() const;
-[section:service_type basic_stream_socket::service_type]
+This function is used to obtain the locally bound endpoint of the socket.
-['Inherited from basic_io_object.]
+[heading Return Value]
+
+An object that represents the local endpoint of the socket.
-The type of the service that will be used to provide I/O operations.
+[heading Exceptions]
+
- typedef StreamSocketService service_type;
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
+[heading Example]
+
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
-[section:set_option basic_stream_socket::set_option]
-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);
+[endsect]
-[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
+
+
+[section:overload2 basic_stream_socket::local_endpoint (2 of 2 overloads)]
['Inherited from basic_socket.]
-Set an option on the socket.
+Get the local endpoint of the socket.
- void set_option(
- const SettableSocketOption & option);
+ endpoint_type local_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 locally bound endpoint of the socket.
[heading Parameters]
@@ -23514,27 +24289,26 @@
[variablelist
-[[option][The new option value to be set on the socket.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
+[heading Return Value]
+
+An object that represents the local endpoint of the socket. Returns a default-constructed endpoint object if an error occurred.
[heading Example]
-Setting the 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::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
@@ -23544,268 +24318,444 @@
[endsect]
+[endsect]
-[section:overload2 basic_stream_socket::set_option (2 of 2 overloads)]
+
+[section:lowest_layer basic_stream_socket::lowest_layer]
['Inherited from basic_socket.]
-Set an option on the socket.
+Get a reference to the lowest layer.
- boost::system::error_code set_option(
- const SettableSocketOption & option,
- boost::system::error_code & ec);
+ lowest_layer_type & lowest_layer();
-This function is used to set an option on the socket.
+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 Parameters]
-
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
-[variablelist
-
-[[option][The new option value to be set on the socket.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[endsect]
-[heading Example]
-
-Setting the IPPROTO\_TCP/TCP\_NODELAY option:
- 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.
- }
+[section:lowest_layer_type basic_stream_socket::lowest_layer_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]]
-[endsect]
+ [
-[section:shutdown basic_stream_socket::shutdown]
+ [[link boost_asio.reference.basic_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
-Disable sends or receives on the socket.
+ [
- void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
- shutdown_type what);
+ [[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. ]
+
+ ]
- boost::system::error_code ``[link boost_asio.reference.basic_stream_socket.shutdown.overload2 shutdown]``(
- shutdown_type what,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.basic_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
-[section:overload1 basic_stream_socket::shutdown (1 of 2 overloads)]
+ [
+ [[link boost_asio.reference.basic_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
-['Inherited from basic_socket.]
+ [
-Disable sends or receives on the socket.
+ [[link boost_asio.reference.basic_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
- void shutdown(
- shutdown_type what);
+ [
+ [[link boost_asio.reference.basic_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-This function is used to disable send operations, receive operations, or both.
+ [
+ [[link boost_asio.reference.basic_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.basic_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
-[[what][Determines what types of operation will no longer be allowed.]]
+ ]
-]
+ [
-[heading Exceptions]
-
+ [[link boost_asio.reference.basic_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
-[variablelist
+ [
+
+ [[link boost_asio.reference.basic_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
-[[boost::system::system_error][Thrown on failure.]]
+ ]
-]
+ [
-[heading Example]
+ [[link boost_asio.reference.basic_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
-Shutting down the send side of the socket:
+ ]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
+ [
+
+ [[link boost_asio.reference.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:overload2 basic_stream_socket::shutdown (2 of 2 overloads)]
+ [
+ [[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 basic_socket.]
+ [
-Disable sends or receives on the socket.
+ [[link boost_asio.reference.basic_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
- boost::system::error_code shutdown(
- shutdown_type what,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.basic_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-This function is used to disable send operations, receive operations, or both.
+ [
+ [[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 Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.basic_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
-[[what][Determines what types of operation will no longer be allowed.]]
+ ]
-[[ec][Set to indicate what error occurred, if any.]]
+]
+
+[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 Example]
+[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. ]
+ ]
-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.
- }
+[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]
[endsect]
-[section:shutdown_type basic_stream_socket::shutdown_type]
+
+[section:max_connections basic_stream_socket::max_connections]
['Inherited from socket_base.]
-Different ways a socket may be shutdown.
+The maximum length of the queue of pending incoming connections.
- enum shutdown_type
+ static const int max_connections = implementation_defined;
-[heading Values]
-[variablelist
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
+[endsect]
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
-]
+
+[section:message_do_not_route basic_stream_socket::message_do_not_route]
+
+
+['Inherited from socket_base.]
+
+Specify that the data should not be subject to routing.
+
+ static const int message_do_not_route = implementation_defined;
[endsect]
-[section:write_some basic_stream_socket::write_some]
-Write some data to the socket.
+[section:message_flags basic_stream_socket::message_flags]
- 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 socket_base.]
+Bitmask type for flags that can be passed to send and receive operations.
-[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
+ typedef int message_flags;
-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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket.]]
+[section:message_out_of_band basic_stream_socket::message_out_of_band]
-]
-[heading Return Value]
-
-The number of bytes written.
+['Inherited from socket_base.]
-[heading Exceptions]
-
+Process out-of-band data.
-[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.]]
+ static const int message_out_of_band = implementation_defined;
-]
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the
-[link boost_asio.reference.write write] function if you need to ensure that all data is written before the blocking operation completes.
-[heading Example]
-
-To write a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+[endsect]
- 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.
+[section:message_peek basic_stream_socket::message_peek]
+
+
+['Inherited from socket_base.]
+
+Peek at incoming data without removing it from the input queue.
+
+ static const int message_peek = implementation_defined;
@@ -23813,189 +24763,120 @@
-[section:overload2 basic_stream_socket::write_some (2 of 2 overloads)]
+[section:native basic_stream_socket::native]
-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);
+['Inherited from basic_socket.]
+Get the native socket representation.
-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.
+ native_type native();
-[heading Parameters]
-
+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.
-[variablelist
-
-[[buffers][One or more data buffers to be written to the socket.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[endsect]
-]
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the
-[link boost_asio.reference.write write] function if you need to ensure that all data is written before the blocking operation completes.
+[section:native_type basic_stream_socket::native_type]
+The native representation of a socket.
+
+ typedef StreamSocketService::native_type native_type;
-[endsect]
[endsect]
-[endsect]
-[section:basic_streambuf basic_streambuf]
+[section:non_blocking_io basic_stream_socket::non_blocking_io]
-Automatically resizable buffer class based on std::streambuf.
- template<
- typename Allocator = std::allocator<char>>
- class basic_streambuf :
- noncopyable
+['Inherited from socket_base.]
+IO control command to set the blocking mode of the socket.
-[heading Types]
-[table
- [[Name][Description]]
+ typedef implementation_defined non_blocking_io;
- [
- [[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. ]
-
- ]
- [
+Implements the FIONBIO IO control command.
- [[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 Example]
+
-[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. ]
- ]
-
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
-[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]
-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:open basic_stream_socket::open]
-[endsect]
+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:commit basic_streambuf::commit]
+[section:overload1 basic_stream_socket::open (1 of 2 overloads)]
-Move the start of the put area by the specified number of characters.
- void commit(
- std::size_t n);
+['Inherited from basic_socket.]
+Open the socket using the specified protocol.
+ void open(
+ const protocol_type & protocol = protocol_type());
-[endsect]
+This function opens the socket so that it will use the specified protocol.
-[section:const_buffers_type basic_streambuf::const_buffers_type]
+[heading Parameters]
+
-The type used to represent the get area as a list of buffers.
+[variablelist
+
+[[protocol][An object specifying protocol parameters to be used.]]
- typedef implementation_defined const_buffers_type;
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[heading Example]
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ socket.open(boost::asio::ip::tcp::v4());
-[section:consume basic_streambuf::consume]
-Move the start of the get area by the specified number of characters.
- void consume(
- std::size_t n);
@@ -24003,374 +24884,402 @@
-[section:data basic_streambuf::data]
+[section:overload2 basic_stream_socket::open (2 of 2 overloads)]
-Get a list of buffers that represents the get area.
- const_buffers_type data() const;
+['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);
-[endsect]
+This function opens the socket so that it will use the specified protocol.
-[section:max_size basic_streambuf::max_size]
+[heading Parameters]
+
-Return the maximum size of the buffer.
+[variablelist
+
+[[protocol][An object specifying which protocol is to be used.]]
- std::size_t max_size() const;
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Example]
+
-[endsect]
+ 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.
+ }
-[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
-The type used to represent the put area as a list of buffers.
- typedef implementation_defined mutable_buffers_type;
+[endsect]
[endsect]
+[section:protocol_type basic_stream_socket::protocol_type]
-[section:overflow basic_streambuf::overflow]
-
+The protocol type.
+ typedef Protocol protocol_type;
- int_type overflow(
- int_type c);
[endsect]
+[section:read_some basic_stream_socket::read_some]
-[section:prepare basic_streambuf::prepare]
-
-Get a list of buffers that represents the put area, with the given size.
+Read some data from the socket.
- mutable_buffers_type prepare(
- std::size_t size);
+ 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);
-[endsect]
+[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);
-[section:reserve basic_streambuf::reserve]
+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.
- void reserve(
- std::size_t n);
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
+]
-[endsect]
+[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.]]
-[section:size basic_streambuf::size]
+]
-Return the size of the get area in characters.
+[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.
- std::size_t size() const;
+[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));
-[endsect]
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-[section:underflow basic_streambuf::underflow]
+[endsect]
- int_type underflow();
+[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);
-[endsect]
+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.
-[endsect]
+[heading Parameters]
+
-[section:buffer buffer]
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read.]]
-Create a new modifiable buffer from an existing buffer.
+[[ec][Set to indicate what error occurred, if any.]]
- 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);
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
- const_buffers_1 ``[link boost_asio.reference.buffer.overload3 buffer]``(
- const const_buffer & b);
+[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.
- 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);
+[endsect]
- 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);
+[endsect]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
- const PodType & data);
+[section:receive basic_stream_socket::receive]
- 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);
+Receive some data on the socket.
template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
- boost::array< PodType, N > & data);
+ 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 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);
+ 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 PodType,
- std::size_t N>
- const_buffers_1 ``[link boost_asio.reference.buffer.overload13 buffer]``(
- boost::array< const PodType, N > & data);
+ 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);
- 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);
+[section:overload1 basic_stream_socket::receive (1 of 3 overloads)]
- 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);
+Receive some data on the socket.
template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 ``[link boost_asio.reference.buffer.overload17 buffer]``(
- std::vector< PodType, Allocator > & data);
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t receive(
+ const MutableBufferSequence & buffers);
- 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);
+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.
- 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);
+[heading Parameters]
+
- const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
- const std::string & data,
- std::size_t max_size_in_bytes);
+[variablelist
+
+[[buffers][One or more buffers into which the data will be received.]]
-The simplest use case involves reading or writing a single buffer of a specified size:
+]
+[heading Return Value]
+
+The number of bytes received.
+[heading Exceptions]
+
- sock.write(boost::asio::buffer(data, size));
+[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:
-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.
+ socket.receive(boost::asio::buffer(data, size));
-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:
+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.
- char d1[128];
- size_t bytes_transferred = sock.read(boost::asio::buffer(d1));
- std::vector<char> d2(128);
- bytes_transferred = sock.read(boost::asio::buffer(d2));
+[endsect]
- boost::array<char, 128> d3;
- bytes_transferred = sock.read(boost::asio::buffer(d3));
+[section:overload2 basic_stream_socket::receive (2 of 3 overloads)]
+Receive some data on the socket.
-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:
+ 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.
- 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.read(bufs1);
+[heading Parameters]
+
- 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);
+[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]
+
-[section:overload1 buffer (1 of 22 overloads)]
+[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.]]
-Create a new modifiable buffer from an existing buffer.
+]
- mutable_buffers_1 buffer(
- const mutable_buffer & b);
+[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);
-[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:overload2 buffer (2 of 22 overloads)]
-Create a new modifiable buffer from an existing buffer.
+[endsect]
- mutable_buffers_1 buffer(
- const mutable_buffer & b,
- std::size_t max_size_in_bytes);
+[section:overload3 basic_stream_socket::receive (3 of 3 overloads)]
-[endsect]
+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);
-[section:overload3 buffer (3 of 22 overloads)]
+This function is used to receive data on the stream socket. The function call will block until one or more bytes of data has been received successfully, or until an error occurs.
-Create a new non-modifiable buffer from an existing buffer.
- const_buffers_1 buffer(
- const const_buffer & b);
+[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.]]
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Return Value]
+
+The number of bytes received. Returns 0 if an error occurred.
-[section:overload4 buffer (4 of 22 overloads)]
+[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.
-Create a new non-modifiable buffer from an existing buffer.
- const_buffers_1 buffer(
- const const_buffer & b,
- std::size_t max_size_in_bytes);
+[endsect]
[endsect]
+[section:receive_buffer_size basic_stream_socket::receive_buffer_size]
-[section:overload5 buffer (5 of 22 overloads)]
-Create a new modifiable buffer that represents the given memory range.
+['Inherited from socket_base.]
- mutable_buffers_1 buffer(
- void * data,
- std::size_t size_in_bytes);
+Socket option for the receive buffer size of a socket.
+ typedef implementation_defined receive_buffer_size;
-[endsect]
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
-[section:overload6 buffer (6 of 22 overloads)]
+[heading Examples]
+
+Setting the option:
-Create a new non-modifiable buffer that represents the given memory range.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
- const_buffers_1 buffer(
- const void * data,
- std::size_t size_in_bytes);
-[endsect]
-
+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();
-[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);
@@ -24378,98 +25287,94 @@
-[section:overload8 buffer (8 of 22 overloads)]
+[section:receive_low_watermark basic_stream_socket::receive_low_watermark]
-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);
+['Inherited from socket_base.]
+Socket option for the receive low watermark.
+ typedef implementation_defined receive_low_watermark;
-[endsect]
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
-[section:overload9 buffer (9 of 22 overloads)]
-Create a new non-modifiable buffer that represents the given POD array.
+[heading Examples]
+
+Setting the option:
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const PodType & data);
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
-[endsect]
+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();
-[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);
[endsect]
+[section:remote_endpoint basic_stream_socket::remote_endpoint]
-[section:overload11 buffer (11 of 22 overloads)]
+Get the remote endpoint of the socket.
-Create a new modifiable buffer that represents the given POD array.
+ endpoint_type ``[link boost_asio.reference.basic_stream_socket.remote_endpoint.overload1 remote_endpoint]``() const;
- template<
- typename PodType,
- std::size_t N>
- mutable_buffers_1 buffer(
- boost::array< PodType, N > & data);
+ 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)]
-[endsect]
+['Inherited from basic_socket.]
+Get the remote endpoint of the socket.
-[section:overload12 buffer (12 of 22 overloads)]
+ endpoint_type remote_endpoint() const;
-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);
+This function is used to obtain the remote endpoint of the socket.
+[heading Return Value]
+
+An object that represents the remote endpoint of the socket.
-[endsect]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
+
+[heading Example]
+
+
+
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
-[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);
@@ -24477,534 +25382,504 @@
-[section:overload14 buffer (14 of 22 overloads)]
+[section:overload2 basic_stream_socket::remote_endpoint (2 of 2 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);
+['Inherited from basic_socket.]
+Get the remote endpoint of the socket.
+ endpoint_type remote_endpoint(
+ boost::system::error_code & ec) const;
-[endsect]
+This function is used to obtain the remote endpoint of the socket.
-[section:overload15 buffer (15 of 22 overloads)]
+[heading Parameters]
+
-Create a new non-modifiable buffer that represents the given POD array.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
- template<
- typename PodType,
- std::size_t N>
- const_buffers_1 buffer(
- const boost::array< PodType, N > & 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]
+
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::system::error_code ec;
+ boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
+ if (ec)
+ {
+ // An error occurred.
+ }
-[section: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);
+[endsect]
[endsect]
+[section:reuse_address basic_stream_socket::reuse_address]
+
-[section:overload17 buffer (17 of 22 overloads)]
+['Inherited from socket_base.]
-Create a new modifiable buffer that represents the given POD vector.
+Socket option to allow the socket to be bound to an address that is already in use.
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data);
+ typedef implementation_defined reuse_address;
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Examples]
+
+Setting the option:
-[endsect]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
-[section:overload18 buffer (18 of 22 overloads)]
-Create a new modifiable buffer that represents the given POD vector.
+Getting the current option value:
- template<
- typename PodType,
- typename Allocator>
- mutable_buffers_1 buffer(
- std::vector< PodType, Allocator > & data,
- std::size_t max_size_in_bytes);
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option;
+ acceptor.get_option(option);
+ bool is_set = option.value();
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
[endsect]
+[section:send basic_stream_socket::send]
-[section:overload19 buffer (19 of 22 overloads)]
+Send some data on the socket.
-Create a new non-modifiable buffer that represents the given POD vector.
+ 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 PodType,
- typename Allocator>
- const_buffers_1 buffer(
- const std::vector< PodType, Allocator > & data);
+ 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);
-[heading Remarks]
-
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+[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);
-[endsect]
+This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
-[section:overload20 buffer (20 of 22 overloads)]
+[heading Parameters]
+
-Create a new non-modifiable buffer that represents the given POD vector.
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket.]]
- 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]
+
+The number of bytes sent.
+
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
[heading Remarks]
-The buffer is invalidated by any vector operation that would also invalidate iterators.
+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));
-[endsect]
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-[section:overload21 buffer (21 of 22 overloads)]
-Create a new non-modifiable buffer that represents the given string.
+[endsect]
- const_buffers_1 buffer(
- const std::string & data);
+[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);
-[heading Remarks]
-
-The buffer is invalidated by any non-const operation called on the given string object.
+This function is used to send data on the stream socket. The function call will block until one or more bytes of the data has been sent successfully, or an until error occurs.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more data buffers to be sent on the socket.]]
+[[flags][Flags specifying how the send call is to be made.]]
-[section:overload22 buffer (22 of 22 overloads)]
+]
-Create a new non-modifiable buffer that represents the given string.
+[heading Return Value]
+
+The number of bytes sent.
- const_buffers_1 buffer(
- const std::string & data,
- std::size_t max_size_in_bytes);
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
[heading Remarks]
-The buffer is invalidated by any non-const operation called on the given string object.
+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);
-[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:buffered_read_stream buffered_read_stream]
-Adds buffering to the read-related operations of a stream.
+[endsect]
- template<
- typename Stream>
- class buffered_read_stream :
- noncopyable
-[heading Types]
-[table
- [[Name][Description]]
+[section:overload3 basic_stream_socket::send (3 of 3 overloads)]
- [
+Send some data on the socket.
- [[link boost_asio.reference.buffered_read_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
-
- ]
+ 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.buffered_read_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
-
- ]
+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 Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
- [
- [[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. ]
- ]
+[variablelist
-]
+[[buffers][One or more data buffers to be sent on the socket.]]
-[heading Data Members]
-[table
- [[Name][Description]]
+[[flags][Flags specifying how the send call is to be made.]]
- [
- [[link boost_asio.reference.buffered_read_stream.default_buffer_size [*default_buffer_size]]]
- [The default buffer size. ]
- ]
+[[ec][Set to indicate what error occurred, if any.]]
]
-The buffered_read_stream class template can be used to add buffering to the synchronous and asynchronous read operations of a stream.
+[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.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
-[section:async_fill buffered_read_stream::async_fill]
+[endsect]
-Start an asynchronous fill.
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
+[section:send_buffer_size basic_stream_socket::send_buffer_size]
+['Inherited from socket_base.]
-[endsect]
+Socket option for the send buffer size of a socket.
+ typedef implementation_defined send_buffer_size;
-[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.
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+[heading 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);
-[endsect]
-[section:async_write_some buffered_read_stream::async_write_some]
+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();
+
-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]
-Construct, passing the specified argument to initialise the next layer.
+[section:send_low_watermark basic_stream_socket::send_low_watermark]
- 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);
+['Inherited from socket_base.]
+Socket option for the send low watermark.
-[section:overload1 buffered_read_stream::buffered_read_stream (1 of 2 overloads)]
+ typedef implementation_defined send_low_watermark;
-Construct, passing the specified argument to initialise the next layer.
- template<
- typename Arg>
- buffered_read_stream(
- Arg & a);
-
-
-
-[endsect]
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
-[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);
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
-[endsect]
-[endsect]
+Getting the current option value:
-[section:close buffered_read_stream::close]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
-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.
+[endsect]
- void close();
+[section:service basic_stream_socket::service]
-[endsect]
+['Inherited from basic_io_object.]
+The service associated with the I/O object.
-[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
+ service_type & service;
-Close the stream.
- boost::system::error_code close(
- boost::system::error_code & ec);
+[endsect]
-[endsect]
+[section:service_type basic_stream_socket::service_type]
-[endsect]
+['Inherited from basic_io_object.]
-[section:default_buffer_size buffered_read_stream::default_buffer_size]
+The type of the service that will be used to provide I/O operations.
-The default buffer size.
+ typedef StreamSocketService service_type;
- static const std::size_t default_buffer_size = implementation_defined;
[endsect]
-[section:fill buffered_read_stream::fill]
+[section:set_option basic_stream_socket::set_option]
-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.
+Set an option on the socket.
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
+ void ``[link boost_asio.reference.basic_stream_socket.set_option.overload1 set_option]``(
+ const SettableSocketOption & option);
- std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
+ 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 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.
+[section:overload1 basic_stream_socket::set_option (1 of 2 overloads)]
- std::size_t fill();
+['Inherited from basic_socket.]
+Set an option on the socket.
-[endsect]
+ void set_option(
+ const SettableSocketOption & option);
+This function is used to set an option on the socket.
-[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.
+[heading Parameters]
+
- std::size_t fill(
- boost::system::error_code & ec);
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+]
+[heading Exceptions]
+
-[endsect]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::ip::tcp::no_delay option(true);
+ socket.set_option(option);
-[section:get_io_service buffered_read_stream::get_io_service]
-Get the io_service associated with the object.
- boost::asio::io_service & get_io_service();
[endsect]
-[section:in_avail buffered_read_stream::in_avail]
-Determine the amount of data that may be read without blocking.
+[section:overload2 basic_stream_socket::set_option (2 of 2 overloads)]
- 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]``(
+['Inherited from basic_socket.]
+
+Set an option on the socket.
+
+ boost::system::error_code set_option(
+ const SettableSocketOption & option,
boost::system::error_code & ec);
-[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
+This function is used to set an option on the socket.
-Determine the amount of data that may be read without blocking.
- std::size_t in_avail();
+[heading Parameters]
+
+[variablelist
+
+[[option][The new option value to be set on the socket.]]
+[[ec][Set to indicate what error occurred, if any.]]
-[endsect]
+]
+[heading Example]
+
+Setting the IPPROTO\_TCP/TCP\_NODELAY option:
+ 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.
+ }
-[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);
@@ -25013,204 +25888,257 @@
[endsect]
+[section:shutdown basic_stream_socket::shutdown]
-[section:io_service buffered_read_stream::io_service]
+Disable sends or receives on the socket.
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ void ``[link boost_asio.reference.basic_stream_socket.shutdown.overload1 shutdown]``(
+ shutdown_type what);
- boost::asio::io_service & io_service();
+ 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)]
-[endsect]
+['Inherited from basic_socket.]
+Disable sends or receives on the socket.
-[section:lowest_layer buffered_read_stream::lowest_layer]
+ void shutdown(
+ shutdown_type what);
-Get a reference to the lowest layer.
- lowest_layer_type & lowest_layer();
+This function is used to disable send operations, receive operations, or both.
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
+]
+[heading Exceptions]
+
-[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-The type of the lowest layer.
+]
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[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:next_layer buffered_read_stream::next_layer]
+[endsect]
-Get a reference to the next layer.
- next_layer_type & next_layer();
+[section:overload2 basic_stream_socket::shutdown (2 of 2 overloads)]
-[endsect]
+['Inherited from basic_socket.]
+Disable sends or receives on the socket.
+ boost::system::error_code shutdown(
+ shutdown_type what,
+ boost::system::error_code & ec);
-[section:next_layer_type buffered_read_stream::next_layer_type]
-The type of the next layer.
+This function is used to disable send operations, receive operations, or both.
- typedef boost::remove_reference< Stream >::type next_layer_type;
+[heading Parameters]
+
+[variablelist
+
+[[what][Determines what types of operation will no longer be allowed.]]
+[[ec][Set to indicate what error occurred, if any.]]
-[endsect]
+]
+[heading Example]
+
+Shutting down the send side of the socket:
-[section:peek buffered_read_stream::peek]
+ 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.
+ }
-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.
+[endsect]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+[endsect]
-[endsect]
+[section:shutdown_type basic_stream_socket::shutdown_type]
+['Inherited from socket_base.]
-[section:overload2 buffered_read_stream::peek (2 of 2 overloads)]
+Different ways a socket may be shutdown.
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
+ enum shutdown_type
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[heading Values]
+[variablelist
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
+ [
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
+ ]
+
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
+
+]
-[endsect]
[endsect]
-[section:read_some buffered_read_stream::read_some]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+[section:write_some basic_stream_socket::write_some]
+
+Write some data to the socket.
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);
+ 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.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_read_stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
+ 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 buffered_read_stream::read_some (1 of 2 overloads)]
+[section:overload1 basic_stream_socket::write_some (1 of 2 overloads)]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+Write some data to the socket.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+ 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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the socket.]]
-[section:overload2 buffered_read_stream::read_some (2 of 2 overloads)]
+]
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
+[heading Return Value]
+
+The number of bytes written.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[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:
-[endsect]
+ socket.write_some(boost::asio::buffer(data, size));
-[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.
+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.
- 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);
+[endsect]
-[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.
+
+[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);
+ 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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the socket.]]
-[section:overload2 buffered_read_stream::write_some (2 of 2 overloads)]
+[[ec][Set to indicate what error occurred, if any.]]
-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 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.
@@ -25222,13 +26150,13 @@
[endsect]
-[section:buffered_stream buffered_stream]
+[section:basic_streambuf basic_streambuf]
-Adds buffering to the read- and write-related operations of a stream.
+Automatically resizable buffer class based on std::streambuf.
template<
- typename Stream>
- class buffered_stream :
+ typename Allocator = std::allocator<char>>
+ class basic_streambuf :
noncopyable
@@ -25238,15 +26166,15 @@
[
- [[link boost_asio.reference.buffered_stream.lowest_layer_type [*lowest_layer_type]]]
- [The type of the lowest layer. ]
+ [[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.buffered_stream.next_layer_type [*next_layer_type]]]
- [The type of the next layer. ]
+ [[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. ]
]
@@ -25257,106 +26185,84 @@
[[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.basic_streambuf.basic_streambuf [*basic_streambuf]]]
+ [Construct a buffer with a specified maximum size. ]
]
[
- [[link boost_asio.reference.buffered_stream.flush [*flush]]]
- [Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure. ]
+ [[link boost_asio.reference.basic_streambuf.commit [*commit]]]
+ [Move the start of the put area by the specified number of characters. ]
]
[
- [[link boost_asio.reference.buffered_stream.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[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.buffered_stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
+ [[link boost_asio.reference.basic_streambuf.data [*data]]]
+ [Get a list of buffers that represents the get area. ]
]
[
- [[link boost_asio.reference.buffered_stream.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
+ [Return the maximum size of the buffer. ]
]
[
- [[link boost_asio.reference.buffered_stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[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.buffered_stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[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.buffered_stream.peek [*peek]]]
- [Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure. ]
+ [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
+ []
]
[
- [[link boost_asio.reference.buffered_stream.read_some [*read_some]]]
- [Read some data from the stream. Returns the number of bytes read. Throws an exception on failure. ]
+ [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
+ []
]
[
- [[link boost_asio.reference.buffered_stream.write_some [*write_some]]]
- [Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure. ]
+ [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
+ []
]
]
-The buffered_stream class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
+[section:basic_streambuf basic_streambuf::basic_streambuf]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+Construct a buffer with a specified maximum size.
-[*Shared] [*objects:] Unsafe.
+ basic_streambuf(
+ std::size_t max_size = (std::numeric_limits< std::size_t >::max)(),
+ const Allocator & allocator = Allocator());
-[section:async_fill buffered_stream::async_fill]
+[endsect]
-Start an asynchronous fill.
- template<
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_fill(
- ReadHandler handler);
+
+[section:commit basic_streambuf::commit]
+
+Move the start of the put area by the specified number of characters.
+
+ void commit(
+ std::size_t n);
@@ -25364,14 +26270,12 @@
-[section:async_flush buffered_stream::async_flush]
+[section:const_buffers_type basic_streambuf::const_buffers_type]
-Start an asynchronous flush.
+The type used to represent the get area as a list of buffers.
+
+ typedef implementation_defined const_buffers_type;
- template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
@@ -25379,16 +26283,12 @@
-[section:async_read_some buffered_stream::async_read_some]
+[section:consume basic_streambuf::consume]
-Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation.
+Move the start of the get area by the specified number of characters.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
- const MutableBufferSequence & buffers,
- ReadHandler handler);
+ void consume(
+ std::size_t n);
@@ -25396,87 +26296,62 @@
-[section:async_write_some buffered_stream::async_write_some]
+[section:data basic_streambuf::data]
-Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation.
+Get a list of buffers that represents the get area.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ const_buffers_type data() const;
[endsect]
-[section:buffered_stream buffered_stream::buffered_stream]
-Construct, passing the specified argument to initialise the next layer.
+[section:max_size basic_streambuf::max_size]
- template<
- typename Arg>
- ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
- Arg & a);
+Return the maximum size of the buffer.
- 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);
+ std::size_t max_size() const;
-[section:overload1 buffered_stream::buffered_stream (1 of 2 overloads)]
-Construct, passing the specified argument to initialise the next layer.
+[endsect]
- template<
- typename Arg>
- buffered_stream(
- Arg & a);
+[section:mutable_buffers_type basic_streambuf::mutable_buffers_type]
-[endsect]
+The type used to represent the put area as a list of buffers.
+ typedef implementation_defined mutable_buffers_type;
-[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:overflow basic_streambuf::overflow]
-[endsect]
-[section:close buffered_stream::close]
+ int_type overflow(
+ int_type c);
-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);
+[endsect]
-[section:overload1 buffered_stream::close (1 of 2 overloads)]
-Close the stream.
+[section:prepare basic_streambuf::prepare]
- void close();
+Get a list of buffers that represents the put area, with the given size.
+
+ mutable_buffers_type prepare(
+ std::size_t size);
@@ -25484,119 +26359,226 @@
-[section:overload2 buffered_stream::close (2 of 2 overloads)]
+[section:reserve basic_streambuf::reserve]
-Close the stream.
- boost::system::error_code close(
- boost::system::error_code & ec);
+
+ void reserve(
+ std::size_t n);
[endsect]
+
+[section:size basic_streambuf::size]
+
+Return the size of the get area in characters.
+
+ std::size_t size() const;
+
+
+
[endsect]
-[section:fill buffered_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_stream.fill.overload1 fill]``();
+[section:underflow basic_streambuf::underflow]
- 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)]
+ int_type underflow();
-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]
[endsect]
+[section:buffer buffer]
+Create a new modifiable buffer from an existing buffer.
-[section:overload2 buffered_stream::fill (2 of 2 overloads)]
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload1 buffer]``(
+ const mutable_buffer & b);
-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.
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload2 buffer]``(
+ const mutable_buffer & b,
+ std::size_t max_size_in_bytes);
- std::size_t fill(
- boost::system::error_code & ec);
+ 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);
-[endsect]
+ 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);
-[endsect]
+ 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);
-[section:flush buffered_stream::flush]
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload9 buffer]``(
+ const PodType & data);
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+ template<
+ typename 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);
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload1 flush]``();
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 ``[link boost_asio.reference.buffer.overload11 buffer]``(
+ boost::array< PodType, N > & data);
- std::size_t ``[link boost_asio.reference.buffered_stream.flush.overload2 flush]``(
- boost::system::error_code & ec);
+ 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);
-[section:overload1 buffered_stream::flush (1 of 2 overloads)]
+ 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);
-Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure.
+ template<
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload15 buffer]``(
+ const boost::array< PodType, N > & data);
- std::size_t flush();
+ 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);
-[endsect]
+ 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);
-[section:overload2 buffered_stream::flush (2 of 2 overloads)]
+ const_buffers_1 ``[link boost_asio.reference.buffer.overload22 buffer]``(
+ const std::string & data,
+ std::size_t max_size_in_bytes);
-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.
+The simplest use case involves reading or writing a single buffer of a specified size:
- std::size_t flush(
- boost::system::error_code & ec);
+ sock.write(boost::asio::buffer(data, size));
-[endsect]
-[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.
-[section:get_io_service buffered_stream::get_io_service]
+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:
-Get the io_service associated with the object.
- boost::asio::io_service & get_io_service();
+ char d1[128];
+ size_t bytes_transferred = sock.read(boost::asio::buffer(d1));
+ std::vector<char> d2(128);
+ bytes_transferred = sock.read(boost::asio::buffer(d2));
-[endsect]
+ boost::array<char, 128> d3;
+ bytes_transferred = sock.read(boost::asio::buffer(d3));
-[section:in_avail buffered_stream::in_avail]
-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]``();
+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:
- 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)]
+ char d1[128];
+ std::vector<char> d2(128);
+ boost::array<char, 128> d3;
-Determine the amount of data that may be read without blocking.
+ boost::array<mutable_buffer, 3> bufs1 = {
+ boost::asio::buffer(d1),
+ boost::asio::buffer(d2),
+ boost::asio::buffer(d3) };
+ bytes_transferred = sock.read(bufs1);
- std::size_t in_avail();
+ 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);
+
+
+
+
+
+[section:overload1 buffer (1 of 22 overloads)]
+
+Create a new modifiable buffer from an existing buffer.
+
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b);
@@ -25604,26 +26586,40 @@
-[section:overload2 buffered_stream::in_avail (2 of 2 overloads)]
+[section:overload2 buffer (2 of 22 overloads)]
-Determine the amount of data that may be read without blocking.
+Create a new modifiable buffer from an existing buffer.
- std::size_t in_avail(
- boost::system::error_code & ec);
+ mutable_buffers_1 buffer(
+ const mutable_buffer & b,
+ std::size_t 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);
+
+
+
[endsect]
-[section:io_service buffered_stream::io_service]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[section:overload4 buffer (4 of 22 overloads)]
- boost::asio::io_service & io_service();
+Create a new non-modifiable buffer from an existing buffer.
+
+ const_buffers_1 buffer(
+ const const_buffer & b,
+ std::size_t max_size_in_bytes);
@@ -25631,11 +26627,13 @@
-[section:lowest_layer buffered_stream::lowest_layer]
+[section:overload5 buffer (5 of 22 overloads)]
-Get a reference to the lowest layer.
+Create a new modifiable buffer that represents the given memory range.
- lowest_layer_type & lowest_layer();
+ mutable_buffers_1 buffer(
+ void * data,
+ std::size_t size_in_bytes);
@@ -25643,12 +26641,13 @@
-[section:lowest_layer_type buffered_stream::lowest_layer_type]
-
-The type of the lowest layer.
+[section:overload6 buffer (6 of 22 overloads)]
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+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);
@@ -25656,11 +26655,15 @@
-[section:next_layer buffered_stream::next_layer]
+[section:overload7 buffer (7 of 22 overloads)]
-Get a reference to the next layer.
+Create a new modifiable buffer that represents the given POD array.
- next_layer_type & next_layer();
+ template<
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ PodType & data);
@@ -25668,42 +26671,49 @@
-[section:next_layer_type buffered_stream::next_layer_type]
-
-The type of the next layer.
+[section:overload8 buffer (8 of 22 overloads)]
- typedef boost::remove_reference< Stream >::type next_layer_type;
+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);
[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.
+[section:overload9 buffer (9 of 22 overloads)]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
+Create a new non-modifiable buffer that represents the given POD array.
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);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType & data);
-[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.
+[endsect]
+
+
+
+[section:overload10 buffer (10 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const PodType & data,
+ std::size_t max_size_in_bytes);
@@ -25711,47 +26721,48 @@
-[section:overload2 buffered_stream::peek (2 of 2 overloads)]
+[section:overload11 buffer (11 of 22 overloads)]
-Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred.
+Create a new modifiable buffer that represents the given POD array.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ boost::array< PodType, N > & data);
[endsect]
-[endsect]
-[section:read_some buffered_stream::read_some]
+[section:overload12 buffer (12 of 22 overloads)]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+Create a new modifiable buffer that represents the given POD array.
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);
+ typename PodType,
+ std::size_t N>
+ mutable_buffers_1 buffer(
+ boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
- 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)]
+[endsect]
-Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
+
+
+[section:overload13 buffer (13 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ boost::array< const PodType, N > & data);
@@ -25759,47 +26770,49 @@
-[section:overload2 buffered_stream::read_some (2 of 2 overloads)]
+[section:overload14 buffer (14 of 22 overloads)]
-Read some data from the stream. Returns the number of bytes read or 0 if an error occurred.
+Create a new non-modifiable buffer that represents the given POD array.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ boost::array< const PodType, N > & data,
+ std::size_t max_size_in_bytes);
[endsect]
-[endsect]
-[section:write_some buffered_stream::write_some]
+[section:overload15 buffer (15 of 22 overloads)]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+Create a new non-modifiable buffer that represents the given POD array.
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);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const boost::array< PodType, N > & data);
- 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)]
+[endsect]
-Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
+
+
+[section:overload16 buffer (16 of 22 overloads)]
+
+Create a new non-modifiable buffer that represents the given POD array.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+ typename PodType,
+ std::size_t N>
+ const_buffers_1 buffer(
+ const boost::array< PodType, N > & data,
+ std::size_t max_size_in_bytes);
@@ -25807,127 +26820,237 @@
-[section:overload2 buffered_stream::write_some (2 of 2 overloads)]
+[section:overload17 buffer (17 of 22 overloads)]
-Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred.
+Create a new modifiable buffer that represents the given POD vector.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data);
-[endsect]
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
+
[endsect]
-[endsect]
-[section:buffered_write_stream buffered_write_stream]
+[section:overload18 buffer (18 of 22 overloads)]
-Adds buffering to the write-related operations of a stream.
+Create a new modifiable buffer that represents the given POD vector.
template<
- typename Stream>
- class buffered_write_stream :
- noncopyable
+ typename PodType,
+ typename Allocator>
+ mutable_buffers_1 buffer(
+ std::vector< PodType, Allocator > & data,
+ std::size_t max_size_in_bytes);
-[heading Types]
-[table
- [[Name][Description]]
- [
+[heading Remarks]
+
+The buffer is invalidated by any vector operation that would also invalidate iterators.
- [[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. ]
-
- ]
+[endsect]
-]
-[heading Member Functions]
+
+[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 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 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 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 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_write_stream.async_flush [*async_flush]]]
- [Start an asynchronous flush. ]
+
+ [[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_write_stream.async_read_some [*async_read_some]]]
+ [[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_write_stream.async_write_some [*async_write_some]]]
+ [[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_write_stream.buffered_write_stream [*buffered_write_stream]]]
+ [[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_write_stream.close [*close]]]
+ [[link boost_asio.reference.buffered_read_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_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_write_stream.get_io_service [*get_io_service]]]
+ [[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_write_stream.in_avail [*in_avail]]]
+ [[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_write_stream.io_service [*io_service]]]
+ [[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_write_stream.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.buffered_read_stream.lowest_layer [*lowest_layer]]]
[Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.next_layer [*next_layer]]]
+ [[link boost_asio.reference.buffered_read_stream.next_layer [*next_layer]]]
[Get a reference to the next layer. ]
]
[
- [[link boost_asio.reference.buffered_write_stream.peek [*peek]]]
+ [[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_write_stream.read_some [*read_some]]]
+ [[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_write_stream.write_some [*write_some]]]
+ [[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. ]
]
@@ -25938,13 +27061,13 @@
[[Name][Description]]
[
- [[link boost_asio.reference.buffered_write_stream.default_buffer_size [*default_buffer_size]]]
+ [[link boost_asio.reference.buffered_read_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.
+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]
@@ -25955,14 +27078,14 @@
-[section:async_flush buffered_write_stream::async_flush]
+[section:async_fill buffered_read_stream::async_fill]
-Start an asynchronous flush.
+Start an asynchronous fill.
template<
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_flush(
- WriteHandler handler);
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
@@ -25970,7 +27093,7 @@
-[section:async_read_some buffered_write_stream::async_read_some]
+[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.
@@ -25987,7 +27110,7 @@
-[section:async_write_some buffered_write_stream::async_write_some]
+[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.
@@ -26003,29 +27126,29 @@
[endsect]
-[section:buffered_write_stream buffered_write_stream::buffered_write_stream]
+[section:buffered_read_stream buffered_read_stream::buffered_read_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]``(
+ ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload1 buffered_read_stream]``(
Arg & a);
template<
typename Arg>
- ``[link boost_asio.reference.buffered_write_stream.buffered_write_stream.overload2 buffered_write_stream]``(
+ ``[link boost_asio.reference.buffered_read_stream.buffered_read_stream.overload2 buffered_read_stream]``(
Arg & a,
std::size_t buffer_size);
-[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
+[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_write_stream(
+ buffered_read_stream(
Arg & a);
@@ -26034,13 +27157,13 @@
-[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
+[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_write_stream(
+ buffered_read_stream(
Arg & a,
std::size_t buffer_size);
@@ -26051,17 +27174,17 @@
[endsect]
-[section:close buffered_write_stream::close]
+[section:close buffered_read_stream::close]
Close the stream.
- void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
+ void ``[link boost_asio.reference.buffered_read_stream.close.overload1 close]``();
- boost::system::error_code ``[link boost_asio.reference.buffered_write_stream.close.overload2 close]``(
+ boost::system::error_code ``[link boost_asio.reference.buffered_read_stream.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 buffered_write_stream::close (1 of 2 overloads)]
+[section:overload1 buffered_read_stream::close (1 of 2 overloads)]
Close the stream.
@@ -26073,7 +27196,7 @@
-[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
+[section:overload2 buffered_read_stream::close (2 of 2 overloads)]
Close the stream.
@@ -26088,7 +27211,7 @@
[endsect]
-[section:default_buffer_size buffered_write_stream::default_buffer_size]
+[section:default_buffer_size buffered_read_stream::default_buffer_size]
The default buffer size.
@@ -26099,21 +27222,21 @@
[endsect]
-[section:flush buffered_write_stream::flush]
+[section:fill buffered_read_stream::fill]
-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.
+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_write_stream.flush.overload1 flush]``();
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload1 fill]``();
- std::size_t ``[link boost_asio.reference.buffered_write_stream.flush.overload2 flush]``(
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.fill.overload2 fill]``(
boost::system::error_code & ec);
-[section:overload1 buffered_write_stream::flush (1 of 2 overloads)]
+[section:overload1 buffered_read_stream::fill (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.
+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 flush();
+ std::size_t fill();
@@ -26121,11 +27244,11 @@
-[section:overload2 buffered_write_stream::flush (2 of 2 overloads)]
+[section:overload2 buffered_read_stream::fill (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.
+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 flush(
+ std::size_t fill(
boost::system::error_code & ec);
@@ -26136,7 +27259,7 @@
[endsect]
-[section:get_io_service buffered_write_stream::get_io_service]
+[section:get_io_service buffered_read_stream::get_io_service]
Get the io_service associated with the object.
@@ -26147,17 +27270,17 @@
[endsect]
-[section:in_avail buffered_write_stream::in_avail]
+[section:in_avail buffered_read_stream::in_avail]
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_read_stream.in_avail.overload1 in_avail]``();
- std::size_t ``[link boost_asio.reference.buffered_write_stream.in_avail.overload2 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_write_stream::in_avail (1 of 2 overloads)]
+[section:overload1 buffered_read_stream::in_avail (1 of 2 overloads)]
Determine the amount of data that may be read without blocking.
@@ -26169,7 +27292,7 @@
-[section:overload2 buffered_write_stream::in_avail (2 of 2 overloads)]
+[section:overload2 buffered_read_stream::in_avail (2 of 2 overloads)]
Determine the amount of data that may be read without blocking.
@@ -26184,7 +27307,7 @@
[endsect]
-[section:io_service buffered_write_stream::io_service]
+[section:io_service buffered_read_stream::io_service]
(Deprecated: use get_io_service().) Get the io_service associated with the object.
@@ -26196,7 +27319,7 @@
-[section:lowest_layer buffered_write_stream::lowest_layer]
+[section:lowest_layer buffered_read_stream::lowest_layer]
Get a reference to the lowest layer.
@@ -26208,7 +27331,7 @@
-[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
+[section:lowest_layer_type buffered_read_stream::lowest_layer_type]
The type of the lowest layer.
@@ -26221,7 +27344,7 @@
-[section:next_layer buffered_write_stream::next_layer]
+[section:next_layer buffered_read_stream::next_layer]
Get a reference to the next layer.
@@ -26233,7 +27356,7 @@
-[section:next_layer_type buffered_write_stream::next_layer_type]
+[section:next_layer_type buffered_read_stream::next_layer_type]
The type of the next layer.
@@ -26245,23 +27368,23 @@
[endsect]
-[section:peek buffered_write_stream::peek]
+[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_write_stream.peek.overload1 peek]``(
+ 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_write_stream.peek.overload2 peek]``(
+ std::size_t ``[link boost_asio.reference.buffered_read_stream.peek.overload2 peek]``(
const MutableBufferSequence & buffers,
boost::system::error_code & ec);
-[section:overload1 buffered_write_stream::peek (1 of 2 overloads)]
+[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.
@@ -26276,7 +27399,7 @@
-[section:overload2 buffered_write_stream::peek (2 of 2 overloads)]
+[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.
@@ -26293,23 +27416,23 @@
[endsect]
-[section:read_some buffered_write_stream::read_some]
+[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.
template<
typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.buffered_write_stream.read_some.overload1 read_some]``(
+ 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_write_stream.read_some.overload2 read_some]``(
+ 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_write_stream::read_some (1 of 2 overloads)]
+[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.
@@ -26324,7 +27447,7 @@
-[section:overload2 buffered_write_stream::read_some (2 of 2 overloads)]
+[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.
@@ -26341,23 +27464,23 @@
[endsect]
-[section:write_some buffered_write_stream::write_some]
+[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_write_stream.write_some.overload1 write_some]``(
+ 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_write_stream.write_some.overload2 write_some]``(
+ 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_write_stream::write_some (1 of 2 overloads)]
+[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.
@@ -26372,9 +27495,9 @@
-[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
+[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 and the error handler did not throw.
+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]``>
@@ -26392,56 +27515,141 @@
[endsect]
-[section:const_buffer const_buffer]
+[section:buffered_stream buffered_stream]
-Holds a buffer that cannot be modified.
+Adds buffering to the read- and write-related operations of a stream.
- class const_buffer
+ template<
+ typename Stream>
+ class buffered_stream :
+ noncopyable
-[heading Member Functions]
+[heading Types]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer. ]
+
+ [[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 Related Functions]
+[heading Member 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.buffered_stream.async_fill [*async_fill]]]
+ [Start an asynchronous fill. ]
]
[
- [[link boost_asio.reference.const_buffer.buffer_size [*buffer_size]]]
- [Get the number of bytes in a non-modifiable buffer. ]
+ [[link boost_asio.reference.buffered_stream.async_flush [*async_flush]]]
+ [Start an asynchronous flush. ]
]
[
- [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
- [Create a new non-modifiable buffer that is offset from the start of another. ]
+ [[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 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.
+The buffered_stream class template can be used to add buffering to the synchronous and asynchronous read and write operations of a stream.
-[section:buffer_cast const_buffer::buffer_cast]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Cast a non-modifiable buffer to a specified pointer to POD type.
+[*Shared] [*objects:] Unsafe.
+
+
+
+[section:async_fill buffered_stream::async_fill]
+
+Start an asynchronous fill.
template<
- typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
- PointerToPodType buffer_cast(
- const const_buffer & b);
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_fill(
+ ReadHandler handler);
@@ -26449,51 +27657,79 @@
-[section:buffer_size const_buffer::buffer_size]
+[section:async_flush buffered_stream::async_flush]
-Get the number of bytes in a non-modifiable buffer.
+Start an asynchronous flush.
- std::size_t buffer_size(
- const const_buffer & b);
+ template<
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
[endsect]
-[section:const_buffer const_buffer::const_buffer]
-Construct an empty buffer.
+[section:async_read_some buffered_stream::async_read_some]
- ``[link boost_asio.reference.const_buffer.const_buffer.overload1 const_buffer]``();
+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.const_buffer.const_buffer.overload2 const_buffer]``(
- const void * data,
- std::size_t size);
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
+ typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
+ void async_read_some(
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
- ``[link boost_asio.reference.const_buffer.const_buffer.overload3 const_buffer]``(
- const mutable_buffer & b);
-[section:overload1 const_buffer::const_buffer (1 of 3 overloads)]
+[endsect]
-Construct an empty buffer.
- const_buffer();
+
+[section:async_write_some buffered_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_stream buffered_stream::buffered_stream]
-[section:overload2 const_buffer::const_buffer (2 of 3 overloads)]
+Construct, passing the specified argument to initialise the next layer.
-Construct a buffer to represent a given memory range.
+ template<
+ typename Arg>
+ ``[link boost_asio.reference.buffered_stream.buffered_stream.overload1 buffered_stream]``(
+ Arg & a);
- const_buffer(
- const void * data,
- std::size_t size);
+ 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);
@@ -26501,12 +27737,16 @@
-[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
+[section:overload2 buffered_stream::buffered_stream (2 of 2 overloads)]
-Construct a non-modifiable buffer from a modifiable one.
+Construct, passing the specified argument to initialise the next layer.
- const_buffer(
- const mutable_buffer & b);
+ template<
+ typename Arg>
+ buffered_stream(
+ Arg & a,
+ std::size_t read_buffer_size,
+ std::size_t write_buffer_size);
@@ -26515,26 +27755,21 @@
[endsect]
-[section:operator_plus_ const_buffer::operator+]
+[section:close buffered_stream::close]
-Create a new non-modifiable buffer that is offset from the start of another.
+Close the stream.
- const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload1 operator+]``(
- const const_buffer & b,
- std::size_t start);
+ void ``[link boost_asio.reference.buffered_stream.close.overload1 close]``();
- const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const const_buffer & b);
+ boost::system::error_code ``[link boost_asio.reference.buffered_stream.close.overload2 close]``(
+ boost::system::error_code & ec);
-[section:overload1 const_buffer::operator+ (1 of 2 overloads)]
+[section:overload1 buffered_stream::close (1 of 2 overloads)]
-Create a new non-modifiable buffer that is offset from the start of another.
+Close the stream.
- const_buffer operator+(
- const const_buffer & b,
- std::size_t start);
+ void close();
@@ -26542,13 +27777,12 @@
-[section:overload2 const_buffer::operator+ (2 of 2 overloads)]
+[section:overload2 buffered_stream::close (2 of 2 overloads)]
-Create a new non-modifiable buffer that is offset from the start of another.
+Close the stream.
- const_buffer operator+(
- std::size_t start,
- const const_buffer & b);
+ boost::system::error_code close(
+ boost::system::error_code & ec);
@@ -26557,85 +27791,57 @@
[endsect]
+[section:fill buffered_stream::fill]
-[endsect]
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation. Throws an exception on failure.
-[section:const_buffers_1 const_buffers_1]
+ std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload1 fill]``();
-Adapts a single non-modifiable buffer so that it meets the requirements of the ConstBufferSequence concept.
+ std::size_t ``[link boost_asio.reference.buffered_stream.fill.overload2 fill]``(
+ boost::system::error_code & ec);
- class const_buffers_1 :
- public const_buffer
+[section:overload1 buffered_stream::fill (1 of 2 overloads)]
-[heading Types]
-[table
- [[Name][Description]]
+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();
- [[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. ]
-
- ]
+[endsect]
-]
-[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 single non-modifiable buffer. ]
- ]
-
- [
- [[link boost_asio.reference.const_buffers_1.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
- ]
-
-]
+[section:overload2 buffered_stream::fill (2 of 2 overloads)]
-[heading Related Functions]
-[table
- [[Name][Description]]
+Fill the buffer with some data. Returns the number of bytes placed in the buffer as a result of the operation, or 0 if an error occurred.
- [
- [[link boost_asio.reference.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. ]
- ]
-
-]
+ std::size_t fill(
+ boost::system::error_code & ec);
-[section:begin const_buffers_1::begin]
-Get a random-access iterator to the first element.
+[endsect]
- const_iterator begin() const;
+
+[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)]
+
+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();
@@ -26643,33 +27849,47 @@
-[section:buffer_cast const_buffers_1::buffer_cast]
+[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.
-['Inherited from const_buffer.]
+ std::size_t flush(
+ boost::system::error_code & ec);
-Cast a non-modifiable buffer to a specified pointer to POD type.
- template<
- typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
- PointerToPodType buffer_cast(
- const const_buffer & b);
+[endsect]
[endsect]
+[section:get_io_service buffered_stream::get_io_service]
-[section:buffer_size const_buffers_1::buffer_size]
+Get the io_service associated with the object.
+
+ boost::asio::io_service & get_io_service();
-['Inherited from const_buffer.]
-Get the number of bytes in a non-modifiable buffer.
+[endsect]
+
+
+[section:in_avail buffered_stream::in_avail]
+
+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);
- std::size_t buffer_size(
- const const_buffer & b);
+
+[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();
@@ -26677,25 +27897,26 @@
-[section:const_buffers_1 const_buffers_1::const_buffers_1]
+[section:overload2 buffered_stream::in_avail (2 of 2 overloads)]
-Construct to represent a single non-modifiable buffer.
+Determine the amount of data that may be read without blocking.
- const_buffers_1(
- const const_buffer & b);
+ std::size_t in_avail(
+ boost::system::error_code & ec);
[endsect]
+[endsect]
-[section:const_iterator const_buffers_1::const_iterator]
-A random-access iterator type that may be used to read elements.
+[section:io_service buffered_stream::io_service]
- typedef const const_buffer * const_iterator;
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
@@ -26703,40 +27924,36 @@
-[section:end const_buffers_1::end]
+[section:lowest_layer buffered_stream::lowest_layer]
-Get a random-access iterator for one past the last element.
+Get a reference to the lowest layer.
- const_iterator end() const;
+ lowest_layer_type & lowest_layer();
[endsect]
-[section:operator_plus_ const_buffers_1::operator+]
-Create a new non-modifiable buffer that is offset from the start of another.
+[section:lowest_layer_type buffered_stream::lowest_layer_type]
- const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload1 operator+]``(
- const const_buffer & b,
- std::size_t start);
+The type of the lowest layer.
- const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const const_buffer & b);
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
-[section:overload1 const_buffers_1::operator+ (1 of 2 overloads)]
-['Inherited from const_buffer.]
+[endsect]
-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);
+
+[section:next_layer buffered_stream::next_layer]
+
+Get a reference to the next layer.
+
+ next_layer_type & next_layer();
@@ -26744,65 +27961,90 @@
-[section:overload2 const_buffers_1::operator+ (2 of 2 overloads)]
+[section:next_layer_type buffered_stream::next_layer_type]
+The type of the next layer.
-['Inherited from const_buffer.]
+ typedef boost::remove_reference< Stream >::type next_layer_type;
-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]
+
+
+[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: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]
-[section:value_type const_buffers_1::value_type]
+[endsect]
-The type for each element in the list of buffers.
+[section:read_some buffered_stream::read_some]
- typedef const_buffer value_type;
+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);
-[heading Member Functions]
-[table
- [[Name][Description]]
+ 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);
- [
- [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
- [Construct an empty buffer. ]
- ]
-
-]
-[heading Related Functions]
-[table
- [[Name][Description]]
+[section:overload1 buffered_stream::read_some (1 of 2 overloads)]
- [
- [[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. ]
- ]
-
-]
+Read some data from the stream. Returns the number of bytes read. Throws an exception on failure.
-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.
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers);
@@ -26810,47 +28052,99 @@
+[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:datagram_socket_service datagram_socket_service]
-Default service implementation for a datagram socket.
+[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.Protocol Protocol]``>
- class datagram_socket_service :
- public io_service::service
+ 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);
-[heading Types]
-[table
- [[Name][Description]]
- [
+[section:overload1 buffered_stream::write_some (1 of 2 overloads)]
- [[link boost_asio.reference.datagram_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
- [
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
- [[link boost_asio.reference.datagram_socket_service.implementation_type [*implementation_type]]]
- [The type of a datagram socket. ]
-
- ]
+
+
+[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.datagram_socket_service.native_type [*native_type]]]
- [The native socket type. ]
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.buffered_write_stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
]
@@ -26861,158 +28155,73 @@
[[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.buffered_write_stream.async_flush [*async_flush]]]
+ [Start an asynchronous flush. ]
]
[
- [[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.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.datagram_socket_service.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[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.datagram_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[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.datagram_socket_service.native [*native]]]
- [Get the native socket implementation. ]
+ [[link boost_asio.reference.buffered_write_stream.close [*close]]]
+ [Close the stream. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.open [*open]]]
- []
+ [[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.datagram_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[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.datagram_socket_service.receive_from [*receive_from]]]
- [Receive a datagram with the endpoint of the sender. ]
+ [[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.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote 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.datagram_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[link boost_asio.reference.buffered_write_stream.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [[link boost_asio.reference.buffered_write_stream.next_layer [*next_layer]]]
+ [Get a reference to the next layer. ]
]
[
- [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[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.datagram_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[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.datagram_socket_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[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. ]
]
]
@@ -27022,58 +28231,31 @@
[[Name][Description]]
[
- [[link boost_asio.reference.datagram_socket_service.id [*id]]]
- [The unique service identifier. ]
+ [[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.
-[section:assign datagram_socket_service::assign]
-Assign an existing native socket to a datagram socket.
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- 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]
+[*Shared] [*objects:] Unsafe.
-[section:async_receive datagram_socket_service::async_receive]
+[section:async_flush buffered_write_stream::async_flush]
-Start an asynchronous receive.
+Start an asynchronous flush.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive(
- implementation_type & impl,
- const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
- ReadHandler handler);
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_flush(
+ WriteHandler handler);
@@ -27081,18 +28263,15 @@
-[section:async_receive_from datagram_socket_service::async_receive_from]
+[section:async_read_some buffered_write_stream::async_read_some]
-Start an asynchronous receive that will get the endpoint of the sender.
+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_receive_from(
- implementation_type & impl,
+ void async_read_some(
const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
ReadHandler handler);
@@ -27101,17 +28280,15 @@
-[section:async_send datagram_socket_service::async_send]
+[section:async_write_some buffered_write_stream::async_write_some]
-Start an asynchronous send.
+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_send(
- implementation_type & impl,
+ void async_write_some(
const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
WriteHandler handler);
@@ -27119,34 +28296,30 @@
[endsect]
+[section:buffered_write_stream buffered_write_stream::buffered_write_stream]
-[section:async_send_to datagram_socket_service::async_send_to]
-
-Start an asynchronous send.
+Construct, passing the specified argument to initialise the next layer.
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]
+ 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:at_mark datagram_socket_service::at_mark]
+[section:overload1 buffered_write_stream::buffered_write_stream (1 of 2 overloads)]
-Determine whether the socket is at the out-of-band data mark.
+Construct, passing the specified argument to initialise the next layer.
- bool at_mark(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ template<
+ typename Arg>
+ buffered_write_stream(
+ Arg & a);
@@ -27154,42 +28327,38 @@
-[section:available datagram_socket_service::available]
+[section:overload2 buffered_write_stream::buffered_write_stream (2 of 2 overloads)]
-Determine the number of bytes available for reading.
+Construct, passing the specified argument to initialise the next layer.
- std::size_t available(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ template<
+ typename Arg>
+ buffered_write_stream(
+ Arg & a,
+ std::size_t buffer_size);
[endsect]
+[endsect]
-[section:bind datagram_socket_service::bind]
+[section:close buffered_write_stream::close]
+Close the stream.
+ void ``[link boost_asio.reference.buffered_write_stream.close.overload1 close]``();
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
+ 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)]
-[endsect]
-
-
-
-[section:cancel datagram_socket_service::cancel]
-
-Cancel all asynchronous operations associated with the socket.
+Close the stream.
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+ void close();
@@ -27197,12 +28366,11 @@
-[section:close datagram_socket_service::close]
+[section:overload2 buffered_write_stream::close (2 of 2 overloads)]
-Close a datagram socket implementation.
+Close the stream.
boost::system::error_code close(
- implementation_type & impl,
boost::system::error_code & ec);
@@ -27210,41 +28378,35 @@
[endsect]
-
-[section:connect datagram_socket_service::connect]
-
-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:default_buffer_size buffered_write_stream::default_buffer_size]
-[endsect]
+The default buffer size.
+ static const std::size_t default_buffer_size = implementation_defined;
-[section:construct datagram_socket_service::construct]
-Construct a new datagram socket implementation.
+[endsect]
- void construct(
- implementation_type & impl);
+[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.
-[endsect]
+ 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:datagram_socket_service datagram_socket_service::datagram_socket_service]
+[section:overload1 buffered_write_stream::flush (1 of 2 overloads)]
-Construct a new datagram socket service for the specified io_service.
+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.
- datagram_socket_service(
- boost::asio::io_service & io_service);
+ std::size_t flush();
@@ -27252,57 +28414,47 @@
-[section:destroy datagram_socket_service::destroy]
+[section:overload2 buffered_write_stream::flush (2 of 2 overloads)]
-Destroy a datagram socket implementation.
+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.
- void destroy(
- implementation_type & impl);
+ std::size_t flush(
+ boost::system::error_code & ec);
[endsect]
+[endsect]
-[section:endpoint_type datagram_socket_service::endpoint_type]
-The endpoint type.
+[section:get_io_service buffered_write_stream::get_io_service]
- typedef Protocol::endpoint endpoint_type;
+Get the io_service associated with the object.
+ boost::asio::io_service & get_io_service();
[endsect]
+[section:in_avail buffered_write_stream::in_avail]
-[section:get_io_service datagram_socket_service::get_io_service]
-
-
-['Inherited from io_service.]
-
-Get the io_service object that owns the service.
-
- boost::asio::io_service & get_io_service();
-
-
+Determine the amount of data that may be read without blocking.
-[endsect]
+ 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:get_option datagram_socket_service::get_option]
+[section:overload1 buffered_write_stream::in_avail (1 of 2 overloads)]
-Get a socket option.
+Determine the amount of data that may be read without blocking.
- 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;
+ std::size_t in_avail();
@@ -27310,24 +28462,26 @@
-[section:id datagram_socket_service::id]
+[section:overload2 buffered_write_stream::in_avail (2 of 2 overloads)]
-The unique service identifier.
+Determine the amount of data that may be read without blocking.
- static boost::asio::io_service::id id;
+ std::size_t in_avail(
+ boost::system::error_code & ec);
[endsect]
+[endsect]
-[section:implementation_type datagram_socket_service::implementation_type]
-The type of a datagram socket.
+[section:io_service buffered_write_stream::io_service]
- typedef implementation_defined implementation_type;
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
@@ -27335,16 +28489,11 @@
-[section:io_control datagram_socket_service::io_control]
+[section:lowest_layer buffered_write_stream::lowest_layer]
-Perform an IO control command on the socket.
+Get a reference to the lowest layer.
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
+ lowest_layer_type & lowest_layer();
@@ -27352,14 +28501,12 @@
-[section:io_service datagram_socket_service::io_service]
-
+[section:lowest_layer_type buffered_write_stream::lowest_layer_type]
-['Inherited from io_service.]
+The type of the lowest layer.
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
- boost::asio::io_service & io_service();
@@ -27367,12 +28514,11 @@
-[section:is_open datagram_socket_service::is_open]
+[section:next_layer buffered_write_stream::next_layer]
-Determine whether the socket is open.
+Get a reference to the next layer.
- bool is_open(
- const implementation_type & impl) const;
+ next_layer_type & next_layer();
@@ -27380,67 +28526,90 @@
-[section:local_endpoint datagram_socket_service::local_endpoint]
-
-Get the local endpoint.
+[section:next_layer_type buffered_write_stream::next_layer_type]
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+The type of the next layer.
+ typedef boost::remove_reference< Stream >::type next_layer_type;
-[endsect]
+[endsect]
-[section:native datagram_socket_service::native]
-Get the native socket implementation.
+[section:peek buffered_write_stream::peek]
- native_type native(
- implementation_type & impl);
+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);
-[endsect]
+[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.
-[section:native_type datagram_socket_service::native_type]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
-The native socket type.
- typedef implementation_defined native_type;
+[endsect]
-[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);
-[section:open datagram_socket_service::open]
+[endsect]
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
+[endsect]
+[section:read_some buffered_write_stream::read_some]
-[endsect]
+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:protocol_type datagram_socket_service::protocol_type]
-The protocol type.
+[section:overload1 buffered_write_stream::read_some (1 of 2 overloads)]
- typedef Protocol protocol_type;
+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);
@@ -27448,16 +28617,14 @@
-[section:receive datagram_socket_service::receive]
+[section:overload2 buffered_write_stream::read_some (2 of 2 overloads)]
-Receive some data from the peer.
+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 receive(
- implementation_type & impl,
+ std::size_t read_some(
const MutableBufferSequence & buffers,
- socket_base::message_flags flags,
boost::system::error_code & ec);
@@ -27465,33 +28632,32 @@
[endsect]
+[endsect]
-[section:receive_from datagram_socket_service::receive_from]
+[section:write_some buffered_write_stream::write_some]
-Receive a datagram with the endpoint of the sender.
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
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]
+ 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:remote_endpoint datagram_socket_service::remote_endpoint]
+[section:overload1 buffered_write_stream::write_some (1 of 2 overloads)]
-Get the remote endpoint.
+Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure.
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
@@ -27499,16 +28665,14 @@
-[section:send datagram_socket_service::send]
+[section:overload2 buffered_write_stream::write_some (2 of 2 overloads)]
-Send the given data to the peer.
+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 send(
- implementation_type & impl,
+ std::size_t write_some(
const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
boost::system::error_code & ec);
@@ -27516,19 +28680,20 @@
[endsect]
+[endsect]
-[section:send_to datagram_socket_service::send_to]
-Send a datagram to the specified endpoint.
+[endsect]
+
+
+[section:buffers_begin buffers_begin]
+
+Construct an iterator representing the beginning of the buffers' data.
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);
+ typename ``[link boost_asio.reference.BufferSequence BufferSequence]``>
+ buffers_iterator< BufferSequence > buffers_begin(
+ const BufferSequence & buffers);
@@ -27536,295 +28701,283 @@
-[section:set_option datagram_socket_service::set_option]
+[section:buffers_end buffers_end]
-Set a socket option.
+Construct an iterator representing the end of the buffers' data.
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);
+ typename ``[link boost_asio.reference.BufferSequence BufferSequence]``>
+ buffers_iterator< BufferSequence > buffers_end(
+ const BufferSequence & buffers);
[endsect]
+[section:buffers_iterator buffers_iterator]
-[section:shutdown datagram_socket_service::shutdown]
+A random access iterator over the bytes in a buffer sequence.
-Disable sends or receives on the socket.
+ template<
+ typename ``[link boost_asio.reference.BufferSequence BufferSequence]``,
+ typename ``[link boost_asio.reference.ByteType ByteType]`` = char>
+ class buffers_iterator
- boost::system::error_code shutdown(
- implementation_type & impl,
- socket_base::shutdown_type what,
- boost::system::error_code & ec);
+[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. ]
+ ]
+
+]
-[endsect]
+[section:begin buffers_iterator::begin]
+Construct an iterator representing the beginning of the buffers' data.
-[section:shutdown_service datagram_socket_service::shutdown_service]
+ static buffers_iterator begin(
+ const BufferSequence & buffers);
-Destroy all user-defined handler objects owned by the service.
- void shutdown_service();
+[endsect]
-[endsect]
+[section:buffers_iterator buffers_iterator::buffers_iterator]
+Default constructor. Creates an iterator in an undefined state.
-[endsect]
+ buffers_iterator();
-[section:deadline_timer deadline_timer]
-Typedef for the typical usage of timer.
+[endsect]
- typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
-[heading Types]
-[table
- [[Name][Description]]
+[section:end buffers_iterator::end]
- [
+Construct an iterator representing the end of the buffers' data.
- [[link boost_asio.reference.basic_deadline_timer.duration_type [*duration_type]]]
- [The duration type. ]
-
- ]
+ static buffers_iterator end(
+ const BufferSequence & buffers);
- [
- [[link boost_asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
- [
+[endsect]
- [[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. ]
-
- ]
+[endsect]
- [
+[section:const_buffer const_buffer]
- [[link boost_asio.reference.basic_deadline_timer.traits_type [*traits_type]]]
- [The time traits type. ]
-
- ]
+Holds a buffer that cannot be modified.
+
+ class const_buffer
-]
[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.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer. ]
]
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
[
- [[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.const_buffer.buffer_cast [*buffer_cast]]]
+ [Cast a non-modifiable buffer to a specified pointer to POD type. ]
]
[
- [[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.const_buffer.buffer_size [*buffer_size]]]
+ [Get the number of bytes in a non-modifiable buffer. ]
]
[
- [[link boost_asio.reference.basic_deadline_timer.wait [*wait]]]
- [Perform a blocking wait on the timer. ]
+ [[link boost_asio.reference.const_buffer.operator_plus_ [*operator+]]]
+ [Create a new non-modifiable buffer that is offset from the start of another. ]
]
]
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+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_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. ]
- ]
+[section:buffer_cast const_buffer::buffer_cast]
-]
+Cast a non-modifiable buffer to a specified pointer to POD type.
-The basic_deadline_timer class template provides the ability to perform a blocking or asynchronous wait for a timer to expire.
+ template<
+ typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
+ PointerToPodType buffer_cast(
+ const const_buffer & b);
-Most applications will use the boost::asio::deadline\_timer typedef.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
-[*Shared] [*objects:] Unsafe.
-[heading Examples]
-
-Performing a blocking wait:
- // Construct a timer without setting an expiry time.
- boost::asio::deadline_timer timer(io_service);
+[section:buffer_size const_buffer::buffer_size]
- // Set an expiry time relative to now.
- timer.expires_from_now(boost::posix_time::seconds(5));
+Get the number of bytes in a non-modifiable buffer.
- // Wait for the timer to expire.
- timer.wait();
+ std::size_t buffer_size(
+ const const_buffer & b);
+[endsect]
-Performing an asynchronous wait:
- void handler(const boost::system::error_code& error)
- {
- if (!error)
- {
- // Timer expired.
- }
- }
+[section:const_buffer const_buffer::const_buffer]
- ...
+Construct an empty buffer.
- // 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"));
+ ``[link boost_asio.reference.const_buffer.const_buffer.overload1 const_buffer]``();
- // Start an asynchronous wait.
- timer.async_wait(handler);
+ ``[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)]
-[heading Changing an active deadline_timer's expiry time]
-
+Construct an empty buffer.
+ const_buffer();
-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:
+[endsect]
- 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.
- }
- }
+
+[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]
-* 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.
+[section:overload3 const_buffer::const_buffer (3 of 3 overloads)]
-* If a wait handler is cancelled, the boost::system::error_code passed to it contains the value boost::asio::error::operation_aborted.
+Construct a non-modifiable buffer from a modifiable one.
+ const_buffer(
+ const mutable_buffer & b);
[endsect]
-[section:deadline_timer_service deadline_timer_service]
+[endsect]
-Default service implementation for a timer.
+[section:operator_plus_ const_buffer::operator+]
- 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
+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);
-[heading Types]
-[table
- [[Name][Description]]
+ const_buffer ``[link boost_asio.reference.const_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
- [
- [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
- [The duration type. ]
-
- ]
+[section:overload1 const_buffer::operator+ (1 of 2 overloads)]
- [
+Create a new non-modifiable buffer that is offset from the start of another.
- [[link boost_asio.reference.deadline_timer_service.implementation_type [*implementation_type]]]
- [The implementation type of the deadline timer. ]
-
- ]
+ 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.deadline_timer_service.time_type [*time_type]]]
- [The time type. ]
+ [[link boost_asio.reference.const_buffers_1.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.traits_type [*traits_type]]]
- [The time traits type. ]
+ [[link boost_asio.reference.const_buffers_1.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
]
@@ -27835,97 +28988,49 @@
[[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.const_buffers_1.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
]
[
- [[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.const_buffers_1.const_buffers_1 [*const_buffers_1]]]
+ [Construct to represent a single non-modifiable buffer. ]
]
[
- [[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.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.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.const_buffers_1.buffer_cast [*buffer_cast]]]
+ [Cast a non-modifiable buffer to a specified pointer to POD type. ]
]
[
- [[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.const_buffers_1.buffer_size [*buffer_size]]]
+ [Get the number of bytes in a non-modifiable buffer. ]
]
[
- [[link boost_asio.reference.deadline_timer_service.wait [*wait]]]
- []
+ [[link boost_asio.reference.const_buffers_1.operator_plus_ [*operator+]]]
+ [Create a new non-modifiable buffer that is offset from the start of another. ]
]
]
-[heading 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]
-
-
-
- template<
- typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
- void async_wait(
- implementation_type & impl,
- WaitHandler handler);
-
-
-
-[endsect]
-
+[section:begin const_buffers_1::begin]
-[section:cancel deadline_timer_service::cancel]
-
-Cancel any asynchronous wait operations associated with the timer.
+Get a random-access iterator to the first element.
- std::size_t cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+ const_iterator begin() const;
@@ -27933,25 +29038,17 @@
-[section:construct deadline_timer_service::construct]
-
-Construct a new timer implementation.
-
- void construct(
- implementation_type & impl);
-
-
-
-[endsect]
-
+[section:buffer_cast const_buffers_1::buffer_cast]
-[section:deadline_timer_service deadline_timer_service::deadline_timer_service]
+['Inherited from const_buffer.]
-Construct a new timer service for the specified io_service.
+Cast a non-modifiable buffer to a specified pointer to POD type.
- deadline_timer_service(
- boost::asio::io_service & io_service);
+ template<
+ typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
+ PointerToPodType buffer_cast(
+ const const_buffer & b);
@@ -27959,50 +29056,28 @@
-[section:destroy deadline_timer_service::destroy]
-
-Destroy a timer implementation.
-
- void destroy(
- implementation_type & impl);
-
-
-
-[endsect]
-
-
+[section:buffer_size const_buffers_1::buffer_size]
-[section:duration_type deadline_timer_service::duration_type]
-The duration type.
+['Inherited from const_buffer.]
- typedef traits_type::duration_type duration_type;
+Get the number of bytes in a non-modifiable buffer.
+ std::size_t buffer_size(
+ const const_buffer & b);
[endsect]
-[section:expires_at deadline_timer_service::expires_at]
-
-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)]
+[section:const_buffers_1 const_buffers_1::const_buffers_1]
-Get the expiry time for the timer as an absolute time.
+Construct to represent a single non-modifiable buffer.
- time_type expires_at(
- const implementation_type & impl) const;
+ const_buffers_1(
+ const const_buffer & b);
@@ -28010,73 +29085,53 @@
-[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
-
-Set the expiry time for the timer as an absolute time.
+[section:const_iterator const_buffers_1::const_iterator]
- std::size_t expires_at(
- implementation_type & impl,
- const time_type & expiry_time,
- boost::system::error_code & ec);
+A random-access iterator type that may be used to read elements.
+ typedef const const_buffer * const_iterator;
-[endsect]
[endsect]
-[section:expires_from_now deadline_timer_service::expires_from_now]
-
-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)]
+[section:end const_buffers_1::end]
-Get the expiry time for the timer relative to now.
+Get a random-access iterator for one past the last element.
- duration_type expires_from_now(
- const implementation_type & impl) const;
+ const_iterator end() const;
[endsect]
+[section:operator_plus_ const_buffers_1::operator+]
-[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]
+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);
-[endsect]
+ const_buffer ``[link boost_asio.reference.const_buffers_1.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const const_buffer & b);
-[section:get_io_service deadline_timer_service::get_io_service]
+[section:overload1 const_buffers_1::operator+ (1 of 2 overloads)]
-['Inherited from io_service.]
+['Inherited from const_buffer.]
-Get the io_service object that owns the service.
+Create a new non-modifiable buffer that is offset from the start of another.
- boost::asio::io_service & get_io_service();
+ const_buffer operator+(
+ const const_buffer & b,
+ std::size_t start);
@@ -28084,64 +29139,65 @@
-[section:id deadline_timer_service::id]
-
-The unique service identifier.
-
- static boost::asio::io_service::id id;
-
-
-
-[endsect]
-
-
+[section:overload2 const_buffers_1::operator+ (2 of 2 overloads)]
-[section:implementation_type deadline_timer_service::implementation_type]
-The implementation type of the deadline timer.
+['Inherited from const_buffer.]
- typedef implementation_defined implementation_type;
+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]
-
-[section:io_service deadline_timer_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();
-
-
-
[endsect]
+[section:value_type const_buffers_1::value_type]
-[section:shutdown_service deadline_timer_service::shutdown_service]
-
-Destroy all user-defined handler objects owned by the service.
-
- void shutdown_service();
-
-
+The type for each element in the list of buffers.
-[endsect]
+ typedef const_buffer value_type;
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:time_type deadline_timer_service::time_type]
+ [
+ [[link boost_asio.reference.const_buffer.const_buffer [*const_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
-The time type.
+[heading Related Functions]
+[table
+ [[Name][Description]]
- typedef traits_type::time_type time_type;
+ [
+ [[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.
@@ -28149,250 +29205,234 @@
-[section:traits_type deadline_timer_service::traits_type]
-
-The time traits type.
-
- typedef TimeTraits traits_type;
-
-
-
-
[endsect]
+[section:datagram_socket_service datagram_socket_service]
+Default service implementation for a datagram socket.
-[section:wait deadline_timer_service::wait]
-
-
-
- void wait(
- implementation_type & impl,
- boost::system::error_code & ec);
-
-
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class datagram_socket_service :
+ public io_service::service
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[link boost_asio.reference.datagram_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+ [
-[section:error__addrinfo_category error::addrinfo_category]
+ [[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. ]
+
+ ]
- static const boost::system::error_category & addrinfo_category = boost::asio::error::get_addrinfo_category();
+ [
+ [[link boost_asio.reference.datagram_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+]
-[endsect]
-
-
-
-[section:error__addrinfo_errors error::addrinfo_errors]
-
-
-
- enum addrinfo_errors
-
-[heading Values]
-[variablelist
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
- [service_not_found]
- [The service is not supported for the given socket type. ]
+ [[link boost_asio.reference.datagram_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a datagram socket. ]
]
-
+
[
- [socket_type_not_supported]
- [The socket type is not supported. ]
+ [[link boost_asio.reference.datagram_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:error__basic_errors error::basic_errors]
-
-
-
- enum basic_errors
-
-[heading Values]
-[variablelist
-
+
[
- [access_denied]
- [Permission denied. ]
+ [[link boost_asio.reference.datagram_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
]
-
+
[
- [address_family_not_supported]
- [Address family not supported by protocol. ]
+ [[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. ]
]
-
+
[
- [address_in_use]
- [Address already in use. ]
+ [[link boost_asio.reference.datagram_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
]
-
+
[
- [already_connected]
- [Transport endpoint is already connected. ]
+ [[link boost_asio.reference.datagram_socket_service.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
]
-
+
[
- [already_started]
- [Operation already in progress. ]
+ [[link boost_asio.reference.datagram_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
]
-
+
[
- [broken_pipe]
- [Broken pipe. ]
+ [[link boost_asio.reference.datagram_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
]
-
+
[
- [connection_aborted]
- [A connection has been aborted. ]
+ [[link boost_asio.reference.datagram_socket_service.bind [*bind]]]
+ []
]
-
+
[
- [connection_refused]
- [Connection refused. ]
+ [[link boost_asio.reference.datagram_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
]
-
+
[
- [connection_reset]
- [Connection reset by peer. ]
+ [[link boost_asio.reference.datagram_socket_service.close [*close]]]
+ [Close a datagram socket implementation. ]
]
-
+
[
- [bad_descriptor]
- [Bad file descriptor. ]
+ [[link boost_asio.reference.datagram_socket_service.connect [*connect]]]
+ [Connect the datagram socket to the specified endpoint. ]
]
-
+
[
- [fault]
- [Bad address. ]
+ [[link boost_asio.reference.datagram_socket_service.construct [*construct]]]
+ [Construct a new datagram socket implementation. ]
]
-
+
[
- [host_unreachable]
- [No route to host. ]
+ [[link boost_asio.reference.datagram_socket_service.datagram_socket_service [*datagram_socket_service]]]
+ [Construct a new datagram socket service for the specified io_service. ]
]
-
+
[
- [in_progress]
- [Operation now in progress. ]
+ [[link boost_asio.reference.datagram_socket_service.destroy [*destroy]]]
+ [Destroy a datagram socket implementation. ]
]
-
+
[
- [interrupted]
- [Interrupted system call. ]
+ [[link boost_asio.reference.datagram_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
-
+
[
- [invalid_argument]
- [Invalid argument. ]
+ [[link boost_asio.reference.datagram_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
]
-
+
[
- [message_size]
- [Message too long. ]
+ [[link boost_asio.reference.datagram_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
]
-
+
[
- [name_too_long]
- [The name was too long. ]
+ [[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. ]
]
-
+
[
- [network_down]
- [Network is down. ]
+ [[link boost_asio.reference.datagram_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
]
-
+
[
- [network_reset]
- [Network dropped connection on reset. ]
+ [[link boost_asio.reference.datagram_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
]
-
+
[
- [network_unreachable]
- [Network is unreachable. ]
+ [[link boost_asio.reference.datagram_socket_service.native [*native]]]
+ [Get the native socket implementation. ]
]
-
+
[
- [no_descriptors]
- [Too many open files. ]
+ [[link boost_asio.reference.datagram_socket_service.open [*open]]]
+ []
]
-
+
[
- [no_buffer_space]
- [No buffer space available. ]
+ [[link boost_asio.reference.datagram_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
]
-
+
[
- [no_memory]
- [Cannot allocate memory. ]
+ [[link boost_asio.reference.datagram_socket_service.receive_from [*receive_from]]]
+ [Receive a datagram with the endpoint of the sender. ]
]
-
+
[
- [no_permission]
- [Operation not permitted. ]
+ [[link boost_asio.reference.datagram_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
]
-
+
[
- [no_protocol_option]
- [Protocol not available. ]
+ [[link boost_asio.reference.datagram_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
]
-
+
[
- [not_connected]
- [Transport endpoint is not connected. ]
+ [[link boost_asio.reference.datagram_socket_service.send_to [*send_to]]]
+ [Send a datagram to the specified endpoint. ]
]
-
+
[
- [not_socket]
- [Socket operation on non-socket. ]
+ [[link boost_asio.reference.datagram_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
]
-
+
[
- [operation_aborted]
- [Operation cancelled. ]
+ [[link boost_asio.reference.datagram_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
]
-
+
[
- [operation_not_supported]
- [Operation not supported. ]
+ [[link boost_asio.reference.datagram_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
+
+]
- [
- [shut_down]
- [Cannot send after transport endpoint shutdown. ]
- ]
+[heading Data Members]
+[table
+ [[Name][Description]]
[
- [timed_out]
- [Connection timed out. ]
+ [[link boost_asio.reference.datagram_socket_service.id [*id]]]
+ [The unique service identifier. ]
]
- [
- [try_again]
- [Resource temporarily unavailable. ]
- ]
+]
- [
- [would_block]
- [The socket is marked non-blocking and the requested operation would block. ]
- ]
-]
+[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);
@@ -28400,11 +29440,16 @@
-[section:error__get_addrinfo_category error::get_addrinfo_category]
-
+[section:async_connect datagram_socket_service::async_connect]
+Start an asynchronous connect.
- const boost::system::error_category & get_addrinfo_category();
+ template<
+ typename ``[link boost_asio.reference.ConnectHandler ConnectHandler]``>
+ void async_connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
+ ConnectHandler handler);
@@ -28412,11 +29457,18 @@
-[section:error__get_misc_category error::get_misc_category]
-
+[section:async_receive datagram_socket_service::async_receive]
+Start an asynchronous receive.
- const boost::system::error_category & get_misc_category();
+ 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);
@@ -28424,11 +29476,19 @@
-[section:error__get_netdb_category error::get_netdb_category]
-
+[section:async_receive_from datagram_socket_service::async_receive_from]
+Start an asynchronous receive that will get the endpoint of the sender.
- const boost::system::error_category & get_netdb_category();
+ 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);
@@ -28436,11 +29496,18 @@
-[section:error__get_ssl_category error::get_ssl_category]
-
+[section:async_send datagram_socket_service::async_send]
+Start an asynchronous send.
- const boost::system::error_category & get_ssl_category();
+ 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);
@@ -28448,43 +29515,47 @@
-[section:error__get_system_category error::get_system_category]
-
+[section:async_send_to datagram_socket_service::async_send_to]
+Start an asynchronous send.
- const boost::system::error_category & get_system_category();
+ 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:error__make_error_code error::make_error_code]
-
+[section:at_mark datagram_socket_service::at_mark]
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
- basic_errors e);
+Determine whether the socket is at the out-of-band data mark.
- boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
- netdb_errors e);
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
- 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:available datagram_socket_service::available]
+Determine the number of bytes available for reading.
- boost::system::error_code make_error_code(
- basic_errors e);
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -28492,12 +29563,14 @@
-[section:overload2 error::make_error_code (2 of 5 overloads)]
+[section:bind datagram_socket_service::bind]
- boost::system::error_code make_error_code(
- netdb_errors e);
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
@@ -28505,12 +29578,13 @@
-[section:overload3 error::make_error_code (3 of 5 overloads)]
-
+[section:cancel datagram_socket_service::cancel]
+Cancel all asynchronous operations associated with the socket.
- boost::system::error_code make_error_code(
- addrinfo_errors e);
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -28518,12 +29592,13 @@
-[section:overload4 error::make_error_code (4 of 5 overloads)]
-
+[section:close datagram_socket_service::close]
+Close a datagram socket implementation.
- boost::system::error_code make_error_code(
- misc_errors e);
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -28531,26 +29606,40 @@
-[section:overload5 error::make_error_code (5 of 5 overloads)]
-
+[section:connect datagram_socket_service::connect]
+Connect the datagram socket to the specified endpoint.
- boost::system::error_code make_error_code(
- ssl_errors e);
+ 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]
+
+Construct a new datagram socket implementation.
+
+ void construct(
+ implementation_type & impl);
+
+
+
[endsect]
-[section:error__misc_category error::misc_category]
+[section:datagram_socket_service datagram_socket_service::datagram_socket_service]
+Construct a new datagram socket service for the specified io_service.
- static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
+ datagram_socket_service(
+ boost::asio::io_service & io_service);
@@ -28558,36 +29647,25 @@
-[section:error__misc_errors error::misc_errors]
+[section:destroy datagram_socket_service::destroy]
+Destroy a datagram socket implementation.
+ void destroy(
+ implementation_type & impl);
- enum misc_errors
-[heading Values]
-[variablelist
- [
- [already_open]
- [Already open. ]
- ]
+[endsect]
- [
- [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. ]
- ]
+[section:endpoint_type datagram_socket_service::endpoint_type]
+
+The endpoint type.
+
+ typedef Protocol::endpoint endpoint_type;
-]
@@ -28595,11 +29673,14 @@
-[section:error__netdb_category error::netdb_category]
+[section:get_io_service datagram_socket_service::get_io_service]
+['Inherited from io_service.]
- static const boost::system::error_category & netdb_category = boost::asio::error::get_netdb_category();
+Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
@@ -28607,36 +29688,28 @@
-[section:error__netdb_errors error::netdb_errors]
+[section:get_option datagram_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;
- enum netdb_errors
-[heading Values]
-[variablelist
- [
- [host_not_found]
- [Host not found (authoritative). ]
- ]
+[endsect]
- [
- [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. ]
- ]
+[section:id datagram_socket_service::id]
-]
+The unique service identifier.
+
+ static boost::asio::io_service::id id;
@@ -28644,11 +29717,12 @@
-[section:error__ssl_category error::ssl_category]
+[section:implementation_type datagram_socket_service::implementation_type]
+The type of a datagram socket.
+ typedef implementation_defined implementation_type;
- static const boost::system::error_category & ssl_category = boost::asio::error::get_ssl_category();
@@ -28656,11 +29730,16 @@
-[section:error__ssl_errors error::ssl_errors]
-
+[section:io_control datagram_socket_service::io_control]
+Perform an IO control command on the socket.
- enum ssl_errors
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
+ boost::system::error_code & ec);
@@ -28668,11 +29747,14 @@
-[section:error__system_category error::system_category]
+[section:io_service datagram_socket_service::io_service]
+['Inherited from io_service.]
- static const boost::system::error_category & system_category = boost::asio::error::get_system_category();
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+
+ boost::asio::io_service & io_service();
@@ -28680,285 +29762,168 @@
-[section:has_service has_service]
+[section:is_open datagram_socket_service::is_open]
+Determine whether the socket is open.
+ bool is_open(
+ const implementation_type & impl) const;
- 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]
-[heading Parameters]
-
-[variablelist
-
-[[ios][The io\_service object that owns the service.]]
+[section:local_endpoint datagram_socket_service::local_endpoint]
-]
+Get the local endpoint.
-[heading Return Value]
-
-A boolean indicating whether the io_service contains the service.
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
[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.
+[section:native datagram_socket_service::native]
- class invalid_service_owner
+Get the native socket implementation.
+ native_type native(
+ implementation_type & impl);
-[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]
+[endsect]
- invalid_service_owner();
+[section:native_type datagram_socket_service::native_type]
+The native socket type.
+ typedef implementation_defined native_type;
-[endsect]
[endsect]
-[section:io_service io_service]
-Provides core I/O functionality.
- class io_service :
- noncopyable
+[section:open datagram_socket_service::open]
-[heading Types]
-[table
- [[Name][Description]]
- [
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.io_service__strand [*strand]]]
- [Provides serialised handler execution. ]
-
- ]
- [
+[section:protocol_type datagram_socket_service::protocol_type]
- [[link boost_asio.reference.io_service__work [*work]]]
- [Class to inform the io_service when it has work to do. ]
-
- ]
+The protocol type.
-]
+ typedef Protocol protocol_type;
-[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. ]
- ]
-
-]
+[endsect]
-The io_service class provides the core I/O functionality for users of the asynchronous I/O objects, including:
-* boost::asio::ip::tcp::socket
+[section:receive datagram_socket_service::receive]
-* boost::asio::ip::tcp::acceptor
+Receive some data from the peer.
-* boost::asio::ip::udp::socket
+ 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);
-* 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.
-[heading Effect of exceptions thrown from handlers]
-
+[section:receive_from datagram_socket_service::receive_from]
+Receive a datagram with the endpoint of the sender.
-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.
+ 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);
-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:
+[endsect]
- boost::asio::io_service io_service;
- ...
- for (;;)
- {
- try
- {
- io_service.run();
- break; // run() exited normally
- }
- catch (my_exception& e)
- {
- // Deal with exception as appropriate.
- }
- }
+[section:remote_endpoint datagram_socket_service::remote_endpoint]
+Get the remote endpoint.
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
-[section:add_service io_service::add_service]
-Add a service object to the io_service.
+[endsect]
- 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.
+[section:send datagram_socket_service::send]
+Send the given data to the peer.
-[heading Parameters]
-
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t send(
+ implementation_type & impl,
+ const ConstBufferSequence & buffers,
+ socket_base::message_flags flags,
+ boost::system::error_code & ec);
-[variablelist
-
-[[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)
-``
-]]
+[endsect]
-]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the io\_service.]]
+[section:send_to datagram_socket_service::send_to]
-[[boost::asio::invalid_service_owner][Thrown if the service's owning io\_service is not the io\_service object specified by the ios parameter. ]]
+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);
@@ -28966,34 +29931,31 @@
-[section:dispatch io_service::dispatch]
+[section:set_option datagram_socket_service::set_option]
-Request the io_service to invoke the given handler.
+Set a socket option.
template<
- typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
- void dispatch(
- CompletionHandler handler);
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
+ implementation_type & impl,
+ const SettableSocketOption & option,
+ 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.
+[endsect]
-[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();
+[section:shutdown datagram_socket_service::shutdown]
-``
-]]
+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);
@@ -29001,313 +29963,441 @@
-[section:has_service io_service::has_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.
+[section:shutdown_service datagram_socket_service::shutdown_service]
+Destroy all user-defined handler objects owned by the service.
-[heading Parameters]
-
+ void shutdown_service();
-[variablelist
-
-[[ios][The io\_service object that owns the service.]]
-]
-[heading Return Value]
-
-A boolean indicating whether the io_service contains the service.
+[endsect]
[endsect]
-[section:io_service io_service::io_service]
+[section:deadline_timer deadline_timer]
-Constructor.
+Typedef for the typical usage of timer.
- ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
+ typedef basic_deadline_timer< boost::posix_time::ptime > deadline_timer;
- ``[link boost_asio.reference.io_service.io_service.overload2 io_service]``(
- std::size_t concurrency_hint);
+[heading Types]
+[table
+ [[Name][Description]]
-[section:overload1 io_service::io_service (1 of 2 overloads)]
+ [
-Constructor.
+ [[link boost_asio.reference.basic_deadline_timer.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
- io_service();
+ [
+ [[link boost_asio.reference.basic_deadline_timer.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:overload2 io_service::io_service (2 of 2 overloads)]
+ [
-Constructor.
+ [[link boost_asio.reference.basic_deadline_timer.traits_type [*traits_type]]]
+ [The time traits type. ]
+
+ ]
- io_service(
- std::size_t concurrency_hint);
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-Construct with a hint about the required level of concurrency.
+ [
+ [[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]]
-[heading Parameters]
-
+ [
+ [[link boost_asio.reference.basic_deadline_timer.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-[variablelist
-
-[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
+ [
+ [[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.
-
-[endsect]
+Most applications will use the boost::asio::deadline\_timer typedef.
-[endsect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-[section:poll io_service::poll]
+[*Shared] [*objects:] Unsafe.
-Run the io_service's event processing loop to execute ready handlers.
+[heading Examples]
+
+Performing a blocking wait:
- std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
+ // Construct a timer without setting an expiry time.
+ boost::asio::deadline_timer timer(io_service);
- std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
- boost::system::error_code & ec);
+ // Set an expiry time relative to now.
+ timer.expires_from_now(boost::posix_time::seconds(5));
+ // Wait for the timer to expire.
+ timer.wait();
-[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();
+Performing an asynchronous wait:
-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.
+ void handler(const boost::system::error_code& error)
+ {
+ if (!error)
+ {
+ // Timer expired.
+ }
+ }
+ ...
-[heading Return Value]
-
-The number of handlers that were executed.
+ // 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"));
-[heading Exceptions]
-
+ // Start an asynchronous wait.
+ timer.async_wait(handler);
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+[heading Changing an active deadline_timer's expiry time]
+
-[endsect]
+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:
-[section:overload2 io_service::poll (2 of 2 overloads)]
-Run the io_service's event processing loop to execute ready handlers.
+ 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!
+ }
+ }
- std::size_t poll(
- boost::system::error_code & ec);
+ void on_timeout(const boost::system::error_code& e)
+ {
+ if (e != boost::asio::error::operation_aborted)
+ {
+ // Timer was not cancelled, take necessary action.
+ }
+ }
-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.]]
+* The boost::asio::basic_deadline_timer::expires_from_now() function cancels any pending asynchronous waits, and returns the number of asynchronous waits that were cancelled. If it returns 0 then you were too late and the wait handler has already been executed, or will soon be executed. If it returns 1 then the wait handler was successfully cancelled.
-]
+* If a wait handler is cancelled, the boost::system::error_code passed to it contains the value boost::asio::error::operation_aborted.
-[heading Return Value]
-
-The number of handlers that were executed.
[endsect]
-[endsect]
+[section:deadline_timer_service deadline_timer_service]
-[section:poll_one io_service::poll_one]
+Default service implementation for a timer.
-Run the io_service's event processing loop to execute one ready handler.
+ 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
- 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);
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:overload1 io_service::poll_one (1 of 2 overloads)]
+ [[link boost_asio.reference.deadline_timer_service.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
-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.
+ [[link boost_asio.reference.deadline_timer_service.implementation_type [*implementation_type]]]
+ [The implementation type of the deadline timer. ]
+
+ ]
+ [
-[heading Return Value]
-
-The number of handlers that were executed.
+ [[link boost_asio.reference.deadline_timer_service.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
-[heading Exceptions]
-
+ [
-[variablelist
+ [[link boost_asio.reference.deadline_timer_service.traits_type [*traits_type]]]
+ [The time traits type. ]
-[[boost::system::system_error][Thrown on failure. ]]
+ ]
]
+[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]]
-[endsect]
+ [
+ [[link boost_asio.reference.deadline_timer_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+]
-[section:overload2 io_service::poll_one (2 of 2 overloads)]
+[section:async_wait deadline_timer_service::async_wait]
-Run the io_service's event processing loop to execute one ready handler.
- std::size_t poll_one(
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.WaitHandler WaitHandler]``>
+ void async_wait(
+ implementation_type & impl,
+ WaitHandler handler);
-The poll\_one() function runs at most one handler that is ready to run, without blocking.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Return Value]
-
-The number of handlers that were executed.
+[section:cancel deadline_timer_service::cancel]
+Cancel any asynchronous wait operations associated with the timer.
+ std::size_t cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
-[endsect]
[endsect]
-[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);
+[section:construct deadline_timer_service::construct]
+Construct a new timer implementation.
-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.
+ void construct(
+ implementation_type & impl);
-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]
-
+[endsect]
-[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();
-``
-]]
-]
+[section:deadline_timer_service 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]
+[endsect]
-[section:reset io_service::reset]
-Reset the io_service in preparation for a subsequent run() invocation.
- void reset();
+[section:destroy deadline_timer_service::destroy]
+Destroy a timer implementation.
-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.
+ void destroy(
+ implementation_type & impl);
-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]
-Run the io_service's event processing loop.
+[section:duration_type deadline_timer_service::duration_type]
- std::size_t ``[link boost_asio.reference.io_service.run.overload1 run]``();
+The duration type.
- std::size_t ``[link boost_asio.reference.io_service.run.overload2 run]``(
- boost::system::error_code & ec);
+ typedef traits_type::duration_type duration_type;
-[section:overload1 io_service::run (1 of 2 overloads)]
-Run the io_service's event processing loop.
- std::size_t run();
+[endsect]
-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.
+[section:expires_at deadline_timer_service::expires_at]
-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.
+Get the expiry time for the timer as an absolute time.
-The run() function may be safely called again once it has completed only after a call to reset().
+ 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);
-[heading Return Value]
-
-The number of handlers that were executed.
-[heading Exceptions]
-
+[section:overload1 deadline_timer_service::expires_at (1 of 2 overloads)]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+Get the expiry time for the timer as an absolute time.
-]
+ time_type expires_at(
+ const implementation_type & impl) const;
@@ -29315,73 +30405,73 @@
-[section:overload2 io_service::run (2 of 2 overloads)]
+[section:overload2 deadline_timer_service::expires_at (2 of 2 overloads)]
-Run the io_service's event processing loop.
+Set the expiry time for the timer as an absolute time.
- std::size_t run(
+ std::size_t expires_at(
+ implementation_type & impl,
+ const time_type & expiry_time,
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.
+[endsect]
-The run() function may be safely called again once it has completed only after a call to reset().
+[endsect]
-[heading Parameters]
-
+[section:expires_from_now deadline_timer_service::expires_from_now]
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
+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;
-[heading Return Value]
-
-The number of handlers that were executed.
+ 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]
[endsect]
-[section:run_one io_service::run_one]
-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]``();
+[section:overload2 deadline_timer_service::expires_from_now (2 of 2 overloads)]
- std::size_t ``[link boost_asio.reference.io_service.run_one.overload2 run_one]``(
+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);
-[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:get_io_service deadline_timer_service::get_io_service]
-[heading Return Value]
-
-The number of handlers that were executed.
-[heading Exceptions]
-
+['Inherited from io_service.]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+Get the io_service object that owns the service.
-]
+ boost::asio::io_service & get_io_service();
@@ -29389,77 +30479,51 @@
-[section:overload2 io_service::run_one (2 of 2 overloads)]
+[section:id deadline_timer_service::id]
-Run the io_service's event processing loop to execute at most one handler.
+The unique service identifier.
- std::size_t run_one(
- boost::system::error_code & ec);
+ static boost::asio::io_service::id id;
-The run\_one() function blocks until one handler has been dispatched, or until the io_service has been stopped.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[section:implementation_type deadline_timer_service::implementation_type]
-[heading Return Value]
-
-The number of handlers that were executed.
+The implementation type of the deadline timer.
+ typedef implementation_defined implementation_type;
-[endsect]
[endsect]
-[section:stop io_service::stop]
-
-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:io_service deadline_timer_service::io_service]
+['Inherited from io_service.]
-[section:use_service io_service::use_service]
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
-Obtain the service object corresponding to the given type.
+ boost::asio::io_service & io_service();
- 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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ios][The io\_service object that owns the service.]]
+[section:shutdown_service deadline_timer_service::shutdown_service]
-]
+Destroy all user-defined handler objects owned by the service.
-[heading Return Value]
-
-The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
+ void shutdown_service();
@@ -29467,68 +30531,54 @@
-[section:wrap io_service::wrap]
+[section:time_type deadline_timer_service::time_type]
-Create a new handler that automatically dispatches the wrapped handler on the io_service.
+The time type.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- unspecified wrap(
- Handler handler);
+ typedef traits_type::time_type time_type;
-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]
-
+[endsect]
-[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);
-``
-]]
-]
+[section:traits_type deadline_timer_service::traits_type]
-[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:
+The time traits type.
- R f(A1 a1, ... An an);
+ typedef TimeTraits traits_type;
-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);
+[section:wait deadline_timer_service::wait]
-that, when invoked, executes code equivalent to:
- io_service.dispatch(boost::bind(f, a1, ... an));
+
+ void wait(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+[endsect]
[endsect]
+[section:error__addrinfo_category error::addrinfo_category]
-[section:_io_service io_service::~io_service]
-Destructor.
- ~io_service();
+ static const boost::system::error_category & addrinfo_category = boost::asio::error::get_addrinfo_category();
@@ -29536,33 +30586,26 @@
-[endsect]
-
-[section:io_service__id io_service::id]
+[section:error__addrinfo_errors error::addrinfo_errors]
-Class used to uniquely identify a service.
- class id :
- noncopyable
+ enum addrinfo_errors
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
[
- [[link boost_asio.reference.io_service__id.id [*id]]]
- [Constructor. ]
+ [service_not_found]
+ [The service is not supported for the given socket type. ]
]
-
-]
-
-
-[section:id io_service::id::id]
-Constructor.
+ [
+ [socket_type_not_supported]
+ [The socket type is not supported. ]
+ ]
- id();
+]
@@ -29570,200 +30613,229 @@
-[endsect]
-
-[section:io_service__service io_service::service]
+[section:error__basic_errors error::basic_errors]
-Base class for all io_service services.
- class service :
- noncopyable
+ enum basic_errors
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
[
- [[link boost_asio.reference.io_service__service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [access_denied]
+ [Permission denied. ]
]
-
+
[
- [[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. ]
+ [address_family_not_supported]
+ [Address family not supported by protocol. ]
]
-
-]
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ [
+ [address_in_use]
+ [Address already in use. ]
+ ]
[
- [[link boost_asio.reference.io_service__service.service [*service]]]
- [Constructor. ]
+ [already_connected]
+ [Transport endpoint is already connected. ]
]
-
+
[
- [[link boost_asio.reference.io_service__service._service [*~service]]]
- [Destructor. ]
+ [already_started]
+ [Operation already in progress. ]
]
-
-]
+ [
+ [broken_pipe]
+ [Broken pipe. ]
+ ]
-[section:get_io_service io_service::service::get_io_service]
+ [
+ [connection_aborted]
+ [A connection has been aborted. ]
+ ]
-Get the io_service object that owns the service.
+ [
+ [connection_refused]
+ [Connection refused. ]
+ ]
- boost::asio::io_service & get_io_service();
+ [
+ [connection_reset]
+ [Connection reset by peer. ]
+ ]
+ [
+ [bad_descriptor]
+ [Bad file descriptor. ]
+ ]
+ [
+ [fault]
+ [Bad address. ]
+ ]
-[endsect]
+ [
+ [host_unreachable]
+ [No route to host. ]
+ ]
+ [
+ [in_progress]
+ [Operation now in progress. ]
+ ]
+ [
+ [interrupted]
+ [Interrupted system call. ]
+ ]
-[section:io_service io_service::service::io_service]
+ [
+ [invalid_argument]
+ [Invalid argument. ]
+ ]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+ [
+ [message_size]
+ [Message too long. ]
+ ]
- boost::asio::io_service & io_service();
+ [
+ [name_too_long]
+ [The name was too long. ]
+ ]
+ [
+ [network_down]
+ [Network is down. ]
+ ]
+ [
+ [network_reset]
+ [Network dropped connection on reset. ]
+ ]
-[endsect]
+ [
+ [network_unreachable]
+ [Network is unreachable. ]
+ ]
+ [
+ [no_descriptors]
+ [Too many open files. ]
+ ]
+ [
+ [no_buffer_space]
+ [No buffer space available. ]
+ ]
-[section:service io_service::service::service]
+ [
+ [no_memory]
+ [Cannot allocate memory. ]
+ ]
-Constructor.
+ [
+ [no_permission]
+ [Operation not permitted. ]
+ ]
- service(
- boost::asio::io_service & owner);
+ [
+ [no_protocol_option]
+ [Protocol not available. ]
+ ]
+ [
+ [not_connected]
+ [Transport endpoint is not connected. ]
+ ]
+ [
+ [not_socket]
+ [Socket operation on non-socket. ]
+ ]
-[heading Parameters]
-
+ [
+ [operation_aborted]
+ [Operation cancelled. ]
+ ]
-[variablelist
-
-[[owner][The io\_service object that owns the service. ]]
+ [
+ [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]
+[endsect]
-[section:_service io_service::service::~service]
-Destructor.
- virtual ~service();
+[section:error__get_addrinfo_category error::get_addrinfo_category]
-[endsect]
+ const boost::system::error_category & get_addrinfo_category();
[endsect]
-[section:io_service__strand io_service::strand]
-Provides serialised handler execution.
- class strand
+[section:error__get_misc_category error::get_misc_category]
-[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. ]
- ]
-
-]
+ const boost::system::error_category & get_misc_category();
-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.
+[endsect]
-[*Shared] [*objects:] Safe.
+[section:error__get_netdb_category error::get_netdb_category]
-[section:dispatch io_service::strand::dispatch]
-Request the strand to invoke the given handler.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void dispatch(
- Handler handler);
+ const boost::system::error_category & get_netdb_category();
-This function is used to ask the strand to execute the given handler.
-The strand object guarantees that handlers posted or dispatched through the strand will not be executed concurrently. The handler may be executed inside this function if the guarantee can be met. If this function is called from within a handler that was posted or dispatched through the same strand, then the new handler will be executed immediately.
+[endsect]
-The strand's guarantee is in addition to the guarantee provided by the underlying 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]
-
+[section:error__get_ssl_category error::get_ssl_category]
-[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();
-``
-]]
-]
+ const boost::system::error_category & get_ssl_category();
@@ -29771,39 +30843,43 @@
-[section:get_io_service io_service::strand::get_io_service]
+[section:error__get_system_category error::get_system_category]
-Get the io_service associated with the strand.
- boost::asio::io_service & get_io_service();
+ const boost::system::error_category & get_system_category();
-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:error__make_error_code error::make_error_code]
-[endsect]
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload1 make_error_code]``(
+ basic_errors e);
-[section:io_service io_service::strand::io_service]
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload2 make_error_code]``(
+ netdb_errors e);
-(Deprecated: use get_io_service().) Get the io_service associated with the strand.
+ boost::system::error_code ``[link boost_asio.reference.error__make_error_code.overload3 make_error_code]``(
+ addrinfo_errors e);
- boost::asio::io_service & io_service();
+ 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);
-This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
+[section:overload1 error::make_error_code (1 of 5 overloads)]
-[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.
+
+
+ boost::system::error_code make_error_code(
+ basic_errors e);
@@ -29811,34 +30887,25 @@
-[section:post io_service::strand::post]
+[section:overload2 error::make_error_code (2 of 5 overloads)]
-Request the strand to invoke the given handler and return immediately.
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void post(
- Handler handler);
+ boost::system::error_code make_error_code(
+ netdb_errors e);
-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.
+[endsect]
-[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();
-``
-]]
+[section:overload3 error::make_error_code (3 of 5 overloads)]
+
-]
+
+ boost::system::error_code make_error_code(
+ addrinfo_errors e);
@@ -29846,82 +30913,76 @@
-[section:strand io_service::strand::strand]
+[section:overload4 error::make_error_code (4 of 5 overloads)]
-Constructor.
- strand(
- boost::asio::io_service & io_service);
+ boost::system::error_code make_error_code(
+ misc_errors e);
-Constructs the strand.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[io_service][The io\_service object that the strand will use to dispatch handlers that are ready to be run. ]]
-]
+[section:overload5 error::make_error_code (5 of 5 overloads)]
-[endsect]
+ boost::system::error_code make_error_code(
+ ssl_errors e);
-[section:wrap io_service::strand::wrap]
-Create a new handler that automatically dispatches the wrapped handler on the strand.
+[endsect]
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- unspecified wrap(
- Handler handler);
+[endsect]
-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.
+[section:error__misc_category error::misc_category]
-[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);
-``
-]]
+ static const boost::system::error_category & misc_category = boost::asio::error::get_misc_category();
-]
-[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);
+[endsect]
-If this function object is passed to the wrap function like so:
- strand.wrap(f);
+[section:error__misc_errors error::misc_errors]
-then the return value is a function object with the signature
- void g(A1 a1, ... An an);
+ enum misc_errors
+[heading Values]
+[variablelist
-that, when invoked, executes code equivalent to:
+ [
+ [already_open]
+ [Already open. ]
+ ]
- strand.dispatch(boost::bind(f, a1, ... an));
+ [
+ [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. ]
+ ]
+]
@@ -29929,67 +30990,60 @@
-[section:_strand io_service::strand::~strand]
-
-Destructor.
+[section:error__netdb_category error::netdb_category]
- ~strand();
-Destroys a strand.
+ static const boost::system::error_category & netdb_category = boost::asio::error::get_netdb_category();
-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]
+[section:error__netdb_errors error::netdb_errors]
-Class to inform the io_service when it has work to do.
- class work
+ enum netdb_errors
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
[
- [[link boost_asio.reference.io_service__work.get_io_service [*get_io_service]]]
- [Get the io_service associated with the work. ]
+ [host_not_found]
+ [Host not found (authoritative). ]
]
-
+
[
- [[link boost_asio.reference.io_service__work.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the work. ]
+ [host_not_found_try_again]
+ [Host not found (non-authoritative). ]
]
-
+
[
- [[link boost_asio.reference.io_service__work.work [*work]]]
- [Constructor notifies the io_service that work is starting. ]
+ [no_data]
+ [The query is valid but does not have associated address data. ]
]
-
+
[
- [[link boost_asio.reference.io_service__work._work [*~work]]]
- [Destructor notifies the io_service that the work is complete. ]
+ [no_recovery]
+ [A non-recoverable error occurred. ]
]
-
+
]
-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.
+[endsect]
-[section:get_io_service io_service::work::get_io_service]
-Get the io_service associated with the work.
- boost::asio::io_service & get_io_service();
+[section:error__ssl_category error::ssl_category]
+
+
+
+ static const boost::system::error_category & ssl_category = boost::asio::error::get_ssl_category();
@@ -29997,68 +31051,86 @@
-[section:io_service io_service::work::io_service]
+[section:error__ssl_errors error::ssl_errors]
-(Deprecated: use get_io_service().) Get the io_service associated with the work.
- boost::asio::io_service & io_service();
+
+ enum ssl_errors
[endsect]
-[section:work io_service::work::work]
-Constructor notifies the io_service that work is starting.
+[section:error__system_category error::system_category]
- ``[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);
+ static const boost::system::error_category & system_category = boost::asio::error::get_system_category();
-[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);
+[endsect]
-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:has_service has_service]
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ bool has_service(
+ io_service & ios);
+
-[section:overload2 io_service::work::work (2 of 2 overloads)]
+This function is used to determine whether the io_service contains a service object corresponding to the given service type.
-Copy constructor notifies the io_service that work is starting.
- work(
- const work & other);
+[heading Parameters]
+
+[variablelist
+
+[[ios][The io\_service object that owns the 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.
+]
+[heading Return Value]
+
+A boolean indicating whether the io_service contains the service.
-[endsect]
[endsect]
-[section:_work io_service::work::~work]
+[section:invalid_service_owner invalid_service_owner]
-Destructor notifies the io_service that the work is complete.
+Exception thrown when trying to add a service object to an io_service where the service has a different owner.
- ~work();
+ class invalid_service_owner
-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.
+[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]
+
+
+
+ invalid_service_owner();
+
[endsect]
@@ -30067,195 +31139,256 @@
[endsect]
-[section:ip__address ip::address]
+[section:io_service io_service]
-Implements version-independent IP addresses.
+Provides core I/O functionality.
- class address
+ 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.ip__address.address [*address]]]
- [Default constructor. ]
+ [[link boost_asio.reference.io_service.dispatch [*dispatch]]]
+ [Request the io_service to invoke the given handler. ]
]
[
- [[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.io_service.io_service [*io_service]]]
+ [Constructor. ]
]
[
- [[link boost_asio.reference.ip__address.is_v4 [*is_v4]]]
- [Get whether the address is an IP version 4 address. ]
+ [[link boost_asio.reference.io_service.poll [*poll]]]
+ [Run the io_service's event processing loop to execute ready handlers. ]
]
[
- [[link boost_asio.reference.ip__address.is_v6 [*is_v6]]]
- [Get whether the address is an IP version 6 address. ]
+ [[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.ip__address.operator_eq_ [*operator=]]]
- [Assign from another address. ]
+ [[link boost_asio.reference.io_service.post [*post]]]
+ [Request the io_service to invoke the given handler and return immediately. ]
]
[
- [[link boost_asio.reference.ip__address.to_string [*to_string]]]
- [Get the address as a string in dotted decimal format. ]
+ [[link boost_asio.reference.io_service.reset [*reset]]]
+ [Reset the io_service in preparation for a subsequent run() invocation. ]
]
[
- [[link boost_asio.reference.ip__address.to_v4 [*to_v4]]]
- [Get the address as an IP version 4 address. ]
+ [[link boost_asio.reference.io_service.run [*run]]]
+ [Run the io_service's event processing loop. ]
]
[
- [[link boost_asio.reference.ip__address.to_v6 [*to_v6]]]
- [Get the address as an IP version 6 address. ]
+ [[link boost_asio.reference.io_service.run_one [*run_one]]]
+ [Run the io_service's event processing loop to execute at most one handler. ]
]
-]
-
-[heading Friends]
-[table
- [[Name][Description]]
-
[
- [[link boost_asio.reference.ip__address.operator_not__eq_ [*operator!=]]]
- [Compare two addresses for inequality. ]
+ [[link boost_asio.reference.io_service.stop [*stop]]]
+ [Stop the io_service's event processing loop. ]
]
[
- [[link boost_asio.reference.ip__address.operator_lt_ [*operator<]]]
- [Compare addresses for ordering. ]
+ [[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.ip__address.operator_eq__eq_ [*operator==]]]
- [Compare two addresses for equality. ]
+ [[link boost_asio.reference.io_service._io_service [*~io_service]]]
+ [Destructor. ]
]
]
-[heading Related Functions]
+[heading Friends]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address.operator_lt__lt_ [*operator<<]]]
- [Output an address as a string. ]
+ [[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
-[link boost_asio.reference.ip__address ip::address] class provides the ability to use either IP version 4 or version 6 addresses.
+The io_service class provides the core I/O functionality for users of the asynchronous I/O objects, including:
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+* boost::asio::ip::tcp::socket
-[*Shared] [*objects:] Unsafe.
+* boost::asio::ip::tcp::acceptor
+* boost::asio::ip::udp::socket
-[section:address ip::address::address]
-
-Default constructor.
-
- ``[link boost_asio.reference.ip__address.address.overload1 address]``();
+* boost::asio::deadline_timer.
- ``[link boost_asio.reference.ip__address.address.overload2 address]``(
- const boost::asio::ip::address_v4 & ipv4_address);
+The io_service class also includes facilities intended for developers of custom asynchronous services.
- ``[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);
+[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:overload1 ip::address::address (1 of 4 overloads)]
+[heading Effect of exceptions thrown from handlers]
+
-Default constructor.
- address();
+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:
-[endsect]
+ boost::asio::io_service io_service;
+ ...
+ for (;;)
+ {
+ try
+ {
+ io_service.run();
+ break; // run() exited normally
+ }
+ catch (my_exception& e)
+ {
+ // Deal with exception as appropriate.
+ }
+ }
-[section:overload2 ip::address::address (2 of 4 overloads)]
-Construct an address from an IPv4 address.
- address(
- const boost::asio::ip::address_v4 & ipv4_address);
+[section:add_service io_service::add_service]
-[endsect]
+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);
-[section:overload3 ip::address::address (3 of 4 overloads)]
+This function is used to add a service to the io_service.
-Construct an address from an IPv6 address.
- address(
- const boost::asio::ip::address_v6 & ipv6_address);
+[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)
-[endsect]
+``
+]]
+]
+[heading Exceptions]
+
-[section:overload4 ip::address::address (4 of 4 overloads)]
+[variablelist
+
+[[boost::asio::service_already_exists][Thrown if a service of the given type is already present in the io\_service.]]
-Copy constructor.
+[[boost::asio::invalid_service_owner][Thrown if the service's owning io\_service is not the io\_service object specified by the ios parameter. ]]
- address(
- const address & other);
+]
[endsect]
-[endsect]
-[section:from_string ip::address::from_string]
+[section:dispatch io_service::dispatch]
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+Request the io_service to invoke the given handler.
- static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
- const char * str);
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void dispatch(
+ CompletionHandler handler);
- 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);
+This function is used to ask the io_service to execute the given handler.
- static address ``[link boost_asio.reference.ip__address.from_string.overload4 from_string]``(
- const std::string & str,
- boost::system::error_code & ec);
+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.
-[section:overload1 ip::address::from_string (1 of 4 overloads)]
+[heading Parameters]
+
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+[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();
- static address from_string(
- const char * str);
+``
+]]
+
+]
@@ -30263,94 +31396,118 @@
-[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.
+[section:has_service io_service::has_service]
- static address from_string(
- const char * str,
- boost::system::error_code & ec);
+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);
-[endsect]
+This function is used to determine whether the io_service contains a service object corresponding to the given service type.
+[heading Parameters]
+
-[section:overload3 ip::address::from_string (3 of 4 overloads)]
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
-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);
+[heading Return Value]
+
+A boolean indicating whether the io_service contains the service.
[endsect]
+[section:io_service io_service::io_service]
-[section:overload4 ip::address::from_string (4 of 4 overloads)]
+Constructor.
-Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
+ ``[link boost_asio.reference.io_service.io_service.overload1 io_service]``();
- static address from_string(
- const std::string & str,
- boost::system::error_code & ec);
+ ``[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]
[endsect]
-[section:is_v4 ip::address::is_v4]
-Get whether the address is an IP version 4 address.
+[section:overload2 io_service::io_service (2 of 2 overloads)]
- bool is_v4() const;
+Constructor.
+ io_service(
+ std::size_t concurrency_hint);
-[endsect]
+Construct with a hint about the required level of concurrency.
+[heading Parameters]
+
-[section:is_v6 ip::address::is_v6]
+[variablelist
+
+[[concurrency_hint][A suggestion to the implementation on how many threads it should allow to run simultaneously. ]]
-Get whether the address is an IP version 6 address.
+]
- bool is_v6() const;
+[endsect]
+
[endsect]
+[section:poll io_service::poll]
+Run the io_service's event processing loop to execute ready handlers.
-[section:operator_not__eq_ ip::address::operator!=]
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload1 poll]``();
-Compare two addresses for inequality.
+ std::size_t ``[link boost_asio.reference.io_service.poll.overload2 poll]``(
+ boost::system::error_code & ec);
- friend bool operator!=(
- const address & a1,
- const address & a2);
+[section:overload1 io_service::poll (1 of 2 overloads)]
+Run the io_service's event processing loop to execute ready handlers.
-[endsect]
+ 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.
-[section:operator_lt_ ip::address::operator<]
-Compare addresses for ordering.
+[heading Return Value]
+
+The number of handlers that were executed.
- friend bool operator<(
- const address & a1,
- const address & a2);
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
@@ -30358,19 +31515,15 @@
-[section:operator_lt__lt_ ip::address::operator<<]
+[section:overload2 io_service::poll (2 of 2 overloads)]
-Output an address as a string.
+Run the io_service's event processing loop to execute ready handlers.
- template<
- typename ``[link boost_asio.reference.Elem Elem]``,
- typename ``[link boost_asio.reference.Traits Traits]``>
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const address & addr);
+ std::size_t poll(
+ boost::system::error_code & ec);
-Used to output a human-readable string for a specified address.
+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]
@@ -30378,54 +31531,53 @@
[variablelist
-[[os][The output stream to which the string will be written.]]
-
-[[addr][The address to be written.]]
+[[ec][Set to indicate what error occurred, if any.]]
]
[heading Return Value]
-The output stream.
+The number of handlers that were executed.
[endsect]
-[section:operator_eq_ ip::address::operator=]
-
-Assign from another address.
+[endsect]
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload1 operator=]``(
- const address & other);
+[section:poll_one io_service::poll_one]
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload2 operator=]``(
- const boost::asio::ip::address_v4 & ipv4_address);
+Run the io_service's event processing loop to execute one ready handler.
- address & ``[link boost_asio.reference.ip__address.operator_eq_.overload3 operator=]``(
- const boost::asio::ip::address_v6 & ipv6_address);
+ 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 ip::address::operator= (1 of 3 overloads)]
-Assign from another address.
+[section:overload1 io_service::poll_one (1 of 2 overloads)]
- address & operator=(
- const address & other);
+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:overload2 ip::address::operator= (2 of 3 overloads)]
+[heading Exceptions]
+
-Assign from an IPv4 address.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- address & operator=(
- const boost::asio::ip::address_v4 & ipv4_address);
+]
@@ -30433,49 +31585,66 @@
-[section:overload3 ip::address::operator= (3 of 3 overloads)]
+[section:overload2 io_service::poll_one (2 of 2 overloads)]
-Assign from an IPv6 address.
+Run the io_service's event processing loop to execute one ready handler.
- address & operator=(
- const boost::asio::ip::address_v6 & ipv6_address);
+ 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.
-[endsect]
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+]
-[section:operator_eq__eq_ ip::address::operator==]
+[heading Return Value]
+
+The number of handlers that were executed.
-Compare two addresses for equality.
- friend bool operator==(
- const address & a1,
- const address & a2);
+[endsect]
[endsect]
-[section:to_string ip::address::to_string]
+[section:post io_service::post]
-Get the address as a string in dotted decimal format.
+Request the io_service to invoke the given handler and return immediately.
- std::string ``[link boost_asio.reference.ip__address.to_string.overload1 to_string]``() const;
+ template<
+ typename ``[link boost_asio.reference.CompletionHandler CompletionHandler]``>
+ void post(
+ CompletionHandler handler);
- std::string ``[link boost_asio.reference.ip__address.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
+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:overload1 ip::address::to_string (1 of 2 overloads)]
-Get the address as a string in dotted decimal format.
+[heading Parameters]
+
- std::string to_string() const;
+[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();
+
+``
+]]
+
+]
@@ -30483,235 +31652,131 @@
-[section:overload2 ip::address::to_string (2 of 2 overloads)]
+[section:reset io_service::reset]
-Get the address as a string in dotted decimal format.
+Reset the io_service in preparation for a subsequent run() invocation.
- std::string to_string(
- boost::system::error_code & ec) const;
+ 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.
-[endsect]
+This function must not be called while there are any unfinished calls to the run(), run\_one(), poll() or poll\_one() functions.
[endsect]
-[section:to_v4 ip::address::to_v4]
+[section:run io_service::run]
-Get the address as an IP version 4 address.
+Run the io_service's event processing loop.
- boost::asio::ip::address_v4 to_v4() const;
+ 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);
-[endsect]
+[section:overload1 io_service::run (1 of 2 overloads)]
+Run the io_service's event processing loop.
+ std::size_t run();
-[section:to_v6 ip::address::to_v6]
-Get the address as an IP version 6 address.
+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.
- boost::asio::ip::address_v6 to_v6() const;
+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().
-[endsect]
+[heading Return Value]
+
+The number of handlers that were executed.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[endsect]
+]
-[section:ip__address_v4 ip::address_v4]
-Implements IP version 4 style addresses.
- class address_v4
+[endsect]
-[heading Types]
-[table
- [[Name][Description]]
- [
+[section:overload2 io_service::run (2 of 2 overloads)]
- [[link boost_asio.reference.ip__address_v4.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
-
- ]
+Run the io_service's event processing loop.
-]
+ std::size_t run(
+ boost::system::error_code & ec);
-[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. ]
- ]
-
-]
+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.
-[heading Friends]
-[table
- [[Name][Description]]
+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.
- [
- [[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. ]
- ]
-
-]
+The run() function may be safely called again once it has completed only after a call to reset().
-[heading Related Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]]
- [Output an address as a string. ]
- ]
+[heading Parameters]
+
+
+[variablelist
+[[ec][Set to indicate what error occurred, if any.]]
+
]
-The
-[link boost_asio.reference.ip__address_v4 ip::address_v4] class provides the ability to use and manipulate IP version 4 addresses.
+[heading Return Value]
+
+The number of handlers that were executed.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
-[section:address_v4 ip::address_v4::address_v4]
-
-Default constructor.
-
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload1 address_v4]``();
+[endsect]
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload2 address_v4]``(
- const bytes_type & bytes);
+[section:run_one io_service::run_one]
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload3 address_v4]``(
- unsigned long addr);
+Run the io_service's event processing loop to execute at most one handler.
- ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
- const address_v4 & other);
+ 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 ip::address_v4::address_v4 (1 of 4 overloads)]
-Default constructor.
+[section:overload1 io_service::run_one (1 of 2 overloads)]
- address_v4();
+Run the io_service's event processing loop to execute at most one handler.
+ 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.
+[heading Return Value]
+
+The number of handlers that were executed.
-[section:overload2 ip::address_v4::address_v4 (2 of 4 overloads)]
+[heading Exceptions]
+
-Construct an address from raw bytes.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- address_v4(
- const bytes_type & bytes);
+]
@@ -30719,25 +31784,29 @@
-[section:overload3 ip::address_v4::address_v4 (3 of 4 overloads)]
-
-Construct an address from a unsigned long in host byte order.
+[section:overload2 io_service::run_one (2 of 2 overloads)]
- address_v4(
- unsigned long addr);
+Run the io_service's event processing loop to execute at most one handler.
+ std::size_t run_one(
+ boost::system::error_code & ec);
-[endsect]
+The run\_one() function blocks until one handler has been dispatched, or until the io_service has been stopped.
+[heading Parameters]
+
-[section:overload4 ip::address_v4::address_v4 (4 of 4 overloads)]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
-Copy constructor.
+]
- address_v4(
- const address_v4 & other);
+[heading Return Value]
+
+The number of handlers that were executed.
@@ -30747,93 +31816,102 @@
[endsect]
-[section:any ip::address_v4::any]
+[section:stop io_service::stop]
-Obtain an address object that represents any address.
+Stop the io_service's event processing loop.
+
+ void stop();
- static address_v4 any();
+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:broadcast ip::address_v4::broadcast]
-Obtain an address object that represents the broadcast address.
+[section:use_service io_service::use_service]
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload1 broadcast]``();
+Obtain the service object corresponding to the given type.
- static address_v4 ``[link boost_asio.reference.ip__address_v4.broadcast.overload2 broadcast]``(
- const address_v4 & addr,
- const address_v4 & mask);
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ friend Service & use_service(
+ io_service & ios);
-[section:overload1 ip::address_v4::broadcast (1 of 2 overloads)]
+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.
-Obtain an address object that represents the broadcast address.
- static address_v4 broadcast();
+[heading Parameters]
+
+[variablelist
+
+[[ios][The io\_service object that owns the service.]]
+]
-[endsect]
+[heading Return Value]
+
+The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
-[section:overload2 ip::address_v4::broadcast (2 of 2 overloads)]
+[endsect]
-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);
+[section:wrap io_service::wrap]
+Create a new handler that automatically dispatches the wrapped handler on the io_service.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ unspecified wrap(
+ Handler handler);
-[endsect]
+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.
-[section:bytes_type ip::address_v4::bytes_type]
+[heading Parameters]
+
-The type used to represent an address as an array of bytes.
+[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);
- typedef boost::array< unsigned char, 4 > bytes_type;
+``
+]]
+]
+[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);
-[endsect]
+If this function object is passed to the wrap function like so:
-[section:from_string ip::address_v4::from_string]
+ io_service.wrap(f);
-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);
+then the return value is a function object with the signature
- static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload2 from_string]``(
- const char * str,
- boost::system::error_code & ec);
+ void g(A1 a1, ... An an);
- 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);
+that, when invoked, executes code equivalent to:
+ io_service.dispatch(boost::bind(f, a1, ... an));
-[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);
@@ -30841,13 +31919,11 @@
-[section:overload2 ip::address_v4::from_string (2 of 4 overloads)]
+[section:_io_service io_service::~io_service]
-Create an address from an IP address string in dotted decimal form.
+Destructor.
- static address_v4 from_string(
- const char * str,
- boost::system::error_code & ec);
+ ~io_service();
@@ -30855,52 +31931,88 @@
-[section:overload3 ip::address_v4::from_string (3 of 4 overloads)]
+[endsect]
-Create an address from an IP address string in dotted decimal form.
+[section:io_service__id io_service::id]
- static address_v4 from_string(
- const std::string & str);
+Class used to uniquely identify a service.
+ class id :
+ noncopyable
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.io_service__id.id [*id]]]
+ [Constructor. ]
+ ]
+
+]
-[section:overload4 ip::address_v4::from_string (4 of 4 overloads)]
+[section:id io_service::id::id]
-Create an address from an IP address string in dotted decimal form.
+Constructor.
- static address_v4 from_string(
- const std::string & str,
- boost::system::error_code & ec);
+ id();
[endsect]
+
[endsect]
+[section:io_service__service io_service::service]
-[section:is_class_a ip::address_v4::is_class_a]
+Base class for all io_service services.
-Determine whether the address is a class A address.
+ class service :
+ noncopyable
- bool is_class_a() const;
+[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. ]
+ ]
+
+]
-[endsect]
+[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:is_class_b ip::address_v4::is_class_b]
+[section:get_io_service io_service::service::get_io_service]
-Determine whether the address is a class B address.
+Get the io_service object that owns the service.
- bool is_class_b() const;
+ boost::asio::io_service & get_io_service();
@@ -30908,11 +32020,11 @@
-[section:is_class_c ip::address_v4::is_class_c]
+[section:io_service io_service::service::io_service]
-Determine whether the address is a class C address.
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
- bool is_class_c() const;
+ boost::asio::io_service & io_service();
@@ -30920,23 +32032,23 @@
-[section:is_multicast ip::address_v4::is_multicast]
-
-Determine whether the address is a multicast address.
-
- bool is_multicast() const;
-
+[section:service io_service::service::service]
+Constructor.
-[endsect]
+ service(
+ boost::asio::io_service & owner);
-[section:loopback ip::address_v4::loopback]
+[heading Parameters]
+
-Obtain an address object that represents the loopback address.
+[variablelist
+
+[[owner][The io\_service object that owns the service. ]]
- static address_v4 loopback();
+]
@@ -30944,12 +32056,11 @@
-[section:netmask ip::address_v4::netmask]
+[section:_service io_service::service::~service]
-Obtain the netmask that corresponds to the address, based on its address class.
+Destructor.
- static address_v4 netmask(
- const address_v4 & addr);
+ virtual ~service();
@@ -30957,47 +32068,82 @@
-[section:operator_not__eq_ ip::address_v4::operator!=]
-
-Compare two addresses for inequality.
+[endsect]
- friend bool operator!=(
- const address_v4 & a1,
- const address_v4 & a2);
+[section:io_service__strand io_service::strand]
+Provides serialised handler execution.
+ class strand
-[endsect]
+[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. ]
+ ]
+
+]
-[section:operator_lt_ ip::address_v4::operator<]
+The io_service::strand class provides the ability to post and dispatch handlers with the guarantee that none of those handlers will execute concurrently.
-Compare addresses for ordering.
- friend bool operator<(
- const address_v4 & a1,
- const address_v4 & a2);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Safe.
-[endsect]
+[section:dispatch io_service::strand::dispatch]
+Request the strand to invoke the given handler.
-[section:operator_lt__lt_ ip::address_v4::operator<<]
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ void dispatch(
+ Handler handler);
-Output an address as a string.
- template<
- typename ``[link boost_asio.reference.Elem Elem]``,
- typename ``[link boost_asio.reference.Traits Traits]``>
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const address_v4 & addr);
+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.
-Used to output a human-readable string for a specified address.
+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]
@@ -31005,56 +32151,54 @@
[variablelist
-[[os][The output stream to which the string will be written.]]
+[[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();
-[[addr][The address to be written.]]
+``
+]]
]
-[heading Return Value]
-
-The output stream.
-
[endsect]
-[section:operator_lt__eq_ ip::address_v4::operator<=]
+[section:get_io_service io_service::strand::get_io_service]
-Compare addresses for ordering.
+Get the io_service associated with the strand.
- friend bool operator<=(
- const address_v4 & a1,
- const address_v4 & a2);
+ 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.
-[endsect]
+[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.
-[section:operator_eq_ ip::address_v4::operator=]
-Assign from another address.
+[endsect]
- address_v4 & operator=(
- const address_v4 & other);
+[section:io_service io_service::strand::io_service]
-[endsect]
+(Deprecated: use get_io_service().) Get the io_service associated with the strand.
+ boost::asio::io_service & io_service();
-[section:operator_eq__eq_ ip::address_v4::operator==]
+This function may be used to obtain the io_service object that the strand uses to dispatch handlers for asynchronous operations.
-Compare two addresses for equality.
- friend bool operator==(
- const address_v4 & a1,
- const address_v4 & a2);
+[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.
@@ -31062,27 +32206,34 @@
-[section:operator_gt_ ip::address_v4::operator>]
+[section:post io_service::strand::post]
-Compare addresses for ordering.
+Request the strand to invoke the given handler and return immediately.
- friend bool operator>(
- const address_v4 & a1,
- const address_v4 & a2);
+ 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.
-[endsect]
+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]
+
-[section:operator_gt__eq_ ip::address_v4::operator>=]
+[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();
-Compare addresses for ordering.
+``
+]]
- friend bool operator>=(
- const address_v4 & a1,
- const address_v4 & a2);
+]
@@ -31090,59 +32241,82 @@
-[section:to_bytes ip::address_v4::to_bytes]
+[section:strand io_service::strand::strand]
-Get the address in bytes.
+Constructor.
- bytes_type to_bytes() const;
+ 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:to_string ip::address_v4::to_string]
-Get the address as a string in dotted decimal format.
+[section:wrap io_service::strand::wrap]
- std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload1 to_string]``() const;
+Create a new handler that automatically dispatches the wrapped handler on the strand.
- std::string ``[link boost_asio.reference.ip__address_v4.to_string.overload2 to_string]``(
- boost::system::error_code & ec) const;
+ template<
+ typename ``[link boost_asio.reference.Handler Handler]``>
+ unspecified wrap(
+ Handler handler);
-[section:overload1 ip::address_v4::to_string (1 of 2 overloads)]
+This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the strand's dispatch function.
-Get the address as a string in dotted decimal format.
- std::string to_string() const;
+[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);
+``
+]]
-[endsect]
+]
+[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);
-[section:overload2 ip::address_v4::to_string (2 of 2 overloads)]
-Get the address as a string in dotted decimal format.
+If this function object is passed to the wrap function like so:
- std::string to_string(
- boost::system::error_code & ec) const;
+ strand.wrap(f);
+then the return value is a function object with the signature
-[endsect]
+ void g(A1 a1, ... An an);
-[endsect]
+that, when invoked, executes code equivalent to:
+ strand.dispatch(boost::bind(f, a1, ... an));
-[section:to_ulong ip::address_v4::to_ulong]
-Get the address as an unsigned long in host byte order.
- unsigned long to_ulong() const;
@@ -31150,145 +32324,193 @@
-[endsect]
+[section:_strand io_service::strand::~strand]
-[section:ip__address_v6 ip::address_v6]
+Destructor.
-Implements IP version 6 style addresses.
+ ~strand();
- class address_v6
+Destroys a strand.
-[heading Types]
-[table
- [[Name][Description]]
+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.
- [
- [[link boost_asio.reference.ip__address_v6.bytes_type [*bytes_type]]]
- [The type used to represent an address as an array of bytes. ]
-
- ]
+[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.ip__address_v6.address_v6 [*address_v6]]]
- [Default constructor. ]
+ [[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.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.io_service__work.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service associated with the work. ]
]
[
- [[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.io_service__work.work [*work]]]
+ [Constructor notifies the io_service that work is starting. ]
]
[
- [[link boost_asio.reference.ip__address_v6.is_site_local [*is_site_local]]]
- [Determine whether the address is site local. ]
+ [[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]
+
+Get the io_service associated with the work.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:io_service io_service::work::io_service]
+
+(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]
+
+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]
+
+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_v6.is_unspecified [*is_unspecified]]]
- [Determine whether the address is unspecified. ]
+ [[link boost_asio.reference.ip__address.address [*address]]]
+ [Default constructor. ]
]
[
- [[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.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_v6.is_v4_mapped [*is_v4_mapped]]]
- [Determine whether the address is a mapped IPv4 address. ]
+ [[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_v6.loopback [*loopback]]]
- [Obtain an address object that represents the loopback 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_v6.operator_eq_ [*operator=]]]
+ [[link boost_asio.reference.ip__address.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.to_string [*to_string]]]
+ [Get the address as a string in dotted decimal format. ]
]
[
- [[link boost_asio.reference.ip__address_v6.v4_compatible [*v4_compatible]]]
- [Create an IPv4-compatible IPv6 address. ]
+ [[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_v6.v4_mapped [*v4_mapped]]]
- [Create an IPv4-mapped IPv6 address. ]
+ [[link boost_asio.reference.ip__address.to_v6 [*to_v6]]]
+ [Get the address as an IP version 6 address. ]
]
]
@@ -31298,35 +32520,20 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address_v6.operator_not__eq_ [*operator!=]]]
+ [[link boost_asio.reference.ip__address.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<=]]]
+ [[link boost_asio.reference.ip__address.operator_lt_ [*operator<]]]
[Compare addresses for ordering. ]
]
[
- [[link boost_asio.reference.ip__address_v6.operator_eq__eq_ [*operator==]]]
+ [[link boost_asio.reference.ip__address.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]
@@ -31334,14 +32541,14 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]]
+ [[link boost_asio.reference.ip__address.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.
+[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]
@@ -31351,25 +32558,27 @@
[*Shared] [*objects:] Unsafe.
-[section:address_v6 ip::address_v6::address_v6]
+[section:address ip::address::address]
Default constructor.
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload1 address_v6]``();
+ ``[link boost_asio.reference.ip__address.address.overload1 address]``();
- ``[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.address.overload2 address]``(
+ const boost::asio::ip::address_v4 & ipv4_address);
- ``[link boost_asio.reference.ip__address_v6.address_v6.overload3 address_v6]``(
- const address_v6 & other);
+ ``[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_v6::address_v6 (1 of 3 overloads)]
+
+[section:overload1 ip::address::address (1 of 4 overloads)]
Default constructor.
- address_v6();
+ address();
@@ -31377,13 +32586,12 @@
-[section:overload2 ip::address_v6::address_v6 (2 of 3 overloads)]
+[section:overload2 ip::address::address (2 of 4 overloads)]
-Construct an address from raw bytes and scope ID.
+Construct an address from an IPv4 address.
- address_v6(
- const bytes_type & bytes,
- unsigned long scope_id = 0);
+ address(
+ const boost::asio::ip::address_v4 & ipv4_address);
@@ -31391,69 +32599,57 @@
-[section:overload3 ip::address_v6::address_v6 (3 of 3 overloads)]
+[section:overload3 ip::address::address (3 of 4 overloads)]
-Copy constructor.
+Construct an address from an IPv6 address.
- address_v6(
- const address_v6 & other);
+ address(
+ const boost::asio::ip::address_v6 & ipv6_address);
[endsect]
-[endsect]
-
-[section:any ip::address_v6::any]
+[section:overload4 ip::address::address (4 of 4 overloads)]
-Obtain an address object that represents any address.
+Copy constructor.
- static address_v6 any();
+ address(
+ const address & other);
[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::from_string]
-[section:from_string ip::address_v6::from_string]
-
-Create an address from an IP address string.
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload1 from_string]``(
+ static address ``[link boost_asio.reference.ip__address.from_string.overload1 from_string]``(
const char * str);
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload2 from_string]``(
+ static address ``[link boost_asio.reference.ip__address.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]``(
+ static address ``[link boost_asio.reference.ip__address.from_string.overload3 from_string]``(
const std::string & str);
- static address_v6 ``[link boost_asio.reference.ip__address_v6.from_string.overload4 from_string]``(
+ 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_v6::from_string (1 of 4 overloads)]
+[section:overload1 ip::address::from_string (1 of 4 overloads)]
-Create an address from an IP address string.
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address_v6 from_string(
+ static address from_string(
const char * str);
@@ -31462,11 +32658,11 @@
-[section:overload2 ip::address_v6::from_string (2 of 4 overloads)]
+[section:overload2 ip::address::from_string (2 of 4 overloads)]
-Create an address from an IP address string.
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address_v6 from_string(
+ static address from_string(
const char * str,
boost::system::error_code & ec);
@@ -31476,11 +32672,11 @@
-[section:overload3 ip::address_v6::from_string (3 of 4 overloads)]
+[section:overload3 ip::address::from_string (3 of 4 overloads)]
-Create an address from an IP address string.
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address_v6 from_string(
+ static address from_string(
const std::string & str);
@@ -31489,11 +32685,11 @@
-[section:overload4 ip::address_v6::from_string (4 of 4 overloads)]
+[section:overload4 ip::address::from_string (4 of 4 overloads)]
-Create an address from an IP address string.
+Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
- static address_v6 from_string(
+ static address from_string(
const std::string & str,
boost::system::error_code & ec);
@@ -31505,11 +32701,11 @@
[endsect]
-[section:is_link_local ip::address_v6::is_link_local]
+[section:is_v4 ip::address::is_v4]
-Determine whether the address is link local.
+Get whether the address is an IP version 4 address.
- bool is_link_local() const;
+ bool is_v4() const;
@@ -31517,11 +32713,11 @@
-[section:is_loopback ip::address_v6::is_loopback]
+[section:is_v6 ip::address::is_v6]
-Determine whether the address is a loopback address.
+Get whether the address is an IP version 6 address.
- bool is_loopback() const;
+ bool is_v6() const;
@@ -31529,11 +32725,13 @@
-[section:is_multicast ip::address_v6::is_multicast]
+[section:operator_not__eq_ ip::address::operator!=]
-Determine whether the address is a multicast address.
+Compare two addresses for inequality.
- bool is_multicast() const;
+ friend bool operator!=(
+ const address & a1,
+ const address & a2);
@@ -31541,11 +32739,13 @@
-[section:is_multicast_global ip::address_v6::is_multicast_global]
+[section:operator_lt_ ip::address::operator<]
-Determine whether the address is a global multicast address.
+Compare addresses for ordering.
- bool is_multicast_global() const;
+ friend bool operator<(
+ const address & a1,
+ const address & a2);
@@ -31553,47 +32753,61 @@
-[section:is_multicast_link_local ip::address_v6::is_multicast_link_local]
+[section:operator_lt__lt_ ip::address::operator<<]
-Determine whether the address is a link-local multicast address.
+Output an address as a string.
- bool is_multicast_link_local() const;
+ template<
+ typename ``[link boost_asio.reference.Elem Elem]``,
+ typename ``[link boost_asio.reference.Traits 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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
-[section:is_multicast_node_local ip::address_v6::is_multicast_node_local]
+[[addr][The address to be written.]]
-Determine whether the address is a node-local multicast address.
+]
- bool is_multicast_node_local() const;
+[heading Return Value]
+
+The output stream.
[endsect]
+[section:operator_eq_ ip::address::operator=]
-[section:is_multicast_org_local ip::address_v6::is_multicast_org_local]
-
-Determine whether the address is a org-local multicast address.
-
- bool is_multicast_org_local() const;
-
+Assign from another address.
+ address & ``[link boost_asio.reference.ip__address.operator_eq_.overload1 operator=]``(
+ const address & other);
-[endsect]
+ 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:is_multicast_site_local ip::address_v6::is_multicast_site_local]
+[section:overload1 ip::address::operator= (1 of 3 overloads)]
-Determine whether the address is a site-local multicast address.
+Assign from another address.
- bool is_multicast_site_local() const;
+ address & operator=(
+ const address & other);
@@ -31601,11 +32815,12 @@
-[section:is_site_local ip::address_v6::is_site_local]
+[section:overload2 ip::address::operator= (2 of 3 overloads)]
-Determine whether the address is site local.
+Assign from an IPv4 address.
- bool is_site_local() const;
+ address & operator=(
+ const boost::asio::ip::address_v4 & ipv4_address);
@@ -31613,61 +32828,49 @@
-[section:is_unspecified ip::address_v6::is_unspecified]
+[section:overload3 ip::address::operator= (3 of 3 overloads)]
-Determine whether the address is unspecified.
+Assign from an IPv6 address.
- bool is_unspecified() const;
+ address & operator=(
+ const boost::asio::ip::address_v6 & ipv6_address);
[endsect]
-
-[section:is_v4_compatible ip::address_v6::is_v4_compatible]
-
-Determine whether the address is an IPv4-compatible address.
-
- bool is_v4_compatible() const;
-
-
-
[endsect]
+[section:operator_eq__eq_ ip::address::operator==]
-[section:is_v4_mapped ip::address_v6::is_v4_mapped]
-
-Determine whether the address is a mapped IPv4 address.
+Compare two addresses for equality.
- bool is_v4_mapped() const;
+ friend bool operator==(
+ const address & a1,
+ const address & a2);
[endsect]
+[section:to_string ip::address::to_string]
-[section:loopback ip::address_v6::loopback]
-
-Obtain an address object that represents the loopback address.
-
- static address_v6 loopback();
-
-
+Get the address as a string in dotted decimal format.
-[endsect]
+ 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:operator_not__eq_ ip::address_v6::operator!=]
+[section:overload1 ip::address::to_string (1 of 2 overloads)]
-Compare two addresses for inequality.
+Get the address as a string in dotted decimal format.
- friend bool operator!=(
- const address_v6 & a1,
- const address_v6 & a2);
+ std::string to_string() const;
@@ -31675,49 +32878,26 @@
-[section:operator_lt_ ip::address_v6::operator<]
+[section:overload2 ip::address::to_string (2 of 2 overloads)]
-Compare addresses for ordering.
+Get the address as a string in dotted decimal format.
- friend bool operator<(
- const address_v6 & a1,
- const address_v6 & a2);
+ std::string to_string(
+ boost::system::error_code & ec) const;
[endsect]
+[endsect]
-[section:operator_lt__lt_ ip::address_v6::operator<<]
-
-Output an address as a string.
-
- template<
- typename ``[link boost_asio.reference.Elem Elem]``,
- typename ``[link boost_asio.reference.Traits 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.]]
+[section:to_v4 ip::address::to_v4]
-]
+Get the address as an IP version 4 address.
-[heading Return Value]
-
-The output stream.
+ boost::asio::ip::address_v4 to_v4() const;
@@ -31725,13 +32905,11 @@
-[section:operator_lt__eq_ ip::address_v6::operator<=]
+[section:to_v6 ip::address::to_v6]
-Compare addresses for ordering.
+Get the address as an IP version 6 address.
- friend bool operator<=(
- const address_v6 & a1,
- const address_v6 & a2);
+ boost::asio::ip::address_v6 to_v6() const;
@@ -31739,265 +32917,100 @@
-[section:operator_eq_ ip::address_v6::operator=]
+[endsect]
-Assign from another address.
+[section:ip__address_v4 ip::address_v4]
- address_v6 & operator=(
- const address_v6 & other);
+Implements IP version 4 style addresses.
+ class address_v4
-[endsect]
+[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. ]
+
+ ]
-[section:operator_eq__eq_ ip::address_v6::operator==]
+]
-Compare two addresses for equality.
-
- friend bool operator==(
- const address_v6 & a1,
- const address_v6 & a2);
-
-
-
-[endsect]
-
-
-
-[section:operator_gt_ ip::address_v6::operator>]
-
-Compare addresses for ordering.
-
- friend bool operator>(
- const address_v6 & a1,
- const address_v6 & a2);
-
-
-
-[endsect]
-
-
-
-[section:operator_gt__eq_ ip::address_v6::operator>=]
-
-Compare addresses for ordering.
-
- friend bool operator>=(
- const address_v6 & a1,
- const address_v6 & a2);
-
-
-
-[endsect]
-
-
-[section:scope_id ip::address_v6::scope_id]
-
-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]
-
-Get the address in bytes.
-
- bytes_type to_bytes() const;
-
-
-
-[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: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]
-
-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]
-
-Create an IPv4-compatible IPv6 address.
-
- static address_v6 v4_compatible(
- const address_v4 & addr);
-
-
-
-[endsect]
-
-
-
-[section:v4_mapped ip::address_v6::v4_mapped]
-
-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]]
+[heading Member Functions]
+[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__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__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
+ [[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. ]
]
-
-]
-
-[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__address_v4.is_class_a [*is_class_a]]]
+ [Determine whether the address is a class A address. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.basic_endpoint [*basic_endpoint]]]
- [Default constructor. ]
+ [[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__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
+ [[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__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
+ [[link boost_asio.reference.ip__address_v4.is_multicast [*is_multicast]]]
+ [Determine whether the address is a multicast address. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [[link boost_asio.reference.ip__address_v4.loopback [*loopback]]]
+ [Obtain an address object that represents the loopback address. ]
]
[
- [[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__address_v4.netmask [*netmask]]]
+ [Obtain the netmask that corresponds to the address, based on its address class. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [[link boost_asio.reference.ip__address_v4.operator_eq_ [*operator=]]]
+ [Assign from another address. ]
]
[
- [[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__address_v4.to_bytes [*to_bytes]]]
+ [Get the address in bytes. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [[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. ]
]
]
@@ -32007,18 +33020,33 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
- [Compare two endpoints for inequality. ]
+ [[link boost_asio.reference.ip__address_v4.operator_not__eq_ [*operator!=]]]
+ [Compare two addresses for inequality. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
- [Compare endpoints for ordering. ]
+ [[link boost_asio.reference.ip__address_v4.operator_lt_ [*operator<]]]
+ [Compare addresses for ordering. ]
]
[
- [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
- [Compare two endpoints for equality. ]
+ [[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. ]
]
]
@@ -32028,127 +33056,119 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
+ [[link boost_asio.reference.ip__address_v4.operator_lt__lt_ [*operator<<]]]
+ [Output an address 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.
+[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.
+[*Shared] [*objects:] Unsafe.
-[section:address ip::basic_endpoint::address]
+[section:address_v4 ip::address_v4::address_v4]
-Get the IP address associated with the endpoint.
+Default constructor.
- boost::asio::ip::address ``[link boost_asio.reference.ip__basic_endpoint.address.overload1 address]``() const;
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload1 address_v4]``();
- void ``[link boost_asio.reference.ip__basic_endpoint.address.overload2 address]``(
- const boost::asio::ip::address & addr);
+ ``[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);
-[section:overload1 ip::basic_endpoint::address (1 of 2 overloads)]
+ ``[link boost_asio.reference.ip__address_v4.address_v4.overload4 address_v4]``(
+ const address_v4 & other);
-Get the IP address associated with the endpoint.
- boost::asio::ip::address address() const;
+[section:overload1 ip::address_v4::address_v4 (1 of 4 overloads)]
+Default constructor.
+ address_v4();
-[endsect]
+[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);
+[section:overload2 ip::address_v4::address_v4 (2 of 4 overloads)]
+Construct an address from raw bytes.
+ address_v4(
+ const bytes_type & bytes);
-[endsect]
[endsect]
-[section:basic_endpoint ip::basic_endpoint::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:overload3 ip::address_v4::address_v4 (3 of 4 overloads)]
+Construct an address from a unsigned long in host byte order.
-[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+ address_v4(
+ unsigned long addr);
-Default constructor.
- basic_endpoint();
+[endsect]
-[endsect]
+[section:overload4 ip::address_v4::address_v4 (4 of 4 overloads)]
+Copy constructor.
-[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)]
+ address_v4(
+ const address_v4 & other);
-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);
+[endsect]
-[heading Examples]
-
-To initialise an IPv4 TCP endpoint for port 1234, use:
+[endsect]
- boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), 1234);
+[section:any ip::address_v4::any]
+Obtain an address object that represents any address.
+ static address_v4 any();
-To specify an IPv6 UDP endpoint for port 9876, use:
- boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
+[endsect]
+[section:broadcast ip::address_v4::broadcast]
+Obtain an address object that represents the broadcast address.
-[endsect]
+ 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:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)]
+[section:overload1 ip::address_v4::broadcast (1 of 2 overloads)]
-Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.
+Obtain an address object that represents the broadcast address.
- basic_endpoint(
- const boost::asio::ip::address & addr,
- unsigned short port_num);
+ static address_v4 broadcast();
@@ -32156,12 +33176,13 @@
-[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)]
+[section:overload2 ip::address_v4::broadcast (2 of 2 overloads)]
-Copy constructor.
+Obtain an address object that represents the broadcast address that corresponds to the specified address and netmask.
- basic_endpoint(
- const basic_endpoint & other);
+ static address_v4 broadcast(
+ const address_v4 & addr,
+ const address_v4 & mask);
@@ -32171,58 +33192,70 @@
[endsect]
-[section:capacity ip::basic_endpoint::capacity]
+[section:bytes_type ip::address_v4::bytes_type]
-Get the capacity of the endpoint in the native type.
+The type used to represent an address as an array of bytes.
+
+ typedef boost::array< unsigned char, 4 > bytes_type;
- std::size_t capacity() const;
[endsect]
-[section:data ip::basic_endpoint::data]
+[section:from_string ip::address_v4::from_string]
-Get the underlying endpoint in the native type.
+Create an address from an IP address string in dotted decimal form.
- data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload1 data]``();
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload1 from_string]``(
+ const char * str);
- const data_type * ``[link boost_asio.reference.ip__basic_endpoint.data.overload2 data]``() const;
+ 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);
-[section:overload1 ip::basic_endpoint::data (1 of 2 overloads)]
+ static address_v4 ``[link boost_asio.reference.ip__address_v4.from_string.overload4 from_string]``(
+ const std::string & str,
+ boost::system::error_code & ec);
-Get the underlying endpoint in the native type.
- data_type * data();
+[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]
+[endsect]
-[section:overload2 ip::basic_endpoint::data (2 of 2 overloads)]
-Get the underlying endpoint in the native type.
- const data_type * data() const;
+[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]
[endsect]
-[section:data_type ip::basic_endpoint::data_type]
-The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+[section:overload3 ip::address_v4::from_string (3 of 4 overloads)]
- typedef implementation_defined data_type;
+Create an address from an IP address string in dotted decimal form.
+ static address_v4 from_string(
+ const std::string & str);
@@ -32230,27 +33263,27 @@
-[section:operator_not__eq_ ip::basic_endpoint::operator!=]
+[section:overload4 ip::address_v4::from_string (4 of 4 overloads)]
-Compare two endpoints for inequality.
+Create an address from an IP address string in dotted decimal form.
- friend bool operator!=(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+ static address_v4 from_string(
+ const std::string & str,
+ boost::system::error_code & ec);
[endsect]
+[endsect]
+
-[section:operator_lt_ ip::basic_endpoint::operator<]
+[section:is_class_a ip::address_v4::is_class_a]
-Compare endpoints for ordering.
+Determine whether the address is a class A address.
- friend bool operator<(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+ bool is_class_a() const;
@@ -32258,32 +33291,23 @@
-[section:operator_lt__lt_ ip::basic_endpoint::operator<<]
+[section:is_class_b ip::address_v4::is_class_b]
-Output an endpoint as a string.
+Determine whether the address is a class B address.
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const basic_endpoint< InternetProtocol > & endpoint);
+ bool is_class_b() const;
-Used to output a human-readable string for a specified endpoint.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[os][The output stream to which the string will be written.]]
-[[endpoint][The endpoint to be written.]]
+[section:is_class_c ip::address_v4::is_class_c]
-]
+Determine whether the address is a class C address.
-[heading Return Value]
-
-The output stream.
+ bool is_class_c() const;
@@ -32291,12 +33315,11 @@
-[section:operator_eq_ ip::basic_endpoint::operator=]
+[section:is_multicast ip::address_v4::is_multicast]
-Assign from another endpoint.
+Determine whether the address is a multicast address.
- basic_endpoint & operator=(
- const basic_endpoint & other);
+ bool is_multicast() const;
@@ -32304,34 +33327,24 @@
-[section:operator_eq__eq_ ip::basic_endpoint::operator==]
+[section:loopback ip::address_v4::loopback]
-Compare two endpoints for equality.
+Obtain an address object that represents the loopback address.
- friend bool operator==(
- const basic_endpoint< InternetProtocol > & e1,
- const basic_endpoint< InternetProtocol > & e2);
+ static address_v4 loopback();
[endsect]
-[section:port ip::basic_endpoint::port]
-
-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)]
+[section:netmask ip::address_v4::netmask]
-Get the port associated with the endpoint. The port number is always in the host's byte order.
+Obtain the netmask that corresponds to the address, based on its address class.
- unsigned short port() const;
+ static address_v4 netmask(
+ const address_v4 & addr);
@@ -32339,26 +33352,63 @@
-[section:overload2 ip::basic_endpoint::port (2 of 2 overloads)]
+[section:operator_not__eq_ ip::address_v4::operator!=]
-Set the port associated with the endpoint. The port number is always in the host's byte order.
+Compare two addresses for inequality.
- void port(
- unsigned short port_num);
+ friend bool operator!=(
+ const address_v4 & a1,
+ const address_v4 & a2);
[endsect]
+
+[section:operator_lt_ ip::address_v4::operator<]
+
+Compare addresses for ordering.
+
+ friend bool operator<(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+
[endsect]
-[section:protocol ip::basic_endpoint::protocol]
-The protocol associated with the endpoint.
+[section:operator_lt__lt_ ip::address_v4::operator<<]
- protocol_type protocol() const;
+Output an address as a string.
+
+ template<
+ typename ``[link boost_asio.reference.Elem Elem]``,
+ typename ``[link boost_asio.reference.Traits 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.
@@ -32366,12 +33416,26 @@
-[section:protocol_type ip::basic_endpoint::protocol_type]
+[section:operator_lt__eq_ ip::address_v4::operator<=]
+
+Compare addresses for ordering.
+
+ friend bool operator<=(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+
+[endsect]
-The protocol type associated with the endpoint.
- typedef InternetProtocol protocol_type;
+[section:operator_eq_ ip::address_v4::operator=]
+
+Assign from another address.
+
+ address_v4 & operator=(
+ const address_v4 & other);
@@ -32379,12 +33443,13 @@
-[section:resize ip::basic_endpoint::resize]
+[section:operator_eq__eq_ ip::address_v4::operator==]
-Set the underlying size of the endpoint in the native type.
+Compare two addresses for equality.
- void resize(
- std::size_t size);
+ friend bool operator==(
+ const address_v4 & a1,
+ const address_v4 & a2);
@@ -32392,11 +33457,13 @@
-[section:size ip::basic_endpoint::size]
+[section:operator_gt_ ip::address_v4::operator>]
-Get the underlying size of the endpoint in the native type.
+Compare addresses for ordering.
- std::size_t size() const;
+ friend bool operator>(
+ const address_v4 & a1,
+ const address_v4 & a2);
@@ -32404,17 +33471,87 @@
+[section:operator_gt__eq_ ip::address_v4::operator>=]
+
+Compare addresses for ordering.
+
+ friend bool operator>=(
+ const address_v4 & a1,
+ const address_v4 & a2);
+
+
+
[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:to_bytes ip::address_v4::to_bytes]
+
+Get the address in bytes.
+
+ bytes_type to_bytes() const;
+
+
+
+[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)]
+
+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]
+
+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]
@@ -32423,101 +33560,183 @@
[
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
- [The endpoint 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.ip__basic_resolver.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+[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__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
+ [[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__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[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__basic_resolver.query [*query]]]
- [The query type. ]
+ [[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__basic_resolver.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[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 Member Functions]
+[heading Friends]
[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__address_v6.operator_not__eq_ [*operator!=]]]
+ [Compare two addresses for inequality. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
+ [[link boost_asio.reference.ip__address_v6.operator_lt_ [*operator<]]]
+ [Compare addresses for ordering. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
+ [[link boost_asio.reference.ip__address_v6.operator_lt__eq_ [*operator<=]]]
+ [Compare addresses for ordering. ]
]
[
- [[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__address_v6.operator_eq__eq_ [*operator==]]]
+ [Compare two addresses for equality. ]
]
[
- [[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__address_v6.operator_gt_ [*operator>]]]
+ [Compare addresses for ordering. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Resolve a query to a list of entries. ]
+ [[link boost_asio.reference.ip__address_v6.operator_gt__eq_ [*operator>=]]]
+ [Compare addresses for ordering. ]
]
]
-[heading Protected Data Members]
+[heading Related Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
-
- [
- [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
+ [[link boost_asio.reference.ip__address_v6.operator_lt__lt_ [*operator<<]]]
+ [Output an address as a string. ]
]
-
+
]
-The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
+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]
@@ -32527,163 +33746,124 @@
[*Shared] [*objects:] Unsafe.
-[section:async_resolve ip::basic_resolver::async_resolve]
+[section:address_v6 ip::address_v6::address_v6]
-Asynchronously resolve a query to a list of entries.
+Default constructor.
- 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);
+ ``[link boost_asio.reference.ip__address_v6.address_v6.overload1 address_v6]``();
- 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);
+ ``[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::basic_resolver::async_resolve (1 of 2 overloads)]
-Asynchronously resolve a query to a list of entries.
+[section:overload1 ip::address_v6::address_v6 (1 of 3 overloads)]
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const query & q,
- ResolveHandler handler);
+Default constructor.
+ address_v6();
-This function is used to asynchronously resolve a query into a list of endpoint entries.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
-[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- resolver::iterator iterator // Forward-only iterator that can
- // be used to traverse the list
- // of endpoint entries.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
+[section:overload2 ip::address_v6::address_v6 (2 of 3 overloads)]
-]
+Construct an address from raw bytes and scope ID.
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ address_v6(
+ const bytes_type & bytes,
+ unsigned long scope_id = 0);
-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)]
+[section:overload3 ip::address_v6::address_v6 (3 of 3 overloads)]
-Asynchronously resolve an endpoint to a list of entries.
+Copy constructor.
- template<
- typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
- void async_resolve(
- const endpoint_type & e,
- ResolveHandler handler);
+ address_v6(
+ const address_v6 & other);
-This function is used to asynchronously resolve an endpoint into a list of endpoint entries.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[e][An endpoint object that determines what endpoints will be returned.]]
+[endsect]
-[[handler][The handler to be called when the resolve operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- resolver::iterator iterator // Forward-only iterator that can
- // be used to traverse the list
- // of endpoint entries.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
+[section:any ip::address_v6::any]
-]
+Obtain an address object that represents any address.
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ static address_v6 any();
-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]
+[section:bytes_type ip::address_v6::bytes_type]
-Constructor.
+The type used to represent an address as an array of bytes.
- basic_resolver(
- boost::asio::io_service & io_service);
+ typedef boost::array< unsigned char, 16 > bytes_type;
-This constructor creates a basic_resolver.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[io_service][The io\_service object that the resolver will use to dispatch handlers for any asynchronous operations performed on the timer. ]]
-]
+[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);
-[endsect]
+ 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:cancel ip::basic_resolver::cancel]
-Cancel any asynchronous operations that are waiting on the resolver.
+[section:overload1 ip::address_v6::from_string (1 of 4 overloads)]
- void cancel();
+Create an address from an IP address string.
+ static address_v6 from_string(
+ const char * str);
-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]
-
-The endpoint type.
+[section:overload2 ip::address_v6::from_string (2 of 4 overloads)]
- typedef InternetProtocol::endpoint endpoint_type;
+Create an address from an IP address string.
+ static address_v6 from_string(
+ const char * str,
+ boost::system::error_code & ec);
@@ -32691,37 +33871,40 @@
-[section:get_io_service ip::basic_resolver::get_io_service]
+[section:overload3 ip::address_v6::from_string (3 of 4 overloads)]
+Create an address from an IP address string.
-['Inherited from basic_io_object.]
+ static address_v6 from_string(
+ const std::string & str);
-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.
-[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: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:implementation ip::basic_resolver::implementation]
+[endsect]
-['Inherited from basic_io_object.]
+[section:is_link_local ip::address_v6::is_link_local]
-The underlying implementation of the I/O object.
+Determine whether the address is link local.
- implementation_type implementation;
+ bool is_link_local() const;
@@ -32729,38 +33912,35 @@
-[section:implementation_type ip::basic_resolver::implementation_type]
+[section:is_loopback ip::address_v6::is_loopback]
+Determine whether the address is a loopback address.
-['Inherited from basic_io_object.]
+ bool is_loopback() const;
-The underlying implementation type of I/O object.
-
- typedef service_type::implementation_type implementation_type;
+[endsect]
-[endsect]
+[section:is_multicast ip::address_v6::is_multicast]
+Determine whether the address is a multicast address.
-[section:io_service ip::basic_resolver::io_service]
+ bool is_multicast() const;
-['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+[endsect]
- 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.
+[section:is_multicast_global ip::address_v6::is_multicast_global]
+Determine whether the address is a global multicast address.
-[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.
+ bool is_multicast_global() const;
@@ -32768,12 +33948,11 @@
-[section:iterator ip::basic_resolver::iterator]
-
-The iterator type.
+[section:is_multicast_link_local ip::address_v6::is_multicast_link_local]
- typedef InternetProtocol::resolver_iterator iterator;
+Determine whether the address is a link-local multicast address.
+ bool is_multicast_link_local() const;
@@ -32781,12 +33960,11 @@
-[section:protocol_type ip::basic_resolver::protocol_type]
-
-The protocol type.
+[section:is_multicast_node_local ip::address_v6::is_multicast_node_local]
- typedef InternetProtocol protocol_type;
+Determine whether the address is a node-local multicast address.
+ bool is_multicast_node_local() const;
@@ -32794,173 +33972,131 @@
-[section:query ip::basic_resolver::query]
-
-The query type.
+[section:is_multicast_org_local ip::address_v6::is_multicast_org_local]
- typedef InternetProtocol::resolver_query query;
+Determine whether the address is a org-local multicast address.
+ bool is_multicast_org_local() const;
[endsect]
-[section:resolve ip::basic_resolver::resolve]
-
-Resolve a query to a list of entries.
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
- const query & q);
+[section:is_multicast_site_local ip::address_v6::is_multicast_site_local]
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload2 resolve]``(
- const query & q,
- boost::system::error_code & ec);
+Determine whether the address is a site-local multicast address.
- iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload3 resolve]``(
- const endpoint_type & e);
+ bool is_multicast_site_local() const;
- 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)]
+[endsect]
-Resolve a query to a list of entries.
- iterator resolve(
- const query & q);
+[section:is_site_local ip::address_v6::is_site_local]
-This function is used to resolve a query into a list of endpoint entries.
+Determine whether the address is site local.
+ bool is_site_local() const;
-[heading Parameters]
-
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
-]
+[endsect]
-[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.]]
+[section:is_unspecified ip::address_v6::is_unspecified]
-]
+Determine whether the address is unspecified.
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ bool is_unspecified() const;
-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.
+[section:is_v4_compatible ip::address_v6::is_v4_compatible]
- iterator resolve(
- const query & q,
- boost::system::error_code & ec);
+Determine whether the address is an IPv4-compatible address.
+ bool is_v4_compatible() const;
-This function is used to resolve a query into a list of endpoint entries.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[q][A query object that determines what endpoints will be returned.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[section:is_v4_mapped ip::address_v6::is_v4_mapped]
-[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.
+Determine whether the address is a mapped IPv4 address.
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+ bool is_v4_mapped() const;
-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)]
+[section:loopback ip::address_v6::loopback]
-Resolve an endpoint to a list of entries.
+Obtain an address object that represents the loopback address.
- iterator resolve(
- const endpoint_type & e);
+ static address_v6 loopback();
-This function is used to resolve an endpoint into a list of endpoint entries.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[e][An endpoint object that determines what endpoints will be returned.]]
-]
+[section:operator_not__eq_ ip::address_v6::operator!=]
-[heading Return Value]
-
-A forward-only iterator that can be used to traverse the list of endpoint entries.
+Compare two addresses for inequality.
-[heading Exceptions]
-
+ friend bool operator!=(
+ const address_v6 & a1,
+ const address_v6 & a2);
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Remarks]
-
-A default constructed iterator represents the end of the list.
+[endsect]
+
+
+
+[section:operator_lt_ ip::address_v6::operator<]
+
+Compare addresses for ordering.
+
+ friend bool operator<(
+ const address_v6 & a1,
+ const address_v6 & a2);
-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:operator_lt__lt_ ip::address_v6::operator<<]
-Resolve an endpoint to a list of entries.
+Output an address as a string.
- iterator resolve(
- const endpoint_type & e,
- boost::system::error_code & ec);
+ template<
+ typename ``[link boost_asio.reference.Elem Elem]``,
+ typename ``[link boost_asio.reference.Traits Traits]``>
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const address_v6 & addr);
-This function is used to resolve an endpoint into a list of endpoint entries.
+Used to output a human-readable string for a specified address.
[heading Parameters]
@@ -32968,166 +34104,123 @@
[variablelist
-[[e][An endpoint object that determines what endpoints will be returned.]]
+[[os][The output stream to which the string will be written.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[addr][The address to be written.]]
]
[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.
+The output stream.
-A successful call to this function is guaranteed to return at least one entry.
[endsect]
-[endsect]
-
-[section:service ip::basic_resolver::service]
+[section:operator_lt__eq_ ip::address_v6::operator<=]
+Compare addresses for ordering.
-['Inherited from basic_io_object.]
+ friend bool operator<=(
+ const address_v6 & a1,
+ const address_v6 & a2);
-The service associated with the I/O object.
- service_type & service;
+[endsect]
-[endsect]
+[section:operator_eq_ ip::address_v6::operator=]
+Assign from another address.
-[section:service_type ip::basic_resolver::service_type]
+ address_v6 & operator=(
+ const address_v6 & other);
-['Inherited from basic_io_object.]
-The type of the service that will be used to provide I/O operations.
+[endsect]
- typedef ResolverService service_type;
+[section:operator_eq__eq_ ip::address_v6::operator==]
+Compare two addresses for equality.
-[endsect]
+ friend bool operator==(
+ const address_v6 & a1,
+ const address_v6 & a2);
[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
+[section:operator_gt_ ip::address_v6::operator>]
+Compare addresses for ordering.
-[heading Types]
-[table
- [[Name][Description]]
+ friend bool operator>(
+ const address_v6 & a1,
+ const address_v6 & a2);
- [
- [[link boost_asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]]
- [The endpoint type associated with the endpoint entry. ]
-
- ]
- [
+[endsect]
- [[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]]
+[section:operator_gt__eq_ ip::address_v6::operator>=]
- [
- [[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. ]
- ]
-
-]
+Compare addresses for ordering.
-The
-[link boost_asio.reference.ip__basic_resolver_entry ip::basic_resolver_entry] class template describes an entry as returned by a resolver.
+ friend bool operator>=(
+ const address_v6 & a1,
+ const address_v6 & a2);
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
-[section:basic_resolver_entry ip::basic_resolver_entry::basic_resolver_entry]
+[section:scope_id ip::address_v6::scope_id]
-Default constructor.
+The scope ID of the address.
- ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 basic_resolver_entry]``();
+ unsigned long ``[link boost_asio.reference.ip__address_v6.scope_id.overload1 scope_id]``() const;
- ``[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);
+ void ``[link boost_asio.reference.ip__address_v6.scope_id.overload2 scope_id]``(
+ unsigned long id);
-[section:overload1 ip::basic_resolver_entry::basic_resolver_entry (1 of 2 overloads)]
+[section:overload1 ip::address_v6::scope_id (1 of 2 overloads)]
-Default constructor.
+The scope ID of the address.
+
+ unsigned long scope_id() const;
- basic_resolver_entry();
+Returns the scope ID associated with the IPv6 address.
[endsect]
-[section:overload2 ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads)]
+[section:overload2 ip::address_v6::scope_id (2 of 2 overloads)]
-Construct with specified endpoint, host name and service name.
+The scope ID of the address.
+
+ void scope_id(
+ unsigned long id);
- basic_resolver_entry(
- const endpoint_type & endpoint,
- const std::string & host_name,
- const std::string & service_name);
+Modifies the scope ID associated with the IPv6 address.
[endsect]
@@ -33136,24 +34229,32 @@
[endsect]
-[section:endpoint ip::basic_resolver_entry::endpoint]
+[section:to_bytes ip::address_v6::to_bytes]
-Get the endpoint associated with the entry.
+Get the address in bytes.
- endpoint_type endpoint() const;
+ bytes_type to_bytes() const;
[endsect]
+[section:to_string ip::address_v6::to_string]
-[section:endpoint_type ip::basic_resolver_entry::endpoint_type]
+Get the address as a string.
-The endpoint type associated with the endpoint entry.
+ std::string ``[link boost_asio.reference.ip__address_v6.to_string.overload1 to_string]``() const;
- typedef InternetProtocol::endpoint endpoint_type;
+ 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;
@@ -33161,36 +34262,39 @@
-[section:host_name ip::basic_resolver_entry::host_name]
+[section:overload2 ip::address_v6::to_string (2 of 2 overloads)]
-Get the host name associated with the entry.
+Get the address as a string.
- std::string host_name() const;
+ std::string to_string(
+ boost::system::error_code & ec) const;
[endsect]
+[endsect]
-[section:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type]
-Convert to the endpoint associated with the entry.
+[section:to_v4 ip::address_v6::to_v4]
- operator endpoint_type() const;
+Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
+ address_v4 to_v4() const;
-[endsect]
+[endsect]
-[section:protocol_type ip::basic_resolver_entry::protocol_type]
-The protocol type associated with the endpoint entry.
+[section:v4_compatible ip::address_v6::v4_compatible]
- typedef InternetProtocol protocol_type;
+Create an IPv4-compatible IPv6 address.
+ static address_v6 v4_compatible(
+ const address_v4 & addr);
@@ -33198,11 +34302,12 @@
-[section:service_name ip::basic_resolver_entry::service_name]
+[section:v4_mapped ip::address_v6::v4_mapped]
-Get the service name associated with the entry.
+Create an IPv4-mapped IPv6 address.
- std::string service_name() const;
+ static address_v6 v4_mapped(
+ const address_v4 & addr);
@@ -33212,220 +34317,233 @@
[endsect]
-[section:ip__basic_resolver_iterator ip::basic_resolver_iterator]
+[section:ip__basic_endpoint ip::basic_endpoint]
-An iterator over the entries produced by a resolver.
+Describes an endpoint for a version-independent IP socket.
template<
typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_iterator
+ 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_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
- [Default constructor creates an end iterator. ]
+ [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver_iterator.create [*create]]]
- [Create an iterator from an addrinfo list returned by getaddrinfo. ]
+ [[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. ]
]
]
-The
-[link boost_asio.reference.ip__basic_resolver_iterator ip::basic_resolver_iterator] class template is used to define iterators over the results returned by a resolver.
-
-The iterator's value\_type, obtained when the iterator is dereferenced, is:
+[heading Friends]
+[table
+ [[Name][Description]]
- const basic_resolver_entry<InternetProtocol>
+ [
+ [[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.
+[*Shared] [*objects:] Unsafe.
+[section:address ip::basic_endpoint::address]
-[section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator]
+Get the IP address associated with the endpoint.
-Default constructor creates an end iterator.
+ boost::asio::ip::address ``[link boost_asio.reference.ip__basic_endpoint.address.overload1 address]``() const;
- basic_resolver_iterator();
+ 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)]
-[endsect]
+Get the IP address associated with the endpoint.
+ boost::asio::ip::address address() const;
-[section:create ip::basic_resolver_iterator::create]
-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);
+[endsect]
- 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)]
+[section:overload2 ip::basic_endpoint::address (2 of 2 overloads)]
-Create an iterator from an addrinfo list returned by getaddrinfo.
+Set the IP address associated with the endpoint.
- static basic_resolver_iterator create(
- boost::asio::detail::addrinfo_type * address_info,
- const std::string & host_name,
- const std::string & service_name);
+ void address(
+ const boost::asio::ip::address & addr);
[endsect]
+[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);
+[section:basic_endpoint ip::basic_endpoint::basic_endpoint]
+Default constructor.
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload1 basic_endpoint]``();
-[endsect]
-
+ ``[link boost_asio.reference.ip__basic_endpoint.basic_endpoint.overload2 basic_endpoint]``(
+ const InternetProtocol & protocol,
+ unsigned short port_num);
-[endsect]
+ ``[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);
-[endsect]
-[section:ip__basic_resolver_query ip::basic_resolver_query]
+[section:overload1 ip::basic_endpoint::basic_endpoint (1 of 4 overloads)]
-An query to be passed to a resolver.
+Default constructor.
- template<
- typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
- class basic_resolver_query :
- public ip::resolver_query_base
+ basic_endpoint();
-[heading Types]
-[table
- [[Name][Description]]
- [
+[endsect]
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[section:overload2 ip::basic_endpoint::basic_endpoint (2 of 4 overloads)]
- [
- [[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. ]
- ]
-
-]
+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.
-[heading Data Members]
-[table
- [[Name][Description]]
+ basic_endpoint(
+ const InternetProtocol & protocol,
+ unsigned short port_num);
- [
- [[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. ]
- ]
+[heading Examples]
+
+To initialise an IPv4 TCP endpoint for port 1234, use:
- [
- [[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. ]
- ]
+ boost::asio::ip::tcp::endpoint ep(boost::asio::ip::tcp::v4(), 1234);
- [
- [[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. ]
- ]
-]
+To specify an IPv6 UDP endpoint for port 9876, use:
-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.
+ boost::asio::ip::udp::endpoint ep(boost::asio::ip::udp::v6(), 9876);
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[endsect]
-[section:address_configured ip::basic_resolver_query::address_configured]
-['Inherited from ip::resolver_query_base.]
+[section:overload3 ip::basic_endpoint::basic_endpoint (3 of 4 overloads)]
-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.
+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.
- static const int address_configured = implementation_defined;
+ basic_endpoint(
+ const boost::asio::ip::address & addr,
+ unsigned short port_num);
@@ -33433,67 +34551,46 @@
-[section:all_matching ip::basic_resolver_query::all_matching]
-
-
-['Inherited from ip::resolver_query_base.]
+[section:overload4 ip::basic_endpoint::basic_endpoint (4 of 4 overloads)]
-If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
+Copy constructor.
- static const int all_matching = implementation_defined;
+ basic_endpoint(
+ const basic_endpoint & other);
[endsect]
-[section:basic_resolver_query ip::basic_resolver_query::basic_resolver_query]
-
-Construct with specified service name for any protocol.
+[endsect]
- ``[link boost_asio.reference.ip__basic_resolver_query.basic_resolver_query.overload1 basic_resolver_query]``(
- const std::string & service_name,
- 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);
+[section:capacity ip::basic_endpoint::capacity]
- ``[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);
+Get the capacity of the endpoint in the native type.
- ``[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);
+ std::size_t capacity() const;
-[section:overload1 ip::basic_resolver_query::basic_resolver_query (1 of 4 overloads)]
-Construct with specified service name for any protocol.
+[endsect]
- basic_resolver_query(
- const std::string & service_name,
- int flags = passive|address_configured);
+[section:data ip::basic_endpoint::data]
+Get the underlying endpoint in the native type.
-[endsect]
+ 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:overload2 ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads)]
+[section:overload1 ip::basic_endpoint::data (1 of 2 overloads)]
-Construct with specified service name for a given protocol.
+Get the underlying endpoint in the native type.
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & service_name,
- int flags = passive|address_configured);
+ data_type * data();
@@ -33501,47 +34598,40 @@
-[section:overload3 ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads)]
+[section:overload2 ip::basic_endpoint::data (2 of 2 overloads)]
-Construct with specified host name and service name for any protocol.
+Get the underlying endpoint in the native type.
- basic_resolver_query(
- const std::string & host_name,
- const std::string & service_name,
- int flags = address_configured);
+ const data_type * data() const;
[endsect]
+[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.
+[section:data_type ip::basic_endpoint::data_type]
- basic_resolver_query(
- const protocol_type & protocol,
- const std::string & host_name,
- const std::string & service_name,
- int flags = address_configured);
+The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+ typedef implementation_defined data_type;
-[endsect]
[endsect]
-[section:canonical_name ip::basic_resolver_query::canonical_name]
-
-['Inherited from ip::resolver_query_base.]
+[section:operator_not__eq_ ip::basic_endpoint::operator!=]
-Determine the canonical name of the host specified in the query.
+Compare two endpoints for inequality.
- static const int canonical_name = implementation_defined;
+ friend bool operator!=(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
@@ -33549,11 +34639,13 @@
-[section:hints ip::basic_resolver_query::hints]
+[section:operator_lt_ ip::basic_endpoint::operator<]
-Get the hints associated with the query.
+Compare endpoints for ordering.
- const boost::asio::detail::addrinfo_type & hints() const;
+ friend bool operator<(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
@@ -33561,26 +34653,32 @@
-[section:host_name ip::basic_resolver_query::host_name]
-
-Get the host name associated with the query.
-
- std::string host_name() const;
+[section:operator_lt__lt_ ip::basic_endpoint::operator<<]
+Output an endpoint as a string.
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const basic_endpoint< InternetProtocol > & endpoint);
-[endsect]
+Used to output a human-readable string for a specified endpoint.
-[section:numeric_host ip::basic_resolver_query::numeric_host]
+[heading Parameters]
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
-['Inherited from ip::resolver_query_base.]
+[[endpoint][The endpoint to be written.]]
-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;
+[heading Return Value]
+
+The output stream.
@@ -33588,14 +34686,12 @@
-[section:numeric_service ip::basic_resolver_query::numeric_service]
-
-
-['Inherited from ip::resolver_query_base.]
+[section:operator_eq_ ip::basic_endpoint::operator=]
-Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
+Assign from another endpoint.
- static const int numeric_service = implementation_defined;
+ basic_endpoint & operator=(
+ const basic_endpoint & other);
@@ -33603,27 +34699,34 @@
-[section:passive ip::basic_resolver_query::passive]
+[section:operator_eq__eq_ ip::basic_endpoint::operator==]
+Compare two endpoints for equality.
-['Inherited from ip::resolver_query_base.]
+ friend bool operator==(
+ const basic_endpoint< InternetProtocol > & e1,
+ const basic_endpoint< InternetProtocol > & e2);
-Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
- static const int passive = implementation_defined;
+
+[endsect]
+[section:port ip::basic_endpoint::port]
-[endsect]
+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:protocol_type ip::basic_resolver_query::protocol_type]
-The protocol type associated with the endpoint query.
+[section:overload1 ip::basic_endpoint::port (1 of 2 overloads)]
- typedef InternetProtocol protocol_type;
+Get the port associated with the endpoint. The port number is always in the host's byte order.
+ unsigned short port() const;
@@ -33631,26 +34734,26 @@
-[section:service_name ip::basic_resolver_query::service_name]
+[section:overload2 ip::basic_endpoint::port (2 of 2 overloads)]
-Get the service name associated with the query.
+Set the port associated with the endpoint. The port number is always in the host's byte order.
- std::string service_name() const;
+ void port(
+ unsigned short port_num);
[endsect]
-
-[section:v4_mapped ip::basic_resolver_query::v4_mapped]
+[endsect]
-['Inherited from ip::resolver_query_base.]
+[section:protocol ip::basic_endpoint::protocol]
-If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
+The protocol associated with the endpoint.
- static const int v4_mapped = implementation_defined;
+ protocol_type protocol() const;
@@ -33658,23 +34761,25 @@
-[endsect]
+[section:protocol_type ip::basic_endpoint::protocol_type]
-[section:ip__host_name ip::host_name]
+The protocol type associated with the endpoint.
-Get the current host name.
+ typedef InternetProtocol protocol_type;
- 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)]
+[endsect]
-Get the current host name.
- std::string host_name();
+
+[section:resize ip::basic_endpoint::resize]
+
+Set the underlying size of the endpoint in the native type.
+
+ void resize(
+ std::size_t size);
@@ -33682,25 +34787,29 @@
-[section:overload2 ip::host_name (2 of 2 overloads)]
+[section:size ip::basic_endpoint::size]
-Get the current host name.
+Get the underlying size of the endpoint in the native type.
- std::string host_name(
- boost::system::error_code & ec);
+ std::size_t size() const;
[endsect]
+
[endsect]
-[section:ip__icmp ip::icmp]
+[section:ip__basic_resolver ip::basic_resolver]
-Encapsulates the flags needed for ICMP.
+Provides endpoint resolution functionality.
- class icmp
+ 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]
@@ -33709,36 +34818,43 @@
[
- [[link boost_asio.reference.ip__icmp.endpoint [*endpoint]]]
- [The type of a ICMP endpoint. ]
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
]
[
- [[link boost_asio.reference.ip__icmp.resolver [*resolver]]]
- [The ICMP resolver 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__icmp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
]
[
- [[link boost_asio.reference.ip__icmp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
]
[
- [[link boost_asio.reference.ip__icmp.socket [*socket]]]
- [The ICMP socket 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. ]
]
@@ -33749,220 +34865,193 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__icmp.family [*family]]]
- [Obtain an identifier for the protocol family. ]
+ [[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__icmp.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
]
[
- [[link boost_asio.reference.ip__icmp.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
]
[
- [[link boost_asio.reference.ip__icmp.v4 [*v4]]]
- [Construct to represent the IPv4 ICMP protocol. ]
+ [[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__icmp.v6 [*v6]]]
- [Construct to represent the IPv6 ICMP protocol. ]
+ [[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 Friends]
+[heading Protected Data Members]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.ip__icmp.operator_not__eq_ [*operator!=]]]
- [Compare two protocols for inequality. ]
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.ip__icmp.operator_eq__eq_ [*operator==]]]
- [Compare two protocols for equality. ]
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
]
-
+
]
-The
-[link boost_asio.reference.ip__icmp ip::icmp] class contains flags necessary for ICMP sockets.
+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:] Safe.
+[*Shared] [*objects:] Unsafe.
+[section:async_resolve ip::basic_resolver::async_resolve]
-[section:endpoint ip::icmp::endpoint]
+Asynchronously resolve a query to a list of entries.
-The type of a ICMP endpoint.
+ 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);
- typedef basic_endpoint< icmp > endpoint;
+ 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);
-[heading Types]
-[table
- [[Name][Description]]
+[section:overload1 ip::basic_resolver::async_resolve (1 of 2 overloads)]
- [
+Asynchronously resolve a query to a list of entries.
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void async_resolve(
+ const query & q,
+ ResolveHandler handler);
- [
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
+This function is used to asynchronously resolve a query into a list of endpoint entries.
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Parameters]
+
- [
- [[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. ]
- ]
+[variablelist
-]
+[[q][A query object that determines what endpoints will be returned.]]
-[heading Friends]
-[table
- [[Name][Description]]
+[[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.
+ );
- [
- [[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. ]
- ]
-
-]
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
-[heading Related Functions]
-[table
- [[Name][Description]]
+]
- [
- [[link boost_asio.reference.ip__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
-
-]
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
-The
-[link boost_asio.reference.ip__basic_endpoint ip::basic_endpoint] class template describes an endpoint that may be associated with a particular socket.
+A successful resolve operation is guaranteed to pass at least one entry to the handler.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
-[*Shared] [*objects:] Unsafe.
+[section:overload2 ip::basic_resolver::async_resolve (2 of 2 overloads)]
+Asynchronously resolve an endpoint to a list of entries.
-[endsect]
+ 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.
-[section:family ip::icmp::family]
-Obtain an identifier for the protocol family.
+[heading Parameters]
+
- int family() const;
+[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().]]
-[endsect]
+]
+[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.
-[section:operator_not__eq_ ip::icmp::operator!=]
-Compare two protocols for inequality.
+[endsect]
- friend bool operator!=(
- const icmp & p1,
- const icmp & p2);
+[endsect]
-[endsect]
+[section:basic_resolver ip::basic_resolver::basic_resolver]
+Constructor.
+ basic_resolver(
+ boost::asio::io_service & io_service);
-[section:operator_eq__eq_ ip::icmp::operator==]
-Compare two protocols for equality.
+This constructor creates a basic_resolver.
- friend bool operator==(
- const icmp & p1,
- const icmp & p2);
+
+[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. ]]
+
+]
@@ -33970,134 +35059,64 @@
-[section:protocol ip::icmp::protocol]
+[section:cancel ip::basic_resolver::cancel]
-Obtain an identifier for the protocol.
+Cancel any asynchronous operations that are waiting on the resolver.
+
+ void cancel();
- int protocol() const;
+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:resolver ip::icmp::resolver]
-
-The ICMP resolver type.
+[section:endpoint_type ip::basic_resolver::endpoint_type]
- typedef basic_resolver< icmp > resolver;
+The endpoint type.
+ typedef InternetProtocol::endpoint endpoint_type;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[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. ]
-
- ]
- [
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
- [The iterator type. ]
-
- ]
+[section:get_io_service ip::basic_resolver::get_io_service]
- [
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+['Inherited from basic_io_object.]
- [
+Get the io_service associated with the object.
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
- [The query type. ]
-
- ]
+ boost::asio::io_service & get_io_service();
- [
- [[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. ]
-
- ]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[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.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. ]
- ]
+[endsect]
- [
- [[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.
+[section:implementation ip::basic_resolver::implementation]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+['Inherited from basic_io_object.]
-[*Shared] [*objects:] Unsafe.
+The underlying implementation of the I/O object.
+ implementation_type implementation;
@@ -34105,149 +35124,76 @@
-[section:resolver_iterator ip::icmp::resolver_iterator]
+[section:implementation_type ip::basic_resolver::implementation_type]
-The type of a resolver iterator.
- typedef basic_resolver_iterator< icmp > resolver_iterator;
+['Inherited from basic_io_object.]
+The underlying implementation type of I/O object.
-[heading Member Functions]
-[table
- [[Name][Description]]
+ typedef service_type::implementation_type implementation_type;
- [
- [[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>
+[endsect]
+[section:io_service ip::basic_resolver::io_service]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+['Inherited from basic_io_object.]
-[*Shared] [*objects:] Unsafe.
+(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:resolver_query ip::icmp::resolver_query]
-The type of a resolver query.
+[endsect]
- typedef basic_resolver_query< icmp > resolver_query;
-[heading Types]
-[table
- [[Name][Description]]
+[section:iterator ip::basic_resolver::iterator]
- [
+The iterator type.
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
-
- ]
+ typedef InternetProtocol::resolver_iterator iterator;
-]
-[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. ]
- ]
- [
- [[link boost_asio.reference.ip__basic_resolver_query.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+[section:protocol_type ip::basic_resolver::protocol_type]
- [
- [[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. ]
- ]
+The protocol type.
- [
- [[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. ]
- ]
+ typedef InternetProtocol protocol_type;
- [
- [[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.
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:query ip::basic_resolver::query]
+
+The query type.
+
+ typedef InternetProtocol::resolver_query query;
@@ -34255,405 +35201,215 @@
[endsect]
+[section:resolve ip::basic_resolver::resolve]
-[section:socket ip::icmp::socket]
+Resolve a query to a list of entries.
-The ICMP socket type.
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload1 resolve]``(
+ const query & q);
- typedef basic_raw_socket< icmp > socket;
+ 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);
-[heading Types]
-[table
- [[Name][Description]]
+ iterator ``[link boost_asio.reference.ip__basic_resolver.resolve.overload4 resolve]``(
+ const endpoint_type & e,
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.basic_raw_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
+[section:overload1 ip::basic_resolver::resolve (1 of 4 overloads)]
- [
+Resolve a query to a list of entries.
- [[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. ]
-
- ]
+ iterator resolve(
+ const query & q);
- [
- [[link boost_asio.reference.basic_raw_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+This function is used to resolve a query into a list of endpoint entries.
- [
- [[link boost_asio.reference.basic_raw_socket.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[q][A query object that determines what endpoints will be returned.]]
- [
+]
- [[link boost_asio.reference.basic_raw_socket.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries.
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.basic_raw_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure.]]
- [
+]
- [[link boost_asio.reference.basic_raw_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+[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.
- [[link boost_asio.reference.basic_raw_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
- [
+[endsect]
- [[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. ]
-
- ]
+[section:overload2 ip::basic_resolver::resolve (2 of 4 overloads)]
- [
+Resolve a query to a list of entries.
- [[link boost_asio.reference.basic_raw_socket.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
+ iterator resolve(
+ const query & q,
+ boost::system::error_code & ec);
- [
- [[link boost_asio.reference.basic_raw_socket.native_type [*native_type]]]
- [The native representation of a socket. ]
-
- ]
+This function is used to resolve a query into a list of endpoint entries.
- [
- [[link boost_asio.reference.basic_raw_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[q][A query object that determines what endpoints will be returned.]]
- [
+[[ec][Set to indicate what error occurred, if any.]]
- [[link boost_asio.reference.basic_raw_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
-
- ]
+]
- [
+[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.
- [[link boost_asio.reference.basic_raw_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+[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.
- [[link boost_asio.reference.basic_raw_socket.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
- [
+[endsect]
- [[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. ]
-
- ]
+[section:overload3 ip::basic_resolver::resolve (3 of 4 overloads)]
- [
+Resolve an endpoint to a list of entries.
- [[link boost_asio.reference.basic_raw_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+ iterator resolve(
+ const endpoint_type & e);
- [
- [[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. ]
-
- ]
+This function is used to resolve an endpoint into a list of endpoint entries.
- [
- [[link boost_asio.reference.basic_raw_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+[heading Parameters]
+
+
+[variablelist
- ]
+[[e][An endpoint object that determines what endpoints will be returned.]]
]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+A forward-only iterator that can be used to traverse the list of endpoint entries.
- [
- [[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 Exceptions]
+
+
+[variablelist
+[[boost::system::system_error][Thrown on failure.]]
+
]
-[heading Data Members]
-[table
- [[Name][Description]]
+[heading Remarks]
+
+A default constructed iterator represents the end of the list.
- [
- [[link boost_asio.reference.basic_raw_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+A successful call to this function is guaranteed to return at least one entry.
- [
- [[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. ]
- ]
+[endsect]
- [
- [[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]]
+[section:overload4 ip::basic_resolver::resolve (4 of 4 overloads)]
- [
- [[link boost_asio.reference.basic_raw_socket.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+Resolve an endpoint to a list of entries.
- [
- [[link boost_asio.reference.basic_raw_socket.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+ iterator resolve(
+ const endpoint_type & e,
+ boost::system::error_code & ec);
-]
-The basic_raw_socket class template provides asynchronous and blocking raw-oriented socket functionality.
+This function is used to resolve an endpoint into a list of endpoint entries.
-[heading Thread Safety]
+[heading Parameters]
+
+
+[variablelist
-[*Distinct] [*objects:] Safe.
+[[e][An endpoint object that determines what endpoints will be returned.]]
-[*Shared] [*objects:] Unsafe.
+[[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.
-[endsect]
+A successful call to this function is guaranteed to return at least one entry.
+[endsect]
-[section:type ip::icmp::type]
-Obtain an identifier for the type of the protocol.
+[endsect]
- int type() const;
+[section:service ip::basic_resolver::service]
-[endsect]
+['Inherited from basic_io_object.]
+The service associated with the I/O object.
+ service_type & service;
-[section:v4 ip::icmp::v4]
-Construct to represent the IPv4 ICMP protocol.
- static icmp v4();
+[endsect]
-[endsect]
+[section:service_type ip::basic_resolver::service_type]
+['Inherited from basic_io_object.]
-[section:v6 ip::icmp::v6]
+The type of the service that will be used to provide I/O operations.
-Construct to represent the IPv6 ICMP protocol.
+ typedef ResolverService service_type;
- static icmp v6();
@@ -34663,110 +35419,135 @@
[endsect]
+[section:ip__basic_resolver_entry ip::basic_resolver_entry]
-[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.
-
- typedef implementation_defined enable_loopback;
+An entry produced by a resolver.
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_entry
-Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option.
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[heading Examples]
+ [[link boost_asio.reference.ip__basic_resolver_entry.endpoint_type [*endpoint_type]]]
+ [The endpoint type associated with the endpoint entry. ]
-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:
+ [[link boost_asio.reference.ip__basic_resolver_entry.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint entry. ]
+
+ ]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::enable_loopback option;
- socket.get_option(option);
- bool is_set = option.value();
+]
+[heading 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.
-[endsect]
+[*Shared] [*objects:] Unsafe.
+[section:basic_resolver_entry ip::basic_resolver_entry::basic_resolver_entry]
-[section:ip__multicast__hops ip::multicast::hops]
+Default constructor.
-Socket option for time-to-live associated with outgoing multicast packets.
+ ``[link boost_asio.reference.ip__basic_resolver_entry.basic_resolver_entry.overload1 basic_resolver_entry]``();
- typedef implementation_defined hops;
+ ``[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)]
-Implements the IPPROTO\_IP/IP\_MULTICAST\_TTL socket option.
+Default constructor.
+ basic_resolver_entry();
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::hops option(4);
- socket.set_option(option);
+[endsect]
-Getting the current option value:
+[section:overload2 ip::basic_resolver_entry::basic_resolver_entry (2 of 2 overloads)]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::multicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+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]
-[section:ip__multicast__join_group ip::multicast::join_group]
-
-Socket option to join a multicast group on a specified interface.
+Get the endpoint associated with the entry.
- typedef implementation_defined join_group;
+ endpoint_type endpoint() const;
-Implements the IPPROTO\_IP/IP\_ADD\_MEMBERSHIP socket option.
+[endsect]
-[heading Examples]
-
-Setting the option to join a multicast group:
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::address multicast_address =
- boost::asio::ip::address::from_string("225.0.0.1");
- boost::asio::ip::multicast::join_group option(multicast_address);
- socket.set_option(option);
+[section:endpoint_type ip::basic_resolver_entry::endpoint_type]
+The endpoint type associated with the endpoint entry.
+ typedef InternetProtocol::endpoint endpoint_type;
@@ -34775,30 +35556,23 @@
-[section:ip__multicast__leave_group ip::multicast::leave_group]
-
-Socket option to leave a multicast group on a specified interface.
+[section:host_name ip::basic_resolver_entry::host_name]
- typedef implementation_defined leave_group;
+Get the host name associated with the entry.
+ std::string host_name() const;
-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:operator_endpoint_type ip::basic_resolver_entry::operator endpoint_type]
+Convert to the endpoint associated with the entry.
+ operator endpoint_type() const;
@@ -34806,125 +35580,111 @@
-[section:ip__multicast__outbound_interface ip::multicast::outbound_interface]
+[section:protocol_type ip::basic_resolver_entry::protocol_type]
-Socket option for local interface to use for outgoing multicast packets.
+The protocol type associated with the endpoint entry.
- typedef implementation_defined outbound_interface;
+ typedef InternetProtocol protocol_type;
-Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option.
+[endsect]
-[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);
+[section:service_name ip::basic_resolver_entry::service_name]
+Get the service name associated with the entry.
+ std::string service_name() 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:ip__basic_resolver_iterator ip::basic_resolver_iterator]
+An iterator over the entries produced by a resolver.
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_iterator
- [
- [[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]
+[heading Member Functions]
[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__basic_resolver_iterator.basic_resolver_iterator [*basic_resolver_iterator]]]
+ [Default constructor creates an end iterator. ]
]
-
+
[
- [[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__basic_resolver_iterator.create [*create]]]
+ [Create an iterator from an addrinfo list returned by getaddrinfo. ]
]
+
+]
- [
- [[link boost_asio.reference.ip__resolver_query_base.canonical_name [*canonical_name]]]
- [Determine the canonical name of the host specified in the query. ]
- ]
+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.
- [
- [[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. ]
- ]
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
- [
- [[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. ]
- ]
+ const basic_resolver_entry<InternetProtocol>
- [
- [[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]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-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.
+[*Shared] [*objects:] Unsafe.
- static const int address_configured = implementation_defined;
+[section:basic_resolver_iterator ip::basic_resolver_iterator::basic_resolver_iterator]
-[endsect]
+Default constructor creates an end iterator.
+ basic_resolver_iterator();
-[section:all_matching ip::resolver_query_base::all_matching]
-If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
+[endsect]
- static const int all_matching = implementation_defined;
+[section:create ip::basic_resolver_iterator::create]
+Create an iterator from an addrinfo list returned by getaddrinfo.
-[endsect]
+ 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:canonical_name ip::resolver_query_base::canonical_name]
+[section:overload1 ip::basic_resolver_iterator::create (1 of 2 overloads)]
-Determine the canonical name of the host specified in the query.
+Create an iterator from an addrinfo list returned by getaddrinfo.
- static const int canonical_name = implementation_defined;
+ static basic_resolver_iterator create(
+ boost::asio::detail::addrinfo_type * address_info,
+ const std::string & host_name,
+ const std::string & service_name);
@@ -34932,114 +35692,43 @@
-[section:numeric_host ip::resolver_query_base::numeric_host]
+[section:overload2 ip::basic_resolver_iterator::create (2 of 2 overloads)]
-Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
+Create an iterator from an endpoint, host name and service name.
- static const int numeric_host = implementation_defined;
+ static basic_resolver_iterator create(
+ const typename InternetProtocol::endpoint & endpoint,
+ const std::string & host_name,
+ const std::string & service_name);
[endsect]
+[endsect]
-[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;
+[endsect]
+[section:ip__basic_resolver_query ip::basic_resolver_query]
+An query to be passed to a resolver.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.InternetProtocol InternetProtocol]``>
+ class basic_resolver_query :
+ public ip::resolver_query_base
+[heading Types]
+[table
+ [[Name][Description]]
-[section:passive ip::resolver_query_base::passive]
+ [
-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]
-
-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]
-
-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. ]
+ [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint query. ]
]
@@ -35050,92 +35739,88 @@
[[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__basic_resolver_query.basic_resolver_query [*basic_resolver_query]]]
+ [Construct with specified service name for any protocol. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.cancel [*cancel]]]
- [Cancel pending asynchronous operations. ]
+ [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
+ [Get the hints associated with the query. ]
]
[
- [[link boost_asio.reference.ip__resolver_service.construct [*construct]]]
- [Construct a new resolver implementation. ]
+ [[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__resolver_service.destroy [*destroy]]]
- [Destroy a resolver implementation. ]
+ [[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__resolver_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[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__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__basic_resolver_query.all_matching [*all_matching]]]
+ [If used with v4_mapped, return all matching IPv6 and IPv4 addresses. ]
]
-
+
[
- [[link boost_asio.reference.ip__resolver_service.resolve [*resolve]]]
- [Resolve a query to a list of entries. ]
+ [[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__resolver_service.resolver_service [*resolver_service]]]
- [Construct a new resolver service for the specified io_service. ]
+ [[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__resolver_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[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 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.ip__resolver_service.id [*id]]]
- [The unique service identifier. ]
+ [[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:async_resolve ip::resolver_service::async_resolve]
+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.
-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);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
- 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);
+[*Shared] [*objects:] Unsafe.
-[section:overload1 ip::resolver_service::async_resolve (1 of 2 overloads)]
-Asynchronously resolve a query to a list of entries.
+[section:address_configured ip::basic_resolver_query::address_configured]
- template<
- typename ``[link boost_asio.reference.Handler Handler]``>
- void async_resolve(
- implementation_type & impl,
- const query_type & query,
- Handler handler);
+
+['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;
@@ -35143,31 +35828,52 @@
-[section:overload2 ip::resolver_service::async_resolve (2 of 2 overloads)]
+[section:all_matching ip::basic_resolver_query::all_matching]
-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);
+['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;
[endsect]
-[endsect]
+[section:basic_resolver_query ip::basic_resolver_query::basic_resolver_query]
+Construct with specified service name for any protocol.
-[section:cancel ip::resolver_service::cancel]
+ ``[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);
-Cancel pending asynchronous operations.
+ ``[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);
- void cancel(
- implementation_type & impl);
+ ``[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);
@@ -35175,12 +35881,14 @@
-[section:construct ip::resolver_service::construct]
+[section:overload2 ip::basic_resolver_query::basic_resolver_query (2 of 4 overloads)]
-Construct a new resolver implementation.
+Construct with specified service name for a given protocol.
- void construct(
- implementation_type & impl);
+ basic_resolver_query(
+ const protocol_type & protocol,
+ const std::string & service_name,
+ int flags = passive|address_configured);
@@ -35188,12 +35896,14 @@
-[section:destroy ip::resolver_service::destroy]
+[section:overload3 ip::basic_resolver_query::basic_resolver_query (3 of 4 overloads)]
-Destroy a resolver implementation.
+Construct with specified host name and service name for any protocol.
- void destroy(
- implementation_type & impl);
+ basic_resolver_query(
+ const std::string & host_name,
+ const std::string & service_name,
+ int flags = address_configured);
@@ -35201,27 +35911,32 @@
-[section:endpoint_type ip::resolver_service::endpoint_type]
-
-The endpoint type.
+[section:overload4 ip::basic_resolver_query::basic_resolver_query (4 of 4 overloads)]
- typedef InternetProtocol::endpoint endpoint_type;
+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:get_io_service ip::resolver_service::get_io_service]
+[section:canonical_name ip::basic_resolver_query::canonical_name]
-['Inherited from io_service.]
-Get the io_service object that owns the service.
+['Inherited from ip::resolver_query_base.]
- boost::asio::io_service & get_io_service();
+Determine the canonical name of the host specified in the query.
+
+ static const int canonical_name = implementation_defined;
@@ -35229,11 +35944,11 @@
-[section:id ip::resolver_service::id]
+[section:hints ip::basic_resolver_query::hints]
-The unique service identifier.
+Get the hints associated with the query.
- static boost::asio::io_service::id id;
+ const boost::asio::detail::addrinfo_type & hints() const;
@@ -35241,12 +35956,11 @@
-[section:implementation_type ip::resolver_service::implementation_type]
-
-The type of a resolver implementation.
+[section:host_name ip::basic_resolver_query::host_name]
- typedef implementation_defined implementation_type;
+Get the host name associated with the query.
+ std::string host_name() const;
@@ -35254,14 +35968,14 @@
-[section:io_service ip::resolver_service::io_service]
+[section:numeric_host ip::basic_resolver_query::numeric_host]
-['Inherited from io_service.]
+['Inherited from ip::resolver_query_base.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
- boost::asio::io_service & io_service();
+ static const int numeric_host = implementation_defined;
@@ -35269,12 +35983,14 @@
-[section:iterator_type ip::resolver_service::iterator_type]
+[section:numeric_service ip::basic_resolver_query::numeric_service]
-The iterator type.
- typedef InternetProtocol::resolver_iterator iterator_type;
+['Inherited from 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;
@@ -35282,12 +35998,14 @@
-[section:protocol_type ip::resolver_service::protocol_type]
+[section:passive ip::basic_resolver_query::passive]
-The protocol type.
- typedef InternetProtocol protocol_type;
+['Inherited from ip::resolver_query_base.]
+
+Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
+ static const int passive = implementation_defined;
@@ -35295,11 +36013,11 @@
-[section:query_type ip::resolver_service::query_type]
+[section:protocol_type ip::basic_resolver_query::protocol_type]
-The query type.
+The protocol type associated with the endpoint query.
- typedef InternetProtocol::resolver_query query_type;
+ typedef InternetProtocol protocol_type;
@@ -35307,59 +36025,51 @@
[endsect]
-[section:resolve ip::resolver_service::resolve]
-Resolve a query to a list of entries.
+[section:service_name ip::basic_resolver_query::service_name]
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload1 resolve]``(
- implementation_type & impl,
- const query_type & query,
- boost::system::error_code & ec);
+Get the service name associated with the query.
- iterator_type ``[link boost_asio.reference.ip__resolver_service.resolve.overload2 resolve]``(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+ std::string service_name() const;
-[section:overload1 ip::resolver_service::resolve (1 of 2 overloads)]
-Resolve a query to a list of entries.
+[endsect]
- iterator_type resolve(
- implementation_type & impl,
- const query_type & query,
- boost::system::error_code & ec);
+[section:v4_mapped ip::basic_resolver_query::v4_mapped]
-[endsect]
+['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.
+ static const int v4_mapped = implementation_defined;
-[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:ip__host_name ip::host_name]
-[endsect]
+Get the current host name.
+ std::string ``[link boost_asio.reference.ip__host_name.overload1 host_name]``();
-[section:resolver_service ip::resolver_service::resolver_service]
+ std::string ``[link boost_asio.reference.ip__host_name.overload2 host_name]``(
+ boost::system::error_code & ec);
-Construct a new resolver service for the specified io_service.
- resolver_service(
- boost::asio::io_service & io_service);
+[section:overload1 ip::host_name (1 of 2 overloads)]
+
+Get the current host name.
+
+ std::string host_name();
@@ -35367,25 +36077,25 @@
-[section:shutdown_service ip::resolver_service::shutdown_service]
+[section:overload2 ip::host_name (2 of 2 overloads)]
-Destroy all user-defined handler objects owned by the service.
+Get the current host name.
- void shutdown_service();
+ std::string host_name(
+ boost::system::error_code & ec);
[endsect]
-
[endsect]
-[section:ip__tcp ip::tcp]
+[section:ip__icmp ip::icmp]
-Encapsulates the flags needed for TCP.
+Encapsulates the flags needed for ICMP.
- class tcp
+ class icmp
[heading Types]
@@ -35394,57 +36104,36 @@
[
- [[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__icmp.endpoint [*endpoint]]]
+ [The type of a ICMP endpoint. ]
]
[
- [[link boost_asio.reference.ip__tcp.resolver [*resolver]]]
- [The TCP resolver type. ]
+ [[link boost_asio.reference.ip__icmp.resolver [*resolver]]]
+ [The ICMP resolver type. ]
]
[
- [[link boost_asio.reference.ip__tcp.resolver_iterator [*resolver_iterator]]]
+ [[link boost_asio.reference.ip__icmp.resolver_iterator [*resolver_iterator]]]
[The type of a resolver iterator. ]
]
[
- [[link boost_asio.reference.ip__tcp.resolver_query [*resolver_query]]]
+ [[link boost_asio.reference.ip__icmp.resolver_query [*resolver_query]]]
[The type of a resolver query. ]
]
[
- [[link boost_asio.reference.ip__tcp.socket [*socket]]]
- [The TCP socket type. ]
+ [[link boost_asio.reference.ip__icmp.socket [*socket]]]
+ [The ICMP socket type. ]
]
@@ -35455,28 +36144,28 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__tcp.family [*family]]]
+ [[link boost_asio.reference.ip__icmp.family [*family]]]
[Obtain an identifier for the protocol family. ]
]
[
- [[link boost_asio.reference.ip__tcp.protocol [*protocol]]]
+ [[link boost_asio.reference.ip__icmp.protocol [*protocol]]]
[Obtain an identifier for the protocol. ]
]
[
- [[link boost_asio.reference.ip__tcp.type [*type]]]
+ [[link boost_asio.reference.ip__icmp.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__icmp.v4 [*v4]]]
+ [Construct to represent the IPv4 ICMP protocol. ]
]
[
- [[link boost_asio.reference.ip__tcp.v6 [*v6]]]
- [Construct to represent the IPv6 TCP protocol. ]
+ [[link boost_asio.reference.ip__icmp.v6 [*v6]]]
+ [Construct to represent the IPv6 ICMP protocol. ]
]
]
@@ -35486,19 +36175,19 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__tcp.operator_not__eq_ [*operator!=]]]
+ [[link boost_asio.reference.ip__icmp.operator_not__eq_ [*operator!=]]]
[Compare two protocols for inequality. ]
]
[
- [[link boost_asio.reference.ip__tcp.operator_eq__eq_ [*operator==]]]
+ [[link boost_asio.reference.ip__icmp.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.
+[link boost_asio.reference.ip__icmp ip::icmp] class contains flags necessary for ICMP sockets.
[heading Thread Safety]
@@ -35509,11 +36198,11 @@
-[section:acceptor ip::tcp::acceptor]
+[section:endpoint ip::icmp::endpoint]
-The TCP acceptor type.
+The type of a ICMP endpoint.
- typedef basic_socket_acceptor< tcp > acceptor;
+ typedef basic_endpoint< icmp > endpoint;
[heading Types]
@@ -35522,381 +36211,70 @@
[
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
+ [[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.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.ip__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
]
- [
+]
- [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+[heading Member Functions]
+[table
+ [[Name][Description]]
[
-
- [[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.ip__basic_endpoint.address [*address]]]
+ [Get the IP address associated with the endpoint. ]
]
-
- [
-
- [[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.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.basic_socket_acceptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+ [[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.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
+ [[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.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+ [[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. ]
]
-
- [
-
- [[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. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
- [Accept a new connection. ]
- ]
-
- [
- [[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]]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
-
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
-
-]
-
-[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]
-
-[*Distinct] [*objects:] Safe.
-
-[*Shared] [*objects:] Unsafe.
-
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
-
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
- acceptor.open(endpoint.protocol());
- acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- acceptor.bind(endpoint);
- acceptor.listen();
-
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:endpoint ip::tcp::endpoint]
-
-The type of a TCP endpoint.
-
- typedef basic_endpoint< tcp > endpoint;
-
-
-[heading Types]
-[table
- [[Name][Description]]
-
- [
-
- [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
- [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.ip__basic_endpoint.address [*address]]]
- [Get the IP address associated with the endpoint. ]
- ]
-
- [
- [[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
@@ -35947,7 +36325,7 @@
-[section:family ip::tcp::family]
+[section:family ip::icmp::family]
Obtain an identifier for the protocol family.
@@ -35959,92 +36337,13 @@
-[section:iostream ip::tcp::iostream]
-
-The TCP iostream type.
-
- typedef basic_socket_iostream< tcp > 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. ]
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:no_delay ip::tcp::no_delay]
-
-Socket option for disabling the Nagle algorithm.
-
- typedef implementation_defined no_delay;
-
-
-
-Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
-
-
-[heading Examples]
-
-Setting the option:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option(true);
- socket.set_option(option);
-
-
-
-
-Getting the current option value:
-
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::ip::tcp::no_delay option;
- socket.get_option(option);
- bool is_set = option.value();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:operator_not__eq_ ip::tcp::operator!=]
+[section:operator_not__eq_ ip::icmp::operator!=]
Compare two protocols for inequality.
friend bool operator!=(
- const tcp & p1,
- const tcp & p2);
+ const icmp & p1,
+ const icmp & p2);
@@ -36052,13 +36351,13 @@
-[section:operator_eq__eq_ ip::tcp::operator==]
+[section:operator_eq__eq_ ip::icmp::operator==]
Compare two protocols for equality.
friend bool operator==(
- const tcp & p1,
- const tcp & p2);
+ const icmp & p1,
+ const icmp & p2);
@@ -36066,7 +36365,7 @@
-[section:protocol ip::tcp::protocol]
+[section:protocol ip::icmp::protocol]
Obtain an identifier for the protocol.
@@ -36078,11 +36377,11 @@
-[section:resolver ip::tcp::resolver]
+[section:resolver ip::icmp::resolver]
-The TCP resolver type.
+The ICMP resolver type.
- typedef basic_resolver< tcp > resolver;
+ typedef basic_resolver< icmp > resolver;
[heading Types]
@@ -36201,11 +36500,11 @@
-[section:resolver_iterator ip::tcp::resolver_iterator]
+[section:resolver_iterator ip::icmp::resolver_iterator]
The type of a resolver iterator.
- typedef basic_resolver_iterator< tcp > resolver_iterator;
+ typedef basic_resolver_iterator< icmp > resolver_iterator;
[heading Member Functions]
@@ -36248,11 +36547,11 @@
-[section:resolver_query ip::tcp::resolver_query]
+[section:resolver_query ip::icmp::resolver_query]
The type of a resolver query.
- typedef basic_resolver_query< tcp > resolver_query;
+ typedef basic_resolver_query< icmp > resolver_query;
[heading Types]
@@ -36352,11 +36651,11 @@
-[section:socket ip::tcp::socket]
+[section:socket ip::icmp::socket]
-The TCP socket type.
+The ICMP socket type.
- typedef basic_stream_socket< tcp > socket;
+ typedef basic_raw_socket< icmp > socket;
[heading Types]
@@ -36365,147 +36664,147 @@
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_raw_socket.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_raw_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]]]
+ [[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_stream_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_raw_socket.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_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_stream_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_stream_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_stream_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_stream_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_stream_socket.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.basic_raw_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.basic_raw_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]]]
+ [[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_stream_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_stream_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_stream_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_stream_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_stream_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_raw_socket.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
@@ -36517,148 +36816,148 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_socket.async_read_some [*async_read_some]]]
- [Start an asynchronous read. ]
+ [[link boost_asio.reference.basic_raw_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.async_receive [*async_receive]]]
+ [[link boost_asio.reference.basic_raw_socket.async_receive_from [*async_receive_from]]]
[Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.async_send [*async_send]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.basic_raw_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.async_write_some [*async_write_some]]]
- [Start an asynchronous write. ]
+ [[link boost_asio.reference.basic_raw_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.at_mark [*at_mark]]]
+ [[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_stream_socket.available [*available]]]
+ [[link boost_asio.reference.basic_raw_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_raw_socket.basic_raw_socket [*basic_raw_socket]]]
+ [Construct a basic_raw_socket without opening it. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.bind [*bind]]]
+ [[link boost_asio.reference.basic_raw_socket.bind [*bind]]]
[Bind the socket to the given local endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
+ [[link boost_asio.reference.basic_raw_socket.cancel [*cancel]]]
[Cancel all asynchronous operations associated with the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
+ [[link boost_asio.reference.basic_raw_socket.close [*close]]]
[Close the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
+ [[link boost_asio.reference.basic_raw_socket.connect [*connect]]]
[Connect the socket to the specified endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_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_stream_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_stream_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_stream_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_stream_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_stream_socket.native [*native]]]
+ [[link boost_asio.reference.basic_raw_socket.native [*native]]]
[Get the native socket representation. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
+ [[link boost_asio.reference.basic_raw_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_raw_socket.receive [*receive]]]
+ [Receive some data on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the 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_stream_socket.remote_endpoint [*remote_endpoint]]]
+ [[link boost_asio.reference.basic_raw_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_raw_socket.send [*send]]]
+ [Send some data on a connected socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.basic_raw_socket.send_to [*send_to]]]
+ [Send raw data to the specified endpoint. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_raw_socket.set_option [*set_option]]]
+ [Set an option on the socket. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
+ [[link boost_asio.reference.basic_raw_socket.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
]
]
@@ -36668,22 +36967,22 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_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_stream_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_stream_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_stream_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. ]
]
@@ -36694,25 +36993,25 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_raw_socket.implementation [*implementation]]]
[The underlying implementation of the I/O object. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [[link boost_asio.reference.basic_raw_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.
+The basic_raw_socket class template provides asynchronous and blocking raw-oriented socket functionality.
[heading Thread Safety]
[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[*Shared] [*objects:] Unsafe.
@@ -36721,7 +37020,7 @@
-[section:type ip::tcp::type]
+[section:type ip::icmp::type]
Obtain an identifier for the type of the protocol.
@@ -36733,11 +37032,11 @@
-[section:v4 ip::tcp::v4]
+[section:v4 ip::icmp::v4]
-Construct to represent the IPv4 TCP protocol.
+Construct to represent the IPv4 ICMP protocol.
- static tcp v4();
+ static icmp v4();
@@ -36745,11 +37044,11 @@
-[section:v6 ip::tcp::v6]
+[section:v6 ip::icmp::v6]
-Construct to represent the IPv6 TCP protocol.
+Construct to represent the IPv6 ICMP protocol.
- static tcp v6();
+ static icmp v6();
@@ -36759,245 +37058,268 @@
[endsect]
-[section:ip__udp ip::udp]
-Encapsulates the flags needed for UDP.
+[section:ip__multicast__enable_loopback ip::multicast::enable_loopback]
- class udp
+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;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__udp.endpoint [*endpoint]]]
- [The type of a UDP endpoint. ]
-
- ]
+Implements the IPPROTO\_IP/IP\_MULTICAST\_LOOP socket option.
- [
- [[link boost_asio.reference.ip__udp.resolver [*resolver]]]
- [The UDP resolver type. ]
+[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);
- [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
- [The type of a resolver iterator. ]
-
- ]
- [
- [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
- [The type of a resolver query. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.ip__udp.socket [*socket]]]
- [The UDP socket type. ]
-
- ]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::enable_loopback option;
+ socket.get_option(option);
+ bool is_set = option.value();
-]
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__udp.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.v4 [*v4]]]
- [Construct to represent the IPv4 UDP protocol. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.v6 [*v6]]]
- [Construct to represent the IPv6 UDP protocol. ]
- ]
-
-]
-[heading Friends]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ip__udp.operator_not__eq_ [*operator!=]]]
- [Compare two protocols for inequality. ]
- ]
-
- [
- [[link boost_asio.reference.ip__udp.operator_eq__eq_ [*operator==]]]
- [Compare two protocols for equality. ]
- ]
+
+[endsect]
+
+
+
+[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:
-The
-[link boost_asio.reference.ip__udp ip::udp] class contains flags necessary for UDP sockets.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::multicast::hops option(4);
+ socket.set_option(option);
-[heading Thread Safety]
+
+
+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]
+
+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]
-[*Distinct] [*objects:] Safe.
+Setting the option to join a multicast group:
-[*Shared] [*objects:] Safe.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::address multicast_address =
+ boost::asio::ip::address::from_string("225.0.0.1");
+ boost::asio::ip::multicast::join_group option(multicast_address);
+ socket.set_option(option);
-[section:endpoint ip::udp::endpoint]
-The type of a UDP endpoint.
- typedef basic_endpoint< udp > endpoint;
+[endsect]
-[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. ]
+[section:ip__multicast__leave_group 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);
- [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
+
+
+
+
+
+[endsect]
+
+
+
+[section:ip__multicast__outbound_interface ip::multicast::outbound_interface]
+
+Socket option for local interface to use for outgoing multicast packets.
+
+ typedef implementation_defined outbound_interface;
+
+
+
+Implements the IPPROTO\_IP/IP\_MULTICAST\_IF socket option.
+
+
+[heading Examples]
- ]
+Setting the option:
-]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::address_v4 local_interface =
+ boost::asio::ip::address_v4::from_string("1.2.3.4");
+ boost::asio::ip::multicast::outbound_interface option(local_interface);
+ socket.set_option(option);
-[heading Member Functions]
+
+
+
+
+
+[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__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__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__basic_endpoint.capacity [*capacity]]]
- [Get the capacity of the endpoint in the native type. ]
+ [[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__basic_endpoint.data [*data]]]
- [Get the underlying endpoint in the native type. ]
+ [[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__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [[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__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__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__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [[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__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
+ [[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__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.ip__resolver_query_base.v4_mapped [*v4_mapped]]]
+ [If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. ]
]
-
+
]
-[heading 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. ]
- ]
-
-]
+[section:address_configured ip::resolver_query_base::address_configured]
-[heading Related Functions]
-[table
- [[Name][Description]]
+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_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
- ]
-
-]
+ static const int address_configured = implementation_defined;
-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.
+[endsect]
-[*Shared] [*objects:] Unsafe.
+[section:all_matching ip::resolver_query_base::all_matching]
+
+If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
+
+ static const int all_matching = implementation_defined;
+
[endsect]
-[section:family ip::udp::family]
+[section:canonical_name ip::resolver_query_base::canonical_name]
-Obtain an identifier for the protocol family.
+Determine the canonical name of the host specified in the query.
- int family() const;
+ static const int canonical_name = implementation_defined;
@@ -37005,13 +37327,11 @@
-[section:operator_not__eq_ ip::udp::operator!=]
+[section:numeric_host ip::resolver_query_base::numeric_host]
-Compare two protocols for inequality.
+Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
- friend bool operator!=(
- const udp & p1,
- const udp & p2);
+ static const int numeric_host = implementation_defined;
@@ -37019,13 +37339,11 @@
-[section:operator_eq__eq_ ip::udp::operator==]
+[section:numeric_service ip::resolver_query_base::numeric_service]
-Compare two protocols for equality.
+Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
- friend bool operator==(
- const udp & p1,
- const udp & p2);
+ static const int numeric_service = implementation_defined;
@@ -37033,11 +37351,11 @@
-[section:protocol ip::udp::protocol]
+[section:passive ip::resolver_query_base::passive]
-Obtain an identifier for the protocol.
+Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
- int protocol() const;
+ static const int passive = implementation_defined;
@@ -37045,11 +37363,40 @@
-[section:resolver ip::udp::resolver]
+[section:v4_mapped ip::resolver_query_base::v4_mapped]
-The UDP resolver type.
+If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
- typedef basic_resolver< udp > resolver;
+ static const int v4_mapped = implementation_defined;
+
+
+
+[endsect]
+
+
+
+[section:_resolver_query_base ip::resolver_query_base::~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]
@@ -37058,46 +37405,39 @@
[
- [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.ip__resolver_service.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__resolver_service.implementation_type [*implementation_type]]]
+ [The type of a resolver implementation. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [[link boost_asio.reference.ip__resolver_service.iterator_type [*iterator_type]]]
[The iterator type. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.ip__resolver_service.protocol_type [*protocol_type]]]
[The protocol type. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [[link boost_asio.reference.ip__resolver_service.query_type [*query_type]]]
[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]
@@ -37105,62 +37445,92 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [[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__basic_resolver.basic_resolver [*basic_resolver]]]
- [Constructor. ]
+ [[link boost_asio.reference.ip__resolver_service.cancel [*cancel]]]
+ [Cancel pending asynchronous operations. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
- [Cancel any asynchronous operations that are waiting on the resolver. ]
+ [[link boost_asio.reference.ip__resolver_service.construct [*construct]]]
+ [Construct a new resolver implementation. ]
]
[
- [[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__resolver_service.destroy [*destroy]]]
+ [Destroy a resolver implementation. ]
]
[
- [[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__resolver_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
- [Resolve a query to a list of entries. ]
+ [[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. ]
]
-]
-
-[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__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__basic_resolver.service [*service]]]
- [The service associated with the I/O object. ]
+ [[link boost_asio.reference.ip__resolver_service.id [*id]]]
+ [The unique service identifier. ]
]
]
-The basic_resolver class template provides the ability to resolve a query to a list of endpoints.
+[section:async_resolve ip::resolver_service::async_resolve]
+Asynchronously resolve a query to a list of entries.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+ 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);
-[*Shared] [*objects:] Unsafe.
+ 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);
@@ -37168,46 +37538,44 @@
-[section:resolver_iterator ip::udp::resolver_iterator]
+[section:overload2 ip::resolver_service::async_resolve (2 of 2 overloads)]
-The type of a resolver iterator.
+Asynchronously resolve an endpoint to a list of entries.
- typedef basic_resolver_iterator< udp > resolver_iterator;
+ template<
+ typename ``[link boost_asio.reference.ResolveHandler ResolveHandler]``>
+ void async_resolve(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ ResolveHandler handler);
-[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]
-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:cancel ip::resolver_service::cancel]
+
+Cancel pending asynchronous operations.
+
+ void cancel(
+ implementation_type & impl);
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:construct ip::resolver_service::construct]
+
+Construct a new resolver implementation.
+
+ void construct(
+ implementation_type & impl);
@@ -37215,11 +37583,204 @@
-[section:resolver_query ip::udp::resolver_query]
+[section:destroy ip::resolver_service::destroy]
-The type of a resolver query.
+Destroy a resolver implementation.
+
+ void destroy(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:endpoint_type ip::resolver_service::endpoint_type]
+
+The endpoint type.
+
+ typedef InternetProtocol::endpoint endpoint_type;
+
+
+
+
+[endsect]
+
+
+
+[section:get_io_service ip::resolver_service::get_io_service]
+
+
+['Inherited from io_service.]
+
+Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:id ip::resolver_service::id]
+
+The unique service identifier.
+
+ static boost::asio::io_service::id id;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type ip::resolver_service::implementation_type]
+
+The type of a resolver implementation.
+
+ typedef implementation_defined implementation_type;
+
+
+
+
+[endsect]
+
+
+
+[section:io_service ip::resolver_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();
+
+
+
+[endsect]
+
+
+
+[section:iterator_type ip::resolver_service::iterator_type]
+
+The iterator type.
+
+ typedef InternetProtocol::resolver_iterator iterator_type;
+
+
+
+
+[endsect]
+
+
+
+[section:protocol_type ip::resolver_service::protocol_type]
+
+The protocol type.
+
+ typedef InternetProtocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:query_type ip::resolver_service::query_type]
+
+The query type.
+
+ typedef InternetProtocol::resolver_query query_type;
+
+
+
+
+[endsect]
+
+
+[section:resolve ip::resolver_service::resolve]
+
+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]
+
+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]
+
+Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
- typedef basic_resolver_query< udp > resolver_query;
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:ip__tcp ip::tcp]
+
+Encapsulates the flags needed for TCP.
+
+ class tcp
[heading Types]
@@ -37228,102 +37789,126 @@
[
- [[link boost_asio.reference.ip__basic_resolver_query.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint query. ]
+ [[link boost_asio.reference.ip__tcp.acceptor [*acceptor]]]
+ [The TCP acceptor type. ]
]
-]
+ [
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.ip__tcp.endpoint [*endpoint]]]
+ [The type of a TCP endpoint. ]
+
+ ]
[
- [[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__tcp.iostream [*iostream]]]
+ [The TCP iostream type. ]
- [
- [[link boost_asio.reference.ip__basic_resolver_query.hints [*hints]]]
- [Get the hints associated with the query. ]
]
+
+ [
+
+ [[link boost_asio.reference.ip__tcp.no_delay [*no_delay]]]
+ [Socket option for disabling the Nagle algorithm. ]
+ ]
+
[
- [[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__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__basic_resolver_query.service_name [*service_name]]]
- [Get the service name associated with the query. ]
+
+ [[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 Data Members]
+[heading Member Functions]
[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__tcp.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
]
-
+
[
- [[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__tcp.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
]
-
+
[
- [[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__tcp.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
]
-
+
[
- [[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__tcp.v4 [*v4]]]
+ [Construct to represent the IPv4 TCP protocol. ]
]
-
+
[
- [[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__tcp.v6 [*v6]]]
+ [Construct to represent the IPv6 TCP protocol. ]
]
+
+]
+
+[heading Friends]
+[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.ip__tcp.operator_not__eq_ [*operator!=]]]
+ [Compare two protocols for inequality. ]
]
-
+
[
- [[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.ip__tcp.operator_eq__eq_ [*operator==]]]
+ [Compare two protocols for equality. ]
]
-
+
]
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.
+[link boost_asio.reference.ip__tcp ip::tcp] class contains flags necessary for TCP sockets.
[heading Thread Safety]
[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
-
-
-
-
-[endsect]
+[*Shared] [*objects:] Safe.
-[section:socket ip::udp::socket]
+[section:acceptor ip::tcp::acceptor]
-The UDP socket type.
+The TCP acceptor type.
- typedef basic_datagram_socket< udp > socket;
+ typedef basic_socket_acceptor< tcp > acceptor;
[heading Types]
@@ -37332,147 +37917,140 @@
[
- [[link boost_asio.reference.basic_datagram_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_datagram_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_datagram_socket.debug [*debug]]]
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
[Socket option to enable socket-level debugging. ]
]
[
- [[link boost_asio.reference.basic_datagram_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_datagram_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_datagram_socket.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.basic_datagram_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_datagram_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_datagram_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_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]]]
+ [[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_datagram_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_datagram_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_datagram_socket.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.protocol_type [*protocol_type]]]
[The protocol type. ]
]
[
- [[link boost_asio.reference.basic_datagram_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_datagram_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_datagram_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_datagram_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_datagram_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_datagram_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_datagram_socket.shutdown_type [*shutdown_type]]]
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
[Different ways a socket may be shutdown. ]
]
@@ -37484,148 +38062,83 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
- [Assign an existing native socket to the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
+ [[link boost_asio.reference.basic_socket_acceptor.assign [*assign]]]
+ [Assigns an existing native acceptor to the acceptor. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
- [Start an asynchronous receive on a connected socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive. ]
+ [[link boost_asio.reference.basic_socket_acceptor.basic_socket_acceptor [*basic_socket_acceptor]]]
+ [Construct an acceptor without opening it. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
- [Start an asynchronous send on a connected socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.bind [*bind]]]
+ [Bind the acceptor to the given local endpoint. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
+ [[link boost_asio.reference.basic_socket_acceptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
]
[
- [[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_socket_acceptor.close [*close]]]
+ [Close the acceptor. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
- [Determine the number of bytes available for reading. ]
+ [[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_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
- [Construct a basic_datagram_socket without opening it. ]
+ [[link boost_asio.reference.basic_socket_acceptor.get_option [*get_option]]]
+ [Get an option from the acceptor. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.bind [*bind]]]
- [Bind the socket to the given local endpoint. ]
+ [[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_datagram_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
]
[
- [[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_socket_acceptor.listen [*listen]]]
+ [Place the acceptor into the state where it will listen for new connections. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.send [*send]]]
- [Send some data on a connected socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint of the acceptor. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.send_to [*send_to]]]
- [Send a datagram to the specified endpoint. ]
+ [[link boost_asio.reference.basic_socket_acceptor.native [*native]]]
+ [Get the native acceptor representation. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.open [*open]]]
+ [Open the acceptor using the specified protocol. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.basic_socket_acceptor.set_option [*set_option]]]
+ [Set an option on the acceptor. ]
]
]
@@ -37635,22 +38148,22 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_datagram_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_datagram_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_datagram_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_datagram_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. ]
]
@@ -37661,105 +38174,218 @@
[[Name][Description]]
[
- [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
[The underlying implementation of the I/O object. ]
]
[
- [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
+ [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
[The service associated with the I/O object. ]
]
]
-The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
+The basic_socket_acceptor class template is used for accepting new socket connections.
[heading Thread Safety]
[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[*Shared] [*objects:] Unsafe.
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
-[endsect]
-[section:type ip::udp::type]
-Obtain an identifier for the type of the protocol.
- int type() const;
+[endsect]
-[endsect]
+[section:endpoint ip::tcp::endpoint]
+The type of a TCP endpoint.
+ typedef basic_endpoint< tcp > endpoint;
-[section:v4 ip::udp::v4]
-Construct to represent the IPv4 UDP protocol.
+[heading Types]
+[table
+ [[Name][Description]]
- static udp v4();
+ [
+
+ [[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. ]
+
+ ]
-[endsect]
+]
+[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. ]
+ ]
+
+]
-[section:v6 ip::udp::v6]
+[heading Friends]
+[table
+ [[Name][Description]]
-Construct to represent the IPv6 UDP protocol.
+ [
+ [[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. ]
+ ]
+
+]
- static udp v6();
+[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.
-[endsect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[endsect]
-[section:ip__unicast__hops ip::unicast::hops]
+[endsect]
-Socket option for time-to-live associated with outgoing unicast packets.
- typedef implementation_defined hops;
+[section:family ip::tcp::family]
+Obtain an identifier for the protocol family.
-Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
+ int family() const;
-[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:iostream ip::tcp::iostream]
-Getting the current option value:
+The TCP iostream type.
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::ip::unicast::hops option;
- socket.get_option(option);
- int ttl = option.value();
+ typedef basic_socket_iostream< tcp > 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. ]
+ ]
+
+]
@@ -37767,15 +38393,15 @@
-[section:ip__v6_only ip::v6_only]
+[section:no_delay ip::tcp::no_delay]
-Socket option for determining whether an IPv6 socket supports IPv6 communication only.
+Socket option for disabling the Nagle algorithm.
- typedef implementation_defined v6_only;
+ typedef implementation_defined no_delay;
-Implements the IPPROTO\_IPV6/IP\_V6ONLY socket option.
+Implements the IPPROTO\_TCP/TCP\_NODELAY socket option.
[heading Examples]
@@ -37784,7 +38410,7 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::v6_only option(true);
+ boost::asio::ip::tcp::no_delay option(true);
socket.set_option(option);
@@ -37794,9 +38420,9 @@
boost::asio::ip::tcp::socket socket(io_service);
...
- boost::asio::ip::v6_only option;
+ boost::asio::ip::tcp::no_delay option;
socket.get_option(option);
- bool v6_only = option.value();
+ bool is_set = option.value();
@@ -37806,100 +38432,97 @@
[endsect]
-[section:is_read_buffered is_read_buffered]
-
-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 Stream>
- class is_read_buffered
+[section:operator_not__eq_ ip::tcp::operator!=]
-[heading Data Members]
-[table
- [[Name][Description]]
+Compare two protocols for inequality.
- [
- [[link boost_asio.reference.is_read_buffered.value [*value]]]
- [The value member is true only if the Stream type supports buffering of read data. ]
- ]
+ friend bool operator!=(
+ const tcp & p1,
+ const tcp & p2);
-]
-[section:value is_read_buffered::value]
+[endsect]
-The value member is true only if the Stream type supports buffering of read data.
- static const bool value;
+[section:operator_eq__eq_ ip::tcp::operator==]
+Compare two protocols for equality.
-[endsect]
+ friend bool operator==(
+ const tcp & p1,
+ const tcp & p2);
[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.
- template<
- typename Stream>
- class is_write_buffered
+[section:protocol ip::tcp::protocol]
+Obtain an identifier for the protocol.
-[heading Data Members]
-[table
- [[Name][Description]]
+ int protocol() const;
- [
- [[link boost_asio.reference.is_write_buffered.value [*value]]]
- [The value member is true only if the Stream type supports buffering of written data. ]
- ]
-]
+[endsect]
-[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;
+[section:resolver ip::tcp::resolver]
+The TCP resolver type.
+ typedef basic_resolver< tcp > resolver;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-[section:local__basic_endpoint local::basic_endpoint]
+ [
-Describes an endpoint for a UNIX socket.
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class basic_endpoint
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+ [
-[heading Types]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
[
- [[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.ip__basic_resolver.query [*query]]]
+ [The query type. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
- [The protocol type associated with the endpoint. ]
+ [[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. ]
]
@@ -37910,184 +38533,213 @@
[[Name][Description]]
[
- [[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.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously resolve a query to a list of entries. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
- [Assign from another endpoint. ]
+ [[link boost_asio.reference.ip__basic_resolver.basic_resolver [*basic_resolver]]]
+ [Constructor. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.path [*path]]]
- [Get the path associated with the endpoint. ]
+ [[link boost_asio.reference.ip__basic_resolver.cancel [*cancel]]]
+ [Cancel any asynchronous operations that are waiting on the resolver. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.protocol [*protocol]]]
- [The protocol associated with the endpoint. ]
+ [[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.local__basic_endpoint.resize [*resize]]]
- [Set the underlying size of the endpoint in the native type. ]
+ [[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.local__basic_endpoint.size [*size]]]
- [Get the underlying size of the endpoint in the native type. ]
+ [[link boost_asio.reference.ip__basic_resolver.resolve [*resolve]]]
+ [Resolve a query to a list of entries. ]
]
]
-[heading Friends]
+[heading Protected Data Members]
[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. ]
+ [[link boost_asio.reference.ip__basic_resolver.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
-]
-
-[heading Related Functions]
-[table
- [[Name][Description]]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
- [Output an endpoint as a string. ]
+ [[link boost_asio.reference.ip__basic_resolver.service [*service]]]
+ [The service associated with the I/O object. ]
]
-
+
]
-The
-[link boost_asio.reference.local__basic_endpoint local::basic_endpoint] class template describes an endpoint that may be associated with a particular UNIX socket.
+The 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.
-
+[*Shared] [*objects:] Unsafe.
-[section:basic_endpoint local::basic_endpoint::basic_endpoint]
-Default constructor.
- ``[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);
+[endsect]
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
- const std::string & path);
- ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
- const basic_endpoint & other);
+[section:resolver_iterator ip::tcp::resolver_iterator]
-[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+The type of a resolver iterator.
-Default constructor.
+ typedef basic_resolver_iterator< tcp > resolver_iterator;
- basic_endpoint();
+[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]
+The
+[link boost_asio.reference.ip__basic_resolver_iterator ip::basic_resolver_iterator] class template is used to define iterators over the results returned by a resolver.
+The iterator's value\_type, obtained when the iterator is dereferenced, is:
+ const basic_resolver_entry<InternetProtocol>
-[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)]
-Construct an endpoint using the specified path name.
- basic_endpoint(
- const char * path);
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-[endsect]
+[*Shared] [*objects:] Unsafe.
-[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 overloads)]
-Construct an endpoint using the specified path name.
+[endsect]
- basic_endpoint(
- const std::string & path);
+[section:resolver_query ip::tcp::resolver_query]
-[endsect]
+The type of a resolver query.
+ typedef basic_resolver_query< tcp > resolver_query;
-[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 overloads)]
+[heading Types]
+[table
+ [[Name][Description]]
-Copy constructor.
-
- basic_endpoint(
- const basic_endpoint & other);
-
-
-
-[endsect]
+ [
+ [[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]]
-[section:capacity local::basic_endpoint::capacity]
+ [
+ [[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. ]
+ ]
+
+]
-Get the capacity of the endpoint in the native type.
+[heading Data Members]
+[table
+ [[Name][Description]]
- std::size_t capacity() const;
+ [
+ [[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. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_host [*numeric_host]]]
+ [Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. ]
+ ]
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.numeric_service [*numeric_service]]]
+ [Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. ]
+ ]
-[section:data local::basic_endpoint::data]
+ [
+ [[link boost_asio.reference.ip__basic_resolver_query.passive [*passive]]]
+ [Indicate that returned endpoint is intended for use as a locally bound socket endpoint. ]
+ ]
-Get the underlying endpoint in the native type.
+ [
+ [[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. ]
+ ]
- data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload1 data]``();
+]
- const data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload2 data]``() const;
+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.
-[section:overload1 local::basic_endpoint::data (1 of 2 overloads)]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Get the underlying endpoint in the native type.
+[*Shared] [*objects:] Unsafe.
- data_type * data();
@@ -38095,138 +38747,380 @@
-[section:overload2 local::basic_endpoint::data (2 of 2 overloads)]
-
-Get the underlying endpoint in the native type.
+[section:socket ip::tcp::socket]
- const data_type * data() const;
+The TCP socket type.
+ typedef basic_stream_socket< tcp > socket;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+ [
-[section:data_type local::basic_endpoint::data_type]
+ [[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. ]
+
+ ]
-The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
+ [
- typedef implementation_defined data_type;
+ [[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. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:operator_not__eq_ local::basic_endpoint::operator!=]
+ [
-Compare two endpoints for inequality.
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
- friend bool operator!=(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
+ [
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+ [
-[endsect]
+ [[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. ]
+
+ ]
-[section:operator_lt_ local::basic_endpoint::operator<]
+ [
-Compare endpoints for ordering.
+ [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
- friend bool operator<(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
+ [
+ [[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. ]
+
+ ]
+ [
+ [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
-[section:operator_lt__lt_ local::basic_endpoint::operator<<]
+ [
-Output an endpoint as a string.
+ [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
- std::basic_ostream< Elem, Traits > & operator<<(
- std::basic_ostream< Elem, Traits > & os,
- const basic_endpoint< Protocol > & endpoint);
+ [
+ [[link boost_asio.reference.basic_stream_socket.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
-Used to output a human-readable string for a specified endpoint.
+ [
+ [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.basic_stream_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
-[[os][The output stream to which the string will be written.]]
+ ]
-[[endpoint][The endpoint to be written.]]
+ [
-]
+ [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-[heading Return Value]
-
-The output stream.
+ [
+ [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:operator_eq_ local::basic_endpoint::operator=]
+ [
+ [[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. ]
+ ]
+
+]
-Assign from another endpoint.
+[heading Data Members]
+[table
+ [[Name][Description]]
- basic_endpoint & operator=(
- const basic_endpoint & other);
+ [
+ [[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. ]
+ ]
-[endsect]
+ [
+ [[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]]
-[section:operator_eq__eq_ local::basic_endpoint::operator==]
+ [
+ [[link boost_asio.reference.basic_stream_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-Compare two endpoints for equality.
+ [
+ [[link boost_asio.reference.basic_stream_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
- friend bool operator==(
- const basic_endpoint< Protocol > & e1,
- const basic_endpoint< Protocol > & e2);
+]
+The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
-[endsect]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+[*Shared] [*objects:] Unsafe.
-[section:path local::basic_endpoint::path]
-Get the path associated with the endpoint.
- std::string ``[link boost_asio.reference.local__basic_endpoint.path.overload1 path]``() const;
- void ``[link boost_asio.reference.local__basic_endpoint.path.overload2 path]``(
- const char * p);
+[endsect]
- void ``[link boost_asio.reference.local__basic_endpoint.path.overload3 path]``(
- const std::string & p);
-[section:overload1 local::basic_endpoint::path (1 of 3 overloads)]
+[section:type ip::tcp::type]
-Get the path associated with the endpoint.
+Obtain an identifier for the type of the protocol.
- std::string path() const;
+ int type() const;
@@ -38234,12 +39128,11 @@
-[section:overload2 local::basic_endpoint::path (2 of 3 overloads)]
+[section:v4 ip::tcp::v4]
-Set the path associated with the endpoint.
+Construct to represent the IPv4 TCP protocol.
- void path(
- const char * p);
+ static tcp v4();
@@ -38247,183 +39140,117 @@
-[section:overload3 local::basic_endpoint::path (3 of 3 overloads)]
-
-Set the path associated with the endpoint.
-
- void path(
- const std::string & p);
+[section:v6 ip::tcp::v6]
+Construct to represent the IPv6 TCP protocol.
+ static tcp v6();
-[endsect]
[endsect]
-[section:protocol local::basic_endpoint::protocol]
-
-The protocol associated with the endpoint.
-
- protocol_type protocol() const;
-
-
[endsect]
+[section:ip__udp ip::udp]
+Encapsulates the flags needed for UDP.
-[section:protocol_type local::basic_endpoint::protocol_type]
-
-The protocol type associated with the endpoint.
+ class udp
- typedef Protocol protocol_type;
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[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. ]
+
+ ]
+ [
-[section:resize local::basic_endpoint::resize]
+ [[link boost_asio.reference.ip__udp.resolver_iterator [*resolver_iterator]]]
+ [The type of a resolver iterator. ]
+
+ ]
-Set the underlying size of the endpoint in the native type.
+ [
- void resize(
- std::size_t size);
+ [[link boost_asio.reference.ip__udp.resolver_query [*resolver_query]]]
+ [The type of a resolver query. ]
+
+ ]
+ [
+ [[link boost_asio.reference.ip__udp.socket [*socket]]]
+ [The UDP socket type. ]
+
+ ]
-[endsect]
+]
-
-
-[section:size local::basic_endpoint::size]
-
-Get the underlying size of the endpoint in the native type.
-
- std::size_t size() const;
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:local__connect_pair local::connect_pair]
-
-Create a pair of connected sockets.
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
- typename ``[link boost_asio.reference.SocketService2 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.SocketService1 SocketService1]``,
- typename ``[link boost_asio.reference.SocketService2 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);
-
-
-[section:overload1 local::connect_pair (1 of 2 overloads)]
-
-Create a pair of connected sockets.
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
- typename ``[link boost_asio.reference.SocketService2 SocketService2]``>
- void connect_pair(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2);
-
-
-
-[endsect]
-
-
-
-[section:overload2 local::connect_pair (2 of 2 overloads)]
-
-Create a pair of connected sockets.
-
- template<
- typename ``[link boost_asio.reference.Protocol Protocol]``,
- typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
- typename ``[link boost_asio.reference.SocketService2 SocketService2]``>
- boost::system::error_code connect_pair(
- basic_socket< Protocol, SocketService1 > & socket1,
- basic_socket< Protocol, SocketService2 > & socket2,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:local__datagram_protocol local::datagram_protocol]
-
-Encapsulates the flags needed for datagram-oriented UNIX sockets.
-
- class datagram_protocol
-
-
-[heading Types]
+[heading Member Functions]
[table
[[Name][Description]]
[
-
- [[link boost_asio.reference.local__datagram_protocol.endpoint [*endpoint]]]
- [The type of a UNIX domain endpoint. ]
+ [[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.local__datagram_protocol.socket [*socket]]]
- [The UNIX domain socket type. ]
+ [[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 Member Functions]
+[heading Friends]
[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.ip__udp.operator_not__eq_ [*operator!=]]]
+ [Compare two protocols for inequality. ]
]
[
- [[link boost_asio.reference.local__datagram_protocol.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
+ [[link boost_asio.reference.ip__udp.operator_eq__eq_ [*operator==]]]
+ [Compare two protocols for equality. ]
]
]
The
-[link boost_asio.reference.local__datagram_protocol local::datagram_protocol] class contains flags necessary for datagram-oriented UNIX domain sockets.
+[link boost_asio.reference.ip__udp ip::udp] class contains flags necessary for UDP sockets.
[heading Thread Safety]
@@ -38434,11 +39261,11 @@
-[section:endpoint local::datagram_protocol::endpoint]
+[section:endpoint ip::udp::endpoint]
-The type of a UNIX domain endpoint.
+The type of a UDP endpoint.
- typedef basic_endpoint< datagram_protocol > endpoint;
+ typedef basic_endpoint< udp > endpoint;
[heading Types]
@@ -38447,14 +39274,14 @@
[
- [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [[link boost_asio.reference.ip__basic_endpoint.data_type [*data_type]]]
[The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.ip__basic_endpoint.protocol_type [*protocol_type]]]
[The protocol type associated with the endpoint. ]
]
@@ -38466,42 +39293,47 @@
[[Name][Description]]
[
- [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [[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.local__basic_endpoint.capacity [*capacity]]]
+ [[link boost_asio.reference.ip__basic_endpoint.capacity [*capacity]]]
[Get the capacity of the endpoint in the native type. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.data [*data]]]
+ [[link boost_asio.reference.ip__basic_endpoint.data [*data]]]
[Get the underlying endpoint in the native type. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_eq_ [*operator=]]]
+ [[link boost_asio.reference.ip__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.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.local__basic_endpoint.protocol [*protocol]]]
+ [[link boost_asio.reference.ip__basic_endpoint.protocol [*protocol]]]
[The protocol associated with the endpoint. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.resize [*resize]]]
+ [[link boost_asio.reference.ip__basic_endpoint.resize [*resize]]]
[Set the underlying size of the endpoint in the native type. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.size [*size]]]
+ [[link boost_asio.reference.ip__basic_endpoint.size [*size]]]
[Get the underlying size of the endpoint in the native type. ]
]
@@ -38512,17 +39344,17 @@
[[Name][Description]]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_not__eq_ [*operator!=]]]
+ [[link boost_asio.reference.ip__basic_endpoint.operator_not__eq_ [*operator!=]]]
[Compare two endpoints for inequality. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_lt_ [*operator<]]]
+ [[link boost_asio.reference.ip__basic_endpoint.operator_lt_ [*operator<]]]
[Compare endpoints for ordering. ]
]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_eq__eq_ [*operator==]]]
+ [[link boost_asio.reference.ip__basic_endpoint.operator_eq__eq_ [*operator==]]]
[Compare two endpoints for equality. ]
]
@@ -38533,14 +39365,14 @@
[[Name][Description]]
[
- [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [[link boost_asio.reference.ip__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.
+[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]
@@ -38556,7 +39388,7 @@
-[section:family local::datagram_protocol::family]
+[section:family ip::udp::family]
Obtain an identifier for the protocol family.
@@ -38568,7 +39400,35 @@
-[section:protocol local::datagram_protocol::protocol]
+[section:operator_not__eq_ ip::udp::operator!=]
+
+Compare two protocols for inequality.
+
+ friend bool operator!=(
+ const udp & p1,
+ const udp & p2);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ ip::udp::operator==]
+
+Compare two protocols for equality.
+
+ friend bool operator==(
+ const udp & p1,
+ const udp & p2);
+
+
+
+[endsect]
+
+
+
+[section:protocol ip::udp::protocol]
Obtain an identifier for the protocol.
@@ -38580,11 +39440,285 @@
-[section:socket local::datagram_protocol::socket]
+[section:resolver ip::udp::resolver]
-The UNIX domain socket type.
+The UDP resolver type.
- typedef basic_datagram_socket< datagram_protocol > socket;
+ typedef basic_resolver< udp > resolver;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.iterator [*iterator]]]
+ [The iterator type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.query [*query]]]
+ [The query type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.ip__basic_resolver.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.ip__basic_resolver.async_resolve [*async_resolve]]]
+ [Asynchronously 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::udp::resolver_iterator]
+
+The type of a resolver iterator.
+
+ typedef basic_resolver_iterator< udp > 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::udp::resolver_query]
+
+The type of a resolver query.
+
+ typedef basic_resolver_query< udp > 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::udp::socket]
+
+The UDP socket type.
+
+ typedef basic_datagram_socket< udp > socket;
[heading Types]
@@ -38949,7 +40083,7 @@
-[section:type local::datagram_protocol::type]
+[section:type ip::udp::type]
Obtain an identifier for the type of the protocol.
@@ -38961,386 +40095,208 @@
-[endsect]
+[section:v4 ip::udp::v4]
-[section:local__stream_protocol local::stream_protocol]
+Construct to represent the IPv4 UDP protocol.
-Encapsulates the flags needed for stream-oriented UNIX sockets.
+ static udp v4();
- class stream_protocol
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[link boost_asio.reference.local__stream_protocol.acceptor [*acceptor]]]
- [The UNIX domain acceptor type. ]
-
- ]
- [
+[section:v6 ip::udp::v6]
- [[link boost_asio.reference.local__stream_protocol.endpoint [*endpoint]]]
- [The type of a UNIX domain endpoint. ]
-
- ]
+Construct to represent the IPv6 UDP protocol.
- [
+ static udp v6();
- [[link boost_asio.reference.local__stream_protocol.iostream [*iostream]]]
- [The UNIX domain iostream type. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.local__stream_protocol.socket [*socket]]]
- [The UNIX domain socket type. ]
-
- ]
-
-]
-
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.local__stream_protocol.family [*family]]]
- [Obtain an identifier for the protocol family. ]
- ]
-
- [
- [[link boost_asio.reference.local__stream_protocol.protocol [*protocol]]]
- [Obtain an identifier for the protocol. ]
- ]
-
- [
- [[link boost_asio.reference.local__stream_protocol.type [*type]]]
- [Obtain an identifier for the type of the protocol. ]
- ]
-
-]
-The
-[link boost_asio.reference.local__stream_protocol local::stream_protocol] class contains flags necessary for stream-oriented UNIX domain sockets.
+[endsect]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Safe.
+[endsect]
+[section:ip__unicast__hops ip::unicast::hops]
-[section:acceptor local::stream_protocol::acceptor]
+Socket option for time-to-live associated with outgoing unicast packets.
-The UNIX domain acceptor type.
+ typedef implementation_defined hops;
- typedef basic_socket_acceptor< stream_protocol > acceptor;
-[heading Types]
-[table
- [[Name][Description]]
+Implements the IPPROTO\_IP/IP\_UNICAST\_TTL socket option.
- [
- [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
+[heading Examples]
- ]
+Setting the option:
- [
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option(4);
+ socket.set_option(option);
- [[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. ]
-
- ]
- [
+Getting the current option value:
- [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::ip::unicast::hops option;
+ socket.get_option(option);
+ int ttl = option.value();
- [
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
- [
+[section:ip__v6_only ip::v6_only]
- [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+Socket option for determining whether an IPv6 socket supports IPv6 communication only.
- [
+ typedef implementation_defined v6_only;
- [[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. ]
-
- ]
+Implements the IPPROTO\_IPV6/IP\_V6ONLY 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::ip::v6_only option(true);
+ 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::ip::v6_only option;
+ socket.get_option(option);
+ bool v6_only = 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:is_match_condition is_match_condition]
- [
+Type trait used to determine whether a type can be used as a match condition function with read_until and async_read_until.
- [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
-
- ]
+ template<
+ typename T>
+ struct is_match_condition
-]
-[heading Member Functions]
+[heading Data Members]
[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. ]
+ [[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:value is_match_condition::value]
+
+The value member is true if the type may be used as a match condition.
+
+ static const bool value;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:is_read_buffered is_read_buffered]
+
+The is_read_buffered class is a traits class that may be used to determine whether a stream type supports buffering of read data.
+
+ template<
+ typename Stream>
+ class is_read_buffered
+
+
[heading Data Members]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
+ [[link boost_asio.reference.is_read_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of read data. ]
]
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
+]
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
+[section:value is_read_buffered::value]
-]
+The value member is true only if the Stream type supports buffering of read data.
-[heading Protected Data Members]
-[table
- [[Name][Description]]
+ static const bool value;
- [
- [[link boost_asio.reference.basic_socket_acceptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
- [
- [[link boost_asio.reference.basic_socket_acceptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
-]
+[endsect]
-The basic_socket_acceptor class template is used for accepting new socket connections.
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
+[endsect]
-[*Shared] [*objects:] Unsafe.
+[section:is_write_buffered is_write_buffered]
-[heading Example]
-
-Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+The is_write_buffered class is a traits class that may be used to determine whether a stream type supports buffering of written data.
- 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();
+ template<
+ typename Stream>
+ class is_write_buffered
+
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.is_write_buffered.value [*value]]]
+ [The value member is true only if the Stream type supports buffering of written data. ]
+ ]
+
+]
+[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;
@@ -39348,11 +40304,15 @@
-[section:endpoint local::stream_protocol::endpoint]
+[endsect]
-The type of a UNIX domain endpoint.
+[section:local__basic_endpoint local::basic_endpoint]
- typedef basic_endpoint< stream_protocol > endpoint;
+Describes an endpoint for a UNIX socket.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class basic_endpoint
[heading Types]
@@ -39464,56 +40424,40 @@
[*Shared] [*objects:] Unsafe.
+[section:basic_endpoint local::basic_endpoint::basic_endpoint]
+Default constructor.
-[endsect]
-
+ ``[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);
-[section:family local::stream_protocol::family]
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload3 basic_endpoint]``(
+ const std::string & path);
-Obtain an identifier for the protocol family.
+ ``[link boost_asio.reference.local__basic_endpoint.basic_endpoint.overload4 basic_endpoint]``(
+ const basic_endpoint & other);
- int family() const;
+[section:overload1 local::basic_endpoint::basic_endpoint (1 of 4 overloads)]
+Default constructor.
-[endsect]
+ basic_endpoint();
-[section:iostream local::stream_protocol::iostream]
+[endsect]
-The UNIX domain iostream type.
- typedef basic_socket_iostream< stream_protocol > iostream;
+[section:overload2 local::basic_endpoint::basic_endpoint (2 of 4 overloads)]
-[heading Member Functions]
-[table
- [[Name][Description]]
+Construct an endpoint using the specified path name.
- [
- [[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. ]
- ]
-
-]
+ basic_endpoint(
+ const char * path);
@@ -39521,11 +40465,12 @@
-[section:protocol local::stream_protocol::protocol]
+[section:overload3 local::basic_endpoint::basic_endpoint (3 of 4 overloads)]
-Obtain an identifier for the protocol.
+Construct an endpoint using the specified path name.
- int protocol() const;
+ basic_endpoint(
+ const std::string & path);
@@ -39533,161 +40478,4201 @@
-[section:socket local::stream_protocol::socket]
+[section:overload4 local::basic_endpoint::basic_endpoint (4 of 4 overloads)]
-The UNIX domain socket type.
+Copy constructor.
- typedef basic_stream_socket< stream_protocol > socket;
+ basic_endpoint(
+ const basic_endpoint & other);
-[heading Types]
-[table
- [[Name][Description]]
- [
+[endsect]
- [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
- [
+[section:capacity local::basic_endpoint::capacity]
- [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
+Get the capacity of the endpoint in the native type.
- [
+ std::size_t capacity() const;
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
-
- ]
+[section:data local::basic_endpoint::data]
- [
+Get the underlying endpoint in the native type.
- [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
+ data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload1 data]``();
- [
+ const data_type * ``[link boost_asio.reference.local__basic_endpoint.data.overload2 data]``() const;
- [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
- [
+[section:overload1 local::basic_endpoint::data (1 of 2 overloads)]
- [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
- [Socket option to specify whether the socket lingers on close if unsent data is present. ]
-
- ]
+Get the underlying endpoint in the native type.
- [
+ data_type * data();
- [[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. ]
-
- ]
- [
+[section:overload2 local::basic_endpoint::data (2 of 2 overloads)]
- [[link boost_asio.reference.basic_stream_socket.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
+Get the underlying endpoint in the native type.
- [
+ const data_type * data() const;
- [[link boost_asio.reference.basic_stream_socket.protocol_type [*protocol_type]]]
- [The protocol type. ]
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:data_type local::basic_endpoint::data_type]
+
+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_ local::basic_endpoint::operator!=]
+
+Compare two endpoints for inequality.
+
+ friend bool operator!=(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+
+[endsect]
+
+
+
+[section:operator_lt_ local::basic_endpoint::operator<]
+
+Compare endpoints for ordering.
+
+ friend bool operator<(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+
+[endsect]
+
+
+
+[section:operator_lt__lt_ local::basic_endpoint::operator<<]
+
+Output an endpoint as a string.
+
+ std::basic_ostream< Elem, Traits > & operator<<(
+ std::basic_ostream< Elem, Traits > & os,
+ const basic_endpoint< Protocol > & endpoint);
+
+
+Used to output a human-readable string for a specified endpoint.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[os][The output stream to which the string will be written.]]
+
+[[endpoint][The endpoint to be written.]]
+
+]
+
+[heading Return Value]
+
+The output stream.
+
+
+
+[endsect]
+
+
+
+[section:operator_eq_ local::basic_endpoint::operator=]
+
+Assign from another endpoint.
+
+ basic_endpoint & operator=(
+ const basic_endpoint & other);
+
+
+
+[endsect]
+
+
+
+[section:operator_eq__eq_ local::basic_endpoint::operator==]
+
+Compare two endpoints for equality.
+
+ friend bool operator==(
+ const basic_endpoint< Protocol > & e1,
+ const basic_endpoint< Protocol > & e2);
+
+
+
+[endsect]
+
+
+[section:path local::basic_endpoint::path]
+
+Get the path associated with the endpoint.
+
+ std::string ``[link boost_asio.reference.local__basic_endpoint.path.overload1 path]``() const;
+
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload2 path]``(
+ const char * p);
+
+ void ``[link boost_asio.reference.local__basic_endpoint.path.overload3 path]``(
+ const std::string & p);
+
+
+[section:overload1 local::basic_endpoint::path (1 of 3 overloads)]
+
+Get the path associated with the endpoint.
+
+ std::string path() const;
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::basic_endpoint::path (2 of 3 overloads)]
+
+Set the path associated with the endpoint.
+
+ void path(
+ const char * p);
+
+
+
+[endsect]
+
+
+
+[section:overload3 local::basic_endpoint::path (3 of 3 overloads)]
+
+Set the path associated with the endpoint.
+
+ void path(
+ const std::string & p);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:protocol local::basic_endpoint::protocol]
+
+The protocol associated with the endpoint.
+
+ protocol_type protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol_type local::basic_endpoint::protocol_type]
+
+The protocol type associated with the endpoint.
+
+ typedef Protocol protocol_type;
+
+
+
+
+[endsect]
+
+
+
+[section:resize local::basic_endpoint::resize]
+
+Set the underlying size of the endpoint in the native type.
+
+ void resize(
+ std::size_t size);
+
+
+
+[endsect]
+
+
+
+[section:size local::basic_endpoint::size]
+
+Get the underlying size of the endpoint in the native type.
+
+ std::size_t size() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:local__connect_pair local::connect_pair]
+
+Create a pair of connected sockets.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService2 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.SocketService1 SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService2 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);
+
+
+[section:overload1 local::connect_pair (1 of 2 overloads)]
+
+Create a pair of connected sockets.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService2 SocketService2]``>
+ void connect_pair(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2);
+
+
+
+[endsect]
+
+
+
+[section:overload2 local::connect_pair (2 of 2 overloads)]
+
+Create a pair of connected sockets.
+
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``,
+ typename ``[link boost_asio.reference.SocketService1 SocketService1]``,
+ typename ``[link boost_asio.reference.SocketService2 SocketService2]``>
+ boost::system::error_code connect_pair(
+ basic_socket< Protocol, SocketService1 > & socket1,
+ basic_socket< Protocol, SocketService2 > & socket2,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:local__datagram_protocol local::datagram_protocol]
+
+Encapsulates the flags needed for datagram-oriented UNIX sockets.
+
+ class datagram_protocol
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__datagram_protocol.endpoint [*endpoint]]]
+ [The type of a UNIX domain endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__datagram_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__datagram_protocol.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+]
+
+The
+[link boost_asio.reference.local__datagram_protocol local::datagram_protocol] class contains flags necessary for datagram-oriented UNIX domain sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+[section:endpoint local::datagram_protocol::endpoint]
+
+The type of a UNIX domain endpoint.
+
+ typedef basic_endpoint< datagram_protocol > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The
+[link boost_asio.reference.local__basic_endpoint local::basic_endpoint] class template describes an endpoint that may be associated with a particular UNIX socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:family local::datagram_protocol::family]
+
+Obtain an identifier for the protocol family.
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:protocol local::datagram_protocol::protocol]
+
+Obtain an identifier for the protocol.
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:socket local::datagram_protocol::socket]
+
+The UNIX domain socket type.
+
+ typedef basic_datagram_socket< datagram_protocol > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
]
- [
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.native_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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_datagram_socket.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.assign [*assign]]]
+ [Assign an existing native socket to the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive [*async_receive]]]
+ [Start an asynchronous receive on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_receive_from [*async_receive_from]]]
+ [Start an asynchronous receive. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send [*async_send]]]
+ [Start an asynchronous send on a connected socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.available [*available]]]
+ [Determine the number of bytes available for reading. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.basic_datagram_socket [*basic_datagram_socket]]]
+ [Construct a basic_datagram_socket without opening it. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_datagram_socket.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:type local::datagram_protocol::type]
+
+Obtain an identifier for the type of the protocol.
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:local__stream_protocol local::stream_protocol]
+
+Encapsulates the flags needed for stream-oriented UNIX sockets.
+
+ class stream_protocol
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.acceptor [*acceptor]]]
+ [The UNIX domain acceptor type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.endpoint [*endpoint]]]
+ [The type of a UNIX domain endpoint. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.iostream [*iostream]]]
+ [The UNIX domain iostream type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__stream_protocol.socket [*socket]]]
+ [The UNIX domain socket type. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.family [*family]]]
+ [Obtain an identifier for the protocol family. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.protocol [*protocol]]]
+ [Obtain an identifier for the protocol. ]
+ ]
+
+ [
+ [[link boost_asio.reference.local__stream_protocol.type [*type]]]
+ [Obtain an identifier for the type of the protocol. ]
+ ]
+
+]
+
+The
+[link boost_asio.reference.local__stream_protocol local::stream_protocol] class contains flags necessary for stream-oriented UNIX domain sockets.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
+
+
+
+[section:acceptor local::stream_protocol::acceptor]
+
+The UNIX domain acceptor type.
+
+ typedef basic_socket_acceptor< stream_protocol > acceptor;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.native_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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.reuse_address [*reuse_address]]]
+ [Socket option to allow the socket to be bound to an address that is already in use. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_socket_acceptor.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.accept [*accept]]]
+ [Accept a new connection. ]
+ ]
+
+ [
+ [[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]]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_do_not_route [*message_do_not_route]]]
+ [Specify that the data should not be subject to routing. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
+
+ [
+ [[link boost_asio.reference.basic_socket_acceptor.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
+
+]
+
+[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]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+[heading Example]
+
+Opening a socket acceptor with the SO\_REUSEADDR option enabled:
+
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port);
+ acceptor.open(endpoint.protocol());
+ acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
+ acceptor.bind(endpoint);
+ acceptor.listen();
+
+
+
+
+
+
+
+[endsect]
+
+
+
+[section:endpoint local::stream_protocol::endpoint]
+
+The type of a UNIX domain endpoint.
+
+ typedef basic_endpoint< stream_protocol > endpoint;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.data_type [*data_type]]]
+ [The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.local__basic_endpoint.protocol_type [*protocol_type]]]
+ [The protocol type associated with the endpoint. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.basic_endpoint [*basic_endpoint]]]
+ [Default constructor. ]
+ ]
+
+ [
+ [[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. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.local__basic_endpoint.operator_lt__lt_ [*operator<<]]]
+ [Output an endpoint as a string. ]
+ ]
+
+]
+
+The
+[link boost_asio.reference.local__basic_endpoint local::basic_endpoint] class template describes an endpoint that may be associated with a particular UNIX socket.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:family local::stream_protocol::family]
+
+Obtain an identifier for the protocol family.
+
+ int family() const;
+
+
+
+[endsect]
+
+
+
+[section:iostream local::stream_protocol::iostream]
+
+The UNIX domain iostream type.
+
+ typedef basic_socket_iostream< stream_protocol > 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. ]
+ ]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:protocol local::stream_protocol::protocol]
+
+Obtain an identifier for the protocol.
+
+ int protocol() const;
+
+
+
+[endsect]
+
+
+
+[section:socket local::stream_protocol::socket]
+
+The UNIX domain socket type.
+
+ typedef basic_stream_socket< stream_protocol > socket;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_socket is always the lowest layer. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.basic_stream_socket.native_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.
+
+
+
+
+[endsect]
+
+
+
+[section:type local::stream_protocol::type]
+
+Obtain an identifier for the type of the protocol.
+
+ int type() const;
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:mutable_buffer mutable_buffer]
+
+Holds a buffer that can be modified.
+
+ class mutable_buffer
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+
+[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:buffer_cast mutable_buffer::buffer_cast]
+
+Cast a non-modifiable buffer to a specified pointer to POD type.
+
+ template<
+ typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
+ PointerToPodType buffer_cast(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+
+[section:buffer_size mutable_buffer::buffer_size]
+
+Get the number of bytes in a non-modifiable buffer.
+
+ std::size_t buffer_size(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[section:mutable_buffer mutable_buffer::mutable_buffer]
+
+Construct an empty buffer.
+
+ ``[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:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
+
+Construct an empty buffer.
+
+ mutable_buffer();
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
+
+Construct a buffer to represent a given memory range.
+
+ mutable_buffer(
+ void * data,
+ std::size_t size);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:operator_plus_ mutable_buffer::operator+]
+
+Create a new modifiable buffer that is offset from the start of another.
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload1 operator+]``(
+ const mutable_buffer & b,
+ std::size_t start);
+
+ mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload2 operator+]``(
+ std::size_t start,
+ const mutable_buffer & b);
+
+
+[section:overload1 mutable_buffer::operator+ (1 of 2 overloads)]
+
+Create a new modifiable buffer that is offset from the start of another.
+
+ mutable_buffer operator+(
+ const mutable_buffer & b,
+ std::size_t start);
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffer::operator+ (2 of 2 overloads)]
+
+Create a new modifiable buffer that is offset from the start of another.
+
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+
+[section:mutable_buffers_1 mutable_buffers_1]
+
+Adapts a single modifiable buffer so that it meets the requirements of the MutableBufferSequence concept.
+
+ class mutable_buffers_1 :
+ public mutable_buffer
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.mutable_buffers_1.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1 [*mutable_buffers_1]]]
+ [Construct to represent a single modifiable buffer. ]
+ ]
+
+]
+
+[heading Related Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.buffer_cast [*buffer_cast]]]
+ [Cast a non-modifiable buffer to a specified pointer to POD type. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.buffer_size [*buffer_size]]]
+ [Get the number of bytes in a non-modifiable buffer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.mutable_buffers_1.operator_plus_ [*operator+]]]
+ [Create a new modifiable buffer that is offset from the start of another. ]
+ ]
+
+]
+
+
+[section:begin mutable_buffers_1::begin]
+
+Get a random-access iterator to the first element.
+
+ const_iterator begin() const;
+
+
+
+[endsect]
+
+
+
+[section:buffer_cast mutable_buffers_1::buffer_cast]
+
+
+['Inherited from mutable_buffer.]
+
+Cast a non-modifiable buffer to a specified pointer to POD type.
+
+ template<
+ typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
+ PointerToPodType buffer_cast(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+
+[section:buffer_size mutable_buffers_1::buffer_size]
+
+
+['Inherited from mutable_buffer.]
+
+Get the number of bytes in a non-modifiable buffer.
+
+ std::size_t buffer_size(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+
+[section:const_iterator mutable_buffers_1::const_iterator]
+
+A random-access iterator type that may be used to read elements.
+
+ typedef const mutable_buffer * const_iterator;
+
+
+
+
+[endsect]
+
+
+
+[section:end mutable_buffers_1::end]
+
+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]
+
+Construct to represent a single modifiable buffer.
+
+ mutable_buffers_1(
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[section:operator_plus_ mutable_buffers_1::operator+]
+
+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);
+
+
+[section:overload1 mutable_buffers_1::operator+ (1 of 2 overloads)]
+
+
+['Inherited from mutable_buffer.]
+
+Create a new modifiable buffer that is offset from the start of another.
+
+ mutable_buffer operator+(
+ const mutable_buffer & b,
+ std::size_t start);
+
+
+
+[endsect]
+
+
+
+[section:overload2 mutable_buffers_1::operator+ (2 of 2 overloads)]
+
+
+['Inherited from mutable_buffer.]
+
+Create a new modifiable buffer that is offset from the start of another.
+
+ mutable_buffer operator+(
+ std::size_t start,
+ const mutable_buffer & b);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:value_type mutable_buffers_1::value_type]
+
+The type for each element in the list of buffers.
+
+ typedef mutable_buffer value_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+
+[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.
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:null_buffers null_buffers]
+
+An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
+
+ class null_buffers
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.null_buffers.const_iterator [*const_iterator]]]
+ [A random-access iterator type that may be used to read elements. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.null_buffers.value_type [*value_type]]]
+ [The type for each element in the list of buffers. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.null_buffers.begin [*begin]]]
+ [Get a random-access iterator to the first element. ]
+ ]
+
+ [
+ [[link boost_asio.reference.null_buffers.end [*end]]]
+ [Get a random-access iterator for one past the last element. ]
+ ]
+
+]
+
+
+[section:begin null_buffers::begin]
+
+Get a random-access iterator to the first element.
+
+ const_iterator begin() const;
+
+
+
+[endsect]
+
+
+
+[section:const_iterator null_buffers::const_iterator]
+
+A random-access iterator type that may be used to read elements.
+
+ typedef const mutable_buffer * const_iterator;
+
+
+
+
+[endsect]
+
+
+
+[section:end null_buffers::end]
+
+Get a random-access iterator for one past the last element.
+
+ const_iterator end() const;
+
+
+
+[endsect]
+
+
+
+[section:value_type null_buffers::value_type]
+
+The type for each element in the list of buffers.
+
+ typedef mutable_buffer value_type;
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
+ [Construct an empty buffer. ]
+ ]
+
+]
+
+[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.
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+
+[section:placeholders__bytes_transferred 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]
+
+
+
+[section:placeholders__error placeholders::error]
+
+An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
+
+ unspecified error;
+
+
+
+[endsect]
+
+
+
+[section:placeholders__iterator placeholders::iterator]
+
+An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as boost::asio::basic_resolver::resolve.
+
+ unspecified iterator;
+
+
+
+[endsect]
+
+
+[section:posix__basic_descriptor posix::basic_descriptor]
+
+Provides POSIX descriptor functionality.
+
+ template<
+ typename ``[link boost_asio.reference.DescriptorService DescriptorService]``>
+ class basic_descriptor :
+ public basic_io_object< DescriptorService >,
+ public posix::descriptor_base
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.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.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. ]
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+[section:assign posix::basic_descriptor::assign]
+
+Assign an existing native descriptor to the descriptor.
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.assign.overload1 assign]``(
+ const native_type & native_descriptor);
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.assign.overload2 assign]``(
+ const native_type & native_descriptor,
+ boost::system::error_code & ec);
+
+
+[section:overload1 posix::basic_descriptor::assign (1 of 2 overloads)]
+
+Assign an existing native descriptor to the descriptor.
+
+ void assign(
+ const native_type & native_descriptor);
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::assign (2 of 2 overloads)]
+
+Assign an existing native descriptor to the descriptor.
+
+ boost::system::error_code assign(
+ const native_type & native_descriptor,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:basic_descriptor posix::basic_descriptor::basic_descriptor]
+
+Construct a basic_descriptor without opening it.
+
+ ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``(
+ boost::asio::io_service & io_service);
+
+ ``[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.
+
+ basic_descriptor(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a descriptor without opening it.
+
+
+[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. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[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);
+
+
+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.]]
+
+[[native_descriptor][A native descriptor.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:bytes_readable posix::basic_descriptor::bytes_readable]
+
+
+['Inherited from posix::descriptor_base.]
+
+IO control command to get the amount of data that can be read without blocking.
+
+ typedef implementation_defined bytes_readable;
+
+
+
+Implements the FIONREAD IO control command.
+
+
+[heading Example]
+
+
+
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::bytes_readable command(true);
+ descriptor.io_control(command);
+ std::size_t bytes_readable = command.get();
+
+
+
+
+
+
+[endsect]
+
+
+[section:cancel posix::basic_descriptor::cancel]
+
+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);
+
+
+[section:overload1 posix::basic_descriptor::cancel (1 of 2 overloads)]
+
+Cancel all asynchronous operations associated with the descriptor.
+
+ void cancel();
+
+
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[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]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:close posix::basic_descriptor::close]
+
+Close the descriptor.
+
+ void ``[link boost_asio.reference.posix__basic_descriptor.close.overload1 close]``();
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.close.overload2 close]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 posix::basic_descriptor::close (1 of 2 overloads)]
+
+Close the descriptor.
+
+ void close();
+
+
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_descriptor::close (2 of 2 overloads)]
+
+Close the descriptor.
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service posix::basic_descriptor::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+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 posix::basic_descriptor::implementation]
+
+
+['Inherited from basic_io_object.]
+
+The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type posix::basic_descriptor::implementation_type]
+
+
+['Inherited from basic_io_object.]
+
+The underlying implementation type of I/O object.
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+
+[endsect]
+
+
+[section:io_control posix::basic_descriptor::io_control]
+
+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:overload1 posix::basic_descriptor::io_control (1 of 2 overloads)]
+
+Perform an IO control command on the descriptor.
+
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ void io_control(
+ IoControlCommand & command);
+
+
+This function is used to execute an IO control command on the descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the descriptor.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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:overload2 posix::basic_descriptor::io_control (2 of 2 overloads)]
+
+Perform an IO control command on the descriptor.
+
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ IoControlCommand & command,
+ boost::system::error_code & ec);
+
+
+This function is used to execute an IO control command on the descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[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:io_service posix::basic_descriptor::io_service]
+
+
+['Inherited from basic_io_object.]
+
+(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 posix::basic_descriptor::is_open]
+
+Determine whether the descriptor is open.
+
+ bool is_open() const;
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer posix::basic_descriptor::lowest_layer]
+
+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_descriptor cannot contain any further layers, it simply returns a reference to itself.
+
+
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer_type posix::basic_descriptor::lowest_layer_type]
+
+A basic_descriptor is always the lowest layer.
+
+ typedef basic_descriptor< DescriptorService > lowest_layer_type;
+
+
+[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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
+
+ [
+
+ [[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. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+
+ ]
+
+ [
+
+ [[link boost_asio.reference.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.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. ]
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:native posix::basic_descriptor::native]
+
+Get the native descriptor representation.
+
+ native_type native();
+
+
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_type posix::basic_descriptor::native_type]
+
+The native representation of a descriptor.
+
+ typedef DescriptorService::native_type native_type;
+
+
+
+
+[endsect]
+
+
+
+[section:non_blocking_io posix::basic_descriptor::non_blocking_io]
+
+
+['Inherited from posix::descriptor_base.]
+
+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:service posix::basic_descriptor::service]
+
+
+['Inherited from basic_io_object.]
+
+The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type posix::basic_descriptor::service_type]
+
+
+['Inherited from basic_io_object.]
+
+The type of the service that will be used to provide I/O operations.
+
+ typedef DescriptorService service_type;
+
+
+
+
+[endsect]
+
+
+
+[section:_basic_descriptor posix::basic_descriptor::~basic_descriptor]
+
+Protected destructor to prevent deletion through this type.
+
+ ~basic_descriptor();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:posix__basic_stream_descriptor posix::basic_stream_descriptor]
+
+Provides stream-oriented descriptor functionality.
+
+ template<
+ typename ``[link boost_asio.reference.StreamDescriptorService StreamDescriptorService]`` = stream_descriptor_service>
+ class basic_stream_descriptor :
+ public posix::basic_descriptor< StreamDescriptorService >
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.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. ]
+
+ ]
+
+]
+
+[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. ]
+ ]
+
+]
+
+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:assign posix::basic_stream_descriptor::assign]
+
+Assign an existing native descriptor to the descriptor.
+
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 assign]``(
+ const native_type & native_descriptor);
+
+ 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);
+
+
+[section:overload1 posix::basic_stream_descriptor::assign (1 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Assign an existing native descriptor to the descriptor.
+
+ void assign(
+ const native_type & native_descriptor);
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_stream_descriptor::assign (2 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Assign an existing native descriptor to the descriptor.
+
+ boost::system::error_code assign(
+ const native_type & native_descriptor,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:async_read_some posix::basic_stream_descriptor::async_read_some]
+
+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 descriptor. The function call always returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+
+[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
+``
+ void handler(
+ const boost::system::error_code& error, // Result of operation.
+ std::size_t bytes_transferred // Number of bytes read.
+ );
+
+``
+Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using boost::asio::io\_service::post().]]
+
+]
+
+[heading 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:async_write_some posix::basic_stream_descriptor::async_write_some]
+
+Start an asynchronous write.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
+ typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
+ void async_write_some(
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
+
+
+This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[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 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:
+
+ descriptor.async_write_some(boost::asio::buffer(data, size), handler);
+
+
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
+
+[endsect]
+
+
+[section:basic_stream_descriptor posix::basic_stream_descriptor::basic_stream_descriptor]
+
+Construct a basic_stream_descriptor without opening it.
+
+ ``[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:overload1 posix::basic_stream_descriptor::basic_stream_descriptor (1 of 2 overloads)]
+
+Construct a basic_stream_descriptor without opening it.
+
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service);
+
+
+This constructor creates a stream descriptor without opening it. The descriptor needs to be opened and then connected or accepted before data can be sent or received on it.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[io_service][The io\_service object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_stream_descriptor::basic_stream_descriptor (2 of 2 overloads)]
+
+Construct a basic_stream_descriptor on an existing native descriptor.
+
+ basic_stream_descriptor(
+ boost::asio::io_service & io_service,
+ const native_type & native_descriptor);
+
+
+This constructor creates a stream descriptor object to hold an existing native descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[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 Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:bytes_readable posix::basic_stream_descriptor::bytes_readable]
+
+
+['Inherited from posix::descriptor_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]
+
+
+
+ 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();
+
+
+
+
+
+
+[endsect]
+
+
+[section:cancel posix::basic_stream_descriptor::cancel]
+
+Cancel all asynchronous operations associated with the descriptor.
+
+ void ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 cancel]``();
+
+ boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
+
+
+[section:overload1 posix::basic_stream_descriptor::cancel (1 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Cancel all asynchronous operations associated with the descriptor.
+
+ void cancel();
+
+
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_stream_descriptor::cancel (2 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Cancel all asynchronous operations associated with the descriptor.
+
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
+
+
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+[section:close posix::basic_stream_descriptor::close]
+
+Close the descriptor.
+
+ 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);
+
+
+[section:overload1 posix::basic_stream_descriptor::close (1 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+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. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_stream_descriptor::close (2 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Close the descriptor.
+
+ boost::system::error_code close(
+ boost::system::error_code & ec);
+
+
+This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+
+]
+
+
+
+[endsect]
+
+
+[endsect]
+
+
+[section:get_io_service posix::basic_stream_descriptor::get_io_service]
+
+
+['Inherited from basic_io_object.]
+
+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 posix::basic_stream_descriptor::implementation]
+
+
+['Inherited from basic_io_object.]
+
+The underlying implementation of the I/O object.
+
+ implementation_type implementation;
+
+
+
+[endsect]
+
+
+
+[section:implementation_type posix::basic_stream_descriptor::implementation_type]
+
+
+['Inherited from basic_io_object.]
+
+The underlying implementation type of I/O object.
+
+ typedef service_type::implementation_type implementation_type;
+
+
+
+
+[endsect]
+
+
+[section:io_control posix::basic_stream_descriptor::io_control]
+
+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);
+
+
+[section:overload1 posix::basic_stream_descriptor::io_control (1 of 2 overloads)]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Perform an IO control command on the descriptor.
+
+ void io_control(
+ IoControlCommand & command);
+
+
+This function is used to execute an IO control command on the descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the descriptor.]]
+
+]
+
+[heading Exceptions]
+
+
+[variablelist
+
+[[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: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);
+
+
+This function is used to execute an IO control command on the descriptor.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[command][The IO control command to be performed on the descriptor.]]
+
+[[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:io_service posix::basic_stream_descriptor::io_service]
+
+
+['Inherited from basic_io_object.]
+
+(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 posix::basic_stream_descriptor::is_open]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Determine whether the descriptor is open.
+
+ bool is_open() const;
+
+
+
+[endsect]
+
+
+
+[section:lowest_layer posix::basic_stream_descriptor::lowest_layer]
+
+
+['Inherited from posix::basic_descriptor.]
+
+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_descriptor cannot contain any further layers, it simply returns a reference to itself.
+
+
+[heading Return Value]
+
+A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+
- [[link boost_asio.reference.basic_stream_socket.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+
+[endsect]
+
+
+
+[section:lowest_layer_type posix::basic_stream_descriptor::lowest_layer_type]
+
+
+['Inherited from posix::basic_descriptor.]
+
+A basic_descriptor is always the lowest layer.
+
+ typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
+
+
+[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.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
+ [IO control command to get the amount of data that can be read without blocking. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.reuse_address [*reuse_address]]]
- [Socket option to allow the socket to be bound to an address that is already in use. ]
+ [[link boost_asio.reference.posix__basic_descriptor.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.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
+ [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+ [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
]
@@ -39698,351 +44683,526 @@
[[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.posix__basic_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
+ [Construct a basic_descriptor without opening it. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.close [*close]]]
- [Close the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.connect [*connect]]]
- [Connect the socket to the specified endpoint. ]
+ [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
+ [Close the descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.get_io_service [*get_io_service]]]
+ [[link boost_asio.reference.posix__basic_descriptor.get_io_service [*get_io_service]]]
[Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.get_option [*get_option]]]
- [Get an option from the socket. ]
- ]
-
- [
- [[link boost_asio.reference.basic_stream_socket.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
+ [Perform an IO control command on the descriptor. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.io_service [*io_service]]]
+ [[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.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.posix__basic_descriptor.is_open [*is_open]]]
+ [Determine whether the descriptor is open. ]
]
[
- [[link boost_asio.reference.basic_stream_socket.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.posix__basic_descriptor.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.posix__basic_descriptor.native [*native]]]
+ [Get the native descriptor representation. ]
]
+]
+
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.basic_stream_socket.open [*open]]]
- [Open the socket using the specified protocol. ]
+ [[link boost_asio.reference.posix__basic_descriptor._basic_descriptor [*~basic_descriptor]]]
+ [Protected destructor to prevent deletion through this type. ]
]
+]
+
+[heading Protected Data Members]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.basic_stream_socket.read_some [*read_some]]]
- [Read some data from the socket. ]
+ [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
]
-
+
[
- [[link boost_asio.reference.basic_stream_socket.receive [*receive]]]
- [Receive some data on the socket. ]
+ [[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.
+
+
+[heading Thread Safety]
- [
- [[link boost_asio.reference.basic_stream_socket.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint of the socket. ]
- ]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
+
+
+
+
+[endsect]
+
+
+
+[section:native posix::basic_stream_descriptor::native]
+
+
+['Inherited from posix::basic_descriptor.]
+
+Get the native descriptor representation.
+
+ native_type native();
+
+
+This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
+
+
+[endsect]
+
+
+
+[section:native_type posix::basic_stream_descriptor::native_type]
+
+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.]
+
+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]
- [
- [[link boost_asio.reference.basic_stream_socket.send [*send]]]
- [Send some data on the socket. ]
- ]
+
+
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
+
+
+
+
+
+
+[endsect]
+
+
+[section:read_some posix::basic_stream_descriptor::read_some]
+
+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);
+
+ 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)]
+
+Read some data from the descriptor.
+
+ 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 descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+
+
+[heading Parameters]
+
+
+[variablelist
- [
- [[link boost_asio.reference.basic_stream_socket.set_option [*set_option]]]
- [Set an option on the socket. ]
- ]
+[[buffers][One or more buffers into which the data will be read.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes read.
+
+[heading Exceptions]
+
+
+[variablelist
- [
- [[link boost_asio.reference.basic_stream_socket.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
- ]
+[[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]
- [
- [[link boost_asio.reference.basic_stream_socket.write_some [*write_some]]]
- [Write some data to the socket. ]
- ]
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ descriptor.read_some(boost::asio::buffer(data, size));
+
+
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
+
+[endsect]
+
+
+
+[section:overload2 posix::basic_stream_descriptor::read_some (2 of 2 overloads)]
+
+Read some data from the descriptor.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+This function is used to read data from the stream descriptor. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
+
+
+[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 Data Members]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
- [
- [[link boost_asio.reference.basic_stream_socket.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
+[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.
- [
- [[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]]
+[endsect]
- [
- [[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. ]
- ]
+[section:service posix::basic_stream_descriptor::service]
+
+
+['Inherited from basic_io_object.]
+
+The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type posix::basic_stream_descriptor::service_type]
+
+
+['Inherited from basic_io_object.]
+
+The type of the service that will be used to provide I/O operations.
+
+ typedef StreamDescriptorService service_type;
+
+
+
+
+[endsect]
+
+
+[section:write_some posix::basic_stream_descriptor::write_some]
+
+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:overload1 posix::basic_stream_descriptor::write_some (1 of 2 overloads)]
+
+Write some data to the descriptor.
+
+ 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 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]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor.]]
]
-The basic_stream_socket class template provides asynchronous and blocking stream-oriented socket functionality.
+[heading Return Value]
+
+The number of bytes written.
+[heading Exceptions]
+
-[heading Thread Safety]
+[variablelist
-[*Distinct] [*objects:] Safe.
+[[boost::system::system_error][Thrown on failure. An error code of boost::asio::error::eof indicates that the connection was closed by the peer.]]
-[*Shared] [*objects:] Unsafe.
+]
+
+[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:
+
+ descriptor.write_some(boost::asio::buffer(data, size));
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
[endsect]
-[section:type local::stream_protocol::type]
+[section:overload2 posix::basic_stream_descriptor::write_some (2 of 2 overloads)]
+
+Write some data to the descriptor.
+
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
+
+
+This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the descriptor.]]
+
+[[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.
-Obtain an identifier for the type of the protocol.
- int type() const;
+[endsect]
[endsect]
-
[endsect]
-[section:mutable_buffer mutable_buffer]
+[section:posix__descriptor_base posix::descriptor_base]
-Holds a buffer that can be modified.
+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.
- class mutable_buffer
+ class descriptor_base
-[heading Member Functions]
+[heading Types]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer. ]
+
+ [[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. ]
+
]
+
+ [
+
+ [[link boost_asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the descriptor. ]
+ ]
+
]
-[heading Related Functions]
+[heading Protected Member 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. ]
+ [[link boost_asio.reference.posix__descriptor_base._descriptor_base [*~descriptor_base]]]
+ [Protected destructor to prevent deletion through this type. ]
]
]
-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 mutable_buffer::buffer_cast]
-
-Cast a non-modifiable buffer to a specified pointer to POD type.
- template<
- typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
- PointerToPodType buffer_cast(
- const mutable_buffer & b);
+[section:bytes_readable posix::descriptor_base::bytes_readable]
+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:buffer_size mutable_buffer::buffer_size]
-Get the number of bytes in a non-modifiable buffer.
+[heading Example]
+
- std::size_t buffer_size(
- const mutable_buffer & b);
+ 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();
-[endsect]
-[section:mutable_buffer mutable_buffer::mutable_buffer]
-Construct an empty buffer.
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload1 mutable_buffer]``();
+[endsect]
- ``[link boost_asio.reference.mutable_buffer.mutable_buffer.overload2 mutable_buffer]``(
- void * data,
- std::size_t size);
-[section:overload1 mutable_buffer::mutable_buffer (1 of 2 overloads)]
+[section:non_blocking_io posix::descriptor_base::non_blocking_io]
-Construct an empty buffer.
+IO control command to set the blocking mode of the descriptor.
- mutable_buffer();
+ typedef implementation_defined non_blocking_io;
-[endsect]
+Implements the FIONBIO IO control command.
+[heading Example]
+
-[section:overload2 mutable_buffer::mutable_buffer (2 of 2 overloads)]
-Construct a buffer to represent a given memory range.
+ boost::asio::posix::stream_descriptor descriptor(io_service);
+ ...
+ boost::asio::descriptor_base::non_blocking_io command(true);
+ descriptor.io_control(command);
- mutable_buffer(
- void * data,
- std::size_t size);
-[endsect]
[endsect]
-[section:operator_plus_ mutable_buffer::operator+]
-
-Create a new modifiable buffer that is offset from the start of another.
-
- mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload1 operator+]``(
- const mutable_buffer & b,
- std::size_t start);
-
- mutable_buffer ``[link boost_asio.reference.mutable_buffer.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const mutable_buffer & b);
-[section:overload1 mutable_buffer::operator+ (1 of 2 overloads)]
+[section:_descriptor_base posix::descriptor_base::~descriptor_base]
-Create a new modifiable buffer that is offset from the start of another.
+Protected destructor to prevent deletion through this type.
- mutable_buffer operator+(
- const mutable_buffer & b,
- std::size_t start);
+ ~descriptor_base();
@@ -40050,47 +45210,59 @@
-[section:overload2 mutable_buffer::operator+ (2 of 2 overloads)]
+[endsect]
-Create a new modifiable buffer that is offset from the start of another.
- mutable_buffer operator+(
- std::size_t start,
- const mutable_buffer & b);
+[section:posix__stream_descriptor posix::stream_descriptor]
+Typedef for the typical usage of a stream-oriented descriptor.
+ typedef basic_stream_descriptor stream_descriptor;
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
-[endsect]
+ [
+ [[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. ]
+
+ ]
-[endsect]
+ [
-[section:mutable_buffers_1 mutable_buffers_1]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
+
+ ]
-Adapts a single modifiable buffer so that it meets the requirements of the MutableBufferSequence concept.
+ [
- class mutable_buffers_1 :
- public mutable_buffer
+ [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_descriptor is always the lowest layer. ]
+
+ ]
+ [
-[heading Types]
-[table
- [[Name][Description]]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
+ [The native representation of a descriptor. ]
+
+ ]
[
- [[link boost_asio.reference.mutable_buffers_1.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
+ [[link boost_asio.reference.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.mutable_buffers_1.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
+ [[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. ]
]
@@ -40101,96 +45273,260 @@
[[Name][Description]]
[
- [[link boost_asio.reference.mutable_buffers_1.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.assign [*assign]]]
+ [Assign an existing native descriptor to the descriptor. ]
]
[
- [[link boost_asio.reference.mutable_buffers_1.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.mutable_buffers_1.mutable_buffers_1 [*mutable_buffers_1]]]
- [Construct to represent a single modifiable buffer. ]
+ [[link boost_asio.reference.posix__basic_stream_descriptor.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
-]
-
-[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.posix__basic_stream_descriptor.basic_stream_descriptor [*basic_stream_descriptor]]]
+ [Construct a basic_stream_descriptor without opening it. ]
]
[
- [[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.posix__basic_stream_descriptor.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the descriptor. ]
]
[
- [[link boost_asio.reference.mutable_buffers_1.operator_plus_ [*operator+]]]
- [Create a new modifiable buffer that is offset from the start of another. ]
+ [[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]]
-[section:begin mutable_buffers_1::begin]
+ [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
-Get a random-access iterator to the first element.
+ [
+ [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
+
+]
+
+The posix::basic_stream_descriptor class template provides asynchronous and blocking stream-oriented descriptor functionality.
+
+
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Unsafe.
- const_iterator begin() const;
[endsect]
+[section:posix__stream_descriptor_service posix::stream_descriptor_service]
-[section:buffer_cast mutable_buffers_1::buffer_cast]
+Default service implementation for a stream descriptor.
+ class stream_descriptor_service :
+ public io_service::service
-['Inherited from mutable_buffer.]
-Cast a non-modifiable buffer to a specified pointer to POD type.
+[heading Types]
+[table
+ [[Name][Description]]
- template<
- typename ``[link boost_asio.reference.PointerToPodType PointerToPodType]``>
- PointerToPodType buffer_cast(
- const mutable_buffer & b);
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.implementation_type [*implementation_type]]]
+ [The type of a stream descriptor implementation. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.posix__stream_descriptor_service.native_type [*native_type]]]
+ [The native descriptor type. ]
+
+ ]
+]
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[section:buffer_size mutable_buffers_1::buffer_size]
+ [
+ [[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]]
-['Inherited from mutable_buffer.]
+ [
+ [[link boost_asio.reference.posix__stream_descriptor_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
-Get the number of bytes in a non-modifiable buffer.
+]
- std::size_t buffer_size(
- const mutable_buffer & b);
+[section:assign posix::stream_descriptor_service::assign]
+Assign an existing native descriptor to a stream descriptor.
-[endsect]
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const native_type & native_descriptor,
+ boost::system::error_code & ec);
-[section:const_iterator mutable_buffers_1::const_iterator]
+[endsect]
-A random-access iterator type that may be used to read elements.
- typedef const mutable_buffer * const_iterator;
+[section:async_read_some posix::stream_descriptor_service::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(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ ReadHandler descriptorr);
@@ -40198,11 +45534,17 @@
-[section:end mutable_buffers_1::end]
+[section:async_write_some posix::stream_descriptor_service::async_write_some]
-Get a random-access iterator for one past the last element.
+Start an asynchronous write.
- const_iterator end() const;
+ 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);
@@ -40210,107 +45552,80 @@
-[section:mutable_buffers_1 mutable_buffers_1::mutable_buffers_1]
+[section:cancel posix::stream_descriptor_service::cancel]
-Construct to represent a single modifiable buffer.
+Cancel all asynchronous operations associated with the descriptor.
- mutable_buffers_1(
- const mutable_buffer & b);
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
[endsect]
-[section:operator_plus_ mutable_buffers_1::operator+]
-Create a new modifiable buffer that is offset from the start of another.
+[section:close posix::stream_descriptor_service::close]
- mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload1 operator+]``(
- const mutable_buffer & b,
- std::size_t start);
+Close a stream descriptor implementation.
- mutable_buffer ``[link boost_asio.reference.mutable_buffers_1.operator_plus_.overload2 operator+]``(
- std::size_t start,
- const mutable_buffer & b);
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
-[section:overload1 mutable_buffers_1::operator+ (1 of 2 overloads)]
+[endsect]
-['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);
+[section:construct posix::stream_descriptor_service::construct]
+Construct a new stream descriptor implementation.
+ void construct(
+ implementation_type & impl);
-[endsect]
+[endsect]
-[section:overload2 mutable_buffers_1::operator+ (2 of 2 overloads)]
-['Inherited from mutable_buffer.]
+[section:destroy posix::stream_descriptor_service::destroy]
-Create a new modifiable buffer that is offset from the start of another.
+Destroy a stream descriptor implementation.
- mutable_buffer operator+(
- std::size_t start,
- const mutable_buffer & b);
+ void destroy(
+ implementation_type & impl);
[endsect]
-[endsect]
+[section:get_io_service posix::stream_descriptor_service::get_io_service]
-[section:value_type mutable_buffers_1::value_type]
-The type for each element in the list of buffers.
+['Inherited from io_service.]
- typedef mutable_buffer value_type;
+Get the io_service object that owns the service.
+ boost::asio::io_service & get_io_service();
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer. ]
- ]
-
-]
-[heading Related Functions]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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:id posix::stream_descriptor_service::id]
+
+The unique service identifier.
+
+ static boost::asio::io_service::id id;
@@ -40318,70 +45633,57 @@
-[endsect]
+[section:implementation_type posix::stream_descriptor_service::implementation_type]
-[section:null_buffers null_buffers]
+The type of a stream descriptor implementation.
-An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
+ typedef implementation_defined implementation_type;
- class null_buffers
-[heading Types]
-[table
- [[Name][Description]]
- [
+[endsect]
- [[link boost_asio.reference.null_buffers.const_iterator [*const_iterator]]]
- [A random-access iterator type that may be used to read elements. ]
-
- ]
- [
- [[link boost_asio.reference.null_buffers.value_type [*value_type]]]
- [The type for each element in the list of buffers. ]
-
- ]
+[section:io_control posix::stream_descriptor_service::io_control]
-]
+Perform an IO control command on the descriptor.
-[heading Member Functions]
-[table
- [[Name][Description]]
+ 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.null_buffers.begin [*begin]]]
- [Get a random-access iterator to the first element. ]
- ]
-
- [
- [[link boost_asio.reference.null_buffers.end [*end]]]
- [Get a random-access iterator for one past the last element. ]
- ]
-
-]
-[section:begin null_buffers::begin]
+[endsect]
-Get a random-access iterator to the first element.
- const_iterator begin() const;
+[section:io_service posix::stream_descriptor_service::io_service]
-[endsect]
+['Inherited from io_service.]
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+ boost::asio::io_service & io_service();
-[section:const_iterator null_buffers::const_iterator]
-A random-access iterator type that may be used to read elements.
- typedef const mutable_buffer * const_iterator;
+[endsect]
+
+
+
+[section:is_open posix::stream_descriptor_service::is_open]
+
+Determine whether the descriptor is open.
+ bool is_open(
+ const implementation_type & impl) const;
@@ -40389,11 +45691,12 @@
-[section:end null_buffers::end]
+[section:native posix::stream_descriptor_service::native]
-Get a random-access iterator for one past the last element.
+Get the native descriptor implementation.
- const_iterator end() const;
+ native_type native(
+ implementation_type & impl);
@@ -40401,61 +45704,41 @@
-[section:value_type null_buffers::value_type]
+[section:native_type posix::stream_descriptor_service::native_type]
-The type for each element in the list of buffers.
+The native descriptor type.
- typedef mutable_buffer value_type;
+ typedef implementation_defined native_type;
-[heading Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.mutable_buffer.mutable_buffer [*mutable_buffer]]]
- [Construct an empty buffer. ]
- ]
-
-]
-[heading Related Functions]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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:read_some posix::stream_descriptor_service::read_some]
+Read some data from the stream.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some(
+ implementation_type & impl,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
[endsect]
-[section:placeholders__bytes_transferred 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.
+[section:shutdown_service posix::stream_descriptor_service::shutdown_service]
- unspecified bytes_transferred;
+Destroy all user-defined descriptorr objects owned by the service.
+
+ void shutdown_service();
@@ -40463,11 +45746,12 @@
-[section:placeholders__error placeholders::error]
+[section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service]
-An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
+Construct a new stream descriptor service for the specified io_service.
- unspecified error;
+ stream_descriptor_service(
+ boost::asio::io_service & io_service);
@@ -40475,26 +45759,33 @@
-[section:placeholders__iterator placeholders::iterator]
+[section:write_some posix::stream_descriptor_service::write_some]
-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.
+Write the given data to the stream.
- unspecified iterator;
+ 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:posix__basic_descriptor posix::basic_descriptor]
-Provides POSIX descriptor functionality.
+[endsect]
+
+[section:raw_socket_service raw_socket_service]
+
+Default service implementation for a raw socket.
template<
- typename ``[link boost_asio.reference.DescriptorService DescriptorService]``>
- class basic_descriptor :
- public basic_io_object< DescriptorService >,
- public posix::descriptor_base
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class raw_socket_service :
+ public io_service::service
[heading Types]
@@ -40503,43 +45794,29 @@
[
- [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
+ [[link boost_asio.reference.raw_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.implementation_type [*implementation_type]]]
+ [The type of a raw socket. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.native_type [*native_type]]]
+ [The native socket type. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
- [The type of the service that will be used to provide I/O operations. ]
+ [[link boost_asio.reference.raw_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
]
@@ -40550,112 +45827,349 @@
[[Name][Description]]
[
- [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
- [Assign an existing native descriptor to the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.assign [*assign]]]
+ [Assign an existing native socket to a raw socket. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
- [Construct a basic_descriptor without opening it. ]
+ [[link boost_asio.reference.raw_socket_service.async_connect [*async_connect]]]
+ [Start an asynchronous connect. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.async_receive [*async_receive]]]
+ [Start an asynchronous receive. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
- [Close the descriptor. ]
+ [[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.posix__basic_descriptor.get_io_service [*get_io_service]]]
- [Get the io_service associated with the object. ]
+ [[link boost_asio.reference.raw_socket_service.async_send [*async_send]]]
+ [Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
+ [[link boost_asio.reference.raw_socket_service.async_send_to [*async_send_to]]]
+ [Start an asynchronous send. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
+ [[link boost_asio.reference.raw_socket_service.at_mark [*at_mark]]]
+ [Determine whether the socket is at the out-of-band data mark. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
+ [[link boost_asio.reference.raw_socket_service.available [*available]]]
+ [Determine the number of bytes available for reading. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[link boost_asio.reference.raw_socket_service.bind [*bind]]]
+ []
]
[
- [[link boost_asio.reference.posix__basic_descriptor.native [*native]]]
- [Get the native descriptor representation. ]
+ [[link boost_asio.reference.raw_socket_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the socket. ]
]
-]
-
-[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. ]
+ [[link boost_asio.reference.raw_socket_service.close [*close]]]
+ [Close a raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.connect [*connect]]]
+ [Connect the raw socket to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.construct [*construct]]]
+ [Construct a new raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.destroy [*destroy]]]
+ [Destroy a raw socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.get_io_service [*get_io_service]]]
+ [Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.get_option [*get_option]]]
+ [Get a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.is_open [*is_open]]]
+ [Determine whether the socket is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.native [*native]]]
+ [Get the native socket implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.open [*open]]]
+ []
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]]
+ [Construct a new raw socket service for the specified io_service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.receive_from [*receive_from]]]
+ [Receive raw data with the endpoint of the sender. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.send_to [*send_to]]]
+ [Send raw data to the specified endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.raw_socket_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
]
-[heading Protected Data Members]
+[heading 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. ]
+ [[link boost_asio.reference.raw_socket_service.id [*id]]]
+ [The unique service identifier. ]
]
]
-The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
+[section:assign raw_socket_service::assign]
+
+Assign an existing native socket to a raw socket.
+
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:async_connect raw_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]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+[section:async_receive raw_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 raw_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 raw_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 raw_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 raw_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 raw_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 raw_socket_service::bind]
+
+
+
+ boost::system::error_code bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:cancel raw_socket_service::cancel]
+
+Cancel all asynchronous operations associated with the socket.
+
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
-[section:assign posix::basic_descriptor::assign]
-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);
-[section:overload1 posix::basic_descriptor::assign (1 of 2 overloads)]
+[section:close raw_socket_service::close]
-Assign an existing native descriptor to the descriptor.
+Close a raw socket implementation.
- void assign(
- const native_type & native_descriptor);
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -40663,12 +46177,13 @@
-[section:overload2 posix::basic_descriptor::assign (2 of 2 overloads)]
+[section:connect raw_socket_service::connect]
-Assign an existing native descriptor to the descriptor.
+Connect the raw socket to the specified endpoint.
- boost::system::error_code assign(
- const native_type & native_descriptor,
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
boost::system::error_code & ec);
@@ -40676,111 +46191,95 @@
[endsect]
-[endsect]
-[section:basic_descriptor posix::basic_descriptor::basic_descriptor]
+[section:construct raw_socket_service::construct]
-Construct a basic_descriptor without opening it.
+Construct a new raw socket implementation.
- ``[link boost_asio.reference.posix__basic_descriptor.basic_descriptor.overload1 basic_descriptor]``(
- boost::asio::io_service & io_service);
+ void construct(
+ implementation_type & impl);
- ``[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)]
+[endsect]
-Construct a basic_descriptor without opening it.
- basic_descriptor(
- boost::asio::io_service & io_service);
+[section:destroy raw_socket_service::destroy]
-This constructor creates a descriptor without opening it.
+Destroy a raw socket implementation.
+ void destroy(
+ implementation_type & impl);
-[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. ]]
-]
+[endsect]
-[endsect]
+[section:endpoint_type raw_socket_service::endpoint_type]
+The endpoint type.
+ typedef Protocol::endpoint endpoint_type;
-[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);
+[endsect]
-This constructor creates a descriptor object to hold an existing native descriptor.
-[heading Parameters]
-
+[section:get_io_service raw_socket_service::get_io_service]
-[variablelist
-
-[[io_service][The io\_service object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
-[[native_descriptor][A native descriptor.]]
+['Inherited from io_service.]
-]
+Get the io_service object that owns the service.
-[heading Exceptions]
-
+ boost::asio::io_service & get_io_service();
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+[endsect]
-[endsect]
+[section:get_option raw_socket_service::get_option]
-[endsect]
+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;
-[section:bytes_readable posix::basic_descriptor::bytes_readable]
-['Inherited from posix::descriptor_base.]
+[endsect]
-IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined bytes_readable;
+[section:id raw_socket_service::id]
+The unique service identifier.
-Implements the FIONREAD IO control command.
+ static boost::asio::io_service::id id;
-[heading Example]
-
+
+[endsect]
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::bytes_readable command(true);
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
+[section:implementation_type raw_socket_service::implementation_type]
+
+The type of a raw socket.
+ typedef implementation_defined implementation_type;
@@ -40788,34 +46287,32 @@
[endsect]
-[section:cancel posix::basic_descriptor::cancel]
-Cancel all asynchronous operations associated with the descriptor.
+[section:io_control raw_socket_service::io_control]
- void ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload1 cancel]``();
+Perform an IO control command on the socket.
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.cancel.overload2 cancel]``(
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
boost::system::error_code & ec);
-[section: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:io_service raw_socket_service::io_service]
-[heading Exceptions]
-
+['Inherited from io_service.]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
-]
+ boost::asio::io_service & io_service();
@@ -40823,61 +46320,52 @@
-[section:overload2 posix::basic_descriptor::cancel (2 of 2 overloads)]
+[section:is_open raw_socket_service::is_open]
-Cancel all asynchronous operations associated with the descriptor.
+Determine whether the socket is open.
- boost::system::error_code cancel(
- boost::system::error_code & ec);
+ bool is_open(
+ const implementation_type & impl) const;
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:local_endpoint raw_socket_service::local_endpoint]
+Get the local endpoint.
+ endpoint_type local_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
-[endsect]
[endsect]
-[section:close posix::basic_descriptor::close]
-Close the descriptor.
- void ``[link boost_asio.reference.posix__basic_descriptor.close.overload1 close]``();
+[section:native raw_socket_service::native]
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.close.overload2 close]``(
- boost::system::error_code & ec);
+Get the native socket implementation.
+ native_type native(
+ implementation_type & impl);
-[section:overload1 posix::basic_descriptor::close (1 of 2 overloads)]
-Close the descriptor.
- void close();
+[endsect]
-This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the boost::asio::error::operation\_aborted error.
+[section:native_type raw_socket_service::native_type]
-[heading Exceptions]
-
+The native socket type.
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+ typedef implementation_defined native_type;
-]
@@ -40885,65 +46373,77 @@
-[section:overload2 posix::basic_descriptor::close (2 of 2 overloads)]
+[section:open raw_socket_service::open]
-Close the descriptor.
- boost::system::error_code close(
+
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:protocol_type raw_socket_service::protocol_type]
+The protocol type.
+
+ typedef Protocol protocol_type;
-[endsect]
[endsect]
-[section:get_io_service posix::basic_descriptor::get_io_service]
+[section:raw_socket_service raw_socket_service::raw_socket_service]
-['Inherited from basic_io_object.]
+Construct a new raw socket service for the specified io_service.
-Get the io_service associated with the object.
+ raw_socket_service(
+ boost::asio::io_service & io_service);
- 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.
+[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 raw_socket_service::receive]
+Receive some data from the peer.
-[endsect]
+ 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);
-[section:implementation posix::basic_descriptor::implementation]
+[endsect]
-['Inherited from basic_io_object.]
-The underlying implementation of the I/O object.
+[section:receive_from raw_socket_service::receive_from]
- implementation_type implementation;
+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);
@@ -40951,166 +46451,227 @@
-[section:implementation_type posix::basic_descriptor::implementation_type]
+[section:remote_endpoint raw_socket_service::remote_endpoint]
+Get the remote endpoint.
-['Inherited from basic_io_object.]
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
-The underlying implementation type of I/O object.
- typedef service_type::implementation_type implementation_type;
+[endsect]
+
+
+
+[section:send raw_socket_service::send]
+
+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:io_control posix::basic_descriptor::io_control]
-Perform an IO control command on the descriptor.
+[section:send_to raw_socket_service::send_to]
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload1 io_control]``(
- IoControlCommand & command);
+Send raw data to the specified endpoint.
template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code ``[link boost_asio.reference.posix__basic_descriptor.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ typename ``[link boost_asio.reference.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:overload1 posix::basic_descriptor::io_control (1 of 2 overloads)]
-Perform an IO control command on the descriptor.
+[endsect]
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- void io_control(
- IoControlCommand & command);
-This function is used to execute an IO control command on the descriptor.
+[section:set_option raw_socket_service::set_option]
+Set a socket option.
-[heading Parameters]
-
+ 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);
-[variablelist
-
-[[command][The IO control command to be performed on the descriptor.]]
-]
-[heading Exceptions]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
-
-Getting the number of bytes ready to read:
+[section:shutdown raw_socket_service::shutdown]
- 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();
+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]
-[endsect]
+[section:shutdown_service raw_socket_service::shutdown_service]
+Destroy all user-defined handler objects owned by the service.
-[section:overload2 posix::basic_descriptor::io_control (2 of 2 overloads)]
+ void shutdown_service();
-Perform an IO control command on the descriptor.
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- 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]
-
+[endsect]
-[variablelist
-
-[[command][The IO control command to be performed on the descriptor.]]
+[section:read read]
-[[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]``>
+ std::size_t ``[link boost_asio.reference.read.overload1 read]``(
+ SyncReadStream & s,
+ const MutableBufferSequence & buffers);
-[heading Example]
-
-Getting the number of bytes ready to read:
+ 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);
- 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();
+ 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);
+ 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);
+[section:overload1 read (1 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 ``[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:io_service posix::basic_descriptor::io_service]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
-['Inherited from basic_io_object.]
+* An error occurred.
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+This operation is implemented in terms of one or more calls to the stream's read\_some function.
- boost::asio::io_service & io_service();
+[heading Parameters]
+
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
+]
[heading Return Value]
-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.]]
+]
+[heading Example]
+
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
-[endsect]
+ boost::asio::read(s, boost::asio::buffer(data, size));
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::read(
+ s, buffers,
+ boost::asio::transfer_all());
-[section:is_open posix::basic_descriptor::is_open]
-Determine whether the descriptor is open.
- bool is_open() const;
@@ -41118,504 +46679,495 @@
-[section:lowest_layer posix::basic_descriptor::lowest_layer]
+[section:overload2 read (2 of 6 overloads)]
-Get a reference to the lowest layer.
+Attempt to read a certain amount of data from a stream before returning.
- lowest_layer_type & lowest_layer();
+ 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 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.
+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:
-[heading Return Value]
-
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+* 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.
-[endsect]
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
-[section:lowest_layer_type posix::basic_descriptor::lowest_layer_type]
+[[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.
-A basic_descriptor is always the lowest layer.
+ std::size_t bytes_transferred // Number of bytes transferred
+ // so far.
+ );
- typedef basic_descriptor< DescriptorService > lowest_layer_type;
+``
+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 Types]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+The number of bytes transferred.
- [
+[heading Exceptions]
+
- [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
+[variablelist
- ]
+[[boost::system::system_error][Thrown on failure.]]
- [
+]
- [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
+[heading Example]
- ]
+To read into a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
- [
+ boost::asio::read(s, boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32));
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
-
- ]
- [
+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.
- [[link boost_asio.reference.posix__basic_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
-
- ]
- [
- [[link boost_asio.reference.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
-
- ]
+[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. ]
-
- ]
-]
+[section:overload3 read (3 of 6 overloads)]
-[heading Member Functions]
-[table
- [[Name][Description]]
+Attempt to read a certain amount of data from a stream before returning.
- [
- [[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. ]
- ]
-
-]
+ 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);
-[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. ]
- ]
-
-]
+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:
-[heading Protected Data Members]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
- [
- [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
- [The service associated with the 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.
-The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
+[heading Parameters]
+
-[heading Thread Safety]
+[variablelist
-[*Distinct] [*objects:] Safe.
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[*Shared] [*objects:] Unsafe.
+[[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.]]
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
-[section:native posix::basic_descriptor::native]
-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.
+[section:overload4 read (4 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>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b);
-[section:native_type posix::basic_descriptor::native_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:
-The native representation of a descriptor.
- typedef DescriptorService::native_type native_type;
+* An error occurred.
+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.]]
+[[b][The basic\_streambuf object into which the data will be read.]]
+]
-[section:non_blocking_io posix::basic_descriptor::non_blocking_io]
+[heading Return Value]
+
+The number of bytes transferred.
+[heading Exceptions]
+
-['Inherited from posix::descriptor_base.]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-IO control command to set the blocking mode of the descriptor.
+]
- typedef implementation_defined non_blocking_io;
+[heading Remarks]
+
+This overload is equivalent to calling:
+ boost::asio::read(
+ s, b,
+ boost::asio::transfer_all());
-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:overload5 read (5 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 Allocator,
+ typename CompletionCondition>
+ std::size_t read(
+ SyncReadStream & s,
+ basic_streambuf< Allocator > & b,
+ 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:
-[section:service posix::basic_descriptor::service]
+* 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.
-['Inherited from basic_io_object.]
-The service associated with the I/O object.
+[heading Parameters]
+
- service_type & service;
+[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.]]
+[[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.
-[endsect]
+ 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:service_type posix::basic_descriptor::service_type]
+[heading Return Value]
+
+The number of bytes transferred.
+[heading Exceptions]
+
-['Inherited from basic_io_object.]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-The type of the service that will be used to provide I/O operations.
+]
- typedef DescriptorService service_type;
+[endsect]
-[endsect]
+[section:overload6 read (6 of 6 overloads)]
+Attempt to read a certain amount of data from a stream before returning.
-[section:_basic_descriptor posix::basic_descriptor::~basic_descriptor]
+ 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);
-Protected destructor to prevent deletion through this type.
- ~basic_descriptor();
+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 completion_condition function object returns true.
-[endsect]
+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.]]
-[section:posix__basic_stream_descriptor posix::basic_stream_descriptor]
+[[b][The basic\_streambuf object into which the data will be read.]]
-Provides stream-oriented descriptor functionality.
+[[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.
- template<
- typename ``[link boost_asio.reference.StreamDescriptorService StreamDescriptorService]`` = stream_descriptor_service>
- class basic_stream_descriptor :
- public posix::basic_descriptor< StreamDescriptorService >
+ 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 Types]
-[table
- [[Name][Description]]
+[[ec][Set to indicate what error occurred, if any.]]
- [
+]
- [[link boost_asio.reference.posix__basic_stream_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
+[heading Return Value]
+
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
-
- ]
+[section:read_at read_at]
- [
+Attempt to read a certain amount of data at the specified offset before returning.
- [[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. ]
-
- ]
+ 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.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);
- [[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. ]
-
- ]
+ 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);
-]
+ 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);
-[heading Member Functions]
-[table
- [[Name][Description]]
+ 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);
- [
- [[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. ]
- ]
-
-]
+ 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);
-[heading Protected Data Members]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.implementation [*implementation]]]
- [The underlying implementation of the I/O object. ]
- ]
+[section:overload1 read_at (1 of 6 overloads)]
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.service [*service]]]
- [The service associated with the I/O object. ]
- ]
+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);
-The posix::basic_stream_descriptor class template provides asynchronous and blocking stream-oriented descriptor functionality.
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+* An error occurred.
-[section:assign posix::basic_stream_descriptor::assign]
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-Assign an existing native descriptor to the descriptor.
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.assign.overload1 assign]``(
- const native_type & native_descriptor);
+[heading Parameters]
+
- 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);
+[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.]]
-[section:overload1 posix::basic_stream_descriptor::assign (1 of 2 overloads)]
+[[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.]]
+]
-['Inherited from posix::basic_descriptor.]
+[heading Return Value]
+
+The number of bytes transferred.
-Assign an existing native descriptor to the descriptor.
+[heading Exceptions]
+
- void assign(
- const native_type & native_descriptor);
+[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:
-[endsect]
+ boost::asio::read_at(d, 42, boost::asio::buffer(data, size));
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-[section:overload2 posix::basic_stream_descriptor::assign (2 of 2 overloads)]
+[heading Remarks]
+
+This overload is equivalent to calling:
+ boost::asio::read_at(
+ d, 42, buffers,
+ boost::asio::transfer_all());
-['Inherited from posix::basic_descriptor.]
-Assign an existing native descriptor to the descriptor.
- boost::system::error_code assign(
- const native_type & native_descriptor,
- boost::system::error_code & ec);
[endsect]
-[endsect]
-
-[section:async_read_some posix::basic_stream_descriptor::async_read_some]
+[section:overload2 read_at (2 of 6 overloads)]
-Start an asynchronous read.
+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 ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_read_some(
+ typename CompletionCondition>
+ std::size_t read_at(
+ SyncRandomAccessReadDevice & d,
+ boost::uint64_t offset,
const MutableBufferSequence & buffers,
- ReadHandler handler);
+ CompletionCondition completion_condition);
-This function is used to asynchronously read data from the stream descriptor. The function call always returns immediately.
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
+
+
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
[heading Parameters]
@@ -41623,31 +47175,47 @@
[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.]]
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
-[[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:
+[[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:
``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes read.
+ 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
);
``
-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 device's read\_some\_at function are required.]]
]
-[heading Remarks]
+[heading Return Value]
-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.
+The number of bytes transferred.
+
+[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:
- descriptor.async_read_some(boost::asio::buffer(data, size), handler);
+ boost::asio::read_at(d, 42, boost::asio::buffer(data, size),
+ boost::asio::transfer_at_least(32));
See the
@@ -41659,19 +47227,30 @@
-[section:async_write_some posix::basic_stream_descriptor::async_write_some]
+[section:overload3 read_at (3 of 6 overloads)]
-Start an asynchronous write.
+Attempt to read a certain amount of data at the specified offset before returning.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
+ typename ``[link boost_asio.reference.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);
-This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
+
+
+* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+
+* The completion_condition function object returns true.
+
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
[heading Parameters]
@@ -41679,89 +47258,124 @@
[variablelist
-[[buffers][One or more data buffers to be written to the descriptor. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
-[[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:
+[[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:
``
- void handler(
- const boost::system::error_code& error, // Result of operation.
- std::size_t bytes_transferred // Number of bytes written.
+ 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.
);
``
-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 device's read\_some\_at function are required.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
]
-[heading Remarks]
+[heading Return Value]
-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.
+The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
-[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:overload4 read_at (4 of 6 overloads)]
+Attempt to read a certain amount of data at the specified offset before returning.
-[endsect]
+ 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);
-[section:basic_stream_descriptor posix::basic_stream_descriptor::basic_stream_descriptor]
+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:
-Construct a basic_stream_descriptor without opening it.
- ``[link boost_asio.reference.posix__basic_stream_descriptor.basic_stream_descriptor.overload1 basic_stream_descriptor]``(
- boost::asio::io_service & io_service);
+* An error occurred.
- ``[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);
+This operation is implemented in terms of one or more calls to the device's read\_some\_at function.
-[section:overload1 posix::basic_stream_descriptor::basic_stream_descriptor (1 of 2 overloads)]
+[heading Parameters]
+
-Construct a basic_stream_descriptor without opening it.
+[variablelist
+
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
- basic_stream_descriptor(
- boost::asio::io_service & io_service);
+[[offset][The offset at which the data will be read.]]
+[[b][The basic\_streambuf object into which the data will be read.]]
-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 Return Value]
+
+The number of bytes transferred.
-[heading Parameters]
+[heading Exceptions]
[variablelist
-[[io_service][The io\_service object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[heading Remarks]
+
+This overload is equivalent to calling:
+
+ boost::asio::read_at(
+ d, 42, b,
+ boost::asio::transfer_all());
+
+
+
+
[endsect]
-[section:overload2 posix::basic_stream_descriptor::basic_stream_descriptor (2 of 2 overloads)]
+[section:overload5 read_at (5 of 6 overloads)]
-Construct a basic_stream_descriptor on an existing native descriptor.
+Attempt to read a certain amount of data at the specified offset before returning.
- basic_stream_descriptor(
- boost::asio::io_service & io_service,
- const native_type & native_descriptor);
+ 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);
-This constructor creates a stream descriptor object to hold an existing native descriptor.
+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]
@@ -41769,12 +47383,31 @@
[variablelist
-[[io_service][The io\_service object that the stream descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.]]
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
-[[native_descriptor][The new underlying descriptor implementation.]]
+[[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]
+
+The number of bytes transferred.
+
[heading Exceptions]
@@ -41789,91 +47422,237 @@
[endsect]
-[endsect]
+[section:overload6 read_at (6 of 6 overloads)]
-[section:bytes_readable posix::basic_stream_descriptor::bytes_readable]
+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,
+ boost::system::error_code & ec);
-['Inherited from posix::descriptor_base.]
-IO control command to get the amount of data that can be read without blocking.
+This function is used to read a certain number of bytes of data from a random access device at the specified offset. The call will block until one of the following conditions is true:
- typedef implementation_defined bytes_readable;
+* 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.
-Implements the FIONREAD IO control command.
+[heading Parameters]
+
-[heading Example]
+[variablelist
+[[d][The device from which the data is to be read. The type must support the SyncRandomAccessReadDevice concept.]]
+[[offset][The offset at which the data will be read.]]
- boost::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();
+[[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.]]
+]
+[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:cancel posix::basic_stream_descriptor::cancel]
+[endsect]
-Cancel all asynchronous operations associated with the descriptor.
+[section:read_until read_until]
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload1 cancel]``();
+Read data into a streambuf until a delimiter is encountered.
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.cancel.overload2 cancel]``(
+ 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);
+
+ 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);
-[section:overload1 posix::basic_stream_descriptor::cancel (1 of 2 overloads)]
+ 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);
-['Inherited from posix::basic_descriptor.]
+ 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);
-Cancel all asynchronous operations associated with the descriptor.
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.MatchCondition 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);
- void cancel();
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.MatchCondition 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);
-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:overload1 read_until (1 of 8 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);
+
+
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
+
+
+* The get area of the streambuf contains the specified delimiter.
+* An error occurred.
+
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains the delimiter, the function returns immediately.
+
+
+[heading Parameters]
+
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[b][A streambuf object into which the data will be read.]]
+
+[[delim][The delimiter character.]]
+
+]
+
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the delimiter.
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[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);
-[endsect]
-[section:overload2 posix::basic_stream_descriptor::cancel (2 of 2 overloads)]
-['Inherited from posix::basic_descriptor.]
+[endsect]
-Cancel all asynchronous operations associated with the descriptor.
- boost::system::error_code cancel(
+
+[section:overload2 read_until (2 of 8 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);
-This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
+This function is used to 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]
@@ -41881,67 +47660,116 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any. ]]
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[b][A streambuf object into which the data will be read.]]
+
+[[delim][The delimiter character.]]
+
+[[ec][Set to indicate what error occurred, if any.]]
]
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the delimiter. Returns 0 if an error occurred.
+
[endsect]
-[endsect]
-[section:close posix::basic_stream_descriptor::close]
+[section:overload3 read_until (3 of 8 overloads)]
-Close the descriptor.
+Read data into a streambuf until a delimiter is encountered.
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload1 close]``();
+ 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 ``[link boost_asio.reference.posix__basic_stream_descriptor.close.overload2 close]``(
- boost::system::error_code & ec);
+This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
-[section:overload1 posix::basic_stream_descriptor::close (1 of 2 overloads)]
+* The get area of the streambuf contains the specified delimiter.
-['Inherited from posix::basic_descriptor.]
+* An error occurred.
-Close the descriptor.
+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.
- void close();
+[heading Parameters]
+
-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.
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+
+[[b][A streambuf object into which the data will be read.]]
+
+[[delim][The delimiter string.]]
+
+]
+[heading Return Value]
+
+The number of bytes in the streambuf's get area up to and including the delimiter.
[heading Exceptions]
[variablelist
-[[boost::system::system_error][Thrown on failure. ]]
+[[boost::system::system_error][Thrown on failure.]]
]
+[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);
-[endsect]
-[section:overload2 posix::basic_stream_descriptor::close (2 of 2 overloads)]
+
+[endsect]
-['Inherited from posix::basic_descriptor.]
-Close the descriptor.
+[section:overload4 read_until (4 of 8 overloads)]
- boost::system::error_code close(
+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,
+ const std::string & delim,
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.
+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]
@@ -41949,64 +47777,86 @@
[variablelist
-[[ec][Set to indicate what error occurred, if any. ]]
-
-]
-
-
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[endsect]
+[[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.]]
+]
-[section:get_io_service posix::basic_stream_descriptor::get_io_service]
+[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.
-['Inherited from basic_io_object.]
-Get the io_service associated with the object.
+[endsect]
- 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.
+[section:overload5 read_until (5 of 8 overloads)]
+Read data into a streambuf until a regular expression is located.
-[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.
+ 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);
+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.
-[section:implementation posix::basic_stream_descriptor::implementation]
+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.
-['Inherited from basic_io_object.]
+[heading Parameters]
+
-The underlying implementation of the I/O object.
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
- implementation_type implementation;
+[[b][A streambuf object into which the data will be read.]]
+[[expr][The regular expression.]]
+]
-[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.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
-[section:implementation_type posix::basic_stream_descriptor::implementation_type]
+]
+[heading Example]
+
+To read data into a streambuf until a CR-LF sequence is encountered:
-['Inherited from basic_io_object.]
+ 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);
-The underlying implementation type of I/O object.
- typedef service_type::implementation_type implementation_type;
@@ -42014,30 +47864,29 @@
[endsect]
-[section:io_control posix::basic_stream_descriptor::io_control]
-Perform an IO control command on the descriptor.
+[section:overload6 read_until (6 of 8 overloads)]
- void ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload1 io_control]``(
- IoControlCommand & command);
+Read data into a streambuf until a regular expression is located.
- boost::system::error_code ``[link boost_asio.reference.posix__basic_stream_descriptor.io_control.overload2 io_control]``(
- IoControlCommand & command,
+ 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);
-[section:overload1 posix::basic_stream_descriptor::io_control (1 of 2 overloads)]
-
-
-['Inherited from posix::basic_descriptor.]
+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:
-Perform an IO control command on the descriptor.
- void io_control(
- IoControlCommand & command);
+* A substring of the streambuf's get area matches the regular expression.
+* An error occurred.
-This function is used to execute an IO control command on the descriptor.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the streambuf's get area already contains data that matches the regular expression, the function returns immediately.
[heading Parameters]
@@ -42045,51 +47894,49 @@
[variablelist
-[[command][The IO control command to be performed on the descriptor.]]
+[[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 Exceptions]
-
+[[expr][The regular expression.]]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+[[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;
- descriptor.io_control(command);
- std::size_t bytes_readable = command.get();
-
+[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.
+[endsect]
-[endsect]
+[section:overload7 read_until (7 of 8 overloads)]
+Read data into a streambuf until a function object indicates a match.
-[section:overload2 posix::basic_stream_descriptor::io_control (2 of 2 overloads)]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.MatchCondition 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);
-['Inherited from posix::basic_descriptor.]
+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:
-Perform an IO control command on the descriptor.
- boost::system::error_code io_control(
- IoControlCommand & command,
- boost::system::error_code & ec);
+* The match condition function object returns a std::pair where the second element evaluates to true.
+* An error occurred.
-This function is used to execute an IO control command on the descriptor.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
[heading Parameters]
@@ -42097,54 +47944,95 @@
[variablelist
-[[command][The IO control command to be performed on the descriptor.]]
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[[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);
-[heading Example]
-
-Getting the number of bytes ready to read:
+``
+where iterator represents the type:
+``
+ buffers_iterator<basic_streambuf<Allocator>::const_buffers_type>
- 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();
+``
+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.
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
+]
-[endsect]
+[heading Remarks]
+
+The default implementation of the is_match_condition type trait evaluates to true for function pointers and function objects with a result\_type typedef. It must be specialised for other user-defined function objects.
+[heading Examples]
+
+To read data into a streambuf until whitespace is encountered:
-[endsect]
+ typedef boost::asio::buffers_iterator<
+ boost::asio::streambuf::const_buffers_type> iterator;
+ std::pair<iterator, bool>
+ match_whitespace(iterator begin, iterator end)
+ {
+ iterator i = begin;
+ while (i != end)
+ if (std::isspace(*i++))
+ return std::make_pair(i, true);
+ return std::make_pair(i, false);
+ }
+ ...
+ boost::asio::streambuf b;
+ boost::asio::read_until(s, b, match_whitespace);
-[section:io_service posix::basic_stream_descriptor::io_service]
-['Inherited from basic_io_object.]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+To read data into a streambuf until a matching character is found:
- boost::asio::io_service & io_service();
+ 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);
+ }
-This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
+ 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'));
-[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.
@@ -42152,52 +48040,78 @@
-[section:is_open posix::basic_stream_descriptor::is_open]
+[section:overload8 read_until (8 of 8 overloads)]
+Read data into a streambuf until a function object indicates a match.
-['Inherited from posix::basic_descriptor.]
+ template<
+ typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
+ typename Allocator,
+ typename ``[link boost_asio.reference.MatchCondition 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);
-Determine whether the descriptor is open.
- bool is_open() const;
+This function is used to read data into the specified streambuf until a user-defined match condition function object, when applied to the data contained in the streambuf, indicates a successful match. The call will block until one of the following conditions is true:
+* The match condition function object returns a std::pair where the second element evaluates to true.
-[endsect]
+* An error occurred.
+This operation is implemented in terms of zero or more calls to the stream's read\_some function. If the match condition function object already indicates a match, the function returns immediately.
-[section:lowest_layer posix::basic_stream_descriptor::lowest_layer]
+[heading Parameters]
+
+[variablelist
+
+[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-['Inherited from posix::basic_descriptor.]
+[[b][A streambuf object into which the data will be read.]]
-Get a reference to the lowest layer.
+[[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);
- lowest_layer_type & lowest_layer();
+``
+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.]]
-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.
+[[ec][Set to indicate what error occurred, if any.]]
+]
[heading Return Value]
-A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
+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]
+
+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]
-
-[section:lowest_layer_type posix::basic_stream_descriptor::lowest_layer_type]
+[endsect]
-['Inherited from posix::basic_descriptor.]
+[section:serial_port serial_port]
-A basic_descriptor is always the lowest layer.
+Typedef for the typical usage of a serial port.
- typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
+ typedef basic_serial_port serial_port;
[heading Types]
@@ -42206,42 +48120,28 @@
[
- [[link boost_asio.reference.posix__basic_descriptor.bytes_readable [*bytes_readable]]]
- [IO control command to get the amount of data that can be read without blocking. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.posix__basic_descriptor.implementation_type [*implementation_type]]]
+ [[link boost_asio.reference.basic_serial_port.implementation_type [*implementation_type]]]
[The underlying implementation type of I/O object. ]
]
[
- [[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. ]
+ [[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.posix__basic_descriptor.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [[link boost_asio.reference.basic_serial_port.native_type [*native_type]]]
+ [The native representation of a serial port. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.service_type [*service_type]]]
+ [[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. ]
]
@@ -42253,64 +48153,88 @@
[[Name][Description]]
[
- [[link boost_asio.reference.posix__basic_descriptor.assign [*assign]]]
- [Assign an existing native descriptor to the descriptor. ]
+ [[link boost_asio.reference.basic_serial_port.assign [*assign]]]
+ [Assign an existing native serial port to the serial port. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.basic_descriptor [*basic_descriptor]]]
- [Construct a basic_descriptor without opening it. ]
+ [[link boost_asio.reference.basic_serial_port.async_read_some [*async_read_some]]]
+ [Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the descriptor. ]
+ [[link boost_asio.reference.basic_serial_port.async_write_some [*async_write_some]]]
+ [Start an asynchronous write. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.close [*close]]]
- [Close the descriptor. ]
+ [[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.posix__basic_descriptor.get_io_service [*get_io_service]]]
+ [[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.posix__basic_descriptor.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
+ [[link boost_asio.reference.basic_serial_port.get_option [*get_option]]]
+ [Get an option from the serial port. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.io_service [*io_service]]]
+ [[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.posix__basic_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
+ [[link boost_asio.reference.basic_serial_port.is_open [*is_open]]]
+ [Determine whether the serial port is open. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.basic_serial_port.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. ]
+ [[link boost_asio.reference.basic_serial_port.native [*native]]]
+ [Get the native serial port 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. ]
+ [[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. ]
]
]
@@ -42320,18 +48244,18 @@
[[Name][Description]]
[
- [[link boost_asio.reference.posix__basic_descriptor.implementation [*implementation]]]
+ [[link boost_asio.reference.basic_serial_port.implementation [*implementation]]]
[The underlying implementation of the I/O object. ]
]
[
- [[link boost_asio.reference.posix__basic_descriptor.service [*service]]]
+ [[link boost_asio.reference.basic_serial_port.service [*service]]]
[The service associated with the I/O object. ]
]
]
-The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.
+The basic_serial_port class template provides functionality that is common to all serial ports.
[heading Thread Safety]
@@ -42346,134 +48270,162 @@
[endsect]
+[section:serial_port_base serial_port_base]
-[section:native posix::basic_stream_descriptor::native]
+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.
+ class serial_port_base
-['Inherited from posix::basic_descriptor.]
-Get the native descriptor representation.
+[heading Types]
+[table
+ [[Name][Description]]
- native_type native();
+ [
+ [[link boost_asio.reference.serial_port_base__baud_rate [*baud_rate]]]
+ [Serial port option to permit changing the baud rate. ]
+
+ ]
-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.
+ [
+ [[link boost_asio.reference.serial_port_base__character_size [*character_size]]]
+ [Serial port option to permit changing the character size. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control [*flow_control]]]
+ [Serial port option to permit changing the flow control. ]
+
+ ]
+ [
-[section:native_type posix::basic_stream_descriptor::native_type]
+ [[link boost_asio.reference.serial_port_base__parity [*parity]]]
+ [Serial port option to permit changing the parity. ]
+
+ ]
-The native representation of a descriptor.
+ [
- typedef StreamDescriptorService::native_type native_type;
+ [[link boost_asio.reference.serial_port_base__stop_bits [*stop_bits]]]
+ [Serial port option to permit changing the number of stop bits. ]
+
+ ]
+]
+[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. ]
+ ]
+
+]
-[endsect]
+[section:_serial_port_base serial_port_base::~serial_port_base]
+Protected destructor to prevent deletion through this type.
-[section:non_blocking_io posix::basic_stream_descriptor::non_blocking_io]
+ ~serial_port_base();
-['Inherited from posix::descriptor_base.]
-IO control command to set the blocking mode of the descriptor.
+[endsect]
+
- typedef implementation_defined non_blocking_io;
+[endsect]
+[section:serial_port_base__baud_rate serial_port_base::baud_rate]
-Implements the FIONBIO IO control command.
+Serial port option to permit changing the baud rate.
+ class baud_rate
-[heading Example]
+
+[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]]]
+ []
+ ]
+]
+Implements changing the baud rate for a given serial port.
- boost::asio::posix::stream_descriptor descriptor(io_service);
- ...
- boost::asio::descriptor_base::non_blocking_io command(true);
- descriptor.io_control(command);
+[section:baud_rate serial_port_base::baud_rate::baud_rate]
+ baud_rate(
+ unsigned int rate = 0);
+
[endsect]
-[section:read_some posix::basic_stream_descriptor::read_some]
-Read some data from the descriptor.
+[section:load serial_port_base::baud_rate::load]
- 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);
- 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);
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
-[section:overload1 posix::basic_stream_descriptor::read_some (1 of 2 overloads)]
-Read some data from the descriptor.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+[endsect]
-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.
+[section:store serial_port_base::baud_rate::store]
-[heading Parameters]
-
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read.]]
-]
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
-[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:value serial_port_base::baud_rate::value]
- descriptor.read_some(boost::asio::buffer(data, size));
-See the
-[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+ unsigned int value() const;
@@ -42481,56 +48433,64 @@
-[section:overload2 posix::basic_stream_descriptor::read_some (2 of 2 overloads)]
-
-Read some data from the descriptor.
+[endsect]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:serial_port_base__character_size serial_port_base::character_size]
+Serial port option to permit changing the character size.
-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.
+ class character_size
-[heading Parameters]
-
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+ [[link boost_asio.reference.serial_port_base__character_size.character_size [*character_size]]]
+ []
+ ]
-[[buffers][One or more buffers into which the data will be read.]]
+ [
+ [[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]]]
+ []
+ ]
+
+]
-[[ec][Set to indicate what error occurred, if any.]]
+Implements changing the character size for a given serial port.
-]
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
+[section:character_size serial_port_base::character_size::character_size]
-[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.
+ character_size(
+ unsigned int t = 8);
-[endsect]
[endsect]
-[section:service posix::basic_stream_descriptor::service]
+[section:load serial_port_base::character_size::load]
-['Inherited from basic_io_object.]
-The service associated with the I/O object.
- service_type & service;
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
@@ -42538,87 +48498,89 @@
-[section:service_type posix::basic_stream_descriptor::service_type]
-
-
-['Inherited from basic_io_object.]
+[section:store serial_port_base::character_size::store]
-The type of the service that will be used to provide I/O operations.
- typedef StreamDescriptorService service_type;
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
[endsect]
-[section:write_some posix::basic_stream_descriptor::write_some]
-Write some data to the descriptor.
+[section:value serial_port_base::character_size::value]
- 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);
+ unsigned int value() const;
-[section:overload1 posix::basic_stream_descriptor::write_some (1 of 2 overloads)]
-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.
+[endsect]
-[heading Parameters]
-
+[section:serial_port_base__flow_control serial_port_base::flow_control]
-[variablelist
-
-[[buffers][One or more data buffers to be written to the descriptor.]]
+Serial port option to permit changing the flow control.
-]
+ class flow_control
-[heading Return Value]
-
-The number of bytes written.
-[heading Exceptions]
-
+[heading Types]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+
+ [[link boost_asio.reference.serial_port_base__flow_control.type [*type]]]
+ []
-[[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 Member Functions]
+[table
+ [[Name][Description]]
-[heading Example]
+ [
+ [[link boost_asio.reference.serial_port_base__flow_control.flow_control [*flow_control]]]
+ []
+ ]
-To write a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+ [
+ [[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]]]
+ []
+ ]
+
+]
- descriptor.write_some(boost::asio::buffer(data, size));
+Implements changing the flow control for a given serial port.
-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:flow_control serial_port_base::flow_control::flow_control]
+
+
+
+ flow_control(
+ type t = none);
@@ -42626,55 +48588,85 @@
-[section:overload2 posix::basic_stream_descriptor::write_some (2 of 2 overloads)]
+[section:load serial_port_base::flow_control::load]
-Write some data to the descriptor.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
+
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
boost::system::error_code & ec);
-This function is used to write data to the stream descriptor. The function call will block until one or more bytes of the data has been written successfully, or until an error occurs.
+[endsect]
-[heading Parameters]
-
+
+[section:store serial_port_base::flow_control::store]
+
+
+
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+
+[section:type serial_port_base::flow_control::type]
+
+
+
+ enum type
+
+[heading Values]
[variablelist
-
-[[buffers][One or more data buffers to be written to the descriptor.]]
-[[ec][Set to indicate what error occurred, if any.]]
+ [
+ [none]
+ []
+ ]
+
+ [
+ [software]
+ []
+ ]
+
+ [
+ [hardware]
+ []
+ ]
]
-[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]
+
+
+
+[section:value serial_port_base::flow_control::value]
+
+ type value() const;
-[endsect]
[endsect]
+
[endsect]
-[section:posix__descriptor_base posix::descriptor_base]
+[section:serial_port_base__parity serial_port_base::parity]
-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.
+Serial port option to permit changing the parity.
- class descriptor_base
+ class parity
[heading Types]
@@ -42683,96 +48675,108 @@
[
- [[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. ]
-
- ]
-
- [
-
- [[link boost_asio.reference.posix__descriptor_base.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the descriptor. ]
+ [[link boost_asio.reference.serial_port_base__parity.type [*type]]]
+ []
]
]
-[heading Protected Member Functions]
+[heading Member Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.posix__descriptor_base._descriptor_base [*~descriptor_base]]]
- [Protected destructor to prevent deletion through this type. ]
+ [[link boost_asio.reference.serial_port_base__parity.load [*load]]]
+ []
+ ]
+
+ [
+ [[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]]]
+ []
]
]
+Implements changing the parity for a given serial port.
-[section:bytes_readable posix::descriptor_base::bytes_readable]
-
-IO control command to get the amount of data that can be read without blocking.
-
- typedef implementation_defined bytes_readable;
+[section:load serial_port_base::parity::load]
-Implements the FIONREAD IO control command.
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
-[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();
+[endsect]
+[section:parity serial_port_base::parity::parity]
-[endsect]
+ parity(
+ type t = none);
-[section:non_blocking_io posix::descriptor_base::non_blocking_io]
+[endsect]
-IO control command to set the blocking mode of the descriptor.
- typedef implementation_defined non_blocking_io;
+[section:store serial_port_base::parity::store]
-Implements the FIONBIO IO control command.
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
-[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:type serial_port_base::parity::type]
-[endsect]
+ enum type
+[heading Values]
+[variablelist
+ [
+ [none]
+ []
+ ]
-[section:_descriptor_base posix::descriptor_base::~descriptor_base]
+ [
+ [odd]
+ []
+ ]
-Protected destructor to prevent deletion through this type.
+ [
+ [even]
+ []
+ ]
- ~descriptor_base();
+]
@@ -42780,59 +48784,35 @@
-[endsect]
-
-
-[section:posix__stream_descriptor posix::stream_descriptor]
+[section:value serial_port_base::parity::value]
-Typedef for the typical usage of a stream-oriented descriptor.
- typedef basic_stream_descriptor stream_descriptor;
+ type value() const;
-[heading Types]
-[table
- [[Name][Description]]
- [
- [[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. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.posix__basic_stream_descriptor.implementation_type [*implementation_type]]]
- [The underlying implementation type of I/O object. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer_type [*lowest_layer_type]]]
- [A basic_descriptor is always the lowest layer. ]
-
- ]
+[section:serial_port_base__stop_bits serial_port_base::stop_bits]
- [
+Serial port option to permit changing the number of stop bits.
- [[link boost_asio.reference.posix__basic_stream_descriptor.native_type [*native_type]]]
- [The native representation of a descriptor. ]
-
- ]
+ class stop_bits
- [
- [[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 Types]
+[table
+ [[Name][Description]]
[
- [[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. ]
+ [[link boost_asio.reference.serial_port_base__stop_bits.type [*type]]]
+ []
]
@@ -42843,113 +48823,122 @@
[[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.serial_port_base__stop_bits.load [*load]]]
+ []
]
[
- [[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.serial_port_base__stop_bits.stop_bits [*stop_bits]]]
+ []
]
[
- [[link boost_asio.reference.posix__basic_stream_descriptor.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
+ [[link boost_asio.reference.serial_port_base__stop_bits.store [*store]]]
+ []
]
[
- [[link boost_asio.reference.posix__basic_stream_descriptor.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[link boost_asio.reference.serial_port_base__stop_bits.value [*value]]]
+ []
]
+]
+
+Implements changing the number of stop bits for a given serial port.
+
+
+[section:load serial_port_base::stop_bits::load]
+
+
+
+ boost::system::error_code load(
+ const BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:stop_bits serial_port_base::stop_bits::stop_bits]
+
+
+
+ stop_bits(
+ type t = one);
+
+
+
+[endsect]
+
+
+
+[section:store serial_port_base::stop_bits::store]
+
+
+
+ boost::system::error_code store(
+ BOOST_ASIO_OPTION_STORAGE & storage,
+ boost::system::error_code & ec) const;
+
+
+
+[endsect]
+
+
+
+[section:type serial_port_base::stop_bits::type]
+
+
+
+ enum type
+
+[heading Values]
+[variablelist
+
[
- [[link boost_asio.reference.posix__basic_stream_descriptor.native [*native]]]
- [Get the native descriptor representation. ]
+ [one]
+ []
]
-
+
[
- [[link boost_asio.reference.posix__basic_stream_descriptor.read_some [*read_some]]]
- [Read some data from the descriptor. ]
+ [onepointfive]
+ []
]
-
+
[
- [[link boost_asio.reference.posix__basic_stream_descriptor.write_some [*write_some]]]
- [Write some data to the descriptor. ]
+ [two]
+ []
]
-
+
]
-[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:value serial_port_base::stop_bits::value]
-[heading Thread Safety]
-
-[*Distinct] [*objects:] Safe.
-[*Shared] [*objects:] Unsafe.
+ type value() const;
[endsect]
-[section:posix__stream_descriptor_service posix::stream_descriptor_service]
-Default service implementation for a stream descriptor.
+[endsect]
- class stream_descriptor_service :
+[section:serial_port_service serial_port_service]
+
+Default service implementation for a serial port.
+
+ class serial_port_service :
public io_service::service
@@ -42959,15 +48948,15 @@
[
- [[link boost_asio.reference.posix__stream_descriptor_service.implementation_type [*implementation_type]]]
- [The type of a stream descriptor implementation. ]
+ [[link boost_asio.reference.serial_port_service.implementation_type [*implementation_type]]]
+ [The type of a serial port implementation. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.native_type [*native_type]]]
- [The native descriptor type. ]
+ [[link boost_asio.reference.serial_port_service.native_type [*native_type]]]
+ [The native handle type. ]
]
@@ -42978,82 +48967,97 @@
[[Name][Description]]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.assign [*assign]]]
- [Assign an existing native descriptor to a stream descriptor. ]
+ [[link boost_asio.reference.serial_port_service.assign [*assign]]]
+ [Assign an existing native handle to a serial port. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.async_read_some [*async_read_some]]]
+ [[link boost_asio.reference.serial_port_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]]]
+ [[link boost_asio.reference.serial_port_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.serial_port_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.close [*close]]]
- [Close a stream descriptor implementation. ]
+ [[link boost_asio.reference.serial_port_service.close [*close]]]
+ [Close a serial port implementation. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.construct [*construct]]]
- [Construct a new stream descriptor implementation. ]
+ [[link boost_asio.reference.serial_port_service.construct [*construct]]]
+ [Construct a new serial port implementation. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.destroy [*destroy]]]
- [Destroy a stream descriptor implementation. ]
+ [[link boost_asio.reference.serial_port_service.destroy [*destroy]]]
+ [Destroy a serial port implementation. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_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.posix__stream_descriptor_service.io_control [*io_control]]]
- [Perform an IO control command on the descriptor. ]
+ [[link boost_asio.reference.serial_port_service.get_option [*get_option]]]
+ [Get a serial port option. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.io_service [*io_service]]]
+ [[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.posix__stream_descriptor_service.is_open [*is_open]]]
- [Determine whether the descriptor is open. ]
+ [[link boost_asio.reference.serial_port_service.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.native [*native]]]
- [Get the native descriptor implementation. ]
+ [[link boost_asio.reference.serial_port_service.native [*native]]]
+ [Get the native handle implementation. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.read_some [*read_some]]]
+ [[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.posix__stream_descriptor_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined descriptorr objects owned by the service. ]
+ [[link boost_asio.reference.serial_port_service.send_break [*send_break]]]
+ [Send a break sequence to the serial port. ]
]
[
- [[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.serial_port_service.serial_port_service [*serial_port_service]]]
+ [Construct a new serial port service for the specified io_service. ]
]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.write_some [*write_some]]]
+ [[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. ]
]
@@ -43064,20 +49068,20 @@
[[Name][Description]]
[
- [[link boost_asio.reference.posix__stream_descriptor_service.id [*id]]]
+ [[link boost_asio.reference.serial_port_service.id [*id]]]
[The unique service identifier. ]
]
]
-[section:assign posix::stream_descriptor_service::assign]
+[section:assign serial_port_service::assign]
-Assign an existing native descriptor to a stream descriptor.
+Assign an existing native handle to a serial port.
boost::system::error_code assign(
implementation_type & impl,
- const native_type & native_descriptor,
+ const native_type & native_handle,
boost::system::error_code & ec);
@@ -43086,7 +49090,7 @@
-[section:async_read_some posix::stream_descriptor_service::async_read_some]
+[section:async_read_some serial_port_service::async_read_some]
Start an asynchronous read.
@@ -43096,7 +49100,7 @@
void async_read_some(
implementation_type & impl,
const MutableBufferSequence & buffers,
- ReadHandler descriptorr);
+ ReadHandler handler);
@@ -43104,7 +49108,7 @@
-[section:async_write_some posix::stream_descriptor_service::async_write_some]
+[section:async_write_some serial_port_service::async_write_some]
Start an asynchronous write.
@@ -43114,7 +49118,7 @@
void async_write_some(
implementation_type & impl,
const ConstBufferSequence & buffers,
- WriteHandler descriptorr);
+ WriteHandler handler);
@@ -43122,9 +49126,9 @@
-[section:cancel posix::stream_descriptor_service::cancel]
+[section:cancel serial_port_service::cancel]
-Cancel all asynchronous operations associated with the descriptor.
+Cancel all asynchronous operations associated with the handle.
boost::system::error_code cancel(
implementation_type & impl,
@@ -43136,9 +49140,9 @@
-[section:close posix::stream_descriptor_service::close]
+[section:close serial_port_service::close]
-Close a stream descriptor implementation.
+Close a serial port implementation.
boost::system::error_code close(
implementation_type & impl,
@@ -43150,9 +49154,9 @@
-[section:construct posix::stream_descriptor_service::construct]
+[section:construct serial_port_service::construct]
-Construct a new stream descriptor implementation.
+Construct a new serial port implementation.
void construct(
implementation_type & impl);
@@ -43163,9 +49167,9 @@
-[section:destroy posix::stream_descriptor_service::destroy]
+[section:destroy serial_port_service::destroy]
-Destroy a stream descriptor implementation.
+Destroy a serial port implementation.
void destroy(
implementation_type & impl);
@@ -43176,7 +49180,7 @@
-[section:get_io_service posix::stream_descriptor_service::get_io_service]
+[section:get_io_service serial_port_service::get_io_service]
['Inherited from io_service.]
@@ -43191,11 +49195,16 @@
-[section:id posix::stream_descriptor_service::id]
+[section:get_option serial_port_service::get_option]
-The unique service identifier.
+Get a serial port option.
- static boost::asio::io_service::id id;
+ 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;
@@ -43203,12 +49212,11 @@
-[section:implementation_type posix::stream_descriptor_service::implementation_type]
-
-The type of a stream descriptor implementation.
+[section:id serial_port_service::id]
- typedef implementation_defined implementation_type;
+The unique service identifier.
+ static boost::asio::io_service::id id;
@@ -43216,16 +49224,12 @@
-[section:io_control posix::stream_descriptor_service::io_control]
+[section:implementation_type serial_port_service::implementation_type]
-Perform an IO control command on the descriptor.
+The type of a serial port implementation.
+
+ typedef implementation_defined implementation_type;
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
@@ -43233,7 +49237,7 @@
-[section:io_service posix::stream_descriptor_service::io_service]
+[section:io_service serial_port_service::io_service]
['Inherited from io_service.]
@@ -43248,9 +49252,9 @@
-[section:is_open posix::stream_descriptor_service::is_open]
+[section:is_open serial_port_service::is_open]
-Determine whether the descriptor is open.
+Determine whether the handle is open.
bool is_open(
const implementation_type & impl) const;
@@ -43261,9 +49265,9 @@
-[section:native posix::stream_descriptor_service::native]
+[section:native serial_port_service::native]
-Get the native descriptor implementation.
+Get the native handle implementation.
native_type native(
implementation_type & impl);
@@ -43274,9 +49278,9 @@
-[section:native_type posix::stream_descriptor_service::native_type]
+[section:native_type serial_port_service::native_type]
-The native descriptor type.
+The native handle type.
typedef implementation_defined native_type;
@@ -43287,7 +49291,22 @@
-[section:read_some posix::stream_descriptor_service::read_some]
+[section:open serial_port_service::open]
+
+Open a serial port.
+
+ boost::system::error_code open(
+ implementation_type & impl,
+ const std::string & device,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:read_some serial_port_service::read_some]
Read some data from the stream.
@@ -43304,11 +49323,13 @@
-[section:shutdown_service posix::stream_descriptor_service::shutdown_service]
+[section:send_break serial_port_service::send_break]
-Destroy all user-defined descriptorr objects owned by the service.
+Send a break sequence to the serial port.
- void shutdown_service();
+ boost::system::error_code send_break(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -43316,11 +49337,11 @@
-[section:stream_descriptor_service posix::stream_descriptor_service::stream_descriptor_service]
+[section:serial_port_service serial_port_service::serial_port_service]
-Construct a new stream descriptor service for the specified io_service.
+Construct a new serial port service for the specified io_service.
- stream_descriptor_service(
+ serial_port_service(
boost::asio::io_service & io_service);
@@ -43329,7 +49350,36 @@
-[section:write_some posix::stream_descriptor_service::write_some]
+[section:set_option serial_port_service::set_option]
+
+Set a serial port option.
+
+ 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);
+
+
+
+[endsect]
+
+
+
+[section:shutdown_service serial_port_service::shutdown_service]
+
+Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
+
+
+
+[endsect]
+
+
+
+[section:write_some serial_port_service::write_some]
Write the given data to the stream.
@@ -43348,13 +49398,46 @@
[endsect]
-[section:raw_socket_service raw_socket_service]
+[section:service_already_exists service_already_exists]
-Default service implementation for a raw socket.
+Exception thrown when trying to add a duplicate service to an io_service.
+
+ class service_already_exists
+
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.service_already_exists.service_already_exists [*service_already_exists]]]
+ []
+ ]
+
+]
+
+
+[section:service_already_exists service_already_exists::service_already_exists]
+
+
+
+ service_already_exists();
+
+
+
+[endsect]
+
+
+
+[endsect]
+
+[section:socket_acceptor_service socket_acceptor_service]
+
+Default service implementation for a socket acceptor.
template<
typename ``[link boost_asio.reference.Protocol Protocol]``>
- class raw_socket_service :
+ class socket_acceptor_service :
public io_service::service
@@ -43364,28 +49447,28 @@
[
- [[link boost_asio.reference.raw_socket_service.endpoint_type [*endpoint_type]]]
+ [[link boost_asio.reference.socket_acceptor_service.endpoint_type [*endpoint_type]]]
[The endpoint type. ]
]
[
- [[link boost_asio.reference.raw_socket_service.implementation_type [*implementation_type]]]
- [The type of a raw socket. ]
+ [[link boost_asio.reference.socket_acceptor_service.implementation_type [*implementation_type]]]
+ [The native type of the socket acceptor. ]
]
[
- [[link boost_asio.reference.raw_socket_service.native_type [*native_type]]]
- [The native socket type. ]
+ [[link boost_asio.reference.socket_acceptor_service.native_type [*native_type]]]
+ [The native acceptor type. ]
]
[
- [[link boost_asio.reference.raw_socket_service.protocol_type [*protocol_type]]]
+ [[link boost_asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]]
[The protocol type. ]
]
@@ -43397,158 +49480,103 @@
[[Name][Description]]
[
- [[link boost_asio.reference.raw_socket_service.assign [*assign]]]
- [Assign an existing native socket to a raw socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_connect [*async_connect]]]
- [Start an asynchronous connect. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_receive [*async_receive]]]
- [Start an asynchronous receive. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_receive_from [*async_receive_from]]]
- [Start an asynchronous receive that will get the endpoint of the sender. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_send [*async_send]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.async_send_to [*async_send_to]]]
- [Start an asynchronous send. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.at_mark [*at_mark]]]
- [Determine whether the socket is at the out-of-band data mark. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.available [*available]]]
- [Determine the number of bytes available for reading. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.bind [*bind]]]
- []
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.cancel [*cancel]]]
- [Cancel all asynchronous operations associated with the socket. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.close [*close]]]
- [Close a raw socket implementation. ]
- ]
-
- [
- [[link boost_asio.reference.raw_socket_service.connect [*connect]]]
- [Connect the raw socket to the specified endpoint. ]
+ [[link boost_asio.reference.socket_acceptor_service.accept [*accept]]]
+ [Accept a new connection. ]
]
- [
- [[link boost_asio.reference.raw_socket_service.construct [*construct]]]
- [Construct a new raw socket implementation. ]
+ [
+ [[link boost_asio.reference.socket_acceptor_service.assign [*assign]]]
+ [Assign an existing native acceptor to a socket acceptor. ]
]
[
- [[link boost_asio.reference.raw_socket_service.destroy [*destroy]]]
- [Destroy a raw socket implementation. ]
+ [[link boost_asio.reference.socket_acceptor_service.async_accept [*async_accept]]]
+ [Start an asynchronous accept. ]
]
[
- [[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.socket_acceptor_service.bind [*bind]]]
+ [Bind the socket acceptor to the specified local endpoint. ]
]
[
- [[link boost_asio.reference.raw_socket_service.get_option [*get_option]]]
- [Get a socket option. ]
+ [[link boost_asio.reference.socket_acceptor_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the acceptor. ]
]
[
- [[link boost_asio.reference.raw_socket_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[link boost_asio.reference.socket_acceptor_service.close [*close]]]
+ [Close a socket acceptor implementation. ]
]
[
- [[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.socket_acceptor_service.construct [*construct]]]
+ [Construct a new socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.raw_socket_service.is_open [*is_open]]]
- [Determine whether the socket is open. ]
+ [[link boost_asio.reference.socket_acceptor_service.destroy [*destroy]]]
+ [Destroy a socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.raw_socket_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[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.raw_socket_service.native [*native]]]
- [Get the native socket implementation. ]
+ [[link boost_asio.reference.socket_acceptor_service.get_option [*get_option]]]
+ [Get a socket option. ]
]
[
- [[link boost_asio.reference.raw_socket_service.open [*open]]]
- []
+ [[link boost_asio.reference.socket_acceptor_service.io_control [*io_control]]]
+ [Perform an IO control command on the socket. ]
]
[
- [[link boost_asio.reference.raw_socket_service.raw_socket_service [*raw_socket_service]]]
- [Construct a new raw socket service for the specified io_service. ]
+ [[link boost_asio.reference.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.raw_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[link boost_asio.reference.socket_acceptor_service.is_open [*is_open]]]
+ [Determine whether the acceptor is open. ]
]
[
- [[link boost_asio.reference.raw_socket_service.receive_from [*receive_from]]]
- [Receive raw data with the endpoint of the sender. ]
+ [[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.raw_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
+ [[link boost_asio.reference.socket_acceptor_service.local_endpoint [*local_endpoint]]]
+ [Get the local endpoint. ]
]
[
- [[link boost_asio.reference.raw_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[link boost_asio.reference.socket_acceptor_service.native [*native]]]
+ [Get the native acceptor implementation. ]
]
[
- [[link boost_asio.reference.raw_socket_service.send_to [*send_to]]]
- [Send raw data to the specified endpoint. ]
+ [[link boost_asio.reference.socket_acceptor_service.open [*open]]]
+ [Open a new socket acceptor implementation. ]
]
[
- [[link boost_asio.reference.raw_socket_service.set_option [*set_option]]]
+ [[link boost_asio.reference.socket_acceptor_service.set_option [*set_option]]]
[Set a socket option. ]
]
[
- [[link boost_asio.reference.raw_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.socket_acceptor_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.raw_socket_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. ]
]
]
@@ -43558,78 +49586,24 @@
[[Name][Description]]
[
- [[link boost_asio.reference.raw_socket_service.id [*id]]]
+ [[link boost_asio.reference.socket_acceptor_service.id [*id]]]
[The unique service identifier. ]
]
]
-[section:assign raw_socket_service::assign]
-
-Assign an existing native socket to a raw socket.
-
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[section:async_connect raw_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 raw_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 raw_socket_service::async_receive_from]
+[section:accept socket_acceptor_service::accept]
-Start an asynchronous receive that will get the endpoint of the sender.
+Accept a new connection.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``,
- typename ``[link boost_asio.reference.ReadHandler ReadHandler]``>
- void async_receive_from(
+ typename ``[link boost_asio.reference.SocketService SocketService]``>
+ boost::system::error_code accept(
implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
- ReadHandler handler);
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type * peer_endpoint,
+ boost::system::error_code & ec);
@@ -43637,18 +49611,15 @@
-[section:async_send raw_socket_service::async_send]
+[section:assign socket_acceptor_service::assign]
-Start an asynchronous send.
+Assign an existing native acceptor to a socket acceptor.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_send(
+ boost::system::error_code assign(
implementation_type & impl,
- const ConstBufferSequence & buffers,
- socket_base::message_flags flags,
- WriteHandler handler);
+ const protocol_type & protocol,
+ const native_type & native_acceptor,
+ boost::system::error_code & ec);
@@ -43656,47 +49627,18 @@
-[section:async_send_to raw_socket_service::async_send_to]
+[section:async_accept socket_acceptor_service::async_accept]
-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_to(
+ typename ``[link boost_asio.reference.SocketService SocketService]``,
+ typename ``[link boost_asio.reference.AcceptHandler AcceptHandler]``>
+ void async_accept(
implementation_type & impl,
- const ConstBufferSequence & buffers,
- const endpoint_type & destination,
- socket_base::message_flags flags,
- WriteHandler handler);
-
-
-
-[endsect]
-
-
-
-[section:at_mark raw_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 raw_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;
+ basic_socket< protocol_type, SocketService > & peer,
+ endpoint_type * peer_endpoint,
+ AcceptHandler handler);
@@ -43704,9 +49646,9 @@
-[section:bind raw_socket_service::bind]
-
+[section:bind socket_acceptor_service::bind]
+Bind the socket acceptor to the specified local endpoint.
boost::system::error_code bind(
implementation_type & impl,
@@ -43719,9 +49661,9 @@
-[section:cancel raw_socket_service::cancel]
+[section:cancel socket_acceptor_service::cancel]
-Cancel all asynchronous operations associated with the socket.
+Cancel all asynchronous operations associated with the acceptor.
boost::system::error_code cancel(
implementation_type & impl,
@@ -43733,9 +49675,9 @@
-[section:close raw_socket_service::close]
+[section:close socket_acceptor_service::close]
-Close a raw socket implementation.
+Close a socket acceptor implementation.
boost::system::error_code close(
implementation_type & impl,
@@ -43747,24 +49689,9 @@
-[section:connect raw_socket_service::connect]
-
-Connect the raw 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 raw_socket_service::construct]
+[section:construct socket_acceptor_service::construct]
-Construct a new raw socket implementation.
+Construct a new socket acceptor implementation.
void construct(
implementation_type & impl);
@@ -43775,9 +49702,9 @@
-[section:destroy raw_socket_service::destroy]
+[section:destroy socket_acceptor_service::destroy]
-Destroy a raw socket implementation.
+Destroy a socket acceptor implementation.
void destroy(
implementation_type & impl);
@@ -43788,11 +49715,11 @@
-[section:endpoint_type raw_socket_service::endpoint_type]
+[section:endpoint_type socket_acceptor_service::endpoint_type]
The endpoint type.
- typedef Protocol::endpoint endpoint_type;
+ typedef protocol_type::endpoint endpoint_type;
@@ -43801,7 +49728,7 @@
-[section:get_io_service raw_socket_service::get_io_service]
+[section:get_io_service socket_acceptor_service::get_io_service]
['Inherited from io_service.]
@@ -43816,7 +49743,7 @@
-[section:get_option raw_socket_service::get_option]
+[section:get_option socket_acceptor_service::get_option]
Get a socket option.
@@ -43833,7 +49760,7 @@
-[section:id raw_socket_service::id]
+[section:id socket_acceptor_service::id]
The unique service identifier.
@@ -43845,9 +49772,9 @@
-[section:implementation_type raw_socket_service::implementation_type]
+[section:implementation_type socket_acceptor_service::implementation_type]
-The type of a raw socket.
+The native type of the socket acceptor.
typedef implementation_defined implementation_type;
@@ -43858,7 +49785,7 @@
-[section:io_control raw_socket_service::io_control]
+[section:io_control socket_acceptor_service::io_control]
Perform an IO control command on the socket.
@@ -43875,7 +49802,7 @@
-[section:io_service raw_socket_service::io_service]
+[section:io_service socket_acceptor_service::io_service]
['Inherited from io_service.]
@@ -43890,9 +49817,9 @@
-[section:is_open raw_socket_service::is_open]
+[section:is_open socket_acceptor_service::is_open]
-Determine whether the socket is open.
+Determine whether the acceptor is open.
bool is_open(
const implementation_type & impl) const;
@@ -43903,7 +49830,22 @@
-[section:local_endpoint raw_socket_service::local_endpoint]
+[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);
+
+
+
+[endsect]
+
+
+
+[section:local_endpoint socket_acceptor_service::local_endpoint]
Get the local endpoint.
@@ -43917,9 +49859,9 @@
-[section:native raw_socket_service::native]
+[section:native socket_acceptor_service::native]
-Get the native socket implementation.
+Get the native acceptor implementation.
native_type native(
implementation_type & impl);
@@ -43930,9 +49872,9 @@
-[section:native_type raw_socket_service::native_type]
+[section:native_type socket_acceptor_service::native_type]
-The native socket type.
+The native acceptor type.
typedef implementation_defined native_type;
@@ -43943,9 +49885,9 @@
-[section:open raw_socket_service::open]
-
+[section:open socket_acceptor_service::open]
+Open a new socket acceptor implementation.
boost::system::error_code open(
implementation_type & impl,
@@ -43958,7 +49900,7 @@
-[section:protocol_type raw_socket_service::protocol_type]
+[section:protocol_type socket_acceptor_service::protocol_type]
The protocol type.
@@ -43971,48 +49913,15 @@
-[section:raw_socket_service 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);
-
-
-
-[endsect]
-
-
-
-[section:receive raw_socket_service::receive]
-
-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 raw_socket_service::receive_from]
+[section:set_option socket_acceptor_service::set_option]
-Receive raw data with the endpoint of the sender.
+Set a socket option.
template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t receive_from(
+ typename ``[link boost_asio.reference.SettableSocketOption SettableSocketOption]``>
+ boost::system::error_code set_option(
implementation_type & impl,
- const MutableBufferSequence & buffers,
- endpoint_type & sender_endpoint,
- socket_base::message_flags flags,
+ const SettableSocketOption & option,
boost::system::error_code & ec);
@@ -44021,13 +49930,11 @@
-[section:remote_endpoint raw_socket_service::remote_endpoint]
+[section:shutdown_service socket_acceptor_service::shutdown_service]
-Get the remote endpoint.
+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();
@@ -44035,17 +49942,12 @@
-[section:send raw_socket_service::send]
+[section:socket_acceptor_service socket_acceptor_service::socket_acceptor_service]
-Send the given data to the peer.
+Construct a new socket acceptor service for the specified io_service.
- 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);
+ socket_acceptor_service(
+ boost::asio::io_service & io_service);
@@ -44053,192 +49955,194 @@
-[section:send_to raw_socket_service::send_to]
-
-Send raw data 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: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.
-[section:set_option raw_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);
-
-
+ class socket_base
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[section:shutdown raw_socket_service::shutdown]
+ [[link boost_asio.reference.socket_base.broadcast [*broadcast]]]
+ [Socket option to permit sending of broadcast messages. ]
+
+ ]
-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.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.socket_base.debug [*debug]]]
+ [Socket option to enable socket-level debugging. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.socket_base.do_not_route [*do_not_route]]]
+ [Socket option to prevent routing, use local interfaces only. ]
+
+ ]
+ [
-[section:shutdown_service raw_socket_service::shutdown_service]
+ [[link boost_asio.reference.socket_base.enable_connection_aborted [*enable_connection_aborted]]]
+ [Socket option to report aborted connections on accept. ]
+
+ ]
-Destroy all user-defined handler objects owned by the service.
+ [
- void shutdown_service();
+ [[link boost_asio.reference.socket_base.keep_alive [*keep_alive]]]
+ [Socket option to send keep-alives. ]
+
+ ]
+ [
+ [[link boost_asio.reference.socket_base.linger [*linger]]]
+ [Socket option to specify whether the socket lingers on close if unsent data is present. ]
+
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.socket_base.message_flags [*message_flags]]]
+ [Bitmask type for flags that can be passed to send and receive operations. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.socket_base.non_blocking_io [*non_blocking_io]]]
+ [IO control command to set the blocking mode of the socket. ]
+
+ ]
-[section:read read]
+ [
-Attempt to read a certain amount of data from a stream before returning.
+ [[link boost_asio.reference.socket_base.receive_buffer_size [*receive_buffer_size]]]
+ [Socket option for the receive buffer size of a socket. ]
+
+ ]
- 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);
+ [
- 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);
+ [[link boost_asio.reference.socket_base.receive_low_watermark [*receive_low_watermark]]]
+ [Socket option for the receive low watermark. ]
+
+ ]
- 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);
+ [[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. ]
+
+ ]
- 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);
+ [
- 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);
+ [[link boost_asio.reference.socket_base.send_buffer_size [*send_buffer_size]]]
+ [Socket option for the send buffer size of a socket. ]
+
+ ]
+ [
-[section:overload1 read (1 of 6 overloads)]
+ [[link boost_asio.reference.socket_base.send_low_watermark [*send_low_watermark]]]
+ [Socket option for the send low watermark. ]
+
+ ]
-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);
+ [[link boost_asio.reference.socket_base.shutdown_type [*shutdown_type]]]
+ [Different ways a socket may be shutdown. ]
+
+ ]
+]
-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:
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.socket_base._socket_base [*~socket_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
-* The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
+[heading Data Members]
+[table
+ [[Name][Description]]
-* An error occurred.
+ [
+ [[link boost_asio.reference.socket_base.max_connections [*max_connections]]]
+ [The maximum length of the queue of pending incoming connections. ]
+ ]
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+ [
+ [[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.socket_base.message_out_of_band [*message_out_of_band]]]
+ [Process out-of-band data. ]
+ ]
-[heading Parameters]
-
+ [
+ [[link boost_asio.reference.socket_base.message_peek [*message_peek]]]
+ [Peek at incoming data without removing it from the input queue. ]
+ ]
-[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:broadcast socket_base::broadcast]
-[heading Return Value]
-
-The number of bytes transferred.
+Socket option to permit sending of broadcast messages.
-[heading Exceptions]
-
+ typedef implementation_defined broadcast;
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
-[heading Example]
+Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+
+
+[heading Examples]
-To read into a single data buffer use the
-[link boost_asio.reference.buffer buffer] function as follows:
+Setting the option:
- boost::asio::read(s, boost::asio::buffer(data, size));
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::broadcast option(true);
+ socket.set_option(option);
-See the
-[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
-[heading Remarks]
-
-This overload is equivalent to calling:
- boost::asio::read(
- s, buffers,
- boost::asio::transfer_all());
+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();
@@ -44249,265 +50153,189 @@
-[section:overload2 read (2 of 6 overloads)]
+[section:bytes_readable socket_base::bytes_readable]
-Attempt to read a certain amount of data from a stream before returning.
+IO control command to get the amount of data that can be read without blocking.
- 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);
+ typedef implementation_defined bytes_readable;
-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:
+Implements the FIONREAD IO control command.
-* 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 Example]
+
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::bytes_readable command(true);
+ socket.io_control(command);
+ std::size_t bytes_readable = command.get();
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[buffers][One or more buffers into which the data will be read. The sum of the buffer sizes indicates the maximum number of bytes to read from the stream.]]
-[[completion_condition][The function object to be called to determine whether the read operation is complete. The signature of the function object must be:
-``
- 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.]]
+[endsect]
-]
-[heading Return Value]
-
-The number of bytes transferred.
-[heading Exceptions]
-
+[section:debug socket_base::debug]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+Socket option to enable socket-level debugging.
-]
+ typedef implementation_defined debug;
-[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));
+Implements the SOL\_SOCKET/SO\_DEBUG socket option.
-See the
-[link boost_asio.reference.buffer buffer] documentation for information on reading into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+[heading Examples]
+
+Setting the option:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option(true);
+ socket.set_option(option);
-[endsect]
-[section:overload3 read (3 of 6 overloads)]
+Getting the current option value:
-Attempt to read a certain amount of data from a stream before returning.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::debug option;
+ socket.get_option(option);
+ bool is_set = option.value();
- 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);
-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.
+[endsect]
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
-[heading Parameters]
-
+[section:do_not_route socket_base::do_not_route]
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+Socket option to prevent routing, use local interfaces only.
-[[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.]]
+ typedef implementation_defined do_not_route;
-[[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.]]
+Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[heading Examples]
+
+Setting the option:
-[heading Return Value]
-
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option(true);
+ socket.set_option(option);
-[endsect]
+Getting the current option value:
+ boost::asio::ip::udp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::do_not_route option;
+ socket.get_option(option);
+ bool is_set = option.value();
-[section:overload4 read (4 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 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:enable_connection_aborted socket_base::enable_connection_aborted]
-[heading Parameters]
-
+Socket option to report aborted connections on accept.
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+ typedef implementation_defined enable_connection_aborted;
-[[b][The basic\_streambuf object into which the data will be read.]]
-]
-[heading Return Value]
-
-The number of bytes transferred.
+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 Exceptions]
-
-[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]
-
-This overload is equivalent to calling:
- boost::asio::read(
- s, b,
- boost::asio::transfer_all());
+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:overload5 read (5 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);
+[section:keep_alive socket_base::keep_alive]
-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:
+Socket option to send keep-alives.
+ typedef implementation_defined keep_alive;
-* 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.
+Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
-[heading Parameters]
-
-[variablelist
+[heading Examples]
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+Setting the option:
-[[b][The basic\_streambuf object into which the data will be read.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::keep_alive option(true);
+ socket.set_option(option);
-[[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.]]
-]
+Getting the current option value:
-[heading Return Value]
-
-The number of bytes transferred.
+ 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 Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
@@ -44515,183 +50343,101 @@
-[section:overload6 read (6 of 6 overloads)]
-
-Attempt to read a certain amount of data from a stream before returning.
+[section:linger socket_base::linger]
- 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);
+Socket option to specify whether the socket lingers on close if unsent data is present.
+ typedef implementation_defined linger;
-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 completion_condition function object returns true.
+Implements the SOL\_SOCKET/SO\_LINGER socket option.
-This operation is implemented in terms of one or more calls to the stream's read\_some function.
+[heading Examples]
+
+Setting the option:
-[heading Parameters]
-
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::linger option(true, 30);
+ socket.set_option(option);
-[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.]]
-[[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.
- );
+Getting the current option value:
-``
-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.]]
+ 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();
-[[ec][Set to indicate what error occurred, if any.]]
-]
-[heading Return Value]
-
-The number of bytes read. If an error occurs, returns the total number of bytes successfully transferred prior to the error.
[endsect]
-[endsect]
-[section:read_until read_until]
+[section:max_connections socket_base::max_connections]
-Read data into a streambuf until a delimiter is encountered.
+The maximum length of the queue of pending incoming connections.
- 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);
+ static const int max_connections = implementation_defined;
- 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);
+[endsect]
- 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);
+[section:message_do_not_route socket_base::message_do_not_route]
-[section:overload1 read_until (1 of 6 overloads)]
+Specify that the data should not be subject to routing.
-Read data into a streambuf until a delimiter is encountered.
+ static const int message_do_not_route = implementation_defined;
- 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:
+[endsect]
-* The get area of the streambuf contains the specified delimiter.
-* An error occurred.
+[section:message_flags socket_base::message_flags]
-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.
+Bitmask type for flags that can be passed to send and receive operations.
+ typedef int message_flags;
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[b][A streambuf object into which the data will be read.]]
-[[delim][The delimiter character.]]
+[endsect]
-]
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
-[heading Exceptions]
-
+[section:message_out_of_band socket_base::message_out_of_band]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+Process out-of-band data.
-]
+ static const int message_out_of_band = implementation_defined;
-[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);
+
+[endsect]
+
+[section:message_peek socket_base::message_peek]
+
+Peek at incoming data without removing it from the input queue.
+ static const int message_peek = implementation_defined;
@@ -44699,230 +50445,185 @@
-[section:overload2 read_until (2 of 6 overloads)]
+[section:non_blocking_io socket_base::non_blocking_io]
-Read data into a streambuf until a delimiter is encountered.
+IO control command to set the blocking mode of the socket.
- template<
- typename ``[link boost_asio.reference.SyncReadStream SyncReadStream]``,
- typename Allocator>
- std::size_t read_until(
- SyncReadStream & s,
- boost::asio::basic_streambuf< Allocator > & b,
- char delim,
- boost::system::error_code & ec);
+ typedef implementation_defined non_blocking_io;
-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:
+Implements the FIONBIO IO control command.
-* The get area of the streambuf contains the specified delimiter.
-* An error occurred.
+[heading Example]
+
-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.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::non_blocking_io command(true);
+ socket.io_control(command);
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[b][A streambuf object into which the data will be read.]]
-[[delim][The delimiter character.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[endsect]
-[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:receive_buffer_size socket_base::receive_buffer_size]
-[endsect]
+Socket option for the receive buffer size of a socket.
+ typedef implementation_defined receive_buffer_size;
-[section:overload3 read_until (3 of 6 overloads)]
-Read data into a streambuf until a delimiter is encountered.
+Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
- 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);
+[heading Examples]
+
+Setting the option:
-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:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option(8192);
+ socket.set_option(option);
-* 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.
+Getting the current option value:
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_buffer_size option;
+ socket.get_option(option);
+ int size = option.value();
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
-[[b][A streambuf object into which the data will be read.]]
-[[delim][The delimiter string.]]
-]
-[heading Return Value]
-
-The number of bytes in the streambuf's get area up to and including the delimiter.
+[endsect]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
+[section:receive_low_watermark socket_base::receive_low_watermark]
-[heading Example]
-
-To read data into a streambuf until a newline is encountered:
+Socket option for the receive low watermark.
- boost::asio::streambuf b;
- boost::asio::read_until(s, b, "\r\n");
- std::istream is(&b);
- std::string line;
- std::getline(is, line);
+ typedef implementation_defined receive_low_watermark;
+Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+[heading Examples]
+
+Setting the option:
-[endsect]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option(1024);
+ socket.set_option(option);
-[section:overload4 read_until (4 of 6 overloads)]
-Read data into a streambuf until a delimiter is encountered.
+Getting the current option value:
- 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);
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::receive_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
-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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[section:reuse_address socket_base::reuse_address]
-[[b][A streambuf object into which the data will be read.]]
+Socket option to allow the socket to be bound to an address that is already in use.
-[[delim][The delimiter string.]]
+ typedef implementation_defined reuse_address;
-[[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.
+Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Examples]
+
+Setting the option:
-[endsect]
+ boost::asio::ip::tcp::acceptor acceptor(io_service);
+ ...
+ boost::asio::socket_base::reuse_address option(true);
+ acceptor.set_option(option);
-[section:overload5 read_until (5 of 6 overloads)]
-Read data into a streambuf until a regular expression is located.
+Getting the current option value:
- 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::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 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.
-* 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.
+[endsect]
-[heading Parameters]
-
-[variablelist
-
-[[s][The stream from which the data is to be read. The type must support the SyncReadStream concept.]]
+[section:send_buffer_size socket_base::send_buffer_size]
-[[b][A streambuf object into which the data will be read.]]
+Socket option for the send buffer size of a socket.
-[[expr][The regular expression.]]
+ typedef implementation_defined send_buffer_size;
-]
-[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]
-
+Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
-[variablelist
+
+[heading Examples]
-[[boost::system::system_error][Thrown on failure.]]
+Setting the option:
-]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_buffer_size option(8192);
+ socket.set_option(option);
-[heading 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);
+
+
+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();
@@ -44933,80 +50634,83 @@
-[section:overload6 read_until (6 of 6 overloads)]
+[section:send_low_watermark socket_base::send_low_watermark]
-Read data into a streambuf until a regular expression is located.
+Socket option for the send low watermark.
- 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);
+ typedef implementation_defined send_low_watermark;
-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:
+Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
-* A substring of the streambuf's get area matches the regular expression.
-* An error occurred.
+[heading Examples]
+
+Setting the option:
-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.
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option(1024);
+ socket.set_option(option);
-[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.]]
+Getting the current option value:
-[[expr][The regular expression.]]
+ boost::asio::ip::tcp::socket socket(io_service);
+ ...
+ boost::asio::socket_base::send_low_watermark option;
+ socket.get_option(option);
+ int size = option.value();
-[[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.
[endsect]
-[endsect]
-[section:service_already_exists service_already_exists]
+[section:shutdown_type socket_base::shutdown_type]
-Exception thrown when trying to add a duplicate service to an io_service.
+Different ways a socket may be shutdown.
- class service_already_exists
+ enum shutdown_type
+[heading Values]
+[variablelist
-[heading Member Functions]
-[table
- [[Name][Description]]
+ [
+ [shutdown_receive]
+ [Shutdown the receive side of the socket. ]
+ ]
[
- [[link boost_asio.reference.service_already_exists.service_already_exists [*service_already_exists]]]
- []
+ [shutdown_send]
+ [Shutdown the send side of the socket. ]
]
-
+
+ [
+ [shutdown_both]
+ [Shutdown both send and receive on the socket. ]
+ ]
+
]
-[section:service_already_exists service_already_exists::service_already_exists]
+
+[endsect]
- service_already_exists();
+[section:_socket_base socket_base::~socket_base]
+
+Protected destructor to prevent deletion through this type.
+
+ ~socket_base();
@@ -45016,14 +50720,14 @@
[endsect]
-[section:socket_acceptor_service socket_acceptor_service]
+[section:ssl__basic_context ssl::basic_context]
-Default service implementation for a socket acceptor.
+SSL context.
template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class socket_acceptor_service :
- public io_service::service
+ typename ``[link boost_asio.reference.Service Service]``>
+ class basic_context :
+ public ssl::context_base
[heading Types]
@@ -45032,136 +50736,122 @@
[
- [[link boost_asio.reference.socket_acceptor_service.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.socket_acceptor_service.implementation_type [*implementation_type]]]
- [The native type of the socket acceptor. ]
+ [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
+ [The native implementation type of the locking dispatcher. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.native_type [*native_type]]]
- [The native acceptor type. ]
+ [[link boost_asio.reference.ssl__basic_context.method [*method]]]
+ [Different methods supported by a context. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.protocol_type [*protocol_type]]]
- [The protocol type. ]
+ [[link boost_asio.reference.ssl__basic_context.options [*options]]]
+ [Bitmask type for SSL options. ]
]
-]
-
-[heading Member Functions]
-[table
- [[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.ssl__basic_context.password_purpose [*password_purpose]]]
+ [Purpose of PEM password. ]
- [
- [[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__basic_context.service_type [*service_type]]]
+ [The type of the service that will be used to provide context operations. ]
- [
- [[link boost_asio.reference.socket_acceptor_service.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.ssl__basic_context.verify_mode [*verify_mode]]]
+ [Bitmask type for peer verification. ]
- [
- [[link boost_asio.reference.socket_acceptor_service.construct [*construct]]]
- [Construct a new socket acceptor implementation. ]
]
-
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
[
- [[link boost_asio.reference.socket_acceptor_service.destroy [*destroy]]]
- [Destroy a socket acceptor implementation. ]
+ [[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.socket_acceptor_service.get_io_service [*get_io_service]]]
- [Get the io_service object that owns the service. ]
+ [[link boost_asio.reference.ssl__basic_context.basic_context [*basic_context]]]
+ [Constructor. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.get_option [*get_option]]]
- [Get a socket option. ]
+ [[link boost_asio.reference.ssl__basic_context.impl [*impl]]]
+ [Get the underlying implementation in the native type. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.io_control [*io_control]]]
- [Perform an IO control command on the socket. ]
+ [[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.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__basic_context.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__basic_context.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__basic_context.set_verify_mode [*set_verify_mode]]]
+ [Set the peer verification mode. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.local_endpoint [*local_endpoint]]]
- [Get the local endpoint. ]
+ [[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.socket_acceptor_service.native [*native]]]
- [Get the native acceptor implementation. ]
+ [[link boost_asio.reference.ssl__basic_context.use_certificate_file [*use_certificate_file]]]
+ [Use a certificate from a file. ]
]
[
- [[link boost_asio.reference.socket_acceptor_service.open [*open]]]
- [Open a new socket acceptor implementation. ]
+ [[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.socket_acceptor_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[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.socket_acceptor_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.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__basic_context._basic_context [*~basic_context]]]
+ [Destructor. ]
]
]
@@ -45171,88 +50861,92 @@
[[Name][Description]]
[
- [[link boost_asio.reference.socket_acceptor_service.id [*id]]]
- [The unique service identifier. ]
+ [[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. ]
+ ]
-[section:accept socket_acceptor_service::accept]
+ [
+ [[link boost_asio.reference.ssl__basic_context.no_tlsv1 [*no_tlsv1]]]
+ [Disable TLS v1. ]
+ ]
-Accept a new connection.
+ [
+ [[link boost_asio.reference.ssl__basic_context.single_dh_use [*single_dh_use]]]
+ [Always create a new key when using tmp_dh parameters. ]
+ ]
- 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);
+ [
+ [[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. ]
+ ]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_none [*verify_none]]]
+ [No verification. ]
+ ]
-[endsect]
+ [
+ [[link boost_asio.reference.ssl__basic_context.verify_peer [*verify_peer]]]
+ [Verify the peer. ]
+ ]
+]
+[section:add_verify_path ssl::basic_context::add_verify_path]
-[section:assign socket_acceptor_service::assign]
+Add a directory containing certificate authority files to be used for performing verification.
-Assign an existing native acceptor to a socket acceptor.
+ void ``[link boost_asio.reference.ssl__basic_context.add_verify_path.overload1 add_verify_path]``(
+ const std::string & path);
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_acceptor,
+ 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);
+[section:overload1 ssl::basic_context::add_verify_path (1 of 2 overloads)]
-[endsect]
-
-
-
-[section:async_accept socket_acceptor_service::async_accept]
-
-Start an asynchronous accept.
-
- 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);
-
-
-
-[endsect]
-
-
-
-[section:bind socket_acceptor_service::bind]
+Add a directory containing certificate authority files to be used for performing verification.
-Bind the socket acceptor to the specified local endpoint.
+ void add_verify_path(
+ const std::string & path);
- boost::system::error_code bind(
- implementation_type & impl,
- const endpoint_type & endpoint,
- boost::system::error_code & ec);
+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.]]
+]
-[section:cancel socket_acceptor_service::cancel]
+[heading Exceptions]
+
-Cancel all asynchronous operations associated with the acceptor.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+]
@@ -45260,84 +50954,89 @@
-[section:close socket_acceptor_service::close]
+[section:overload2 ssl::basic_context::add_verify_path (2 of 2 overloads)]
-Close a socket acceptor implementation.
+Add a directory containing certificate authority files to be used for performing verification.
- boost::system::error_code close(
- implementation_type & impl,
+ boost::system::error_code add_verify_path(
+ const std::string & path,
boost::system::error_code & ec);
-
-[endsect]
+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]
+
-[section:construct socket_acceptor_service::construct]
+[variablelist
+
+[[path][The name of a directory containing the certificates.]]
-Construct a new socket acceptor implementation.
+[[ec][Set to indicate what error occurred, if any. ]]
- void construct(
- implementation_type & impl);
+]
[endsect]
+[endsect]
-[section:destroy socket_acceptor_service::destroy]
-
-Destroy a socket acceptor implementation.
-
- void destroy(
- implementation_type & impl);
+[section:basic_context ssl::basic_context::basic_context]
+Constructor.
-[endsect]
+ basic_context(
+ boost::asio::io_service & io_service,
+ method m);
-[section:endpoint_type socket_acceptor_service::endpoint_type]
+[endsect]
-The endpoint type.
- typedef protocol_type::endpoint endpoint_type;
+[section:default_workarounds ssl::basic_context::default_workarounds]
+['Inherited from ssl::context_base.]
-[endsect]
+Implement various bug workarounds.
+ static const int default_workarounds = implementation_defined;
-[section:get_io_service socket_acceptor_service::get_io_service]
+[endsect]
-['Inherited from io_service.]
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+[section:file_format ssl::basic_context::file_format]
+['Inherited from ssl::context_base.]
-[endsect]
+File format types.
+ enum file_format
+[heading Values]
+[variablelist
-[section:get_option socket_acceptor_service::get_option]
+ [
+ [asn1]
+ [ASN.1 file. ]
+ ]
-Get a socket option.
+ [
+ [pem]
+ [PEM file. ]
+ ]
- 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;
+]
@@ -45345,23 +51044,25 @@
-[section:id socket_acceptor_service::id]
+[section:impl ssl::basic_context::impl]
-The unique service identifier.
+Get the underlying implementation in the native type.
- static boost::asio::io_service::id id;
+ impl_type impl();
+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:implementation_type socket_acceptor_service::implementation_type]
+[section:impl_type ssl::basic_context::impl_type]
-The native type of the socket acceptor.
+The native implementation type of the locking dispatcher.
- typedef implementation_defined implementation_type;
+ typedef service_type::impl_type impl_type;
@@ -45369,100 +51070,157 @@
[endsect]
+[section:load_verify_file ssl::basic_context::load_verify_file]
-[section:io_control socket_acceptor_service::io_control]
+Load a certification authority file for performing verification.
-Perform an IO control command on the socket.
+ void ``[link boost_asio.reference.ssl__basic_context.load_verify_file.overload1 load_verify_file]``(
+ const std::string & filename);
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
+ 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);
+[section:overload1 ssl::basic_context::load_verify_file (1 of 2 overloads)]
-[endsect]
+Load a certification authority file for performing verification.
+ void load_verify_file(
+ const std::string & filename);
-[section:io_service socket_acceptor_service::io_service]
+This function is used to load one or more trusted certification authorities from a file.
-['Inherited from io_service.]
+[heading Parameters]
+
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[variablelist
+
+[[filename][The name of a file containing certification authority certificates in PEM format.]]
- boost::asio::io_service & io_service();
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[endsect]
+]
-[section:is_open socket_acceptor_service::is_open]
+[endsect]
-Determine whether the acceptor is open.
- bool is_open(
- const implementation_type & impl) const;
+[section:overload2 ssl::basic_context::load_verify_file (2 of 2 overloads)]
+Load a certification authority file for performing verification.
-[endsect]
+ 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.
-[section:listen socket_acceptor_service::listen]
-Place the socket acceptor into the state where it will listen for new connections.
+[heading Parameters]
+
- boost::system::error_code listen(
- implementation_type & impl,
- int backlog,
- boost::system::error_code & ec);
+[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:local_endpoint socket_acceptor_service::local_endpoint]
-Get the local endpoint.
+[section:method ssl::basic_context::method]
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+['Inherited from ssl::context_base.]
+Different methods supported by a context.
-[endsect]
+ enum method
+[heading Values]
+[variablelist
+ [
+ [sslv2]
+ [Generic SSL version 2. ]
+ ]
-[section:native socket_acceptor_service::native]
+ [
+ [sslv2_client]
+ [SSL version 2 client. ]
+ ]
-Get the native acceptor implementation.
+ [
+ [sslv2_server]
+ [SSL version 2 server. ]
+ ]
- native_type native(
- implementation_type & impl);
+ [
+ [sslv3]
+ [Generic SSL version 3. ]
+ ]
+ [
+ [sslv3_client]
+ [SSL version 3 client. ]
+ ]
+ [
+ [sslv3_server]
+ [SSL version 3 server. ]
+ ]
-[endsect]
+ [
+ [tlsv1]
+ [Generic TLS version 1. ]
+ ]
+ [
+ [tlsv1_client]
+ [TLS version 1 client. ]
+ ]
+ [
+ [tlsv1_server]
+ [TLS version 1 server. ]
+ ]
-[section:native_type socket_acceptor_service::native_type]
+ [
+ [sslv23]
+ [Generic SSL/TLS. ]
+ ]
-The native acceptor type.
+ [
+ [sslv23_client]
+ [SSL/TLS client. ]
+ ]
- typedef implementation_defined native_type;
+ [
+ [sslv23_server]
+ [SSL/TLS server. ]
+ ]
+]
@@ -45470,69 +51228,60 @@
-[section:open socket_acceptor_service::open]
+[section:no_sslv2 ssl::basic_context::no_sslv2]
-Open a new socket acceptor implementation.
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
+['Inherited from ssl::context_base.]
+Disable SSL v2.
+ static const int no_sslv2 = implementation_defined;
-[endsect]
+[endsect]
-[section:protocol_type socket_acceptor_service::protocol_type]
-The protocol type.
- typedef Protocol protocol_type;
+[section:no_sslv3 ssl::basic_context::no_sslv3]
+['Inherited from ssl::context_base.]
+Disable SSL v3.
-[endsect]
+ static const int no_sslv3 = implementation_defined;
-[section:set_option socket_acceptor_service::set_option]
+[endsect]
-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);
+[section:no_tlsv1 ssl::basic_context::no_tlsv1]
-[endsect]
+['Inherited from ssl::context_base.]
+Disable TLS v1.
+ static const int no_tlsv1 = implementation_defined;
-[section:shutdown_service socket_acceptor_service::shutdown_service]
-Destroy all user-defined handler objects owned by the service.
- void shutdown_service();
+[endsect]
-[endsect]
+[section:options ssl::basic_context::options]
+['Inherited from ssl::context_base.]
-[section:socket_acceptor_service socket_acceptor_service::socket_acceptor_service]
+Bitmask type for SSL options.
-Construct a new socket acceptor service for the specified io_service.
+ typedef int options;
- socket_acceptor_service(
- boost::asio::io_service & io_service);
@@ -45540,267 +51289,266 @@
-[endsect]
+[section:password_purpose ssl::basic_context::password_purpose]
-[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.
+['Inherited from ssl::context_base.]
- class socket_base
+Purpose of PEM password.
+ enum password_purpose
-[heading Types]
-[table
- [[Name][Description]]
+[heading Values]
+[variablelist
[
-
- [[link boost_asio.reference.socket_base.broadcast [*broadcast]]]
- [Socket option to permit sending of broadcast messages. ]
-
+ [for_reading]
+ [The password is needed for reading/decryption. ]
]
[
-
- [[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. ]
-
+ [for_writing]
+ [The password is needed for writing/encryption. ]
]
- [
+]
- [[link boost_asio.reference.socket_base.debug [*debug]]]
- [Socket option to enable socket-level debugging. ]
-
- ]
- [
- [[link boost_asio.reference.socket_base.do_not_route [*do_not_route]]]
- [Socket option to prevent routing, use local interfaces only. ]
-
- ]
+[endsect]
- [
- [[link boost_asio.reference.socket_base.enable_connection_aborted [*enable_connection_aborted]]]
- [Socket option to report aborted connections on accept. ]
-
- ]
- [
+[section:service_type ssl::basic_context::service_type]
- [[link boost_asio.reference.socket_base.keep_alive [*keep_alive]]]
- [Socket option to send keep-alives. ]
-
- ]
+The type of the service that will be used to provide context operations.
- [
+ typedef Service service_type;
- [[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.socket_base.message_flags [*message_flags]]]
- [Bitmask type for flags that can be passed to send and receive operations. ]
-
- ]
- [
+[endsect]
- [[link boost_asio.reference.socket_base.non_blocking_io [*non_blocking_io]]]
- [IO control command to set the blocking mode of the socket. ]
-
- ]
- [
+[section:set_options ssl::basic_context::set_options]
- [[link boost_asio.reference.socket_base.receive_buffer_size [*receive_buffer_size]]]
- [Socket option for the receive buffer size of a socket. ]
-
- ]
+Set options on the context.
- [
+ void ``[link boost_asio.reference.ssl__basic_context.set_options.overload1 set_options]``(
+ options o);
- [[link boost_asio.reference.socket_base.receive_low_watermark [*receive_low_watermark]]]
- [Socket option for the receive low watermark. ]
-
- ]
+ boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_options.overload2 set_options]``(
+ options o,
+ boost::system::error_code & ec);
- [
- [[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. ]
-
- ]
+[section:overload1 ssl::basic_context::set_options (1 of 2 overloads)]
- [
+Set options on the context.
- [[link boost_asio.reference.socket_base.send_buffer_size [*send_buffer_size]]]
- [Socket option for the send buffer size of a socket. ]
-
- ]
+ void set_options(
+ options o);
- [
- [[link boost_asio.reference.socket_base.send_low_watermark [*send_low_watermark]]]
- [Socket option for the send low watermark. ]
-
- ]
+This function may be used to configure the SSL options used by the context.
- [
- [[link boost_asio.reference.socket_base.shutdown_type [*shutdown_type]]]
- [Different ways a socket may be shutdown. ]
+[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.]]
]
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+[heading Exceptions]
+
- [
- [[link boost_asio.reference.socket_base._socket_base [*~socket_base]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
+[variablelist
+[[boost::system::system_error][Thrown on failure. ]]
+
]
-[heading Data Members]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.socket_base.max_connections [*max_connections]]]
- [The maximum length of the queue of pending incoming connections. ]
- ]
- [
- [[link boost_asio.reference.socket_base.message_do_not_route [*message_do_not_route]]]
- [Specify that the data should not be subject to routing. ]
- ]
+[endsect]
- [
- [[link boost_asio.reference.socket_base.message_out_of_band [*message_out_of_band]]]
- [Process out-of-band data. ]
- ]
- [
- [[link boost_asio.reference.socket_base.message_peek [*message_peek]]]
- [Peek at incoming data without removing it from the input queue. ]
- ]
-]
+[section:overload2 ssl::basic_context::set_options (2 of 2 overloads)]
+Set options on the context.
-[section:broadcast socket_base::broadcast]
+ boost::system::error_code set_options(
+ options o,
+ boost::system::error_code & ec);
-Socket option to permit sending of broadcast messages.
- typedef implementation_defined broadcast;
+This function may be used to configure the SSL options used by the context.
+[heading Parameters]
+
-Implements the SOL\_SOCKET/SO\_BROADCAST socket option.
+[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. ]]
-[heading Examples]
-
-Setting the option:
+]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option(true);
- socket.set_option(option);
+[endsect]
-Getting the current option value:
+[endsect]
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::broadcast option;
- socket.get_option(option);
- bool is_set = option.value();
+[section: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)]
-[endsect]
+Set the password callback.
+ template<
+ typename PasswordCallback>
+ void set_password_callback(
+ PasswordCallback callback);
-[section:bytes_readable socket_base::bytes_readable]
+This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
-IO control command to get the amount of data that can be read without blocking.
- typedef implementation_defined bytes_readable;
+[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.]]
-Implements the FIONREAD IO control command.
+]
+[heading Exceptions]
+
-[heading Example]
+[variablelist
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
+
+
+
+[endsect]
+
+
+
+[section:overload2 ssl::basic_context::set_password_callback (2 of 2 overloads)]
+
+Set the password callback.
+
+ template<
+ typename PasswordCallback>
+ boost::system::error_code set_password_callback(
+ PasswordCallback callback,
+ boost::system::error_code & ec);
+
+
+This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
+
+[heading Parameters]
+
- 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();
+[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. ]]
+]
[endsect]
+[endsect]
-[section:debug socket_base::debug]
+[section:set_verify_mode ssl::basic_context::set_verify_mode]
-Socket option to enable socket-level debugging.
+Set the peer verification mode.
- typedef implementation_defined debug;
+ 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);
-Implements the SOL\_SOCKET/SO\_DEBUG socket option.
+[section:overload1 ssl::basic_context::set_verify_mode (1 of 2 overloads)]
+Set the peer verification mode.
-[heading Examples]
-
-Setting the option:
+ void set_verify_mode(
+ verify_mode v);
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option(true);
- socket.set_option(option);
+This function may be used to configure the peer verification mode used by the context.
+[heading Parameters]
+
-Getting the current option value:
+[variablelist
+
+[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::debug option;
- socket.get_option(option);
- bool is_set = option.value();
+]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -45808,160 +51556,173 @@
-[section:do_not_route socket_base::do_not_route]
+[section:overload2 ssl::basic_context::set_verify_mode (2 of 2 overloads)]
-Socket option to prevent routing, use local interfaces only.
+Set the peer verification mode.
- typedef implementation_defined do_not_route;
+ boost::system::error_code set_verify_mode(
+ verify_mode v,
+ boost::system::error_code & ec);
+This function may be used to configure the peer verification mode used by the context.
-Implements the SOL\_SOCKET/SO\_DONTROUTE socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
-
- boost::asio::ip::udp::socket socket(io_service);
- ...
- boost::asio::socket_base::do_not_route option(true);
- socket.set_option(option);
-
+[[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. ]]
+]
-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]
+[endsect]
+[section:single_dh_use ssl::basic_context::single_dh_use]
-[endsect]
+['Inherited from ssl::context_base.]
+Always create a new key when using tmp_dh parameters.
-[section:enable_connection_aborted socket_base::enable_connection_aborted]
+ static const int single_dh_use = implementation_defined;
-Socket option to report aborted connections on accept.
- typedef implementation_defined enable_connection_aborted;
+[endsect]
-Implements a custom socket option that determines whether or not an accept operation is permitted to fail with boost::asio::error::connection\_aborted. By default the option is false.
+[section:use_certificate_chain_file ssl::basic_context::use_certificate_chain_file]
+Use a certificate chain from a file.
-[heading Examples]
-
-Setting the option:
+ void ``[link boost_asio.reference.ssl__basic_context.use_certificate_chain_file.overload1 use_certificate_chain_file]``(
+ const std::string & filename);
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::enable_connection_aborted option(true);
- acceptor.set_option(option);
+ 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.
-Getting the current option value:
+ void use_certificate_chain_file(
+ const std::string & filename);
- 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();
+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.]]
+]
-[endsect]
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
-[section:keep_alive socket_base::keep_alive]
-Socket option to send keep-alives.
- typedef implementation_defined keep_alive;
+[endsect]
-Implements the SOL\_SOCKET/SO\_KEEPALIVE socket option.
+[section:overload2 ssl::basic_context::use_certificate_chain_file (2 of 2 overloads)]
+Use a certificate chain from a file.
-[heading Examples]
-
-Setting the option:
+ boost::system::error_code use_certificate_chain_file(
+ const std::string & filename,
+ boost::system::error_code & ec);
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option(true);
- socket.set_option(option);
+This function is used to load a certificate chain into the context from a file.
+[heading Parameters]
+
-Getting the current option value:
+[variablelist
+
+[[filename][The name of the file containing the certificate. The file must use the PEM format.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::keep_alive option;
- socket.get_option(option);
- bool is_set = option.value();
+[[ec][Set to indicate what error occurred, if any. ]]
+]
+[endsect]
[endsect]
+[section:use_certificate_file ssl::basic_context::use_certificate_file]
+Use a certificate from a file.
-[section:linger socket_base::linger]
-
-Socket option to specify whether the socket lingers on close if unsent data is present.
+ void ``[link boost_asio.reference.ssl__basic_context.use_certificate_file.overload1 use_certificate_file]``(
+ const std::string & filename,
+ file_format format);
- typedef implementation_defined linger;
+ 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)]
-Implements the SOL\_SOCKET/SO\_LINGER socket option.
+Use a certificate from a file.
+ void use_certificate_file(
+ const std::string & filename,
+ file_format format);
-[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 load a certificate into the context from a file.
+[heading Parameters]
+
+[variablelist
+
+[[filename][The name of the file containing the certificate.]]
-Getting the current option value:
+[[format][The file format (ASN.1 or PEM).]]
- 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 Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+]
@@ -45969,60 +51730,84 @@
-[section:max_connections socket_base::max_connections]
+[section:overload2 ssl::basic_context::use_certificate_file (2 of 2 overloads)]
-The maximum length of the queue of pending incoming connections.
+Use a certificate from a file.
- static const int max_connections = implementation_defined;
+ boost::system::error_code use_certificate_file(
+ const std::string & filename,
+ file_format format,
+ 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.]]
-[section:message_do_not_route socket_base::message_do_not_route]
+[[format][The file format (ASN.1 or PEM).]]
-Specify that the data should not be subject to routing.
+[[ec][Set to indicate what error occurred, if any. ]]
- static const int message_do_not_route = implementation_defined;
+]
[endsect]
+[endsect]
-[section:message_flags socket_base::message_flags]
-
-Bitmask type for flags that can be passed to send and receive operations.
-
- typedef int message_flags;
+[section:use_private_key_file ssl::basic_context::use_private_key_file]
+Use a private key from a file.
+ 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:message_out_of_band socket_base::message_out_of_band]
+ void use_private_key_file(
+ const std::string & filename,
+ file_format format);
-Process out-of-band data.
- static const int message_out_of_band = implementation_defined;
+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:message_peek socket_base::message_peek]
+[heading Exceptions]
+
-Peek at incoming data without removing it from the input queue.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- static const int message_peek = implementation_defined;
+]
@@ -46030,68 +51815,84 @@
-[section:non_blocking_io socket_base::non_blocking_io]
+[section:overload2 ssl::basic_context::use_private_key_file (2 of 2 overloads)]
-IO control command to set the blocking mode of the socket.
+Use a private key from a file.
- typedef implementation_defined non_blocking_io;
+ 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.
-Implements the FIONBIO IO control command.
+[heading Parameters]
+
-[heading Example]
+[variablelist
+[[filename][The name of the file containing the private key.]]
+[[format][The file format (ASN.1 or PEM).]]
- 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:use_rsa_private_key_file ssl::basic_context::use_rsa_private_key_file]
+Use an RSA private key from a file.
-[section:receive_buffer_size socket_base::receive_buffer_size]
-
-Socket option for the receive buffer size of a socket.
+ 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);
- typedef implementation_defined receive_buffer_size;
+ 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)]
-Implements the SOL\_SOCKET/SO\_RCVBUF socket option.
+Use an RSA private key from a file.
+ void use_rsa_private_key_file(
+ const std::string & filename,
+ file_format format);
-[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);
+This function is used to load an RSA private key into the context from a file.
+[heading Parameters]
+
+[variablelist
+
+[[filename][The name of the file containing the RSA private key.]]
-Getting the current option value:
+[[format][The file format (ASN.1 or PEM).]]
- 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. ]]
+]
@@ -46099,191 +51900,186 @@
-[section:receive_low_watermark socket_base::receive_low_watermark]
+[section:overload2 ssl::basic_context::use_rsa_private_key_file (2 of 2 overloads)]
-Socket option for the receive low watermark.
+Use an RSA private key from a file.
- typedef implementation_defined receive_low_watermark;
+ 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.
-Implements the SOL\_SOCKET/SO\_RCVLOWAT socket option.
+[heading Parameters]
+
-[heading Examples]
+[variablelist
-Setting the option:
+[[filename][The name of the file containing the RSA private key.]]
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option(1024);
- socket.set_option(option);
+[[format][The file format (ASN.1 or PEM).]]
+[[ec][Set to indicate what error occurred, if any. ]]
+]
-Getting the current option value:
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::receive_low_watermark option;
- socket.get_option(option);
- int size = option.value();
+[endsect]
+[endsect]
+[section: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:reuse_address socket_base::reuse_address]
+Use the specified file to obtain the temporary Diffie-Hellman parameters.
-Socket option to allow the socket to be bound to an address that is already in use.
+ void use_tmp_dh_file(
+ const std::string & filename);
- typedef implementation_defined reuse_address;
+This function is used to load Diffie-Hellman parameters into the context from a file.
-Implements the SOL\_SOCKET/SO\_REUSEADDR socket option.
+[heading Parameters]
+
+
+[variablelist
+
+[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
+]
-[heading Examples]
+[heading Exceptions]
+
+
+[variablelist
-Setting the option:
+[[boost::system::system_error][Thrown on failure. ]]
- boost::asio::ip::tcp::acceptor acceptor(io_service);
- ...
- boost::asio::socket_base::reuse_address option(true);
- acceptor.set_option(option);
+]
+[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 ssl::basic_context::use_tmp_dh_file (2 of 2 overloads)]
+Use the specified file to obtain the temporary Diffie-Hellman parameters.
+ boost::system::error_code use_tmp_dh_file(
+ const std::string & filename,
+ boost::system::error_code & ec);
+This function is used to load Diffie-Hellman parameters into the context from a file.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
-[section:send_buffer_size socket_base::send_buffer_size]
+[[ec][Set to indicate what error occurred, if any. ]]
-Socket option for the send buffer size of a socket.
+]
- typedef implementation_defined send_buffer_size;
+[endsect]
-Implements the SOL\_SOCKET/SO\_SNDBUF socket option.
+[endsect]
-[heading Examples]
-
-Setting the option:
- boost::asio::ip::tcp::socket socket(io_service);
- ...
- boost::asio::socket_base::send_buffer_size option(8192);
- socket.set_option(option);
+[section:verify_client_once ssl::basic_context::verify_client_once]
+['Inherited from ssl::context_base.]
+Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
-Getting the current option value:
+ static const int verify_client_once = implementation_defined;
- 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:verify_fail_if_no_peer_cert ssl::basic_context::verify_fail_if_no_peer_cert]
-[endsect]
+['Inherited from ssl::context_base.]
+Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
-[section:send_low_watermark socket_base::send_low_watermark]
+ static const int verify_fail_if_no_peer_cert = implementation_defined;
-Socket option for the send low watermark.
- typedef implementation_defined send_low_watermark;
+[endsect]
-Implements the SOL\_SOCKET/SO\_SNDLOWAT socket option.
+[section:verify_mode ssl::basic_context::verify_mode]
-[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);
+['Inherited from ssl::context_base.]
+
+Bitmask type for peer verification.
+ typedef int verify_mode;
-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:verify_none ssl::basic_context::verify_none]
+['Inherited from ssl::context_base.]
-[endsect]
+No verification.
+ static const int verify_none = implementation_defined;
-[section:shutdown_type socket_base::shutdown_type]
-Different ways a socket may be shutdown.
+[endsect]
- enum shutdown_type
-[heading Values]
-[variablelist
- [
- [shutdown_receive]
- [Shutdown the receive side of the socket. ]
- ]
+[section:verify_peer ssl::basic_context::verify_peer]
- [
- [shutdown_send]
- [Shutdown the send side of the socket. ]
- ]
- [
- [shutdown_both]
- [Shutdown both send and receive on the socket. ]
- ]
+['Inherited from ssl::context_base.]
-]
+Verify the peer.
+
+ static const int verify_peer = implementation_defined;
@@ -46291,11 +52087,11 @@
-[section:_socket_base socket_base::~socket_base]
+[section:_basic_context ssl::basic_context::~basic_context]
-Protected destructor to prevent deletion through this type.
+Destructor.
- ~socket_base();
+ ~basic_context();
@@ -46305,14 +52101,12 @@
[endsect]
-[section:ssl__basic_context ssl::basic_context]
-SSL context.
+[section:ssl__context ssl::context]
- template<
- typename ``[link boost_asio.reference.Service Service]``>
- class basic_context :
- public ssl::context_base
+Typedef for the typical usage of context.
+
+ typedef basic_context< context_service > context;
[heading Types]
@@ -46492,102 +52286,123 @@
]
-[section:add_verify_path ssl::basic_context::add_verify_path]
-
-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);
- 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);
+[endsect]
-[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.
+[section:ssl__context_base ssl::context_base]
- void add_verify_path(
- const std::string & path);
+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.
+ class context_base
-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 Types]
+[table
+ [[Name][Description]]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.ssl__context_base.file_format [*file_format]]]
+ [File format types. ]
-[[path][The name of a directory containing the certificates.]]
-
-]
+ ]
-[heading Exceptions]
-
+ [
-[variablelist
+ [[link boost_asio.reference.ssl__context_base.method [*method]]]
+ [Different methods supported by a context. ]
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:overload2 ssl::basic_context::add_verify_path (2 of 2 overloads)]
-
-Add a directory containing certificate authority files to be used for performing verification.
+ ]
- boost::system::error_code add_verify_path(
- const std::string & path,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.ssl__context_base.options [*options]]]
+ [Bitmask type for SSL options. ]
+
+ ]
-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.ssl__context_base.password_purpose [*password_purpose]]]
+ [Purpose of PEM password. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.ssl__context_base.verify_mode [*verify_mode]]]
+ [Bitmask type for peer verification. ]
-[[path][The name of a directory containing the certificates.]]
-
-[[ec][Set to indicate what error occurred, if any. ]]
+ ]
]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__context_base._context_base [*~context_base]]]
+ [Protected destructor to prevent deletion through this type. ]
+ ]
+
+]
-[endsect]
-
-
-[endsect]
+[heading Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__context_base.default_workarounds [*default_workarounds]]]
+ [Implement various bug workarounds. ]
+ ]
-[section:basic_context ssl::basic_context::basic_context]
+ [
+ [[link boost_asio.reference.ssl__context_base.no_sslv2 [*no_sslv2]]]
+ [Disable SSL v2. ]
+ ]
-Constructor.
+ [
+ [[link boost_asio.reference.ssl__context_base.no_sslv3 [*no_sslv3]]]
+ [Disable SSL v3. ]
+ ]
- basic_context(
- boost::asio::io_service & io_service,
- method m);
+ [
+ [[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:default_workarounds ssl::basic_context::default_workarounds]
+]
-['Inherited from ssl::context_base.]
+[section:default_workarounds ssl::context_base::default_workarounds]
Implement various bug workarounds.
@@ -46599,10 +52414,7 @@
-[section:file_format ssl::basic_context::file_format]
-
-
-['Inherited from ssl::context_base.]
+[section:file_format ssl::context_base::file_format]
File format types.
@@ -46629,114 +52441,7 @@
-[section:impl ssl::basic_context::impl]
-
-Get the underlying implementation in the native type.
-
- impl_type impl();
-
-
-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]
-
-The native implementation type of the locking dispatcher.
-
- typedef service_type::impl_type impl_type;
-
-
-
-
-[endsect]
-
-
-[section:load_verify_file ssl::basic_context::load_verify_file]
-
-Load a certification authority file for performing verification.
-
- 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);
-
-
-[section:overload1 ssl::basic_context::load_verify_file (1 of 2 overloads)]
-
-Load a certification authority file for performing verification.
-
- void load_verify_file(
- const std::string & filename);
-
-
-This function is used to load 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.]]
-
-]
-
-[heading Exceptions]
-
-
-[variablelist
-
-[[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.]
+[section:method ssl::context_base::method]
Different methods supported by a context.
@@ -46813,10 +52518,7 @@
-[section:no_sslv2 ssl::basic_context::no_sslv2]
-
-
-['Inherited from ssl::context_base.]
+[section:no_sslv2 ssl::context_base::no_sslv2]
Disable SSL v2.
@@ -46828,10 +52530,7 @@
-[section:no_sslv3 ssl::basic_context::no_sslv3]
-
-
-['Inherited from ssl::context_base.]
+[section:no_sslv3 ssl::context_base::no_sslv3]
Disable SSL v3.
@@ -46843,10 +52542,7 @@
-[section:no_tlsv1 ssl::basic_context::no_tlsv1]
-
-
-['Inherited from ssl::context_base.]
+[section:no_tlsv1 ssl::context_base::no_tlsv1]
Disable TLS v1.
@@ -46858,10 +52554,7 @@
-[section:options ssl::basic_context::options]
-
-
-['Inherited from ssl::context_base.]
+[section:options ssl::context_base::options]
Bitmask type for SSL options.
@@ -46874,10 +52567,7 @@
-[section:password_purpose ssl::basic_context::password_purpose]
-
-
-['Inherited from ssl::context_base.]
+[section:password_purpose ssl::context_base::password_purpose]
Purpose of PEM password.
@@ -46904,58 +52594,48 @@
-[section:service_type ssl::basic_context::service_type]
-
-The type of the service that will be used to provide context operations.
+[section:single_dh_use ssl::context_base::single_dh_use]
- typedef Service service_type;
+Always create a new key when using tmp_dh parameters.
+ static const int single_dh_use = implementation_defined;
[endsect]
-[section:set_options ssl::basic_context::set_options]
-Set options on the context.
+[section:verify_client_once ssl::context_base::verify_client_once]
- void ``[link boost_asio.reference.ssl__basic_context.set_options.overload1 set_options]``(
- options o);
+Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.set_options.overload2 set_options]``(
- options o,
- boost::system::error_code & ec);
+ static const int verify_client_once = implementation_defined;
-[section:overload1 ssl::basic_context::set_options (1 of 2 overloads)]
-Set options on the context.
+[endsect]
- void set_options(
- options o);
-This function may be used to configure the SSL options used by the context.
+[section:verify_fail_if_no_peer_cert ssl::context_base::verify_fail_if_no_peer_cert]
+Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
-[heading Parameters]
-
+ static const int verify_fail_if_no_peer_cert = implementation_defined;
-[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]
-
+[endsect]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+
+[section:verify_mode ssl::context_base::verify_mode]
+
+Bitmask type for peer verification.
+
+ typedef int verify_mode;
+
@@ -46963,177 +52643,216 @@
-[section:overload2 ssl::basic_context::set_options (2 of 2 overloads)]
+[section:verify_none ssl::context_base::verify_none]
-Set options on the context.
+No verification.
- boost::system::error_code set_options(
- options o,
- boost::system::error_code & ec);
+ static const int verify_none = implementation_defined;
-This function may be used to configure the SSL options used by the context.
+[endsect]
-[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. ]]
+[section:verify_peer ssl::context_base::verify_peer]
-]
+Verify the peer.
+
+ static const int verify_peer = implementation_defined;
[endsect]
-[endsect]
-[section:set_password_callback ssl::basic_context::set_password_callback]
+[section:_context_base ssl::context_base::~context_base]
-Set the password callback.
+Protected destructor to prevent deletion through this type.
- template<
- typename PasswordCallback>
- void ``[link boost_asio.reference.ssl__basic_context.set_password_callback.overload1 set_password_callback]``(
- PasswordCallback callback);
+ ~context_base();
- 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)]
+[endsect]
-Set the password callback.
- template<
- typename PasswordCallback>
- void set_password_callback(
- PasswordCallback callback);
+[endsect]
-This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
+[section:ssl__context_service ssl::context_service]
+Default service implementation for a context.
-[heading Parameters]
-
+ class context_service :
+ public io_service::service
-[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 Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[link boost_asio.reference.ssl__context_service.impl_type [*impl_type]]]
+ [The type of the context. ]
+
+ ]
]
-[heading Exceptions]
-
+[heading Member Functions]
+[table
+ [[Name][Description]]
-[variablelist
+ [
+ [[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.ssl__context_service.context_service [*context_service]]]
+ [Constructor. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.create [*create]]]
+ [Create a new context implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.destroy [*destroy]]]
+ [Destroy a context 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.ssl__context_service.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.load_verify_file [*load_verify_file]]]
+ [Load a certification authority file for performing verification. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.null [*null]]]
+ [Return a null context implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.set_options [*set_options]]]
+ [Set options on the context. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.set_password_callback [*set_password_callback]]]
+ [Set the password callback. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.set_verify_mode [*set_verify_mode]]]
+ [Set peer verification mode. ]
+ ]
+
+ [
+ [[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.ssl__context_service.use_certificate_chain_file [*use_certificate_chain_file]]]
+ [Use a certificate chain from a file. ]
+ ]
+
+ [
+ [[link boost_asio.reference.ssl__context_service.use_certificate_file [*use_certificate_file]]]
+ [Use a certificate from a file. ]
+ ]
+
+ [
+ [[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.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.ssl__context_service.use_tmp_dh_file [*use_tmp_dh_file]]]
+ [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
+ ]
-[[boost::system::system_error][Thrown on failure. ]]
-
]
+[heading Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__context_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
-[endsect]
-
+]
-[section:overload2 ssl::basic_context::set_password_callback (2 of 2 overloads)]
+[section:add_verify_path ssl::context_service::add_verify_path]
-Set the password callback.
+Add a directory containing certification authority files to be used for performing verification.
- template<
- typename PasswordCallback>
- boost::system::error_code set_password_callback(
- PasswordCallback callback,
+ boost::system::error_code add_verify_path(
+ impl_type & impl,
+ const std::string & path,
boost::system::error_code & ec);
-This function is used to specify a callback function to obtain password information about an encrypted key in PEM format.
-
-
-[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:context_service ssl::context_service::context_service]
+Constructor.
+ context_service(
+ boost::asio::io_service & io_service);
-[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)]
-
-Set the peer verification mode.
+[section:create ssl::context_service::create]
- void set_verify_mode(
- verify_mode v);
+Create a new context implementation.
+ void create(
+ impl_type & impl,
+ context_base::method m);
-This function may be used to configure the peer verification mode used by the context.
-[heading Parameters]
-
+[endsect]
-[variablelist
-
-[[v][A bitmask of peer verification modes. The available verify\_mode values are defined in the context\_base class.]]
-]
-[heading Exceptions]
-
+[section:destroy ssl::context_service::destroy]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+Destroy a context implementation.
-]
+ void destroy(
+ impl_type & impl);
@@ -47141,91 +52860,54 @@
-[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);
-
-
-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.]]
+[section:get_io_service ssl::context_service::get_io_service]
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+['Inherited from io_service.]
+Get the io_service object that owns the service.
+ boost::asio::io_service & get_io_service();
-[endsect]
[endsect]
-[section:single_dh_use ssl::basic_context::single_dh_use]
-
-['Inherited from ssl::context_base.]
+[section:id ssl::context_service::id]
-Always create a new key when using tmp_dh parameters.
+The unique service identifier.
- static const int single_dh_use = implementation_defined;
+ static boost::asio::io_service::id id;
[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:impl_type ssl::context_service::impl_type]
+The type of the context.
-[section:overload1 ssl::basic_context::use_certificate_chain_file (1 of 2 overloads)]
+ typedef implementation_defined impl_type;
-Use a certificate chain from a file.
- void use_certificate_chain_file(
- const std::string & filename);
-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.]]
+[section:io_service ssl::context_service::io_service]
-]
-[heading Exceptions]
-
+['Inherited from io_service.]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
-]
+ boost::asio::io_service & io_service();
@@ -47233,81 +52915,58 @@
-[section:overload2 ssl::basic_context::use_certificate_chain_file (2 of 2 overloads)]
+[section:load_verify_file ssl::context_service::load_verify_file]
-Use a certificate chain from a file.
+Load a certification authority file for performing verification.
- boost::system::error_code use_certificate_chain_file(
+ boost::system::error_code load_verify_file(
+ impl_type & impl,
const std::string & filename,
boost::system::error_code & ec);
-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.]]
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[section:null ssl::context_service::null]
+Return a null context implementation.
+ impl_type null() const;
-[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.
-
- void use_certificate_file(
- const std::string & filename,
- file_format format);
+[section:set_options ssl::context_service::set_options]
+Set options on the context.
-This function is used to load a certificate into the context from a file.
+ boost::system::error_code set_options(
+ impl_type & impl,
+ context_base::options o,
+ boost::system::error_code & ec);
-[heading Parameters]
-
-[variablelist
-
-[[filename][The name of the file containing the certificate.]]
+[endsect]
-[[format][The file format (ASN.1 or PEM).]]
-]
-[heading Exceptions]
-
+[section:set_password_callback ssl::context_service::set_password_callback]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+Set the password callback.
-]
+ template<
+ typename PasswordCallback>
+ boost::system::error_code set_password_callback(
+ impl_type & impl,
+ PasswordCallback callback,
+ boost::system::error_code & ec);
@@ -47315,84 +52974,57 @@
-[section:overload2 ssl::basic_context::use_certificate_file (2 of 2 overloads)]
+[section:set_verify_mode ssl::context_service::set_verify_mode]
-Use a certificate from a file.
+Set peer verification mode.
- boost::system::error_code use_certificate_file(
- const std::string & filename,
- file_format format,
+ boost::system::error_code set_verify_mode(
+ impl_type & impl,
+ context_base::verify_mode v,
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:shutdown_service ssl::context_service::shutdown_service]
-[[ec][Set to indicate what error occurred, if any. ]]
+Destroy all user-defined handler objects owned by the service.
-]
+ void shutdown_service();
[endsect]
-[endsect]
-
-[section:use_private_key_file ssl::basic_context::use_private_key_file]
-Use a private key from a file.
+[section:use_certificate_chain_file ssl::context_service::use_certificate_chain_file]
- void ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload1 use_private_key_file]``(
- const std::string & filename,
- file_format format);
+Use a certificate chain from a file.
- boost::system::error_code ``[link boost_asio.reference.ssl__basic_context.use_private_key_file.overload2 use_private_key_file]``(
+ boost::system::error_code use_certificate_chain_file(
+ impl_type & impl,
const std::string & filename,
- file_format format,
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:use_certificate_file ssl::context_service::use_certificate_file]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+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);
@@ -47400,181 +53032,232 @@
-[section:overload2 ssl::basic_context::use_private_key_file (2 of 2 overloads)]
+[section:use_private_key_file ssl::context_service::use_private_key_file]
Use a private key from a file.
boost::system::error_code use_private_key_file(
+ impl_type & impl,
const std::string & filename,
- file_format format,
+ context_base::file_format format,
boost::system::error_code & ec);
-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.]]
-
-[[format][The file format (ASN.1 or PEM).]]
-
-[[ec][Set to indicate what error occurred, if any. ]]
-
-]
-
-
[endsect]
-[endsect]
-[section:use_rsa_private_key_file ssl::basic_context::use_rsa_private_key_file]
+[section:use_rsa_private_key_file ssl::context_service::use_rsa_private_key_file]
Use an RSA private key from a file.
- 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]``(
+ boost::system::error_code use_rsa_private_key_file(
+ impl_type & impl,
const std::string & filename,
- file_format format,
+ context_base::file_format format,
boost::system::error_code & ec);
-[section:overload1 ssl::basic_context::use_rsa_private_key_file (1 of 2 overloads)]
-
-Use an RSA private key from a file.
-
- void use_rsa_private_key_file(
- const std::string & filename,
- file_format format);
-
-
-This function is used to load an RSA private key into the context from a file.
-
-
-[heading Parameters]
-
-
-[variablelist
-
-[[filename][The name of the file containing the RSA private key.]]
-
-[[format][The file format (ASN.1 or PEM).]]
-
-]
-
-[heading Exceptions]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-
-]
-
-
[endsect]
-[section:overload2 ssl::basic_context::use_rsa_private_key_file (2 of 2 overloads)]
+[section:use_tmp_dh_file ssl::context_service::use_tmp_dh_file]
-Use an RSA private key from a file.
+Use the specified file to obtain the temporary Diffie-Hellman parameters.
- boost::system::error_code use_rsa_private_key_file(
+ boost::system::error_code use_tmp_dh_file(
+ impl_type & impl,
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).]]
+[endsect]
-[[ec][Set to indicate what error occurred, if any. ]]
+[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
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
-[endsect]
+ [[link boost_asio.reference.ssl__stream.handshake_type [*handshake_type]]]
+ [Different handshake types. ]
+
+ ]
-[section:use_tmp_dh_file ssl::basic_context::use_tmp_dh_file]
+ [
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+ [[link boost_asio.reference.ssl__stream.impl_type [*impl_type]]]
+ [The native implementation type of the stream. ]
+
+ ]
- void ``[link boost_asio.reference.ssl__basic_context.use_tmp_dh_file.overload1 use_tmp_dh_file]``(
- const std::string & filename);
+ [
- 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);
+ [[link boost_asio.reference.ssl__stream.lowest_layer_type [*lowest_layer_type]]]
+ [The type of the lowest layer. ]
+
+ ]
+ [
-[section:overload1 ssl::basic_context::use_tmp_dh_file (1 of 2 overloads)]
+ [[link boost_asio.reference.ssl__stream.next_layer_type [*next_layer_type]]]
+ [The type of the next layer. ]
+
+ ]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+ [
- void use_tmp_dh_file(
- const std::string & filename);
+ [[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]]
-This function is used to load Diffie-Hellman parameters into the context from a file.
+ [
+ [[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.
-[heading Parameters]
-
-[variablelist
+[heading Thread Safety]
-[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
-
-]
+[*Distinct] [*objects:] Safe.
-[heading Exceptions]
-
+[*Shared] [*objects:] Unsafe.
-[variablelist
+[heading Example]
-[[boost::system::system_error][Thrown on failure. ]]
+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:overload2 ssl::basic_context::use_tmp_dh_file (2 of 2 overloads)]
+[section:async_handshake ssl::stream::async_handshake]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+Start an asynchronous SSL handshake.
- boost::system::error_code use_tmp_dh_file(
- const std::string & filename,
- boost::system::error_code & ec);
+ template<
+ typename HandshakeHandler>
+ void async_handshake(
+ handshake_type type,
+ HandshakeHandler handler);
-This function is used to load Diffie-Hellman parameters into the context from a file.
+This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
[heading Parameters]
@@ -47582,9 +53265,16 @@
[variablelist
-[[filename][The name of the file containing the Diffie-Hellman parameters. The file must use the PEM format.]]
+[[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. ]]
+[[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.
+ );
+
+``
+]]
]
@@ -47593,48 +53283,80 @@
[endsect]
-[endsect]
+[section:async_read_some ssl::stream::async_read_some]
-[section:verify_client_once ssl::basic_context::verify_client_once]
+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);
-['Inherited from ssl::context_base.]
-Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
+This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
- static const int verify_client_once = implementation_defined;
+[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.]]
-[endsect]
+[[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.
+ );
+``
+]]
+]
-[section:verify_fail_if_no_peer_cert ssl::basic_context::verify_fail_if_no_peer_cert]
+[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.
-['Inherited from ssl::context_base.]
-Fail verification if the peer has no certificate. Ignored unless verify_peer is set.
+[endsect]
- static const int verify_fail_if_no_peer_cert = implementation_defined;
+[section:async_shutdown ssl::stream::async_shutdown]
-[endsect]
+Asynchronously shut down SSL on the stream.
+ template<
+ typename ShutdownHandler>
+ void async_shutdown(
+ ShutdownHandler handler);
-[section:verify_mode ssl::basic_context::verify_mode]
+This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
-['Inherited from ssl::context_base.]
+[heading Parameters]
+
-Bitmask type for peer verification.
+[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.
+ );
- typedef int verify_mode;
+``
+]]
+]
@@ -47642,29 +53364,44 @@
-[section:verify_none ssl::basic_context::verify_none]
-
-
-['Inherited from ssl::context_base.]
-
-No verification.
+[section:async_write_some ssl::stream::async_write_some]
- static const int verify_none = implementation_defined;
+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:verify_peer ssl::basic_context::verify_peer]
+[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.
+ );
-['Inherited from ssl::context_base.]
+``
+]]
-Verify the peer.
+]
- static const int verify_peer = implementation_defined;
+[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.
@@ -47672,202 +53409,63 @@
-[section:_basic_context ssl::basic_context::~basic_context]
-
-Destructor.
-
- ~basic_context();
-
-
-
-[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();
-[endsect]
+This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
-[section:ssl__context ssl::context]
-Typedef for the typical usage of context.
+[heading Return Value]
+
+A reference to the io_service object that stream will use to dispatch handlers. Ownership 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:handshake ssl::stream::handshake]
- [
+Perform SSL handshaking.
- [[link boost_asio.reference.ssl__basic_context.impl_type [*impl_type]]]
- [The native implementation type of the locking dispatcher. ]
-
- ]
+ void ``[link boost_asio.reference.ssl__stream.handshake.overload1 handshake]``(
+ handshake_type type);
- [
+ boost::system::error_code ``[link boost_asio.reference.ssl__stream.handshake.overload2 handshake]``(
+ handshake_type type,
+ boost::system::error_code & ec);
- [[link boost_asio.reference.ssl__basic_context.method [*method]]]
- [Different methods supported by a context. ]
-
- ]
- [
+[section:overload1 ssl::stream::handshake (1 of 2 overloads)]
- [[link boost_asio.reference.ssl__basic_context.options [*options]]]
- [Bitmask type for SSL options. ]
-
- ]
+Perform SSL handshaking.
- [
+ void handshake(
+ handshake_type type);
- [[link boost_asio.reference.ssl__basic_context.password_purpose [*password_purpose]]]
- [Purpose of PEM password. ]
-
- ]
- [
+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.ssl__basic_context.service_type [*service_type]]]
- [The type of the service that will be used to provide context operations. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.ssl__basic_context.verify_mode [*verify_mode]]]
- [Bitmask type for peer verification. ]
+[variablelist
- ]
+[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
]
-[heading Member Functions]
-[table
- [[Name][Description]]
+[heading Exceptions]
+
- [
- [[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. ]
- ]
+[variablelist
-]
-
-[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. ]
- ]
-
- [
- [[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. ]
- ]
-
- [
- [[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. ]
- ]
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -47876,224 +53474,121 @@
[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.
-
- class context_base
-
-
-[heading Types]
-[table
- [[Name][Description]]
- [
+[section:overload2 ssl::stream::handshake (2 of 2 overloads)]
- [[link boost_asio.reference.ssl__context_base.file_format [*file_format]]]
- [File format types. ]
-
- ]
+Perform SSL handshaking.
- [
+ boost::system::error_code handshake(
+ handshake_type type,
+ boost::system::error_code & ec);
- [[link boost_asio.reference.ssl__context_base.method [*method]]]
- [Different methods supported by a context. ]
-
- ]
- [
+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.ssl__context_base.options [*options]]]
- [Bitmask type for SSL options. ]
-
- ]
- [
+[heading Parameters]
+
- [[link boost_asio.reference.ssl__context_base.password_purpose [*password_purpose]]]
- [Purpose of PEM password. ]
+[variablelist
- ]
-
- [
+[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
- [[link boost_asio.reference.ssl__context_base.verify_mode [*verify_mode]]]
- [Bitmask type for peer verification. ]
-
- ]
+[[ec][Set to indicate what error occurred, if any. ]]
]
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
- [
- [[link boost_asio.reference.ssl__context_base._context_base [*~context_base]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
-[heading Data Members]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[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. ]
- ]
+[endsect]
- [
- [[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:handshake_type ssl::stream::handshake_type]
- [
- [[link boost_asio.reference.ssl__context_base.single_dh_use [*single_dh_use]]]
- [Always create a new key when using tmp_dh parameters. ]
- ]
+Different handshake types.
- [
- [[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. ]
- ]
+ enum handshake_type
- [
- [[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. ]
- ]
+[heading Values]
+[variablelist
[
- [[link boost_asio.reference.ssl__context_base.verify_none [*verify_none]]]
- [No verification. ]
+ [client]
+ [Perform handshaking as a client. ]
]
[
- [[link boost_asio.reference.ssl__context_base.verify_peer [*verify_peer]]]
- [Verify the peer. ]
+ [server]
+ [Perform handshaking as a server. ]
]
]
-[section:default_workarounds ssl::context_base::default_workarounds]
-
-Implement various bug workarounds.
- static const int default_workarounds = implementation_defined;
+[endsect]
-[endsect]
+[section:impl ssl::stream::impl]
+Get the underlying implementation in the native type.
+ impl_type impl();
-[section:file_format ssl::context_base::file_format]
-File format types.
+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.
- enum file_format
-[heading Values]
-[variablelist
+[endsect]
- [
- [asn1]
- [ASN.1 file. ]
- ]
- [
- [pem]
- [PEM file. ]
- ]
-]
+[section:impl_type ssl::stream::impl_type]
+The native implementation type of the stream.
+ typedef service_type::impl_type impl_type;
-[endsect]
-[section:method ssl::context_base::method]
+[endsect]
-Different methods supported by a context.
- enum method
+[section:in_avail ssl::stream::in_avail]
-[heading Values]
-[variablelist
+Determine the amount of data that may be read without blocking.
- [
- [sslv2]
- [Generic SSL version 2. ]
- ]
+ std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload1 in_avail]``();
- [
- [sslv2_client]
- [SSL version 2 client. ]
- ]
+ std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload2 in_avail]``(
+ boost::system::error_code & ec);
- [
- [sslv2_server]
- [SSL version 2 server. ]
- ]
- [
- [sslv3]
- [Generic SSL version 3. ]
- ]
+[section:overload1 ssl::stream::in_avail (1 of 2 overloads)]
- [
- [sslv3_client]
- [SSL version 3 client. ]
- ]
+Determine the amount of data that may be read without blocking.
- [
- [sslv3_server]
- [SSL version 3 server. ]
- ]
+ std::size_t in_avail();
- [
- [tlsv1]
- [Generic TLS version 1. ]
- ]
- [
- [tlsv1_client]
- [TLS version 1 client. ]
- ]
+This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
- [
- [tlsv1_server]
- [TLS version 1 server. ]
- ]
- [
- [sslv23]
- [Generic SSL/TLS. ]
- ]
+[heading Return Value]
+
+The number of bytes of data that can be read without blocking.
- [
- [sslv23_client]
- [SSL/TLS client. ]
- ]
+[heading Exceptions]
+
- [
- [sslv23_server]
- [SSL/TLS server. ]
- ]
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
]
@@ -48103,35 +53598,51 @@
-[section:no_sslv2 ssl::context_base::no_sslv2]
+[section:overload2 ssl::stream::in_avail (2 of 2 overloads)]
-Disable SSL v2.
+Determine the amount of data that may be read without blocking.
+
+ std::size_t in_avail(
+ boost::system::error_code & ec);
- static const int no_sslv2 = implementation_defined;
+This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any.]]
+]
-[section:no_sslv3 ssl::context_base::no_sslv3]
+[heading Return Value]
+
+The number of bytes of data that can be read without blocking.
-Disable SSL v3.
- static const int no_sslv3 = implementation_defined;
+[endsect]
[endsect]
+[section:io_service ssl::stream::io_service]
-[section:no_tlsv1 ssl::context_base::no_tlsv1]
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
-Disable TLS v1.
+ boost::asio::io_service & io_service();
- static const int no_tlsv1 = implementation_defined;
+
+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.
@@ -48139,39 +53650,32 @@
-[section:options ssl::context_base::options]
+[section:lowest_layer ssl::stream::lowest_layer]
-Bitmask type for SSL options.
+Get a reference to the lowest layer.
- typedef int options;
+ lowest_layer_type & lowest_layer();
+This function returns a reference to the lowest layer in a stack of stream layers.
-[endsect]
+[heading Return Value]
+
+A reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.
-[section:password_purpose ssl::context_base::password_purpose]
+[endsect]
-Purpose of PEM password.
- enum password_purpose
-[heading Values]
-[variablelist
+[section:lowest_layer_type ssl::stream::lowest_layer_type]
- [
- [for_reading]
- [The password is needed for reading/decryption. ]
- ]
+The type of the lowest layer.
- [
- [for_writing]
- [The password is needed for writing/encryption. ]
- ]
+ typedef next_layer_type::lowest_layer_type lowest_layer_type;
-]
@@ -48179,60 +53683,88 @@
-[section:single_dh_use ssl::context_base::single_dh_use]
+[section:next_layer ssl::stream::next_layer]
-Always create a new key when using tmp_dh parameters.
+Get a reference to the next layer.
- static const int single_dh_use = implementation_defined;
+ next_layer_type & next_layer();
+This function returns a reference to the next layer in a stack of stream layers.
-[endsect]
+[heading Return Value]
+
+A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
-[section:verify_client_once ssl::context_base::verify_client_once]
-Do not request client certificate on renegotiation. Ignored unless verify_peer is set.
+[endsect]
- static const int verify_client_once = implementation_defined;
+[section:next_layer_type ssl::stream::next_layer_type]
-[endsect]
+The type of the next layer.
+ typedef boost::remove_reference< Stream >::type next_layer_type;
-[section:verify_fail_if_no_peer_cert ssl::context_base::verify_fail_if_no_peer_cert]
-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]
+[section:peek ssl::stream::peek]
-[endsect]
+Peek at the incoming data on the stream.
+
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload1 peek]``(
+ const MutableBufferSequence & buffers);
+ 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:verify_mode ssl::context_base::verify_mode]
+[section:overload1 ssl::stream::peek (1 of 2 overloads)]
-Bitmask type for peer verification.
+Peek at the incoming data on the stream.
- typedef int verify_mode;
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t peek(
+ const MutableBufferSequence & buffers);
+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.
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read.]]
+]
-[section:verify_none ssl::context_base::verify_none]
+[heading Return Value]
+
+The number of bytes read.
-No verification.
+[heading Exceptions]
+
- static const int verify_none = implementation_defined;
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
+
+]
@@ -48240,231 +53772,186 @@
-[section:verify_peer ssl::context_base::verify_peer]
+[section:overload2 ssl::stream::peek (2 of 2 overloads)]
-Verify the peer.
+Peek at the incoming data on the stream.
- static const int verify_peer = 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:_context_base ssl::context_base::~context_base]
+[[ec][Set to indicate what error occurred, if any.]]
-Protected destructor to prevent deletion through this type.
+]
- ~context_base();
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
[endsect]
-
[endsect]
-[section:ssl__context_service ssl::context_service]
+[section:read_some ssl::stream::read_some]
-Default service implementation for a context.
+Read some data from the stream.
- class context_service :
- public io_service::service
+ 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);
-[heading Types]
-[table
- [[Name][Description]]
- [
+[section:overload1 ssl::stream::read_some (1 of 2 overloads)]
- [[link boost_asio.reference.ssl__context_service.impl_type [*impl_type]]]
- [The type of the context. ]
-
- ]
+Read some data from the stream.
-]
+ 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.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.ssl__context_service.context_service [*context_service]]]
- [Constructor. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.create [*create]]]
- [Create a new context implementation. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.destroy [*destroy]]]
- [Destroy a context 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.ssl__context_service.io_service [*io_service]]]
- [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.load_verify_file [*load_verify_file]]]
- [Load a certification authority file for performing verification. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.null [*null]]]
- [Return a null context implementation. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.set_options [*set_options]]]
- [Set options on the context. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.set_password_callback [*set_password_callback]]]
- [Set the password callback. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.set_verify_mode [*set_verify_mode]]]
- [Set peer verification mode. ]
- ]
-
- [
- [[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.ssl__context_service.use_certificate_chain_file [*use_certificate_chain_file]]]
- [Use a certificate chain from a file. ]
- ]
-
- [
- [[link boost_asio.reference.ssl__context_service.use_certificate_file [*use_certificate_file]]]
- [Use a certificate from a file. ]
- ]
-
- [
- [[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.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.ssl__context_service.use_tmp_dh_file [*use_tmp_dh_file]]]
- [Use the specified file to obtain the temporary Diffie-Hellman parameters. ]
- ]
+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.
+
+
+[heading Parameters]
+
+
+[variablelist
+[[buffers][The buffers into which the data will be read.]]
+
]
-[heading Data Members]
-[table
- [[Name][Description]]
+[heading Return Value]
+
+The number of bytes read.
- [
- [[link boost_asio.reference.ssl__context_service.id [*id]]]
- [The unique service identifier. ]
- ]
+[heading Exceptions]
+
+
+[variablelist
+
+[[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.
-[section:add_verify_path ssl::context_service::add_verify_path]
-Add a directory containing certification authority files to be used for performing verification.
- boost::system::error_code add_verify_path(
- impl_type & impl,
- const std::string & path,
- boost::system::error_code & ec);
+[endsect]
-[endsect]
+[section:overload2 ssl::stream::read_some (2 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,
+ boost::system::error_code & ec);
-[section:context_service ssl::context_service::context_service]
-Constructor.
+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.
- context_service(
- boost::asio::io_service & io_service);
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The buffers into which the data will be read.]]
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Return Value]
+
+The number of bytes read. Returns 0 if an error occurred.
-[section:create ssl::context_service::create]
+[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.
-Create a new context implementation.
- void create(
- impl_type & impl,
- context_base::method m);
+[endsect]
[endsect]
+[section:service_type ssl::stream::service_type]
-[section:destroy ssl::context_service::destroy]
+The type of the service that will be used to provide stream operations.
-Destroy a context implementation.
+ typedef Service service_type;
- void destroy(
- impl_type & impl);
[endsect]
+[section:shutdown ssl::stream::shutdown]
-[section:get_io_service ssl::context_service::get_io_service]
+Shut down SSL on the stream.
+ void ``[link boost_asio.reference.ssl__stream.shutdown.overload1 shutdown]``();
-['Inherited from io_service.]
+ boost::system::error_code ``[link boost_asio.reference.ssl__stream.shutdown.overload2 shutdown]``(
+ boost::system::error_code & ec);
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+[section:overload1 ssl::stream::shutdown (1 of 2 overloads)]
+Shut down SSL on the stream.
+ void shutdown();
-[endsect]
+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.
-[section:id ssl::context_service::id]
+[heading Exceptions]
+
-The unique service identifier.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- static boost::asio::io_service::id id;
+]
@@ -48472,86 +53959,120 @@
-[section:impl_type ssl::context_service::impl_type]
+[section:overload2 ssl::stream::shutdown (2 of 2 overloads)]
-The type of the context.
+Shut down SSL on the stream.
+
+ boost::system::error_code shutdown(
+ boost::system::error_code & ec);
- typedef implementation_defined impl_type;
+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.
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
+]
-[section:io_service ssl::context_service::io_service]
+[endsect]
-['Inherited from io_service.]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+[endsect]
- boost::asio::io_service & io_service();
+[section:stream ssl::stream::stream]
+Construct a stream.
-[endsect]
+ 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.
-[section:load_verify_file ssl::context_service::load_verify_file]
-Load a certification authority file for performing verification.
+[heading Parameters]
+
- boost::system::error_code load_verify_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+[variablelist
+
+[[arg][The argument to be passed to initialise the underlying stream.]]
+[[context][The SSL context to be used for the stream. ]]
+]
-[endsect]
+[endsect]
-[section:null ssl::context_service::null]
-Return a null context implementation.
+[section:write_some ssl::stream::write_some]
- impl_type null() const;
+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.
-[section:set_options ssl::context_service::set_options]
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some(
+ const ConstBufferSequence & buffers);
-Set options on the context.
- boost::system::error_code set_options(
- impl_type & impl,
- context_base::options o,
- 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.
+[heading Parameters]
+
-[endsect]
+[variablelist
+
+[[buffers][The data to be written.]]
+]
+[heading Return Value]
+
+The number of bytes written.
-[section:set_password_callback ssl::context_service::set_password_callback]
+[heading Exceptions]
+
-Set the password callback.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure.]]
- template<
- typename PasswordCallback>
- boost::system::error_code set_password_callback(
- impl_type & impl,
- PasswordCallback callback,
- boost::system::error_code & ec);
+]
+
+[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.
@@ -48559,41 +54080,53 @@
-[section:set_verify_mode ssl::context_service::set_verify_mode]
+[section:overload2 ssl::stream::write_some (2 of 2 overloads)]
-Set peer verification mode.
+Write some data to the stream.
- boost::system::error_code set_verify_mode(
- impl_type & impl,
- context_base::verify_mode v,
+ 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 on the stream. The function call will block until one or more bytes of data has been written successfully, or until an error occurs.
+
-[endsect]
+[heading Parameters]
+
+[variablelist
+
+[[buffers][The data to be written to the stream.]]
+[[ec][Set to indicate what error occurred, if any.]]
-[section:shutdown_service ssl::context_service::shutdown_service]
+]
-Destroy all user-defined handler objects owned by the service.
+[heading Return Value]
+
+The number of bytes written. Returns 0 if an error occurred.
- void shutdown_service();
+[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:use_certificate_chain_file ssl::context_service::use_certificate_chain_file]
+[section:_stream ssl::stream::~stream]
-Use a certificate chain from a file.
+Destructor.
- boost::system::error_code use_certificate_chain_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+ ~stream();
@@ -48601,47 +54134,60 @@
-[section:use_certificate_file ssl::context_service::use_certificate_file]
+[endsect]
-Use a certificate from a file.
+[section:ssl__stream_base ssl::stream_base]
- boost::system::error_code use_certificate_file(
- impl_type & impl,
- const std::string & filename,
- context_base::file_format format,
- boost::system::error_code & ec);
+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
-[endsect]
+[heading Types]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__stream_base.handshake_type [*handshake_type]]]
+ [Different handshake types. ]
+
+ ]
-[section:use_private_key_file ssl::context_service::use_private_key_file]
+]
-Use a private key from a file.
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
- 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);
+ [
+ [[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]
-[endsect]
+Different handshake types.
+ enum handshake_type
+[heading Values]
+[variablelist
-[section:use_rsa_private_key_file ssl::context_service::use_rsa_private_key_file]
+ [
+ [client]
+ [Perform handshaking as a client. ]
+ ]
-Use an RSA private key from a file.
+ [
+ [server]
+ [Perform handshaking as a server. ]
+ ]
- 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);
+]
@@ -48649,14 +54195,11 @@
-[section:use_tmp_dh_file ssl::context_service::use_tmp_dh_file]
+[section:_stream_base ssl::stream_base::~stream_base]
-Use the specified file to obtain the temporary Diffie-Hellman parameters.
+Protected destructor to prevent deletion through this type.
- boost::system::error_code use_tmp_dh_file(
- impl_type & impl,
- const std::string & filename,
- boost::system::error_code & ec);
+ ~stream_base();
@@ -48666,15 +54209,12 @@
[endsect]
-[section:ssl__stream ssl::stream]
+[section:ssl__stream_service ssl::stream_service]
-Provides stream-oriented functionality using SSL.
+Default service implementation for an SSL stream.
- template<
- typename Stream,
- typename ``[link boost_asio.reference.Service Service]`` = stream_service>
- class stream :
- public ssl::stream_base
+ class stream_service :
+ public io_service::service
[heading Types]
@@ -48683,36 +54223,8 @@
[
- [[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. ]
+ [[link boost_asio.reference.ssl__stream_service.impl_type [*impl_type]]]
+ [The type of a stream implementation. ]
]
@@ -48723,145 +54235,154 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__stream.async_handshake [*async_handshake]]]
+ [[link boost_asio.reference.ssl__stream_service.async_handshake [*async_handshake]]]
[Start an asynchronous SSL handshake. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_read_some [*async_read_some]]]
+ [[link boost_asio.reference.ssl__stream_service.async_read_some [*async_read_some]]]
[Start an asynchronous read. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_shutdown [*async_shutdown]]]
+ [[link boost_asio.reference.ssl__stream_service.async_shutdown [*async_shutdown]]]
[Asynchronously shut down SSL on the stream. ]
]
[
- [[link boost_asio.reference.ssl__stream.async_write_some [*async_write_some]]]
+ [[link boost_asio.reference.ssl__stream_service.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_service.create [*create]]]
+ [Create a new stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__stream.handshake [*handshake]]]
- [Perform SSL handshaking. ]
+ [[link boost_asio.reference.ssl__stream_service.destroy [*destroy]]]
+ [Destroy a stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__stream.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__stream.in_avail [*in_avail]]]
- [Determine the amount of data that may be read without blocking. ]
+ [[link boost_asio.reference.ssl__stream_service.handshake [*handshake]]]
+ [Perform SSL handshaking. ]
]
[
- [[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_service.in_avail [*in_avail]]]
+ [Determine the amount of data that may be read without blocking. ]
]
[
- [[link boost_asio.reference.ssl__stream.lowest_layer [*lowest_layer]]]
- [Get a reference to the lowest layer. ]
+ [[link boost_asio.reference.ssl__stream_service.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
]
[
- [[link boost_asio.reference.ssl__stream.next_layer [*next_layer]]]
- [Get a reference to the next layer. ]
+ [[link boost_asio.reference.ssl__stream_service.null [*null]]]
+ [Return a null stream implementation. ]
]
[
- [[link boost_asio.reference.ssl__stream.peek [*peek]]]
+ [[link boost_asio.reference.ssl__stream_service.peek [*peek]]]
[Peek at the incoming data on the stream. ]
]
[
- [[link boost_asio.reference.ssl__stream.read_some [*read_some]]]
+ [[link boost_asio.reference.ssl__stream_service.read_some [*read_some]]]
[Read some data from the stream. ]
]
[
- [[link boost_asio.reference.ssl__stream.shutdown [*shutdown]]]
+ [[link boost_asio.reference.ssl__stream_service.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_service.shutdown_service [*shutdown_service]]]
+ [Destroy all user-defined handler objects owned by the service. ]
]
[
- [[link boost_asio.reference.ssl__stream.write_some [*write_some]]]
- [Write some data to the stream. ]
+ [[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__stream._stream [*~stream]]]
- [Destructor. ]
+ [[link boost_asio.reference.ssl__stream_service.write_some [*write_some]]]
+ [Write some data to the stream. ]
]
]
-The stream class template provides asynchronous and blocking stream-oriented functionality using SSL.
+[heading Data Members]
+[table
+ [[Name][Description]]
+ [
+ [[link boost_asio.reference.ssl__stream_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
-[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:
+[section:async_handshake ssl::stream_service::async_handshake]
- 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);
+Start an asynchronous SSL handshake.
+ template<
+ typename Stream,
+ typename HandshakeHandler>
+ void async_handshake(
+ impl_type & impl,
+ Stream & next_layer,
+ stream_base::handshake_type type,
+ HandshakeHandler handler);
+[endsect]
-[section:async_handshake ssl::stream::async_handshake]
-Start an asynchronous SSL handshake.
+[section:async_read_some ssl::stream_service::async_read_some]
+
+Start an asynchronous read.
template<
- typename HandshakeHandler>
- void async_handshake(
- handshake_type type,
- HandshakeHandler handler);
+ 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);
-This function is used to asynchronously perform an SSL handshake on the stream. This function call always returns immediately.
+[endsect]
-[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.
- );
+[section:async_shutdown ssl::stream_service::async_shutdown]
-``
-]]
+Asynchronously shut down SSL on the stream.
-]
+ template<
+ typename Stream,
+ typename ShutdownHandler>
+ void async_shutdown(
+ impl_type & impl,
+ Stream & next_layer,
+ ShutdownHandler handler);
@@ -48869,44 +54390,37 @@
-[section:async_read_some ssl::stream::async_read_some]
+[section:async_write_some ssl::stream_service::async_write_some]
-Start an asynchronous read.
+Start an asynchronous write.
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 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);
-This function is used to asynchronously read one or more bytes of data from the stream. The function call always returns immediately.
-[heading Parameters]
-
+[endsect]
-[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.
- );
-``
-]]
+[section:create ssl::stream_service::create]
-]
+Create a new stream implementation.
-[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.
+ template<
+ typename Stream,
+ typename Context_Service>
+ void create(
+ impl_type & impl,
+ Stream & next_layer,
+ basic_context< Context_Service > & context);
@@ -48914,34 +54428,30 @@
-[section:async_shutdown ssl::stream::async_shutdown]
+[section:destroy ssl::stream_service::destroy]
-Asynchronously shut down SSL on the stream.
+Destroy a stream implementation.
template<
- typename ShutdownHandler>
- void async_shutdown(
- ShutdownHandler handler);
+ typename Stream>
+ void destroy(
+ impl_type & impl,
+ Stream & next_layer);
-This function is used to asynchronously shut down SSL on the stream. This function call always returns immediately.
+[endsect]
-[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.
- );
-``
-]]
+[section:get_io_service ssl::stream_service::get_io_service]
-]
+
+['Inherited from io_service.]
+
+Get the io_service object that owns the service.
+
+ boost::asio::io_service & get_io_service();
@@ -48949,44 +54459,29 @@
-[section:async_write_some ssl::stream::async_write_some]
+[section:handshake ssl::stream_service::handshake]
-Start an asynchronous write.
+Perform SSL handshaking.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``,
- typename ``[link boost_asio.reference.WriteHandler WriteHandler]``>
- void async_write_some(
- const ConstBufferSequence & buffers,
- WriteHandler handler);
-
+ typename Stream>
+ boost::system::error_code handshake(
+ impl_type & impl,
+ Stream & next_layer,
+ stream_base::handshake_type type,
+ boost::system::error_code & ec);
-This function is used to asynchronously write one or more bytes of data to the stream. The function call always returns immediately.
-[heading Parameters]
-
+[endsect]
-[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.
- );
-``
-]]
+[section:id ssl::stream_service::id]
-]
+The unique service identifier.
-[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.
+ static boost::asio::io_service::id id;
@@ -48994,65 +54489,56 @@
-[section:get_io_service ssl::stream::get_io_service]
+[section:impl_type ssl::stream_service::impl_type]
-Get the io_service associated with the object.
+The type of a stream implementation.
- boost::asio::io_service & get_io_service();
+ typedef implementation_defined impl_type;
-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]
-[endsect]
+[section:in_avail ssl::stream_service::in_avail]
+Determine the amount of data that may be read without blocking.
-[section:handshake ssl::stream::handshake]
+ template<
+ typename Stream>
+ std::size_t in_avail(
+ impl_type & impl,
+ Stream & next_layer,
+ boost::system::error_code & ec);
-Perform SSL handshaking.
- void ``[link boost_asio.reference.ssl__stream.handshake.overload1 handshake]``(
- handshake_type type);
- boost::system::error_code ``[link boost_asio.reference.ssl__stream.handshake.overload2 handshake]``(
- handshake_type type,
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 ssl::stream::handshake (1 of 2 overloads)]
-Perform SSL handshaking.
+[section:io_service ssl::stream_service::io_service]
- void handshake(
- handshake_type type);
+['Inherited from io_service.]
-This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+ boost::asio::io_service & io_service();
-[heading Parameters]
-
-[variablelist
-
-[[type][The type of handshaking to be performed, i.e. as a client or as a server.]]
-]
+[endsect]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+[section:null ssl::stream_service::null]
+
+Return a null stream implementation.
+
+ impl_type null() const;
@@ -49060,57 +54546,66 @@
-[section:overload2 ssl::stream::handshake (2 of 2 overloads)]
+[section:peek ssl::stream_service::peek]
-Perform SSL handshaking.
+Peek at the incoming data on the stream.
- boost::system::error_code handshake(
- handshake_type 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);
-This function is used to perform SSL handshaking on the stream. The function call will block until handshaking is complete or an error occurs.
+[endsect]
-[heading Parameters]
-
-[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. ]]
+[section:read_some ssl::stream_service::read_some]
-]
+Read some data from the stream.
+
+ 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);
[endsect]
-[endsect]
+[section:shutdown ssl::stream_service::shutdown]
-[section:handshake_type ssl::stream::handshake_type]
+Shut down SSL on the stream.
-Different handshake types.
+ template<
+ typename Stream>
+ boost::system::error_code shutdown(
+ impl_type & impl,
+ Stream & next_layer,
+ boost::system::error_code & ec);
- enum handshake_type
-[heading Values]
-[variablelist
- [
- [client]
- [Perform handshaking as a client. ]
- ]
+[endsect]
- [
- [server]
- [Perform handshaking as a server. ]
- ]
-]
+
+[section:shutdown_service ssl::stream_service::shutdown_service]
+
+Destroy all user-defined handler objects owned by the service.
+
+ void shutdown_service();
@@ -49118,116 +54613,310 @@
-[section:impl ssl::stream::impl]
-
-Get the underlying implementation in the native type.
+[section:stream_service ssl::stream_service::stream_service]
- impl_type impl();
+Construct a new stream service for the specified io_service.
+ stream_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 stream functionality that is not otherwise provided.
[endsect]
-[section:impl_type ssl::stream::impl_type]
-
-The native implementation type of the stream.
+[section:write_some ssl::stream_service::write_some]
- typedef service_type::impl_type impl_type;
+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]
-[section:in_avail ssl::stream::in_avail]
-
-Determine the amount of data that may be read without blocking.
-
- std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload1 in_avail]``();
- std::size_t ``[link boost_asio.reference.ssl__stream.in_avail.overload2 in_avail]``(
- boost::system::error_code & ec);
+[endsect]
-[section:overload1 ssl::stream::in_avail (1 of 2 overloads)]
+[section:strand strand]
-Determine the amount of data that may be read without blocking.
+Typedef for backwards compatibility.
- std::size_t in_avail();
+ typedef boost::asio::io_service::strand strand;
-This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
+[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. ]
+ ]
+
+]
-[heading Return Value]
-
-The number of bytes of data that can be read without blocking.
+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 Exceptions]
-
-[variablelist
+[heading Thread Safety]
-[[boost::system::system_error][Thrown on failure. ]]
+[*Distinct] [*objects:] Safe.
+
+[*Shared] [*objects:] Safe.
-]
[endsect]
+[section:stream_socket_service stream_socket_service]
-[section:overload2 ssl::stream::in_avail (2 of 2 overloads)]
+Default service implementation for a stream socket.
-Determine the amount of data that may be read without blocking.
+ template<
+ typename ``[link boost_asio.reference.Protocol Protocol]``>
+ class stream_socket_service :
+ public io_service::service
- std::size_t in_avail(
- boost::system::error_code & ec);
+[heading Types]
+[table
+ [[Name][Description]]
-This function is used to determine the amount of data, in bytes, that may be read from the stream without blocking.
+ [
+ [[link boost_asio.reference.stream_socket_service.endpoint_type [*endpoint_type]]]
+ [The endpoint type. ]
+
+ ]
-[heading Parameters]
-
+ [
-[variablelist
+ [[link boost_asio.reference.stream_socket_service.implementation_type [*implementation_type]]]
+ [The type of a stream socket implementation. ]
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
+ ]
-[heading Return Value]
-
-The number of bytes of data that can be read without blocking.
+ [
+ [[link boost_asio.reference.stream_socket_service.native_type [*native_type]]]
+ [The native socket type. ]
+
+ ]
+ [
-[endsect]
+ [[link boost_asio.reference.stream_socket_service.protocol_type [*protocol_type]]]
+ [The protocol type. ]
+
+ ]
+]
-[endsect]
+[heading Member Functions]
+[table
+ [[Name][Description]]
+ [
+ [[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. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.receive [*receive]]]
+ [Receive some data from the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.remote_endpoint [*remote_endpoint]]]
+ [Get the remote endpoint. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.send [*send]]]
+ [Send the given data to the peer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.set_option [*set_option]]]
+ [Set a socket option. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_service.shutdown [*shutdown]]]
+ [Disable sends or receives on the socket. ]
+ ]
+
+ [
+ [[link boost_asio.reference.stream_socket_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. ]
+ ]
+
+]
-[section:io_service ssl::stream::io_service]
+[heading Data Members]
+[table
+ [[Name][Description]]
-(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ [
+ [[link boost_asio.reference.stream_socket_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
- boost::asio::io_service & io_service();
+]
-This function may be used to obtain the io_service object that the stream uses to dispatch handlers for asynchronous operations.
+[section:assign stream_socket_service::assign]
+Assign an existing native socket to a stream socket.
-[heading Return Value]
-
-A reference to the io_service object that stream will use to dispatch handlers. Ownership is not transferred to the caller.
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ const native_type & native_socket,
+ boost::system::error_code & ec);
@@ -49235,52 +54924,68 @@
-[section:lowest_layer ssl::stream::lowest_layer]
-
-Get a reference to the lowest layer.
+[section:async_connect stream_socket_service::async_connect]
- lowest_layer_type & lowest_layer();
+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);
-This function returns a reference to the lowest layer in a stack of stream layers.
-[heading Return Value]
-
-A reference to the lowest layer in the stack of stream layers. Ownership is not transferred to the caller.
+[endsect]
-[endsect]
+[section:async_receive stream_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);
-[section:lowest_layer_type ssl::stream::lowest_layer_type]
-The type of the lowest layer.
- typedef next_layer_type::lowest_layer_type lowest_layer_type;
+[endsect]
+[section:async_send stream_socket_service::async_send]
-[endsect]
+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);
-[section:next_layer ssl::stream::next_layer]
-Get a reference to the next layer.
+[endsect]
- next_layer_type & next_layer();
-This function returns a reference to the next layer in a stack of stream layers.
+[section:at_mark stream_socket_service::at_mark]
+Determine whether the socket is at the out-of-band data mark.
-[heading Return Value]
-
-A reference to the next layer in the stack of stream layers. Ownership is not transferred to the caller.
+ bool at_mark(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
@@ -49288,68 +54993,56 @@
-[section:next_layer_type ssl::stream::next_layer_type]
-
-The type of the next layer.
+[section:available stream_socket_service::available]
- typedef boost::remove_reference< Stream >::type next_layer_type;
+Determine the number of bytes available for reading.
+ std::size_t available(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
[endsect]
-[section:peek ssl::stream::peek]
-Peek at the incoming data on the stream.
+[section:bind stream_socket_service::bind]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t ``[link boost_asio.reference.ssl__stream.peek.overload1 peek]``(
- const MutableBufferSequence & buffers);
+Bind the stream socket to the specified local endpoint.
- 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 bind(
+ implementation_type & impl,
+ const endpoint_type & endpoint,
boost::system::error_code & ec);
-[section:overload1 ssl::stream::peek (1 of 2 overloads)]
-Peek at the incoming data on the stream.
+[endsect]
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers);
-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.
+[section:cancel stream_socket_service::cancel]
+Cancel all asynchronous operations associated with the socket.
-[heading Parameters]
-
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
-[variablelist
-
-[[buffers][The buffers into which the data will be read.]]
-]
-[heading Return Value]
-
-The number of bytes read.
+[endsect]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
-]
+[section:close stream_socket_service::close]
+
+Close a stream socket implementation.
+
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
@@ -49357,151 +55050,109 @@
-[section:overload2 ssl::stream::peek (2 of 2 overloads)]
+[section:connect stream_socket_service::connect]
-Peek at the incoming data on the stream.
+Connect the stream socket to the specified endpoint.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t peek(
- const MutableBufferSequence & buffers,
+ boost::system::error_code connect(
+ implementation_type & impl,
+ const endpoint_type & peer_endpoint,
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.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[section:construct stream_socket_service::construct]
-]
+Construct a new stream socket implementation.
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
+ void construct(
+ implementation_type & impl);
[endsect]
-[endsect]
-[section:read_some ssl::stream::read_some]
+[section:destroy stream_socket_service::destroy]
-Read some data from the stream.
+Destroy a stream socket implementation.
- 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);
+ void destroy(
+ implementation_type & impl);
- 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:overload1 ssl::stream::read_some (1 of 2 overloads)]
+[endsect]
-Read some data from the stream.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
+[section:endpoint_type stream_socket_service::endpoint_type]
-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.
+The endpoint type.
+ typedef Protocol::endpoint endpoint_type;
-[heading Parameters]
-
-[variablelist
-
-[[buffers][The buffers into which the data will be read.]]
-]
-[heading Return Value]
-
-The number of bytes read.
+[endsect]
-[heading Exceptions]
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-]
+[section:get_io_service stream_socket_service::get_io_service]
-[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.
+['Inherited from io_service.]
+Get the io_service object that owns the service.
-[endsect]
+ boost::asio::io_service & get_io_service();
-[section:overload2 ssl::stream::read_some (2 of 2 overloads)]
+[endsect]
-Read some data from the stream.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:get_option stream_socket_service::get_option]
-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.
+Get a socket option.
+ template<
+ typename ``[link boost_asio.reference.GettableSocketOption GettableSocketOption]``>
+ boost::system::error_code get_option(
+ const implementation_type & impl,
+ GettableSocketOption & option,
+ boost::system::error_code & ec) const;
-[heading Parameters]
-
-[variablelist
-
-[[buffers][The buffers into which the data will be read.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[endsect]
-]
-[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.
+[section:id stream_socket_service::id]
+The unique service identifier.
+ static boost::asio::io_service::id id;
-[endsect]
[endsect]
-[section:service_type ssl::stream::service_type]
-The type of the service that will be used to provide stream operations.
+[section:implementation_type stream_socket_service::implementation_type]
- typedef Service service_type;
+The type of a stream socket implementation.
+
+ typedef implementation_defined implementation_type;
@@ -49509,34 +55160,32 @@
[endsect]
-[section:shutdown ssl::stream::shutdown]
-Shut down SSL on the stream.
+[section:io_control stream_socket_service::io_control]
- void ``[link boost_asio.reference.ssl__stream.shutdown.overload1 shutdown]``();
+Perform an IO control command on the socket.
- boost::system::error_code ``[link boost_asio.reference.ssl__stream.shutdown.overload2 shutdown]``(
+ template<
+ typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
+ boost::system::error_code io_control(
+ implementation_type & impl,
+ IoControlCommand & command,
boost::system::error_code & ec);
-[section:overload1 ssl::stream::shutdown (1 of 2 overloads)]
-Shut down SSL on the stream.
+[endsect]
- 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.
+[section:io_service stream_socket_service::io_service]
-[heading Exceptions]
-
+['Inherited from io_service.]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. ]]
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
-]
+ boost::asio::io_service & io_service();
@@ -49544,120 +55193,80 @@
-[section:overload2 ssl::stream::shutdown (2 of 2 overloads)]
+[section:is_open stream_socket_service::is_open]
-Shut down SSL on the stream.
+Determine whether the socket is open.
- boost::system::error_code shutdown(
- boost::system::error_code & ec);
+ bool is_open(
+ const implementation_type & impl) const;
-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 Parameters]
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any. ]]
-]
+[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]
[endsect]
-[section:stream ssl::stream::stream]
-
-Construct a stream.
-
- 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.
+[section:native stream_socket_service::native]
+Get the native socket implementation.
-[heading Parameters]
-
+ native_type native(
+ implementation_type & impl);
-[variablelist
-
-[[arg][The argument to be passed to initialise the underlying stream.]]
-[[context][The SSL context to be used for the stream. ]]
-]
+[endsect]
-[endsect]
+[section:native_type stream_socket_service::native_type]
+The native socket type.
-[section:write_some ssl::stream::write_some]
+ typedef implementation_defined native_type;
-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:open stream_socket_service::open]
+Open a stream 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.
+ boost::system::error_code open(
+ implementation_type & impl,
+ const protocol_type & protocol,
+ boost::system::error_code & ec);
-[heading Parameters]
-
-[variablelist
-
-[[buffers][The data to be written.]]
+[endsect]
-]
-[heading Return Value]
-
-The number of bytes written.
-[heading Exceptions]
-
+[section:protocol_type stream_socket_service::protocol_type]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
+The protocol type.
-]
+ typedef Protocol protocol_type;
-[heading Remarks]
-
-The write\_some operation may not transmit all of the data to the peer. Consider using the
-[link boost_asio.reference.write write] function if you need to ensure that all data is written before the blocking operation completes.
@@ -49665,53 +55274,49 @@
-[section:overload2 ssl::stream::write_some (2 of 2 overloads)]
+[section:receive stream_socket_service::receive]
-Write some data to the stream.
+Receive some data from the peer.
template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
+ 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 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]
-
+[endsect]
-[variablelist
-
-[[buffers][The data to be written to the stream.]]
-[[ec][Set to indicate what error occurred, if any.]]
-]
+[section:remote_endpoint stream_socket_service::remote_endpoint]
-[heading Return Value]
-
-The number of bytes written. Returns 0 if an error occurred.
+Get the remote 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.
+ endpoint_type remote_endpoint(
+ const implementation_type & impl,
+ boost::system::error_code & ec) const;
[endsect]
-[endsect]
-
-[section:_stream ssl::stream::~stream]
+[section:send stream_socket_service::send]
-Destructor.
+Send the given data to the peer.
- ~stream();
+ 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);
@@ -49719,60 +55324,43 @@
-[endsect]
+[section:set_option stream_socket_service::set_option]
-[section:ssl__stream_base ssl::stream_base]
+Set a socket option.
-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.
+ 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);
- class stream_base
-[heading Types]
-[table
- [[Name][Description]]
+[endsect]
- [
- [[link boost_asio.reference.ssl__stream_base.handshake_type [*handshake_type]]]
- [Different handshake types. ]
-
- ]
-]
+[section:shutdown stream_socket_service::shutdown]
-[heading Protected Member Functions]
-[table
- [[Name][Description]]
+Disable sends or receives on the socket.
- [
- [[link boost_asio.reference.ssl__stream_base._stream_base [*~stream_base]]]
- [Protected destructor to prevent deletion through this type. ]
- ]
-
-]
+ boost::system::error_code shutdown(
+ implementation_type & impl,
+ socket_base::shutdown_type what,
+ boost::system::error_code & ec);
-[section:handshake_type ssl::stream_base::handshake_type]
-Different handshake types.
+[endsect]
- enum handshake_type
-[heading Values]
-[variablelist
- [
- [client]
- [Perform handshaking as a client. ]
- ]
+[section:shutdown_service stream_socket_service::shutdown_service]
- [
- [server]
- [Perform handshaking as a server. ]
- ]
+Destroy all user-defined handler objects owned by the service.
-]
+ void shutdown_service();
@@ -49780,11 +55368,12 @@
-[section:_stream_base ssl::stream_base::~stream_base]
+[section:stream_socket_service stream_socket_service::stream_socket_service]
-Protected destructor to prevent deletion through this type.
+Construct a new stream socket service for the specified io_service.
- ~stream_base();
+ stream_socket_service(
+ boost::asio::io_service & io_service);
@@ -49794,12 +55383,12 @@
[endsect]
-[section:ssl__stream_service ssl::stream_service]
-Default service implementation for an SSL stream.
+[section:streambuf streambuf]
- class stream_service :
- public io_service::service
+Typedef for the typical usage of basic_streambuf.
+
+ typedef basic_streambuf streambuf;
[heading Types]
@@ -49808,8 +55397,15 @@
[
- [[link boost_asio.reference.ssl__stream_service.impl_type [*impl_type]]]
- [The type of a stream implementation. ]
+ [[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. ]
]
@@ -49820,253 +55416,135 @@
[[Name][Description]]
[
- [[link boost_asio.reference.ssl__stream_service.async_handshake [*async_handshake]]]
- [Start an asynchronous SSL handshake. ]
- ]
-
- [
- [[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.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.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.ssl__stream_service.handshake [*handshake]]]
- [Perform SSL handshaking. ]
+ [[link boost_asio.reference.basic_streambuf.basic_streambuf [*basic_streambuf]]]
+ [Construct a buffer with a specified maximum size. ]
]
[
- [[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.basic_streambuf.commit [*commit]]]
+ [Move the start of the put area by the specified number of characters. ]
]
[
- [[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.basic_streambuf.consume [*consume]]]
+ [Move the start of the get area by the specified number of characters. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.null [*null]]]
- [Return a null stream implementation. ]
+ [[link boost_asio.reference.basic_streambuf.data [*data]]]
+ [Get a list of buffers that represents the get area. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.peek [*peek]]]
- [Peek at the incoming data on the stream. ]
+ [[link boost_asio.reference.basic_streambuf.max_size [*max_size]]]
+ [Return the maximum size of the buffer. ]
]
[
- [[link boost_asio.reference.ssl__stream_service.read_some [*read_some]]]
- [Read some data from the stream. ]
+ [[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.ssl__stream_service.shutdown [*shutdown]]]
- [Shut down SSL on the stream. ]
+ [[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.ssl__stream_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
+ []
]
[
- [[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.basic_streambuf.reserve [*reserve]]]
+ []
]
[
- [[link boost_asio.reference.ssl__stream_service.write_some [*write_some]]]
- [Write some data to the stream. ]
+ [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
+ []
]
]
-[heading Data Members]
-[table
- [[Name][Description]]
-
- [
- [[link boost_asio.reference.ssl__stream_service.id [*id]]]
- [The unique service identifier. ]
- ]
-
-]
-
-
-[section:async_handshake ssl::stream_service::async_handshake]
-
-Start an asynchronous SSL handshake.
-
- template<
- typename Stream,
- typename HandshakeHandler>
- void async_handshake(
- impl_type & impl,
- Stream & next_layer,
- stream_base::handshake_type type,
- HandshakeHandler handler);
-
-
-
-[endsect]
-
-
-
-[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]
-
-
-
-[section:async_shutdown ssl::stream_service::async_shutdown]
-
-Asynchronously shut down SSL on the stream.
-
- template<
- typename Stream,
- typename ShutdownHandler>
- void async_shutdown(
- impl_type & impl,
- Stream & next_layer,
- ShutdownHandler handler);
-
-
-
-[endsect]
-
-
-
-[section:async_write_some ssl::stream_service::async_write_some]
-
-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);
-
-
-
-[endsect]
-
-
-
-[section:create ssl::stream_service::create]
-
-Create a new stream implementation.
-
- template<
- typename Stream,
- typename Context_Service>
- void create(
- impl_type & impl,
- Stream & next_layer,
- basic_context< Context_Service > & context);
-
-
-
-[endsect]
-
-
-
-[section:destroy ssl::stream_service::destroy]
-
-Destroy a stream implementation.
-
- template<
- typename Stream>
- void destroy(
- impl_type & impl,
- Stream & next_layer);
-
[endsect]
+[section:time_traits_lt__ptime__gt_ time_traits< boost::posix_time::ptime >]
-[section:get_io_service ssl::stream_service::get_io_service]
-
-
-['Inherited from io_service.]
-
-Get the io_service object that owns the service.
-
- boost::asio::io_service & get_io_service();
-
-
+Time traits specialised for posix_time.
-[endsect]
+ template<>
+ struct time_traits< boost::posix_time::ptime >
+[heading Types]
+[table
+ [[Name][Description]]
-[section:handshake ssl::stream_service::handshake]
+ [
-Perform SSL handshaking.
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.duration_type [*duration_type]]]
+ [The duration type. ]
+
+ ]
- template<
- typename Stream>
- boost::system::error_code handshake(
- impl_type & impl,
- Stream & next_layer,
- stream_base::handshake_type type,
- boost::system::error_code & ec);
+ [
+ [[link boost_asio.reference.time_traits_lt__ptime__gt_.time_type [*time_type]]]
+ [The time type. ]
+
+ ]
+]
-[endsect]
+[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:id ssl::stream_service::id]
+[section:add time_traits< boost::posix_time::ptime >::add]
-The unique service identifier.
+Add a duration to a time.
- static boost::asio::io_service::id id;
+ static time_type add(
+ const time_type & t,
+ const duration_type & d);
@@ -50074,11 +55552,11 @@
-[section:impl_type ssl::stream_service::impl_type]
+[section:duration_type time_traits< boost::posix_time::ptime >::duration_type]
-The type of a stream implementation.
+The duration type.
- typedef implementation_defined impl_type;
+ typedef boost::posix_time::time_duration duration_type;
@@ -50087,16 +55565,13 @@
-[section:in_avail ssl::stream_service::in_avail]
+[section:less_than time_traits< boost::posix_time::ptime >::less_than]
-Determine the amount of data that may be read without blocking.
+Test whether one time is less than another.
- template<
- typename Stream>
- std::size_t in_avail(
- impl_type & impl,
- Stream & next_layer,
- boost::system::error_code & ec);
+ static bool less_than(
+ const time_type & t1,
+ const time_type & t2);
@@ -50104,14 +55579,11 @@
-[section:io_service ssl::stream_service::io_service]
-
-
-['Inherited from io_service.]
+[section:now time_traits< boost::posix_time::ptime >::now]
-(Deprecated: use get_io_service().) Get the io_service object that owns the service.
+Get the current time.
- boost::asio::io_service & io_service();
+ static time_type now();
@@ -50119,11 +55591,13 @@
-[section:null ssl::stream_service::null]
+[section:subtract time_traits< boost::posix_time::ptime >::subtract]
-Return a null stream implementation.
+Subtract one time from another.
- impl_type null() const;
+ static duration_type subtract(
+ const time_type & t1,
+ const time_type & t2);
@@ -50131,18 +55605,12 @@
-[section:peek ssl::stream_service::peek]
+[section:time_type time_traits< boost::posix_time::ptime >::time_type]
-Peek at the incoming data on the stream.
+The time type.
+
+ typedef boost::posix_time::ptime time_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);
@@ -50150,18 +55618,12 @@
-[section:read_some ssl::stream_service::read_some]
+[section:to_posix_duration time_traits< boost::posix_time::ptime >::to_posix_duration]
-Read some data from the stream.
+Convert to POSIX duration type.
- 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);
+ static boost::posix_time::time_duration to_posix_duration(
+ const duration_type & d);
@@ -50169,141 +55631,123 @@
-[section:shutdown ssl::stream_service::shutdown]
-
-Shut down SSL on the stream.
+[endsect]
- template<
- typename Stream>
- boost::system::error_code shutdown(
- impl_type & impl,
- Stream & next_layer,
- boost::system::error_code & ec);
+[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.
-[endsect]
+ unspecified transfer_all();
+This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
-[section:shutdown_service ssl::stream_service::shutdown_service]
-Destroy all user-defined handler objects owned by the service.
+[heading Example]
+
+Reading until a buffer is full:
- void shutdown_service();
+ 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:stream_service ssl::stream_service::stream_service]
+[endsect]
-Construct a new stream service for the specified io_service.
- stream_service(
- boost::asio::io_service & io_service);
+[section:transfer_at_least 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.
-[endsect]
+ unspecified transfer_at_least(
+ std::size_t minimum);
+This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
-[section:write_some ssl::stream_service::write_some]
-Write some data to the stream.
+[heading Example]
+
+Reading until a buffer is full or contains at least 64 bytes:
- 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);
+ 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
+ }
-[endsect]
[endsect]
-[section:strand strand]
-Typedef for backwards compatibility.
+[section:use_service use_service]
- typedef boost::asio::io_service::strand strand;
-[heading Member Functions]
-[table
- [[Name][Description]]
+ template<
+ typename ``[link boost_asio.reference.Service Service]``>
+ Service & use_service(
+ io_service & ios);
- [
- [[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.
+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 Thread Safety]
+[heading Parameters]
+
+
+[variablelist
-[*Distinct] [*objects:] Safe.
+[[ios][The io\_service object that owns the service.]]
-[*Shared] [*objects:] Safe.
+]
+[heading Return Value]
+
+The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
[endsect]
-[section:stream_socket_service stream_socket_service]
+[section:windows__basic_handle windows::basic_handle]
-Default service implementation for a stream socket.
+Provides Windows handle functionality.
template<
- typename ``[link boost_asio.reference.Protocol Protocol]``>
- class stream_socket_service :
- public io_service::service
+ typename ``[link boost_asio.reference.HandleService HandleService]``>
+ class basic_handle :
+ public basic_io_object< HandleService >
[heading Types]
@@ -50312,29 +55756,29 @@
[
- [[link boost_asio.reference.stream_socket_service.endpoint_type [*endpoint_type]]]
- [The endpoint type. ]
+ [[link boost_asio.reference.windows__basic_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_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_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_handle.service_type [*service_type]]]
+ [The type of the service that will be used to provide I/O operations. ]
]
@@ -50345,289 +55789,107 @@
[[Name][Description]]
[
- [[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.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.open [*open]]]
- [Open a stream socket. ]
+ [[link boost_asio.reference.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
]
[
- [[link boost_asio.reference.stream_socket_service.receive [*receive]]]
- [Receive some data from the peer. ]
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.remote_endpoint [*remote_endpoint]]]
- [Get the remote endpoint. ]
+ [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [Close the handle. ]
]
[
- [[link boost_asio.reference.stream_socket_service.send [*send]]]
- [Send the given data to the peer. ]
+ [[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.stream_socket_service.set_option [*set_option]]]
- [Set a socket option. ]
+ [[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.stream_socket_service.shutdown [*shutdown]]]
- [Disable sends or receives on the socket. ]
+ [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.stream_socket_service.shutdown_service [*shutdown_service]]]
- [Destroy all user-defined handler objects owned by the service. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[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__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
]
]
-[heading Data Members]
+[heading Protected Member Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.stream_socket_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:assign stream_socket_service::assign]
-
-Assign an existing native socket to a stream socket.
-
- boost::system::error_code assign(
- implementation_type & impl,
- const protocol_type & protocol,
- const native_type & native_socket,
- boost::system::error_code & ec);
-
-
-
-[endsect]
-
-
-
-[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]
-
-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_send stream_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: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);
-
+ [
+ [[link boost_asio.reference.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+ [
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[endsect]
+]
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
-[section:cancel stream_socket_service::cancel]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Cancel all asynchronous operations associated with the socket.
+[*Shared] [*objects:] Unsafe.
- boost::system::error_code cancel(
- implementation_type & impl,
- boost::system::error_code & ec);
+[section:assign windows::basic_handle::assign]
+Assign an existing native handle to the handle.
-[endsect]
+ 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:close stream_socket_service::close]
+[section:overload1 windows::basic_handle::assign (1 of 2 overloads)]
-Close a stream socket implementation.
+Assign an existing native handle to the handle.
- boost::system::error_code close(
- implementation_type & impl,
- boost::system::error_code & ec);
+ void assign(
+ const native_type & native_handle);
@@ -50635,13 +55897,12 @@
-[section:connect stream_socket_service::connect]
+[section:overload2 windows::basic_handle::assign (2 of 2 overloads)]
-Connect the stream socket to the specified endpoint.
+Assign an existing native handle to the handle.
- boost::system::error_code connect(
- implementation_type & impl,
- const endpoint_type & peer_endpoint,
+ boost::system::error_code assign(
+ const native_type & native_handle,
boost::system::error_code & ec);
@@ -50649,39 +55910,39 @@
[endsect]
-
-[section:construct stream_socket_service::construct]
-
-Construct a new stream socket implementation.
-
- void construct(
- implementation_type & impl);
-
-
-
[endsect]
+[section:basic_handle windows::basic_handle::basic_handle]
+Construct a basic_handle without opening it.
-[section:destroy stream_socket_service::destroy]
+ ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload1 basic_handle]``(
+ boost::asio::io_service & io_service);
-Destroy a stream socket implementation.
+ ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload2 basic_handle]``(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
- void destroy(
- implementation_type & impl);
+[section:overload1 windows::basic_handle::basic_handle (1 of 2 overloads)]
+Construct a basic_handle without opening it.
-[endsect]
+ basic_handle(
+ boost::asio::io_service & io_service);
+This constructor creates a handle without opening it.
-[section:endpoint_type stream_socket_service::endpoint_type]
-The endpoint type.
+[heading Parameters]
+
- typedef Protocol::endpoint endpoint_type;
+[variablelist
+
+[[io_service][The io\_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
+]
@@ -50689,73 +55950,73 @@
-[section:get_io_service stream_socket_service::get_io_service]
+[section:overload2 windows::basic_handle::basic_handle (2 of 2 overloads)]
+Construct a basic_handle on an existing native handle.
-['Inherited from io_service.]
+ basic_handle(
+ boost::asio::io_service & io_service,
+ const native_type & native_handle);
-Get the io_service object that owns the service.
- boost::asio::io_service & get_io_service();
+This constructor creates a handle object to hold an existing native handle.
+[heading Parameters]
+
-[endsect]
+[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.]]
+]
-[section:get_option stream_socket_service::get_option]
+[heading Exceptions]
+
-Get a socket option.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- 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]
-
-The unique service identifier.
-
- static boost::asio::io_service::id id;
-
-
-
[endsect]
+[section:cancel windows::basic_handle::cancel]
+Cancel all asynchronous operations associated with the handle.
-[section:implementation_type stream_socket_service::implementation_type]
+ void ``[link boost_asio.reference.windows__basic_handle.cancel.overload1 cancel]``();
-The type of a stream socket implementation.
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.cancel.overload2 cancel]``(
+ boost::system::error_code & ec);
- typedef implementation_defined implementation_type;
+[section:overload1 windows::basic_handle::cancel (1 of 2 overloads)]
+Cancel all asynchronous operations associated with the handle.
+ void cancel();
-[endsect]
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
-[section:io_control stream_socket_service::io_control]
+[heading Exceptions]
+
-Perform an IO control command on the socket.
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
- template<
- typename ``[link boost_asio.reference.IoControlCommand IoControlCommand]``>
- boost::system::error_code io_control(
- implementation_type & impl,
- IoControlCommand & command,
- boost::system::error_code & ec);
+]
@@ -50763,127 +56024,127 @@
-[section:io_service stream_socket_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();
+[section:overload2 windows::basic_handle::cancel (2 of 2 overloads)]
+Cancel all asynchronous operations associated with the handle.
+ boost::system::error_code cancel(
+ boost::system::error_code & ec);
-[endsect]
+This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation\_aborted error.
-[section:is_open stream_socket_service::is_open]
+[heading Parameters]
+
-Determine whether the socket is open.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
- bool is_open(
- const implementation_type & impl) const;
+]
[endsect]
+[endsect]
-[section:local_endpoint stream_socket_service::local_endpoint]
+[section:close windows::basic_handle::close]
-Get the local endpoint.
+Close the handle.
- endpoint_type local_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ void ``[link boost_asio.reference.windows__basic_handle.close.overload1 close]``();
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.close.overload2 close]``(
+ boost::system::error_code & ec);
-[endsect]
+[section:overload1 windows::basic_handle::close (1 of 2 overloads)]
+Close the handle.
+ void close();
-[section:native stream_socket_service::native]
-Get the native socket implementation.
+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.
- native_type native(
- implementation_type & impl);
+[heading Exceptions]
+
+[variablelist
+
+[[boost::system::system_error][Thrown on failure. ]]
-[endsect]
+]
-[section:native_type stream_socket_service::native_type]
+[endsect]
-The native socket type.
- typedef implementation_defined native_type;
+[section:overload2 windows::basic_handle::close (2 of 2 overloads)]
+Close the handle.
+ boost::system::error_code close(
+ boost::system::error_code & ec);
-[endsect]
+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.
-[section:open stream_socket_service::open]
+[heading Parameters]
+
-Open a stream socket.
+[variablelist
+
+[[ec][Set to indicate what error occurred, if any. ]]
- boost::system::error_code open(
- implementation_type & impl,
- const protocol_type & protocol,
- boost::system::error_code & ec);
+]
[endsect]
+[endsect]
-[section:protocol_type stream_socket_service::protocol_type]
-The protocol type.
+[section:get_io_service windows::basic_handle::get_io_service]
- typedef Protocol protocol_type;
+['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.
-[section:receive stream_socket_service::receive]
+[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.
-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]
-[endsect]
+[section:implementation windows::basic_handle::implementation]
-[section:remote_endpoint stream_socket_service::remote_endpoint]
+['Inherited from basic_io_object.]
-Get the remote endpoint.
+The underlying implementation of the I/O object.
- endpoint_type remote_endpoint(
- const implementation_type & impl,
- boost::system::error_code & ec) const;
+ implementation_type implementation;
@@ -50891,49 +56152,38 @@
-[section:send stream_socket_service::send]
+[section:implementation_type windows::basic_handle::implementation_type]
-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);
+['Inherited from basic_io_object.]
+The underlying implementation type of I/O object.
+ typedef service_type::implementation_type implementation_type;
-[endsect]
-[section:set_option stream_socket_service::set_option]
+[endsect]
-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);
+
+[section:io_service windows::basic_handle::io_service]
+['Inherited from basic_io_object.]
-[endsect]
+(Deprecated: use get_io_service().) Get the io_service associated with the object.
+ boost::asio::io_service & io_service();
-[section:shutdown stream_socket_service::shutdown]
+This function may be used to obtain the io_service object that the I/O object uses to dispatch handlers for asynchronous operations.
-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);
+[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.
@@ -50941,11 +56191,11 @@
-[section:shutdown_service stream_socket_service::shutdown_service]
+[section:is_open windows::basic_handle::is_open]
-Destroy all user-defined handler objects owned by the service.
+Determine whether the handle is open.
- void shutdown_service();
+ bool is_open() const;
@@ -50953,27 +56203,31 @@
-[section:stream_socket_service stream_socket_service::stream_socket_service]
+[section:lowest_layer windows::basic_handle::lowest_layer]
-Construct a new stream socket service for the specified io_service.
+Get a reference to the lowest layer.
- stream_socket_service(
- boost::asio::io_service & io_service);
+ 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:streambuf streambuf]
-Typedef for the typical usage of basic_streambuf.
+[section:lowest_layer_type windows::basic_handle::lowest_layer_type]
- typedef basic_streambuf streambuf;
+A basic_handle is always the lowest layer.
+
+ typedef basic_handle< HandleService > lowest_layer_type;
[heading Types]
@@ -50982,233 +56236,121 @@
[
- [[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__basic_handle.implementation_type [*implementation_type]]]
+ [The underlying implementation type of I/O object. ]
]
[
- [[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__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [A basic_handle is always the lowest layer. ]
]
-]
-
-[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.windows__basic_handle.native_type [*native_type]]]
+ [The native representation of a handle. ]
- [
- [[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.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.basic_streambuf.size [*size]]]
- [Return the size of the get area in characters. ]
]
-
+
]
-[heading Protected Member Functions]
+[heading Member Functions]
[table
[[Name][Description]]
[
- [[link boost_asio.reference.basic_streambuf.overflow [*overflow]]]
- []
+ [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
]
[
- [[link boost_asio.reference.basic_streambuf.reserve [*reserve]]]
- []
+ [[link boost_asio.reference.windows__basic_handle.basic_handle [*basic_handle]]]
+ [Construct a basic_handle without opening it. ]
]
[
- [[link boost_asio.reference.basic_streambuf.underflow [*underflow]]]
- []
+ [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
]
-]
-
-
-
-[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__basic_handle.close [*close]]]
+ [Close the handle. ]
]
-
- [
-
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.time_type [*time_type]]]
- [The time type. ]
- ]
-
-]
-
-[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__basic_handle.get_io_service [*get_io_service]]]
+ [Get the io_service associated with the object. ]
]
[
- [[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__basic_handle.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service associated with the object. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.now [*now]]]
- [Get the current time. ]
+ [[link boost_asio.reference.windows__basic_handle.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.time_traits_lt__ptime__gt_.subtract [*subtract]]]
- [Subtract one time from another. ]
+ [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
]
[
- [[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__basic_handle.native [*native]]]
+ [Get the native handle representation. ]
]
]
+[heading Protected Member Functions]
+[table
+ [[Name][Description]]
-[section:add time_traits< boost::posix_time::ptime >::add]
-
-Add a duration to a time.
-
- static time_type add(
- const time_type & t,
- const duration_type & d);
-
-
-
-[endsect]
-
-
-
-[section:duration_type time_traits< boost::posix_time::ptime >::duration_type]
-
-The duration type.
-
- typedef boost::posix_time::time_duration duration_type;
-
-
-
-
-[endsect]
-
-
-
-[section:less_than time_traits< boost::posix_time::ptime >::less_than]
-
-Test whether one time is less than another.
-
- static bool less_than(
- const time_type & t1,
- const time_type & t2);
-
-
-
-[endsect]
-
-
-
-[section:now time_traits< boost::posix_time::ptime >::now]
-
-Get the current time.
-
- static time_type now();
-
-
-
-[endsect]
-
-
-
-[section:subtract time_traits< boost::posix_time::ptime >::subtract]
-
-Subtract one time from another.
-
- static duration_type subtract(
- const time_type & t1,
- const time_type & t2);
-
-
-
-[endsect]
-
-
-
-[section:time_type time_traits< boost::posix_time::ptime >::time_type]
-
-The time type.
-
- typedef boost::posix_time::ptime time_type;
+ [
+ [[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.windows__basic_handle.implementation [*implementation]]]
+ [The underlying implementation of the I/O object. ]
+ ]
+ [
+ [[link boost_asio.reference.windows__basic_handle.service [*service]]]
+ [The service associated with the I/O object. ]
+ ]
-[endsect]
+]
+The windows::basic_handle class template provides the ability to wrap a Windows handle.
-[section:to_posix_duration time_traits< boost::posix_time::ptime >::to_posix_duration]
+[heading Thread Safety]
+
+[*Distinct] [*objects:] Safe.
-Convert to POSIX duration type.
+[*Shared] [*objects:] Unsafe.
- static boost::posix_time::time_duration to_posix_duration(
- const duration_type & d);
@@ -51216,38 +56358,25 @@
-[endsect]
+[section:native windows::basic_handle::native]
+Get the native handle representation.
-[section:transfer_all transfer_all]
+ native_type native();
-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();
+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.
-This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
+[endsect]
-[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
- }
+[section:native_type windows::basic_handle::native_type]
+The native representation of a handle.
+ typedef HandleService::native_type native_type;
@@ -51256,83 +56385,59 @@
-[section:transfer_at_least transfer_at_least]
+[section:service windows::basic_handle::service]
-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);
+['Inherited from basic_io_object.]
+The service associated with the I/O object.
-This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.
+ service_type & service;
-[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
- }
+[endsect]
+[section:service_type windows::basic_handle::service_type]
+['Inherited from basic_io_object.]
-[endsect]
+The type of the service that will be used to provide I/O operations.
+ typedef HandleService service_type;
-[section:use_service use_service]
+[endsect]
- 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.
+[section:_basic_handle windows::basic_handle::~basic_handle]
+Protected destructor to prevent deletion through this type.
-[heading Parameters]
-
+ ~basic_handle();
-[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]
[endsect]
+[section:windows__basic_random_access_handle windows::basic_random_access_handle]
-[section:windows__basic_handle windows::basic_handle]
-
-Provides Windows handle functionality.
+Provides random-access handle functionality.
template<
- typename ``[link boost_asio.reference.HandleService HandleService]``>
- class basic_handle :
- public basic_io_object< HandleService >
+ typename ``[link boost_asio.reference.RandomAccessHandleService RandomAccessHandleService]`` = random_access_handle_service>
+ class basic_random_access_handle :
+ public windows::basic_handle< RandomAccessHandleService >
[heading Types]
@@ -51341,28 +56446,28 @@
[
- [[link boost_asio.reference.windows__basic_handle.implementation_type [*implementation_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.windows__basic_handle.lowest_layer_type [*lowest_layer_type]]]
+ [[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_handle.native_type [*native_type]]]
+ [[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_handle.service_type [*service_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. ]
]
@@ -51374,59 +56479,68 @@
[[Name][Description]]
[
- [[link boost_asio.reference.windows__basic_handle.assign [*assign]]]
+ [[link boost_asio.reference.windows__basic_random_access_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_random_access_handle.async_read_some_at [*async_read_some_at]]]
+ [Start an asynchronous read at the specified offset. ]
]
[
- [[link boost_asio.reference.windows__basic_handle.cancel [*cancel]]]
+ [[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.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.windows__basic_random_access_handle.cancel [*cancel]]]
[Cancel all asynchronous operations associated with the handle. ]
]
[
- [[link boost_asio.reference.windows__basic_handle.close [*close]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.close [*close]]]
[Close the handle. ]
]
[
- [[link boost_asio.reference.windows__basic_handle.get_io_service [*get_io_service]]]
+ [[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_handle.io_service [*io_service]]]
+ [[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_handle.is_open [*is_open]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.is_open [*is_open]]]
[Determine whether the handle is open. ]
]
[
- [[link boost_asio.reference.windows__basic_handle.lowest_layer [*lowest_layer]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.lowest_layer [*lowest_layer]]]
[Get a reference to the lowest layer. ]
]
[
- [[link boost_asio.reference.windows__basic_handle.native [*native]]]
+ [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
[Get the native handle representation. ]
]
-]
-
-[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. ]
+ [[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.windows__basic_random_access_handle.write_some_at [*write_some_at]]]
+ [Write some data to the handle at the specified offset. ]
]
]
@@ -51436,18 +56550,18 @@
[[Name][Description]]
[
- [[link boost_asio.reference.windows__basic_handle.implementation [*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_handle.service [*service]]]
+ [[link boost_asio.reference.windows__basic_random_access_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.
+The windows::basic_random_access_handle class template provides asynchronous and blocking random-access handle functionality.
[heading Thread Safety]
@@ -51457,19 +56571,22 @@
[*Shared] [*objects:] Unsafe.
-[section:assign windows::basic_handle::assign]
+[section:assign windows::basic_random_access_handle::assign]
Assign an existing native handle to the handle.
- void ``[link boost_asio.reference.windows__basic_handle.assign.overload1 assign]``(
+ 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_handle.assign.overload2 assign]``(
+ 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_handle::assign (1 of 2 overloads)]
+[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.
@@ -51482,7 +56599,10 @@
-[section:overload2 windows::basic_handle::assign (2 of 2 overloads)]
+[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.
@@ -51497,27 +56617,145 @@
[endsect]
-[section:basic_handle windows::basic_handle::basic_handle]
-Construct a basic_handle without opening it.
+[section:async_read_some_at windows::basic_random_access_handle::async_read_some_at]
- ``[link boost_asio.reference.windows__basic_handle.basic_handle.overload1 basic_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
+
+[[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]
+
+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.]]
+
+[[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.]]
+
+[[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.
+
+[heading Example]
+
+To write a single data buffer use the
+[link boost_asio.reference.buffer buffer] function as follows:
+
+ handle.async_write_some_at(42, boost::asio::buffer(data, size), handler);
+
+
+See the
+[link boost_asio.reference.buffer buffer] documentation for information on writing multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.
+
+
+
+[endsect]
+
+
+[section:basic_random_access_handle windows::basic_random_access_handle::basic_random_access_handle]
+
+Construct a basic_random_access_handle without opening it.
+
+ ``[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_handle.basic_handle.overload2 basic_handle]``(
+ ``[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);
-[section:overload1 windows::basic_handle::basic_handle (1 of 2 overloads)]
+[section:overload1 windows::basic_random_access_handle::basic_random_access_handle (1 of 2 overloads)]
-Construct a basic_handle without opening it.
+Construct a basic_random_access_handle without opening it.
- basic_handle(
+ basic_random_access_handle(
boost::asio::io_service & io_service);
-This constructor creates a handle without opening it.
+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.
[heading Parameters]
@@ -51525,7 +56763,7 @@
[variablelist
-[[io_service][The io\_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
+[[io_service][The io\_service object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle. ]]
]
@@ -51535,16 +56773,16 @@
-[section:overload2 windows::basic_handle::basic_handle (2 of 2 overloads)]
+[section:overload2 windows::basic_random_access_handle::basic_random_access_handle (2 of 2 overloads)]
-Construct a basic_handle on an existing native handle.
+Construct a basic_random_access_handle on an existing native handle.
- basic_handle(
+ basic_random_access_handle(
boost::asio::io_service & io_service,
const native_type & native_handle);
-This constructor creates a handle object to hold an existing native handle.
+This constructor creates a random-access handle object to hold an existing native handle.
[heading Parameters]
@@ -51552,9 +56790,9 @@
[variablelist
-[[io_service][The io\_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
+[[io_service][The io\_service object that the random-access handle will use to dispatch handlers for any asynchronous operations performed on the handle.]]
-[[native_handle][A native handle.]]
+[[native_handle][The new underlying handle implementation.]]
]
@@ -51574,17 +56812,20 @@
[endsect]
-[section:cancel windows::basic_handle::cancel]
+[section:cancel windows::basic_random_access_handle::cancel]
Cancel all asynchronous operations associated with the handle.
- void ``[link boost_asio.reference.windows__basic_handle.cancel.overload1 cancel]``();
+ void ``[link boost_asio.reference.windows__basic_random_access_handle.cancel.overload1 cancel]``();
- boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.cancel.overload2 cancel]``(
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.cancel.overload2 cancel]``(
boost::system::error_code & ec);
-[section:overload1 windows::basic_handle::cancel (1 of 2 overloads)]
+[section:overload1 windows::basic_random_access_handle::cancel (1 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
Cancel all asynchronous operations associated with the handle.
@@ -51609,7 +56850,10 @@
-[section:overload2 windows::basic_handle::cancel (2 of 2 overloads)]
+[section:overload2 windows::basic_random_access_handle::cancel (2 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
Cancel all asynchronous operations associated with the handle.
@@ -51636,17 +56880,20 @@
[endsect]
-[section:close windows::basic_handle::close]
+[section:close windows::basic_random_access_handle::close]
Close the handle.
- void ``[link boost_asio.reference.windows__basic_handle.close.overload1 close]``();
+ void ``[link boost_asio.reference.windows__basic_random_access_handle.close.overload1 close]``();
- boost::system::error_code ``[link boost_asio.reference.windows__basic_handle.close.overload2 close]``(
+ boost::system::error_code ``[link boost_asio.reference.windows__basic_random_access_handle.close.overload2 close]``(
boost::system::error_code & ec);
-[section:overload1 windows::basic_handle::close (1 of 2 overloads)]
+[section:overload1 windows::basic_random_access_handle::close (1 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
Close the handle.
@@ -51671,7 +56918,10 @@
-[section:overload2 windows::basic_handle::close (2 of 2 overloads)]
+[section:overload2 windows::basic_random_access_handle::close (2 of 2 overloads)]
+
+
+['Inherited from windows::basic_handle.]
Close the handle.
@@ -51699,7 +56949,7 @@
[endsect]
-[section:get_io_service windows::basic_handle::get_io_service]
+[section:get_io_service windows::basic_random_access_handle::get_io_service]
['Inherited from basic_io_object.]
@@ -51722,7 +56972,7 @@
-[section:implementation windows::basic_handle::implementation]
+[section:implementation windows::basic_random_access_handle::implementation]
['Inherited from basic_io_object.]
@@ -51737,7 +56987,7 @@
-[section:implementation_type windows::basic_handle::implementation_type]
+[section:implementation_type windows::basic_random_access_handle::implementation_type]
['Inherited from basic_io_object.]
@@ -51753,7 +57003,7 @@
-[section:io_service windows::basic_handle::io_service]
+[section:io_service windows::basic_random_access_handle::io_service]
['Inherited from basic_io_object.]
@@ -51776,7 +57026,10 @@
-[section:is_open windows::basic_handle::is_open]
+[section:is_open windows::basic_random_access_handle::is_open]
+
+
+['Inherited from windows::basic_handle.]
Determine whether the handle is open.
@@ -51788,7 +57041,10 @@
-[section:lowest_layer windows::basic_handle::lowest_layer]
+[section:lowest_layer windows::basic_random_access_handle::lowest_layer]
+
+
+['Inherited from windows::basic_handle.]
Get a reference to the lowest layer.
@@ -51808,11 +57064,14 @@
-[section:lowest_layer_type windows::basic_handle::lowest_layer_type]
+[section:lowest_layer_type windows::basic_random_access_handle::lowest_layer_type]
+
+
+['Inherited from windows::basic_handle.]
A basic_handle is always the lowest layer.
- typedef basic_handle< HandleService > lowest_layer_type;
+ typedef basic_handle< RandomAccessHandleService > lowest_layer_type;
[heading Types]
@@ -51943,7 +57202,10 @@
-[section:native windows::basic_handle::native]
+[section:native windows::basic_random_access_handle::native]
+
+
+['Inherited from windows::basic_handle.]
Get the native handle representation.
@@ -51957,11 +57219,11 @@
-[section:native_type windows::basic_handle::native_type]
+[section:native_type windows::basic_random_access_handle::native_type]
The native representation of a handle.
- typedef HandleService::native_type native_type;
+ typedef RandomAccessHandleService::native_type native_type;
@@ -51969,8 +57231,130 @@
[endsect]
+[section:read_some_at windows::basic_random_access_handle::read_some_at]
+
+Read some data from the handle at the specified offset.
+
+ template<
+ 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);
+
+ 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 windows::basic_random_access_handle::read_some_at (1 of 2 overloads)]
+
+Read some data from the handle at the specified offset.
+
+ 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 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]
+
+
+[variablelist
+
+[[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. 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.
+
-[section:service windows::basic_handle::service]
+
+[endsect]
+
+
+
+[section:overload2 windows::basic_random_access_handle::read_some_at (2 of 2 overloads)]
+
+Read some data from the handle at the specified offset.
+
+ 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 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]
+
+
+[variablelist
+
+[[offset][The offset at which the data will be read.]]
+
+[[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:service windows::basic_random_access_handle::service]
['Inherited from basic_io_object.]
@@ -51985,34 +57369,144 @@
-[section:service_type windows::basic_handle::service_type]
+[section:service_type windows::basic_random_access_handle::service_type]
['Inherited from basic_io_object.]
The type of the service that will be used to provide I/O operations.
- typedef HandleService service_type;
+ typedef RandomAccessHandleService service_type;
+
+
+
+
+[endsect]
+
+
+[section:write_some_at windows::basic_random_access_handle::write_some_at]
+
+Write some data to the handle at the specified offset.
+
+ 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:overload1 windows::basic_random_access_handle::write_some_at (1 of 2 overloads)]
+Write some data to the handle at the specified offset.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some_at(
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers);
+
+
+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]
+
+
+[variablelist
+
+[[offset][The offset at which the data will be written.]]
+
+[[buffers][One or more data buffers to be written to the handle.]]
+
+]
+
+[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\_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 windows::basic_random_access_handle::write_some_at (2 of 2 overloads)]
+
+Write some data to the handle at the specified offset.
+
+ 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 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]
+
+
+[variablelist
+
+[[offset][The offset at which the data will be written.]]
+[[buffers][One or more data buffers to be written to the handle.]]
-[endsect]
+[[ec][Set to indicate what error occurred, if any.]]
+]
+[heading Return Value]
+
+The number of bytes written. Returns 0 if an error occurred.
-[section:_basic_handle windows::basic_handle::~basic_handle]
+[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.
-Protected destructor to prevent deletion through this type.
- ~basic_handle();
+[endsect]
[endsect]
-
[endsect]
[section:windows__basic_stream_handle windows::basic_stream_handle]
@@ -52883,56 +58377,615 @@
-[section:overload2 windows::basic_stream_handle::read_some (2 of 2 overloads)]
+[section:overload2 windows::basic_stream_handle::read_some (2 of 2 overloads)]
+
+Read some data from the handle.
+
+ 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.
+
+
+[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:service windows::basic_stream_handle::service]
+
+
+['Inherited from basic_io_object.]
+
+The service associated with the I/O object.
+
+ service_type & service;
+
+
+
+[endsect]
+
+
+
+[section:service_type windows::basic_stream_handle::service_type]
+
+
+['Inherited from basic_io_object.]
+
+The type of the service that will be used to provide I/O operations.
+
+ typedef StreamHandleService service_type;
+
+
+
+
+[endsect]
+
+
+[section:write_some windows::basic_stream_handle::write_some]
+
+Write some data to the handle.
+
+ 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 ``[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)]
+
+Write some data to the handle.
+
+ 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 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]
+
+
+[variablelist
+
+[[buffers][One or more data buffers to be written to the handle.]]
+
+]
+
+[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:
+
+ handle.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 windows::basic_stream_handle::write_some (2 of 2 overloads)]
+
+Write some data to the handle.
+
+ 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 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]
+
+
+[variablelist
+
+[[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 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:windows__random_access_handle windows::random_access_handle]
+
+Typedef for the typical usage of a random-access handle.
+
+ typedef basic_random_access_handle random_access_handle;
+
+
+[heading Types]
+[table
+ [[Name][Description]]
+
+ [
+
+ [[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. ]
+
+ ]
+
+]
+
+[heading Member Functions]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.assign [*assign]]]
+ [Assign an existing native handle to the handle. ]
+ ]
+
+ [
+ [[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.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.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.windows__basic_random_access_handle.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
+ ]
+
+ [
+ [[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.windows__basic_random_access_handle.lowest_layer [*lowest_layer]]]
+ [Get a reference to the lowest layer. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__basic_random_access_handle.native [*native]]]
+ [Get the native handle representation. ]
+ ]
+
+ [
+ [[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.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.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.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.windows__random_access_handle_service.assign [*assign]]]
+ [Assign an existing native handle to a random-access handle. ]
+ ]
+
+ [
+ [[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.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.windows__random_access_handle_service.cancel [*cancel]]]
+ [Cancel all asynchronous operations associated with the handle. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.close [*close]]]
+ [Close a random-access handle implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.construct [*construct]]]
+ [Construct a new random-access handle implementation. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.destroy [*destroy]]]
+ [Destroy a random-access handle implementation. ]
+ ]
+
+ [
+ [[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.windows__random_access_handle_service.io_service [*io_service]]]
+ [(Deprecated: use get_io_service().) Get the io_service object that owns the service. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.is_open [*is_open]]]
+ [Determine whether the handle is open. ]
+ ]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.native [*native]]]
+ [Get the native handle implementation. ]
+ ]
+
+ [
+ [[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.windows__random_access_handle_service.read_some_at [*read_some_at]]]
+ [Read some data from the specified offset. ]
+ ]
+
+ [
+ [[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.windows__random_access_handle_service.write_some_at [*write_some_at]]]
+ [Write the given data at the specified offset. ]
+ ]
+
+]
+
+[heading Data Members]
+[table
+ [[Name][Description]]
+
+ [
+ [[link boost_asio.reference.windows__random_access_handle_service.id [*id]]]
+ [The unique service identifier. ]
+ ]
+
+]
+
+
+[section:assign windows::random_access_handle_service::assign]
+
+Assign an existing native handle to a random-access handle.
+
+ boost::system::error_code assign(
+ implementation_type & impl,
+ const native_type & native_handle,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:async_read_some_at windows::random_access_handle_service::async_read_some_at]
+
+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(
+ implementation_type & impl,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ ReadHandler handler);
+
+
+
+[endsect]
+
+
+
+[section:async_write_some_at windows::random_access_handle_service::async_write_some_at]
+
+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(
+ implementation_type & impl,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ WriteHandler handler);
+
+
+
+[endsect]
+
+
+
+[section:cancel windows::random_access_handle_service::cancel]
+
+Cancel all asynchronous operations associated with the handle.
+
+ boost::system::error_code cancel(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:close windows::random_access_handle_service::close]
+
+Close a random-access handle implementation.
+
+ boost::system::error_code close(
+ implementation_type & impl,
+ boost::system::error_code & ec);
+
+
+
+[endsect]
+
+
+
+[section:construct windows::random_access_handle_service::construct]
+
+Construct a new random-access handle implementation.
+
+ void construct(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[section:destroy windows::random_access_handle_service::destroy]
+
+Destroy a random-access handle implementation.
+
+ void destroy(
+ implementation_type & impl);
+
+
+
+[endsect]
+
+
+
+[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.
+
+ boost::asio::io_service & get_io_service();
+
+
+
+[endsect]
+
+
+
+[section:id windows::random_access_handle_service::id]
-Read some data from the handle.
+The unique service identifier.
- template<
- typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
+ static boost::asio::io_service::id id;
-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.]]
-[[ec][Set to indicate what error occurred, if any.]]
+[section:implementation_type windows::random_access_handle_service::implementation_type]
-]
+The type of a random-access handle implementation.
-[heading Return Value]
-
-The number of bytes read. Returns 0 if an error occurred.
+ typedef implementation_defined implementation_type;
-[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:service windows::basic_stream_handle::service]
+[section:io_service windows::random_access_handle_service::io_service]
-['Inherited from basic_io_object.]
+['Inherited from io_service.]
-The service associated with the I/O object.
+(Deprecated: use get_io_service().) Get the io_service object that owns the service.
- service_type & service;
+ boost::asio::io_service & io_service();
@@ -52940,136 +58993,106 @@
-[section:service_type windows::basic_stream_handle::service_type]
+[section:is_open windows::random_access_handle_service::is_open]
+Determine whether the handle is open.
-['Inherited from basic_io_object.]
+ bool is_open(
+ const implementation_type & impl) const;
-The type of the service that will be used to provide I/O operations.
- typedef StreamHandleService service_type;
+[endsect]
-[endsect]
+[section:native windows::random_access_handle_service::native]
+Get the native handle implementation.
-[section:write_some windows::basic_stream_handle::write_some]
+ native_type native(
+ implementation_type & impl);
-Write some data to the handle.
- 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 ``[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);
+[endsect]
-[section:overload1 windows::basic_stream_handle::write_some (1 of 2 overloads)]
-Write some data to the handle.
+[section:native_type windows::random_access_handle_service::native_type]
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers);
+The native handle type.
+ typedef implementation_defined native_type;
-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]
-
-[variablelist
-
-[[buffers][One or more data buffers to be written to the handle.]]
+[endsect]
-]
-[heading Return Value]
-
-The number of bytes written.
-[heading Exceptions]
-
+[section:random_access_handle_service windows::random_access_handle_service::random_access_handle_service]
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of boost::asio::error::eof indicates that the connection was closed by the peer.]]
+Construct a new random-access handle service for the specified io_service.
-]
+ random_access_handle_service(
+ boost::asio::io_service & io_service);
-[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:
- handle.write_some(boost::asio::buffer(data, size));
+[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_at windows::random_access_handle_service::read_some_at]
+Read some data from the specified offset.
-[endsect]
+ template<
+ typename ``[link boost_asio.reference.MutableBufferSequence MutableBufferSequence]``>
+ std::size_t read_some_at(
+ implementation_type & impl,
+ boost::uint64_t offset,
+ const MutableBufferSequence & buffers,
+ boost::system::error_code & ec);
-[section:overload2 windows::basic_stream_handle::write_some (2 of 2 overloads)]
+[endsect]
-Write some data to the handle.
- template<
- typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
- std::size_t write_some(
- const ConstBufferSequence & buffers,
- boost::system::error_code & ec);
+[section:shutdown_service windows::random_access_handle_service::shutdown_service]
-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.
+Destroy all user-defined handler objects owned by the service.
+ void shutdown_service();
-[heading Parameters]
-
-[variablelist
-
-[[buffers][One or more data buffers to be written to the handle.]]
-[[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:write_some_at windows::random_access_handle_service::write_some_at]
+Write the given data at the specified offset.
+ template<
+ typename ``[link boost_asio.reference.ConstBufferSequence ConstBufferSequence]``>
+ std::size_t write_some_at(
+ implementation_type & impl,
+ boost::uint64_t offset,
+ const ConstBufferSequence & buffers,
+ boost::system::error_code & ec);
-[endsect]
[endsect]
+
[endsect]
@@ -53870,7 +59893,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]``,
@@ -54060,6 +60083,493 @@
[endsect]
+[section:write_at write_at]
+
+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 ``[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 >]
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