Commit Graph

2590 Commits

Author SHA1 Message Date
Christopher Kohlhoff
1c9a4ac338 Allow visibility pragmas to be disabled by defining 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 10:14:38 +11:00
JackBurton79
38d3fc09ab Add -lnetwork to LDFLAGS when building for Haiku OS. 2019-02-28 10:07:31 +11:00
JackBurton79
0616f498bf Include unistd.h when targeting Haiku OS. 2019-02-28 10:07:03 +11:00
MiguelCompany
a10d3595eb Also set SO_REUSEPORT on QNX to correctly enable multicast. 2019-02-28 10:03:56 +11:00
Zyrin
555ed6c993 Return correct number of bytes transferred when datagram truncation occurs. 2019-02-28 09:50:05 +11:00
Cristian Morales Vega
3b0daafa0b Make the executor_work_guard move constructor noexcept. 2019-02-28 09:49:58 +11:00
Christopher Kohlhoff
1a7b0c7220 Don't allow thread_pool locking to be set by ASIO_CONCURRENCY_HINT_ macros.
Conservatively prevent the thread_pool's internal locking behaviour from
being changed via the ASIO_CONCURRENCY_HINT_ macros, as there is no way
to use a thread_pool object in a purely single-threaded use case anyway.
This change also fixes a conversion warning.
2019-02-28 09:39:57 +11:00
Christopher Kohlhoff
51274de46a Update list of unit tests in MSVC makefile. 2019-02-27 21:56:14 +11:00
Christopher Kohlhoff
4e49b8c3e5 Disambiguate enable_if and native_handle_type. 2019-02-27 21:56:14 +11:00
Christopher Kohlhoff
ea67e69e3a Repeat typedefs in derived class templates to fix gcc compile error on Windows. 2019-02-27 21:56:14 +11:00
Christopher Kohlhoff
490743a662 Promote coroutines TS support classes to asio namespace.
The awaitable<>, co_spawn(), this_coro, detached, and redirect_error
facilities have been moved from the asio::experimental namespace to
namespace asio. As part of this change, the this_coro::token() awaitable
has been superseded by the asio::use_awaitable completion token.

Please note that the use_awaitable and redirect_error completion tokens
work only with asynchronous operations that use the new form of
async_result with member function initiate(). Furthermore, when using
use_awaitable, please be aware that the asynchronous operation is not
initiated until co_await is applied to the awaitable<>.
2019-02-27 21:56:14 +11:00
abbyssoul
171a02ed0d Added constructor for local::basic_endpoint from string_view 2019-02-24 11:07:00 -10:00
Christopher Kohlhoff
6f40eb3155 Add noexcept qualifier to ip::basic_endpoint class. 2019-02-24 10:41:02 -10:00
Christopher Kohlhoff
3b4bf13bd1 Add noexcept qualifier to ip::address_v6 class. 2019-02-24 10:30:12 -10:00
Christopher Kohlhoff
b5b9717ed6 Add noexcept qualifier to ip::address_v4 class. 2019-02-24 10:20:27 -10:00
Christopher Kohlhoff
39993b3ec2 Add noexcept qualifier to ip::address class. 2019-02-24 07:19:41 -10:00
Christopher Kohlhoff
e7b397142a Update windows::overlapped_ptr to support custom I/O executors. 2019-02-21 14:49:25 +11:00
Christopher Kohlhoff
84e9a48ae6 Fix completion signatures used for ssl::stream's async_handshake and async_shutdown. 2019-02-18 19:09:44 -10:00
Christopher Kohlhoff
24e92ea209 Change archetype completion token's handler to require exact signature. 2019-02-18 19:08:35 -10:00
Christopher Kohlhoff
498dab4662 Fix compile error in serialization example. 2019-02-17 19:50:30 -10:00
Christopher Kohlhoff
62c4488abc New async_result form with initiate() static member function.
The `async_result` template now supports a new form:

    template <typename CompletionToken, typename Signature>
    struct async_result
    {
      typedef /* ... */ return_type;

      template <typename Initiation,
          typename RawCompletionToken,
          typename... Args>
      static return_type initiate(
          Initiation&& initiation,
          RawCompletionToken&& token,
          Args&&... args);
    };

The `initiate()` function must:

* Transform the token into a completion handler object `handler`.

* Cause the invocation of the function object `initiation` as if
  by calling:

    std::forward<Initiation>(initiation)(
        std::move(handler),
        std::forward<Args>(args)...);

The invocation of `initiation` may be deferred (e.g. lazily evaluated),
in which case `initiation` and `args` must be decay-copied and moved
as required.

