Commit Graph

1359 Commits

Author SHA1 Message Date
Christopher Kohlhoff
6194807812 Merge asio 1.14.0 from 'develop'. 2019-04-03 19:34:34 +11:00
Christopher Kohlhoff
db6423c9b1 Version bump. 2019-03-31 23:41:34 +11:00
Christopher Kohlhoff
ce7e3bbf4b Revision history. 2019-03-31 23:41:34 +11:00
Christopher Kohlhoff
c4439871aa On Windows, ensure global object destructors are run. 2019-03-31 22:49:12 +11:00
Christopher Kohlhoff
f3a6802fdc Fix move-based async_accept between sockets with different executor types. 2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
e830f97d55 The executor is copied, not moved, when the I/O object moves.
The moved-from I/O object needs to be left in the same state as if
constructed with a valid executor but without a resource.
2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
b8c61d7e82 Add runtime detection of native I/O executors when using polymorphic wrapper. 2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
27c6b3016c Remove BOOST_ASIO_ENABLE_OLD_SERVICES from documentation. 2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
4f12771542 Change default _WIN32_WINNT value to 0x0601 (Windows 7). 2019-03-31 22:49:11 +11:00
Christopher Kohlhoff
642cb6e27f Bump minimum MSVC version for BOOST_ASIO_HAS_DECLTYPE.
Although MSVC 11.0 supports the decltype keyword, it does not operate
correctly when used in the buffer sequence detection traits. This change
fixes compile errors when trying to use the read and write composed
operations with MSVC 11.0.
2019-03-31 22:49:06 +11:00
Christopher Kohlhoff
2e19dc524b Add more missing entries to quick reference. 2019-03-31 22:20:48 +11:00
Christopher Kohlhoff
54cdc73c29 Suppress various unused variable warnings. 2019-03-07 16:18:56 +11:00
Christopher Kohlhoff
0e7ad0b146 Don't overwrite a failure error code from the SSL engine when doing sync I/O. 2019-03-07 16:18:20 +11:00
Christopher Kohlhoff
0340c15e49 Fix up dispatch() documentation. Clarify distinction between post() and defer(). 2019-03-07 16:17:18 +11:00
Christopher Kohlhoff
834abb1d62 Merge asio from 'develop'. 2019-03-06 23:57:27 +11:00
Christopher Kohlhoff
d4d0edd416 Copy new examples to documentation directory. 2019-03-06 22:48:32 +11:00
Christopher Kohlhoff
593236cfd2 Fix template argument list bracketing. 2019-03-06 22:47:39 +11:00
Christopher Kohlhoff
f2e6af2693 Regenerate documentation. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
95041862ae Remove experimental directory from documentation processing. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
b85528b585 Add new entities to quick reference. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
2f7af2e33c Update composed operations examples to use async_initiate and a new helper function async_compose. 2019-03-06 20:22:23 +11:00
Christopher Kohlhoff
ca743caf6d Fix handler tracking arguments in io_context implementation. 2019-03-06 18:43:27 +11:00
Christopher Kohlhoff
70ac79aa72 Merge asio from 'develop'. 2019-03-04 00:41:55 +11:00
Christopher Kohlhoff
a266dd4b7c Only enable <atomic> for the most recent Xcode clang version. 2019-03-03 19:59:43 +11:00
Christopher Kohlhoff
688ea91d69 Fix cross references. 2019-03-03 19:58:48 +11:00
Christopher Kohlhoff
da23b05953 Fix typo in basic_stream_socket documentation. 2019-03-03 19:55:58 +11:00
Christopher Kohlhoff
9be88fb192 Add new DynamicBuffer_v2 which is CopyConstructible.
This change adds a new set of type requirements for dynamic buffers,
DynamicBuffer_v2, which supports copy construction. These new type
requirements enable dynamic buffers to be used as arguments to
user-defined composed operations, where the same dynamic buffer object
is used repeatedly for multiple underlying operations. For example:

  template <typename DynamicBuffer>
  void echo_line(tcp::socket& sock, DynamicBuffer buf)
  {
    n = boost::asio::read_until(sock, buf, '\n');
    boost::asio::write(sock, buf, boost::asio::transfer_exactly(n));
  }

The original DynamicBuffer type requirements have been renamed to
DynamicBuffer_v1.

New type traits is_dynamic_buffer_v1 and is_dynamic_buffer_v2 have been
added to test for conformance to DynamicBuffer_v1 and DynamicBuffer_v2
respectively. The existing is_dynamic_buffer trait has been retained and
delegates to is_dynamic_buffer_v1, unless BOOST_ASIO_NO_DYNAMIC_BUFFER_V1
is defined, in which case it delegates to is_dynamic_buffer_v2.