A helper function template `async_initiate` has also been added as a
wrapper for the invocation of `async_result<>::initiate`. For backward
compatibility, this function supports both the old and new async_result
forms.
2019-02-17 18:49:54 -10:00
Christopher Kohlhoff
fc05ce407c Remove deprecated handler_type and single-argument async_result. 2019-02-17 18:16:31 -10:00
Christopher Kohlhoff
f9e4489b57 Update copyright notices. 2019-02-17 18:16:31 -10:00
Christopher Kohlhoff
cbe1c5e13d Add custom I/O executor support to I/O objects.
All I/O objects now have an additional Executor template parameter. This
template parameter defaults to the asio::executor type (the polymorphic
executor wrapper) but can be used to specify a user-defined executor
type.

I/O objects' constructors and functions that previously took an
asio::io_context& now accept either an Executor or a reference to a
concrete ExecutionContext (such as asio::io_context or
asio::thread_pool).

One potential point of breakage in existing user code is when reusing an
I/O object's io_context for constructing another I/O object, as in:

    asio::steady_timer my_timer(my_socket.get_executor().context());

To fix this, either construct the second I/O object using the first I/O
object's executor:

    asio::steady_timer my_timer(my_socket.get_executor());

or otherwise explicitly pass the io_context:

    asio::steady_timer my_timer(my_io_context);
2019-02-17 18:16:31 -10:00
Christopher Kohlhoff
2c689adc90 Remove deprecated get_io_context and get_io_service functions. 2019-02-15 22:05:33 +11:00
Christopher Kohlhoff
9801132ea0 Remove deprecated services support. 2018-12-17 09:55:24 +11:00
Christopher Kohlhoff
531475f46c Use separate recycled memory slot for polymorphic executor. 2018-12-16 17:07:01 +11:00
Christopher Kohlhoff
22afb86087 asio version 1.12.2 released 2018-12-12 09:25:15 +11:00
Christopher Kohlhoff
7a566ad1e5 Ensure socks4 example header file is included in release tarball. 2018-12-12 09:25:15 +11:00
Christopher Kohlhoff
9d54ba058e Revision history. 2018-12-12 09:25:15 +11:00
Christopher Kohlhoff
b3a3961047 Fix example links. 2018-12-05 14:10:01 +11:00
Christopher Kohlhoff
765f197ed6 Add examples showing how to write composed operations. 2018-12-05 14:10:01 +11:00
Christopher Kohlhoff
11fe8b7c7e Add documentation for change in concurrency_hint type. 2018-12-05 13:44:01 +11:00
Christopher Kohlhoff
fd5a89b004 Regenerate documentation. 2018-12-05 13:44:01 +11:00
Christopher Kohlhoff
d6209b6c73 Add C++11 version of SOCKS4 example. 2018-12-05 13:43:57 +11:00
Christopher Kohlhoff
e7dbfcecb8 Fix long lines. 2018-12-05 10:46:18 +11:00
Christopher Kohlhoff
a452dfd43b Add C++11 version of SSL example. 2018-12-05 10:46:18 +11:00
Christopher Kohlhoff
dd006b867e Add C++11 version of timers example. 2018-12-05 10:46:18 +11:00
Christopher Kohlhoff
caa9450231 Add C++11 versions of timeouts examples. 2018-12-05 10:46:18 +11:00
Christopher Kohlhoff
019449fb0f Use new form of async_accept where socket is moved into the completion handler. 2018-12-02 21:16:35 +11:00
Christopher Kohlhoff
a432abc27e Execution contexts must be publicly derived from asio::execution_context. 2018-12-02 21:16:35 +11:00
Christopher Kohlhoff
4d7d624970 Make distinction between overloads clearer. 2018-12-02 21:16:35 +11:00
Christopher Kohlhoff
8c5004b100 Indicate replacements for deprecated overloads. 2018-12-02 21:16:35 +11:00
Christopher Kohlhoff
f03803ea8b Fix brief description of buffer() overload for non-const std::string. 2018-11-24 13:16:53 +11:00
Christopher Kohlhoff
eed287d46c Fix detection of std::future with libstdc++. 2018-11-05 14:47:12 +11:00
Christopher Kohlhoff
e0daf291bc Fix compile error in regex overload of read_until. 2018-11-05 14:47:12 +11:00
Christopher Kohlhoff
ff28c6f777 Clear the heap index for removed timers.
Fixes timer heap corruption that can occur after move assignment of
a cancelled timer.
2018-11-05 14:47:12 +11:00
Christopher Kohlhoff
68df16d560 Fix detection of std::experimental::string_view and std::string_view with newer clang/libc++. 2018-11-05 14:47:12 +11:00
Christopher Kohlhoff
c7d2467be2 Add compile-time test for TLSv1 presence. 2018-11-05 14:47:12 +11:00
Christopher Kohlhoff
2c6b6db640 Fix macro used to test for TLS v1.2 support. 2018-11-05 14:47:12 +11:00