The dynamic_string_buffer and dynamic_vector buffer classes conform to
both DynamicBuffer_v1 and DynamicBuffer_v2 requirements.

When BOOST_ASIO_NO_DYNAMIC_BUFFER_V1 is defined, all support for
DynamicBuffer_v1 types and functions is #ifdef-ed out. Support for using
basic_streambuf with the read, async_read, read_until, async_read_until,
write, and async_write functions is also disabled as a consequence.

This change should have no impact on existing source code that simply
uses dynamic buffers in conjunction with asio's composed operations,
such as:

  string data;
  // ...
  size_t n = boost::asio::read_until(my_socket
      boost::asio::dynamic_buffer(data, MY_MAX),
      '\n');
2019-03-03 19:53:57 +11:00
Christopher Kohlhoff
20ef9b46da Merge asio from 'develop'. 2019-03-02 23:37:07 +11:00
Christopher Kohlhoff
6534af41b4 Reduce number of copies of I/O executor. 2019-03-02 16:14:37 +11:00
Christopher Kohlhoff
0f7e8c9915 Move rather than copy buffers when moving a composed operation implementation. 2019-03-02 16:13:50 +11:00
Christopher Kohlhoff
b9600df415 Completion conditions now require move rather than copy.
The CompletionCondition type requirements have been relaxed such that
they only require MoveConstructible types instead of CopyConstructible.
2019-03-02 16:12:53 +11:00
Christopher Kohlhoff
7a4f4cb90f Add a fallback error code for when we get SSL_ERROR_SYSCALL without an associated error. 2019-03-02 16:11:53 +11:00
Christopher Kohlhoff
cb335f6b2d Exclude implementation details from documentation. 2019-03-02 16:10:36 +11:00
Christopher Kohlhoff
530febded7 Fix parameter documentation in basic_object_handle constructor. 2019-03-02 16:09:50 +11:00
Christopher Kohlhoff
83278307e1 Add ip::resolver_base to quick reference and cross reference it from ip::basic_resolver. 2019-03-02 16:09:08 +11:00
Christopher Kohlhoff
1f323bb6a2 Suppress eof on shutdown as it actually indicates success. 2019-03-02 16:07:11 +11:00
Christopher Kohlhoff
2864d2bf32 Ensure SSL handshake errors are propagated to the peer. 2019-03-02 16:06:18 +11:00
Christopher Kohlhoff
94c6359604 Add noexcept to buffer_sequence_begin/end. 2019-03-02 16:05:03 +11:00
Christopher Kohlhoff
350afe1bee Prevent implicit conversion with buffer_sequence_begin/end.
This change addresses an issue where a call to buffer_sequence_begin or
buffer_sequence_end could trigger an implicit conversion to const_buffer
or mutable_buffer. Whenever this implicit conversion occurred, the
return value of buffer_sequence_begin/end would point to a temporary
object.
2019-03-02 16:03:47 +11:00
Christopher Kohlhoff
9eb153718d Add a make_strand function.
The make_strand function creates a strand with a deduced Executor template
argument.
2019-03-02 16:02:42 +11:00
Christopher Kohlhoff
94743a1a96 Remove experimental directory from documentation processing. 2019-03-02 16:00:44 +11:00
Christopher Kohlhoff
154c3fe277 Fix long line. 2019-02-28 20:18:05 +11:00
Christopher Kohlhoff
4cc2856dee Deduce EndpointSequence iterator type. 2019-02-28 20:17:40 +11:00
Christopher Kohlhoff
90f1cda1d9 Fix calculation of absolute timeout when using pthread_cond_timedwait. 2019-02-28 20:16:44 +11:00
Christopher Kohlhoff
2b3c9a4693 Capture port by value to prevent dangling reference. 2019-02-28 20:15:59 +11:00
Christopher Kohlhoff
d547df309f Add network_v[46].hpp headers to top-level convenience header. 2019-02-28 20:15:26 +11:00
Christopher Kohlhoff
5b78e1b5b3 Allow visibility pragmas to be disabled by defining BOOST_ASIO_DISABLE_VISIBILITY.
Note: If symbols are hidden extra care must be taken to ensure that asio
types are not passed across shared library API boundaries.
2019-02-28 20:14:38 +11:00
Christopher Kohlhoff
2d0b996119 Include unistd.h when targeting Haiku OS. 2019-02-28 20:13:29 +11:00
Christopher Kohlhoff
f4e0e43080 Also set SO_REUSEPORT on QNX to correctly enable multicast. 2019-02-28 20:12:57 +11:00
Christopher Kohlhoff
a23ecd3a62 Return correct number of bytes transferred when datagram truncation occurs. 2019-02-28 20:12:15 +11:00