From ef42de2714f3c47f9068c20dc69ae767e9c043cd Mon Sep 17 00:00:00 2001 From: Chris Hold Date: Tue, 12 Jun 2018 18:24:25 -0700 Subject: [PATCH] Update asio lib to 1.12.1 --- extern/include/asio.hpp | 32 +- extern/include/asio/associated_allocator.hpp | 131 + extern/include/asio/associated_executor.hpp | 149 ++ extern/include/asio/async_result.hpp | 171 +- extern/include/asio/basic_datagram_socket.hpp | 189 +- extern/include/asio/basic_deadline_timer.hpp | 180 +- extern/include/asio/basic_io_object.hpp | 134 +- extern/include/asio/basic_raw_socket.hpp | 188 +- .../include/asio/basic_seq_packet_socket.hpp | 143 +- extern/include/asio/basic_serial_port.hpp | 93 +- extern/include/asio/basic_signal_set.hpp | 83 +- extern/include/asio/basic_socket.hpp | 461 +++- extern/include/asio/basic_socket_acceptor.hpp | 1070 +++++++- extern/include/asio/basic_socket_iostream.hpp | 252 +- .../include/asio/basic_socket_streambuf.hpp | 708 +++-- extern/include/asio/basic_stream_socket.hpp | 163 +- extern/include/asio/basic_streambuf.hpp | 115 +- extern/include/asio/basic_streambuf_fwd.hpp | 5 +- extern/include/asio/basic_waitable_timer.hpp | 284 +- extern/include/asio/bind_executor.hpp | 611 +++++ extern/include/asio/buffer.hpp | 2355 ++++++++--------- extern/include/asio/buffered_read_stream.hpp | 41 +- .../include/asio/buffered_read_stream_fwd.hpp | 2 +- extern/include/asio/buffered_stream.hpp | 32 +- extern/include/asio/buffered_stream_fwd.hpp | 2 +- extern/include/asio/buffered_write_stream.hpp | 41 +- .../asio/buffered_write_stream_fwd.hpp | 2 +- extern/include/asio/buffers_iterator.hpp | 82 +- extern/include/asio/completion_condition.hpp | 2 +- extern/include/asio/connect.hpp | 688 +++-- extern/include/asio/coroutine.hpp | 14 +- .../include/asio/datagram_socket_service.hpp | 164 +- extern/include/asio/deadline_timer.hpp | 2 +- .../include/asio/deadline_timer_service.hpp | 38 +- extern/include/asio/defer.hpp | 107 + extern/include/asio/detail/addressof.hpp | 38 - extern/include/asio/detail/array.hpp | 2 +- extern/include/asio/detail/array_fwd.hpp | 2 +- extern/include/asio/detail/assert.hpp | 2 +- extern/include/asio/detail/atomic_count.hpp | 2 +- .../asio/detail/base_from_completion_cond.hpp | 2 +- extern/include/asio/detail/bind_handler.hpp | 481 +++- .../asio/detail/buffer_resize_guard.hpp | 2 +- .../asio/detail/buffer_sequence_adapter.hpp | 263 +- .../asio/detail/buffered_stream_storage.hpp | 2 +- extern/include/asio/detail/call_stack.hpp | 4 +- extern/include/asio/detail/chrono.hpp | 66 + .../asio/detail/chrono_time_traits.hpp | 2 +- .../asio/detail/completion_handler.hpp | 14 +- .../include/asio/detail/concurrency_hint.hpp | 94 + .../detail/conditionally_enabled_event.hpp | 112 + .../detail/conditionally_enabled_mutex.hpp | 149 ++ extern/include/asio/detail/config.hpp | 522 +++- .../include/asio/detail/consuming_buffers.hpp | 452 ++-- extern/include/asio/detail/cstddef.hpp | 31 + extern/include/asio/detail/cstdint.hpp | 16 +- extern/include/asio/detail/date_time_fwd.hpp | 2 +- .../asio/detail/deadline_timer_service.hpp | 79 +- extern/include/asio/detail/dependent_type.hpp | 2 +- extern/include/asio/detail/descriptor_ops.hpp | 6 +- .../asio/detail/descriptor_read_op.hpp | 25 +- .../asio/detail/descriptor_write_op.hpp | 25 +- .../include/asio/detail/dev_poll_reactor.hpp | 42 +- extern/include/asio/detail/epoll_reactor.hpp | 58 +- extern/include/asio/detail/event.hpp | 2 +- .../detail/eventfd_select_interrupter.hpp | 2 +- extern/include/asio/detail/executor_op.hpp | 84 + extern/include/asio/detail/fd_set_adapter.hpp | 2 +- extern/include/asio/detail/fenced_block.hpp | 6 +- .../detail/{function.hpp => functional.hpp} | 20 +- .../asio/detail/gcc_arm_fenced_block.hpp | 4 +- .../asio/detail/gcc_hppa_fenced_block.hpp | 4 +- .../asio/detail/gcc_sync_fenced_block.hpp | 4 +- .../asio/detail/gcc_x86_fenced_block.hpp | 4 +- extern/include/asio/detail/global.hpp | 52 + .../asio/detail/handler_alloc_helpers.hpp | 159 +- .../asio/detail/handler_cont_helpers.hpp | 4 +- .../asio/detail/handler_invoke_helpers.hpp | 4 +- .../include/asio/detail/handler_tracking.hpp | 97 +- .../asio/detail/handler_type_requirements.hpp | 166 +- extern/include/asio/detail/handler_work.hpp | 95 + extern/include/asio/detail/hash_map.hpp | 8 +- .../detail/impl/buffer_sequence_adapter.ipp | 12 +- .../asio/detail/impl/descriptor_ops.ipp | 25 +- .../asio/detail/impl/dev_poll_reactor.hpp | 21 +- .../asio/detail/impl/dev_poll_reactor.ipp | 52 +- .../asio/detail/impl/epoll_reactor.hpp | 21 +- .../asio/detail/impl/epoll_reactor.ipp | 223 +- .../impl/eventfd_select_interrupter.ipp | 2 +- .../asio/detail/impl/handler_tracking.ipp | 107 +- .../asio/detail/impl/kqueue_reactor.hpp | 25 +- .../asio/detail/impl/kqueue_reactor.ipp | 116 +- .../include/asio/detail/impl/null_event.ipp | 74 + .../detail/impl/pipe_select_interrupter.ipp | 2 +- .../include/asio/detail/impl/posix_event.ipp | 14 +- .../include/asio/detail/impl/posix_mutex.ipp | 2 +- .../include/asio/detail/impl/posix_thread.ipp | 12 +- .../asio/detail/impl/posix_tss_ptr.ipp | 2 +- .../impl/reactive_descriptor_service.ipp | 40 +- .../impl/reactive_serial_port_service.ipp | 13 +- .../impl/reactive_socket_service_base.ipp | 53 +- .../detail/impl/resolver_service_base.ipp | 84 +- .../{task_io_service.ipp => scheduler.ipp} | 237 +- .../asio/detail/impl/select_reactor.hpp | 21 +- .../asio/detail/impl/select_reactor.ipp | 72 +- .../asio/detail/impl/service_registry.hpp | 66 +- .../asio/detail/impl/service_registry.ipp | 69 +- .../asio/detail/impl/signal_set_service.ipp | 64 +- .../include/asio/detail/impl/socket_ops.ipp | 198 +- .../detail/impl/socket_select_interrupter.ipp | 5 +- .../detail/impl/strand_executor_service.hpp | 179 ++ .../detail/impl/strand_executor_service.ipp | 134 + .../asio/detail/impl/strand_service.hpp | 26 +- .../asio/detail/impl/strand_service.ipp | 29 +- .../asio/detail/impl/task_io_service.hpp | 78 - .../include/asio/detail/impl/throw_error.ipp | 2 +- .../asio/detail/impl/timer_queue_ptime.ipp | 17 +- .../asio/detail/impl/timer_queue_set.ipp | 2 +- extern/include/asio/detail/impl/win_event.ipp | 15 +- .../detail/impl/win_iocp_handle_service.ipp | 48 +- ...io_service.hpp => win_iocp_io_context.hpp} | 73 +- ...io_service.ipp => win_iocp_io_context.ipp} | 114 +- .../impl/win_iocp_serial_port_service.ipp | 9 +- .../impl/win_iocp_socket_service_base.ipp | 111 +- extern/include/asio/detail/impl/win_mutex.ipp | 8 +- .../detail/impl/win_object_handle_service.ipp | 38 +- .../asio/detail/impl/win_static_mutex.ipp | 20 +- .../include/asio/detail/impl/win_thread.ipp | 21 +- .../include/asio/detail/impl/win_tss_ptr.ipp | 6 +- .../impl/winrt_ssocket_service_base.ipp | 57 +- .../detail/impl/winrt_timer_scheduler.hpp | 21 +- .../detail/impl/winrt_timer_scheduler.ipp | 18 +- .../include/asio/detail/impl/winsock_init.ipp | 2 +- extern/include/asio/detail/io_control.hpp | 52 +- .../asio/detail/is_buffer_sequence.hpp | 239 ++ extern/include/asio/detail/is_executor.hpp | 126 + .../include/asio/detail/keyword_tss_ptr.hpp | 2 +- extern/include/asio/detail/kqueue_reactor.hpp | 50 +- .../asio/detail/local_free_on_block_exit.hpp | 4 +- .../asio/detail/macos_fenced_block.hpp | 3 +- extern/include/asio/detail/memory.hpp | 70 + extern/include/asio/detail/mutex.hpp | 2 +- extern/include/asio/detail/noncopyable.hpp | 2 +- extern/include/asio/detail/null_event.hpp | 22 +- .../include/asio/detail/null_fenced_block.hpp | 4 +- extern/include/asio/detail/null_global.hpp | 59 + extern/include/asio/detail/null_mutex.hpp | 2 +- extern/include/asio/detail/null_reactor.hpp | 19 +- .../asio/detail/null_signal_blocker.hpp | 2 +- .../asio/detail/null_socket_service.hpp | 49 +- .../include/asio/detail/null_static_mutex.hpp | 2 +- extern/include/asio/detail/null_thread.hpp | 8 +- extern/include/asio/detail/null_tss_ptr.hpp | 2 +- extern/include/asio/detail/object_pool.hpp | 27 +- .../asio/detail/old_win_sdk_compat.hpp | 2 +- extern/include/asio/detail/op_queue.hpp | 8 +- extern/include/asio/detail/operation.hpp | 6 +- .../asio/detail/pipe_select_interrupter.hpp | 2 +- extern/include/asio/detail/pop_options.hpp | 6 +- extern/include/asio/detail/posix_event.hpp | 38 +- .../asio/detail/posix_fd_set_adapter.hpp | 2 +- extern/include/asio/detail/posix_global.hpp | 80 + extern/include/asio/detail/posix_mutex.hpp | 2 +- .../asio/detail/posix_signal_blocker.hpp | 2 +- .../asio/detail/posix_static_mutex.hpp | 2 +- extern/include/asio/detail/posix_thread.hpp | 6 +- extern/include/asio/detail/posix_tss_ptr.hpp | 2 +- extern/include/asio/detail/push_options.hpp | 11 +- .../detail/reactive_descriptor_service.hpp | 106 +- .../asio/detail/reactive_null_buffers_op.hpp | 16 +- .../detail/reactive_serial_port_service.hpp | 18 +- .../asio/detail/reactive_socket_accept_op.hpp | 121 +- .../detail/reactive_socket_connect_op.hpp | 21 +- .../asio/detail/reactive_socket_recv_op.hpp | 28 +- .../detail/reactive_socket_recvfrom_op.hpp | 21 +- .../detail/reactive_socket_recvmsg_op.hpp | 23 +- .../asio/detail/reactive_socket_send_op.hpp | 36 +- .../asio/detail/reactive_socket_sendto_op.hpp | 23 +- .../asio/detail/reactive_socket_service.hpp | 131 +- .../detail/reactive_socket_service_base.hpp | 131 +- .../include/asio/detail/reactive_wait_op.hpp | 90 + extern/include/asio/detail/reactor.hpp | 4 +- extern/include/asio/detail/reactor_fwd.hpp | 4 +- extern/include/asio/detail/reactor_op.hpp | 10 +- .../include/asio/detail/reactor_op_queue.hpp | 2 +- .../asio/detail/recycling_allocator.hpp | 104 + extern/include/asio/detail/regex_fwd.hpp | 2 +- .../asio/detail/resolve_endpoint_op.hpp | 49 +- extern/include/asio/detail/resolve_op.hpp | 98 +- .../include/asio/detail/resolve_query_op.hpp | 134 + .../include/asio/detail/resolver_service.hpp | 60 +- .../asio/detail/resolver_service_base.hpp | 49 +- .../{task_io_service.hpp => scheduler.hpp} | 102 +- ..._operation.hpp => scheduler_operation.hpp} | 36 +- ...ead_info.hpp => scheduler_thread_info.hpp} | 20 +- extern/include/asio/detail/scoped_lock.hpp | 2 +- extern/include/asio/detail/scoped_ptr.hpp | 10 +- .../asio/detail/select_interrupter.hpp | 2 +- extern/include/asio/detail/select_reactor.hpp | 55 +- .../include/asio/detail/service_registry.hpp | 88 +- extern/include/asio/detail/shared_ptr.hpp | 38 - extern/include/asio/detail/signal_blocker.hpp | 2 +- extern/include/asio/detail/signal_handler.hpp | 14 +- extern/include/asio/detail/signal_init.hpp | 2 +- extern/include/asio/detail/signal_op.hpp | 2 +- .../asio/detail/signal_set_service.hpp | 27 +- extern/include/asio/detail/socket_holder.hpp | 2 +- extern/include/asio/detail/socket_ops.hpp | 15 +- extern/include/asio/detail/socket_option.hpp | 2 +- .../asio/detail/socket_select_interrupter.hpp | 2 +- extern/include/asio/detail/socket_types.hpp | 24 +- .../asio/detail/solaris_fenced_block.hpp | 3 +- extern/include/asio/detail/static_mutex.hpp | 2 +- extern/include/asio/detail/std_event.hpp | 2 +- .../include/asio/detail/std_fenced_block.hpp | 62 + extern/include/asio/detail/std_global.hpp | 70 + extern/include/asio/detail/std_mutex.hpp | 2 +- .../include/asio/detail/std_static_mutex.hpp | 2 +- extern/include/asio/detail/std_thread.hpp | 8 +- .../asio/detail/strand_executor_service.hpp | 142 + extern/include/asio/detail/strand_service.hpp | 20 +- extern/include/asio/detail/string_view.hpp | 47 + extern/include/asio/detail/thread.hpp | 6 +- extern/include/asio/detail/thread_context.hpp | 42 + extern/include/asio/detail/thread_group.hpp | 89 + .../include/asio/detail/thread_info_base.hpp | 60 +- extern/include/asio/detail/throw_error.hpp | 2 +- .../include/asio/detail/throw_exception.hpp | 2 +- extern/include/asio/detail/timer_queue.hpp | 31 +- .../include/asio/detail/timer_queue_base.hpp | 2 +- .../include/asio/detail/timer_queue_ptime.hpp | 16 +- .../include/asio/detail/timer_queue_set.hpp | 2 +- .../include/asio/detail/timer_scheduler.hpp | 4 +- .../asio/detail/timer_scheduler_fwd.hpp | 4 +- extern/include/asio/detail/tss_ptr.hpp | 2 +- extern/include/asio/detail/type_traits.hpp | 30 +- .../asio/detail/variadic_templates.hpp | 92 +- extern/include/asio/detail/wait_handler.hpp | 14 +- extern/include/asio/detail/wait_op.hpp | 2 +- extern/include/asio/detail/weak_ptr.hpp | 38 - extern/include/asio/detail/win_event.hpp | 27 +- .../asio/detail/win_fd_set_adapter.hpp | 2 +- .../include/asio/detail/win_fenced_block.hpp | 3 +- extern/include/asio/detail/win_global.hpp | 73 + .../asio/detail/win_iocp_handle_read_op.hpp | 12 +- .../asio/detail/win_iocp_handle_service.hpp | 41 +- .../asio/detail/win_iocp_handle_write_op.hpp | 12 +- ...io_service.hpp => win_iocp_io_context.hpp} | 77 +- .../asio/detail/win_iocp_null_buffers_op.hpp | 16 +- .../asio/detail/win_iocp_operation.hpp | 15 +- .../asio/detail/win_iocp_overlapped_op.hpp | 12 +- .../asio/detail/win_iocp_overlapped_ptr.hpp | 27 +- .../detail/win_iocp_serial_port_service.hpp | 18 +- .../asio/detail/win_iocp_socket_accept_op.hpp | 142 +- .../detail/win_iocp_socket_connect_op.hpp | 17 +- .../asio/detail/win_iocp_socket_recv_op.hpp | 12 +- .../detail/win_iocp_socket_recvfrom_op.hpp | 12 +- .../detail/win_iocp_socket_recvmsg_op.hpp | 12 +- .../asio/detail/win_iocp_socket_send_op.hpp | 12 +- .../asio/detail/win_iocp_socket_service.hpp | 138 +- .../detail/win_iocp_socket_service_base.hpp | 155 +- .../asio/detail/win_iocp_thread_info.hpp | 2 +- .../include/asio/detail/win_iocp_wait_op.hpp | 121 + extern/include/asio/detail/win_mutex.hpp | 2 +- .../asio/detail/win_object_handle_service.hpp | 23 +- .../include/asio/detail/win_static_mutex.hpp | 2 +- extern/include/asio/detail/win_thread.hpp | 14 +- extern/include/asio/detail/win_tss_ptr.hpp | 2 +- extern/include/asio/detail/winapp_thread.hpp | 124 + extern/include/asio/detail/wince_thread.hpp | 16 +- .../asio/detail/winrt_async_manager.hpp | 28 +- extern/include/asio/detail/winrt_async_op.hpp | 2 +- .../include/asio/detail/winrt_resolve_op.hpp | 27 +- .../asio/detail/winrt_resolver_service.hpp | 67 +- .../asio/detail/winrt_socket_connect_op.hpp | 14 +- .../asio/detail/winrt_socket_recv_op.hpp | 12 +- .../asio/detail/winrt_socket_send_op.hpp | 12 +- .../asio/detail/winrt_ssocket_service.hpp | 25 +- .../detail/winrt_ssocket_service_base.hpp | 34 +- .../asio/detail/winrt_timer_scheduler.hpp | 22 +- extern/include/asio/detail/winrt_utils.hpp | 8 +- extern/include/asio/detail/winsock_init.hpp | 2 +- .../include/asio/detail/work_dispatcher.hpp | 72 + .../include/asio/detail/wrapped_handler.hpp | 2 +- extern/include/asio/dispatch.hpp | 108 + extern/include/asio/error.hpp | 30 +- extern/include/asio/error_code.hpp | 16 +- extern/include/asio/execution_context.hpp | 411 +++ extern/include/asio/executor.hpp | 341 +++ extern/include/asio/executor_work_guard.hpp | 170 ++ extern/include/asio/experimental.hpp | 22 + extern/include/asio/experimental/co_spawn.hpp | 226 ++ extern/include/asio/experimental/detached.hpp | 65 + .../asio/experimental/impl/co_spawn.hpp | 876 ++++++ .../asio/experimental/impl/detached.hpp | 91 + .../asio/experimental/impl/redirect_error.hpp | 294 ++ .../asio/experimental/redirect_error.hpp | 67 + .../include/asio/generic/basic_endpoint.hpp | 2 +- .../asio/generic/datagram_protocol.hpp | 2 +- .../include/asio/generic/detail/endpoint.hpp | 2 +- .../asio/generic/detail/impl/endpoint.ipp | 5 +- extern/include/asio/generic/raw_protocol.hpp | 2 +- .../asio/generic/seq_packet_protocol.hpp | 2 +- .../include/asio/generic/stream_protocol.hpp | 2 +- extern/include/asio/handler_alloc_hook.hpp | 2 +- .../asio/handler_continuation_hook.hpp | 2 +- extern/include/asio/handler_invoke_hook.hpp | 8 +- extern/include/asio/handler_type.hpp | 84 +- extern/include/asio/high_resolution_timer.hpp | 27 +- .../asio/impl/buffered_read_stream.hpp | 101 +- .../asio/impl/buffered_write_stream.hpp | 111 +- extern/include/asio/impl/connect.hpp | 670 ++++- extern/include/asio/impl/defer.hpp | 77 + extern/include/asio/impl/dispatch.hpp | 78 + extern/include/asio/impl/error.ipp | 2 +- extern/include/asio/impl/error_code.ipp | 136 +- .../include/asio/impl/execution_context.hpp | 107 + .../include/asio/impl/execution_context.ipp | 82 + extern/include/asio/impl/executor.hpp | 386 +++ extern/include/asio/impl/executor.ipp | 38 + .../include/asio/impl/handler_alloc_hook.ipp | 39 +- extern/include/asio/impl/io_context.hpp | 343 +++ extern/include/asio/impl/io_context.ipp | 174 ++ extern/include/asio/impl/io_service.hpp | 152 -- extern/include/asio/impl/io_service.ipp | 155 -- extern/include/asio/impl/post.hpp | 77 + extern/include/asio/impl/read.hpp | 720 +++-- extern/include/asio/impl/read_at.hpp | 516 ++-- extern/include/asio/impl/read_until.hpp | 765 ++++-- extern/include/asio/impl/serial_port_base.hpp | 2 +- extern/include/asio/impl/serial_port_base.ipp | 60 +- extern/include/asio/impl/spawn.hpp | 326 ++- extern/include/asio/impl/src.cpp | 2 +- extern/include/asio/impl/src.hpp | 16 +- extern/include/asio/impl/system_context.hpp | 34 + extern/include/asio/impl/system_context.ipp | 73 + extern/include/asio/impl/system_executor.hpp | 85 + extern/include/asio/impl/thread_pool.hpp | 127 + extern/include/asio/impl/thread_pool.ipp | 76 + extern/include/asio/impl/use_future.hpp | 940 ++++++- extern/include/asio/impl/write.hpp | 807 +++--- extern/include/asio/impl/write_at.hpp | 583 ++-- extern/include/asio/io_context.hpp | 876 ++++++ extern/include/asio/io_context_strand.hpp | 384 +++ extern/include/asio/io_service.hpp | 749 +----- extern/include/asio/io_service_strand.hpp | 20 + extern/include/asio/ip/address.hpp | 98 +- extern/include/asio/ip/address_v4.hpp | 134 +- .../include/asio/ip/address_v4_iterator.hpp | 162 ++ extern/include/asio/ip/address_v4_range.hpp | 134 + extern/include/asio/ip/address_v6.hpp | 118 +- .../include/asio/ip/address_v6_iterator.hpp | 183 ++ extern/include/asio/ip/address_v6_range.hpp | 129 + extern/include/asio/ip/bad_address_cast.hpp | 48 + extern/include/asio/ip/basic_endpoint.hpp | 10 +- extern/include/asio/ip/basic_resolver.hpp | 892 ++++++- .../include/asio/ip/basic_resolver_entry.hpp | 27 +- .../asio/ip/basic_resolver_iterator.hpp | 130 +- .../include/asio/ip/basic_resolver_query.hpp | 2 +- .../asio/ip/basic_resolver_results.hpp | 311 +++ extern/include/asio/ip/detail/endpoint.hpp | 4 +- .../include/asio/ip/detail/impl/endpoint.ipp | 29 +- .../include/asio/ip/detail/socket_option.hpp | 35 +- extern/include/asio/ip/host_name.hpp | 2 +- extern/include/asio/ip/icmp.hpp | 2 +- extern/include/asio/ip/impl/address.hpp | 42 +- extern/include/asio/ip/impl/address.ipp | 102 +- extern/include/asio/ip/impl/address_v4.hpp | 42 +- extern/include/asio/ip/impl/address_v4.ipp | 120 +- extern/include/asio/ip/impl/address_v6.hpp | 42 +- extern/include/asio/ip/impl/address_v6.ipp | 118 +- .../include/asio/ip/impl/basic_endpoint.hpp | 16 +- extern/include/asio/ip/impl/host_name.ipp | 2 +- extern/include/asio/ip/impl/network_v4.hpp | 54 + extern/include/asio/ip/impl/network_v4.ipp | 216 ++ extern/include/asio/ip/impl/network_v6.hpp | 53 + extern/include/asio/ip/impl/network_v6.ipp | 185 ++ extern/include/asio/ip/multicast.hpp | 16 +- extern/include/asio/ip/network_v4.hpp | 261 ++ extern/include/asio/ip/network_v6.hpp | 235 ++ extern/include/asio/ip/resolver_base.hpp | 129 + .../include/asio/ip/resolver_query_base.hpp | 93 +- extern/include/asio/ip/resolver_service.hpp | 72 +- extern/include/asio/ip/tcp.hpp | 6 +- extern/include/asio/ip/udp.hpp | 2 +- extern/include/asio/ip/unicast.hpp | 6 +- extern/include/asio/ip/v6_only.hpp | 6 +- extern/include/asio/is_executor.hpp | 46 + extern/include/asio/is_read_buffered.hpp | 2 +- extern/include/asio/is_write_buffered.hpp | 2 +- extern/include/asio/local/basic_endpoint.hpp | 2 +- extern/include/asio/local/connect_pair.hpp | 44 +- .../include/asio/local/datagram_protocol.hpp | 2 +- extern/include/asio/local/detail/endpoint.hpp | 2 +- .../asio/local/detail/impl/endpoint.ipp | 5 +- extern/include/asio/local/stream_protocol.hpp | 2 +- extern/include/asio/packaged_task.hpp | 126 + extern/include/asio/placeholders.hpp | 32 +- .../include/asio/posix/basic_descriptor.hpp | 184 +- .../asio/posix/basic_stream_descriptor.hpp | 30 +- extern/include/asio/posix/descriptor.hpp | 644 +++++ extern/include/asio/posix/descriptor_base.hpp | 41 +- .../include/asio/posix/stream_descriptor.hpp | 329 ++- .../asio/posix/stream_descriptor_service.hpp | 107 +- extern/include/asio/post.hpp | 107 + extern/include/asio/raw_socket_service.hpp | 164 +- extern/include/asio/read.hpp | 340 ++- extern/include/asio/read_at.hpp | 19 +- extern/include/asio/read_until.hpp | 1395 ++++++++-- .../asio/seq_packet_socket_service.hpp | 150 +- extern/include/asio/serial_port.hpp | 739 +++++- extern/include/asio/serial_port_base.hpp | 22 +- extern/include/asio/serial_port_service.hpp | 86 +- extern/include/asio/signal_set.hpp | 425 ++- extern/include/asio/signal_set_service.hpp | 56 +- .../include/asio/socket_acceptor_service.hpp | 168 +- extern/include/asio/socket_base.hpp | 131 +- extern/include/asio/spawn.hpp | 107 +- extern/include/asio/ssl.hpp | 5 +- extern/include/asio/ssl/basic_context.hpp | 40 - extern/include/asio/ssl/context.hpp | 95 +- extern/include/asio/ssl/context_base.hpp | 13 +- extern/include/asio/ssl/context_service.hpp | 40 - .../asio/ssl/detail/buffered_handshake_op.hpp | 50 +- extern/include/asio/ssl/detail/engine.hpp | 24 +- .../include/asio/ssl/detail/handshake_op.hpp | 10 +- .../include/asio/ssl/detail/impl/engine.ipp | 57 +- .../asio/ssl/detail/impl/openssl_init.ipp | 46 +- extern/include/asio/ssl/detail/io.hpp | 57 +- .../include/asio/ssl/detail/openssl_init.hpp | 4 +- .../include/asio/ssl/detail/openssl_types.hpp | 6 +- .../asio/ssl/detail/password_callback.hpp | 14 +- extern/include/asio/ssl/detail/read_op.hpp | 12 +- .../include/asio/ssl/detail/shutdown_op.hpp | 10 +- .../include/asio/ssl/detail/stream_core.hpp | 46 +- .../asio/ssl/detail/verify_callback.hpp | 10 +- extern/include/asio/ssl/detail/write_op.hpp | 12 +- extern/include/asio/ssl/error.hpp | 47 +- extern/include/asio/ssl/impl/context.hpp | 20 +- extern/include/asio/ssl/impl/context.ipp | 445 +++- extern/include/asio/ssl/impl/error.ipp | 47 +- .../asio/ssl/impl/rfc2818_verification.ipp | 20 +- extern/include/asio/ssl/impl/src.hpp | 2 +- extern/include/asio/ssl/old/basic_context.hpp | 434 --- .../include/asio/ssl/old/context_service.hpp | 174 -- .../old/detail/openssl_context_service.hpp | 386 --- .../asio/ssl/old/detail/openssl_operation.hpp | 524 ---- .../ssl/old/detail/openssl_stream_service.hpp | 571 ---- extern/include/asio/ssl/old/stream.hpp | 501 ---- .../include/asio/ssl/old/stream_service.hpp | 184 -- .../include/asio/ssl/rfc2818_verification.hpp | 20 +- extern/include/asio/ssl/stream.hpp | 175 +- extern/include/asio/ssl/stream_base.hpp | 2 +- extern/include/asio/ssl/stream_service.hpp | 40 - extern/include/asio/ssl/verify_context.hpp | 12 +- extern/include/asio/ssl/verify_mode.hpp | 2 +- extern/include/asio/steady_timer.hpp | 27 +- extern/include/asio/strand.hpp | 384 +-- extern/include/asio/stream_socket_service.hpp | 150 +- extern/include/asio/streambuf.hpp | 2 +- extern/include/asio/system_context.hpp | 78 + extern/include/asio/system_error.hpp | 2 +- extern/include/asio/system_executor.hpp | 129 + extern/include/asio/system_timer.hpp | 23 +- extern/include/asio/thread.hpp | 8 +- extern/include/asio/thread_pool.hpp | 232 ++ extern/include/asio/time_traits.hpp | 2 +- extern/include/asio/ts/buffer.hpp | 24 + extern/include/asio/ts/executor.hpp | 35 + extern/include/asio/ts/internet.hpp | 40 + extern/include/asio/ts/io_context.hpp | 20 + extern/include/asio/ts/net.hpp | 26 + extern/include/asio/ts/netfwd.hpp | 197 ++ extern/include/asio/ts/socket.hpp | 27 + extern/include/asio/ts/timer.hpp | 26 + extern/include/asio/unyield.hpp | 2 +- extern/include/asio/use_future.hpp | 73 +- extern/include/asio/uses_executor.hpp | 71 + extern/include/asio/version.hpp | 4 +- extern/include/asio/wait_traits.hpp | 19 +- .../include/asio/waitable_timer_service.hpp | 82 +- extern/include/asio/windows/basic_handle.hpp | 52 +- .../asio/windows/basic_object_handle.hpp | 24 +- .../windows/basic_random_access_handle.hpp | 30 +- .../asio/windows/basic_stream_handle.hpp | 30 +- extern/include/asio/windows/object_handle.hpp | 349 ++- .../asio/windows/object_handle_service.hpp | 46 +- .../asio/windows/overlapped_handle.hpp | 331 +++ .../include/asio/windows/overlapped_ptr.hpp | 12 +- .../asio/windows/random_access_handle.hpp | 347 ++- .../windows/random_access_handle_service.hpp | 68 +- extern/include/asio/windows/stream_handle.hpp | 331 ++- .../asio/windows/stream_handle_service.hpp | 66 +- extern/include/asio/write.hpp | 333 ++- extern/include/asio/write_at.hpp | 19 +- extern/include/asio/yield.hpp | 2 +- 496 files changed, 36312 insertions(+), 13606 deletions(-) create mode 100644 extern/include/asio/associated_allocator.hpp create mode 100644 extern/include/asio/associated_executor.hpp create mode 100644 extern/include/asio/bind_executor.hpp create mode 100644 extern/include/asio/defer.hpp delete mode 100644 extern/include/asio/detail/addressof.hpp create mode 100644 extern/include/asio/detail/chrono.hpp create mode 100644 extern/include/asio/detail/concurrency_hint.hpp create mode 100644 extern/include/asio/detail/conditionally_enabled_event.hpp create mode 100644 extern/include/asio/detail/conditionally_enabled_mutex.hpp create mode 100644 extern/include/asio/detail/cstddef.hpp create mode 100644 extern/include/asio/detail/executor_op.hpp rename extern/include/asio/detail/{function.hpp => functional.hpp} (63%) create mode 100644 extern/include/asio/detail/global.hpp create mode 100644 extern/include/asio/detail/handler_work.hpp create mode 100644 extern/include/asio/detail/impl/null_event.ipp rename extern/include/asio/detail/impl/{task_io_service.ipp => scheduler.ipp} (58%) create mode 100644 extern/include/asio/detail/impl/strand_executor_service.hpp create mode 100644 extern/include/asio/detail/impl/strand_executor_service.ipp delete mode 100644 extern/include/asio/detail/impl/task_io_service.hpp rename extern/include/asio/detail/impl/{win_iocp_io_service.hpp => win_iocp_io_context.hpp} (54%) rename extern/include/asio/detail/impl/{win_iocp_io_service.ipp => win_iocp_io_context.ipp} (80%) create mode 100644 extern/include/asio/detail/is_buffer_sequence.hpp create mode 100644 extern/include/asio/detail/is_executor.hpp create mode 100644 extern/include/asio/detail/memory.hpp create mode 100644 extern/include/asio/detail/null_global.hpp create mode 100644 extern/include/asio/detail/posix_global.hpp create mode 100644 extern/include/asio/detail/reactive_wait_op.hpp create mode 100644 extern/include/asio/detail/recycling_allocator.hpp create mode 100644 extern/include/asio/detail/resolve_query_op.hpp rename extern/include/asio/detail/{task_io_service.hpp => scheduler.hpp} (68%) rename extern/include/asio/detail/{task_io_service_operation.hpp => scheduler_operation.hpp} (59%) rename extern/include/asio/detail/{task_io_service_thread_info.hpp => scheduler_thread_info.hpp} (54%) delete mode 100644 extern/include/asio/detail/shared_ptr.hpp create mode 100644 extern/include/asio/detail/std_fenced_block.hpp create mode 100644 extern/include/asio/detail/std_global.hpp create mode 100644 extern/include/asio/detail/strand_executor_service.hpp create mode 100644 extern/include/asio/detail/string_view.hpp create mode 100644 extern/include/asio/detail/thread_context.hpp create mode 100644 extern/include/asio/detail/thread_group.hpp delete mode 100644 extern/include/asio/detail/weak_ptr.hpp create mode 100644 extern/include/asio/detail/win_global.hpp rename extern/include/asio/detail/{win_iocp_io_service.hpp => win_iocp_io_context.hpp} (83%) create mode 100644 extern/include/asio/detail/win_iocp_wait_op.hpp create mode 100644 extern/include/asio/detail/winapp_thread.hpp create mode 100644 extern/include/asio/detail/work_dispatcher.hpp create mode 100644 extern/include/asio/dispatch.hpp create mode 100644 extern/include/asio/execution_context.hpp create mode 100644 extern/include/asio/executor.hpp create mode 100644 extern/include/asio/executor_work_guard.hpp create mode 100644 extern/include/asio/experimental.hpp create mode 100644 extern/include/asio/experimental/co_spawn.hpp create mode 100644 extern/include/asio/experimental/detached.hpp create mode 100644 extern/include/asio/experimental/impl/co_spawn.hpp create mode 100644 extern/include/asio/experimental/impl/detached.hpp create mode 100644 extern/include/asio/experimental/impl/redirect_error.hpp create mode 100644 extern/include/asio/experimental/redirect_error.hpp create mode 100644 extern/include/asio/impl/defer.hpp create mode 100644 extern/include/asio/impl/dispatch.hpp create mode 100644 extern/include/asio/impl/execution_context.hpp create mode 100644 extern/include/asio/impl/execution_context.ipp create mode 100644 extern/include/asio/impl/executor.hpp create mode 100644 extern/include/asio/impl/executor.ipp create mode 100644 extern/include/asio/impl/io_context.hpp create mode 100644 extern/include/asio/impl/io_context.ipp delete mode 100644 extern/include/asio/impl/io_service.hpp delete mode 100644 extern/include/asio/impl/io_service.ipp create mode 100644 extern/include/asio/impl/post.hpp create mode 100644 extern/include/asio/impl/system_context.hpp create mode 100644 extern/include/asio/impl/system_context.ipp create mode 100644 extern/include/asio/impl/system_executor.hpp create mode 100644 extern/include/asio/impl/thread_pool.hpp create mode 100644 extern/include/asio/impl/thread_pool.ipp create mode 100644 extern/include/asio/io_context.hpp create mode 100644 extern/include/asio/io_context_strand.hpp create mode 100644 extern/include/asio/io_service_strand.hpp create mode 100644 extern/include/asio/ip/address_v4_iterator.hpp create mode 100644 extern/include/asio/ip/address_v4_range.hpp create mode 100644 extern/include/asio/ip/address_v6_iterator.hpp create mode 100644 extern/include/asio/ip/address_v6_range.hpp create mode 100644 extern/include/asio/ip/bad_address_cast.hpp create mode 100644 extern/include/asio/ip/basic_resolver_results.hpp create mode 100644 extern/include/asio/ip/impl/network_v4.hpp create mode 100644 extern/include/asio/ip/impl/network_v4.ipp create mode 100644 extern/include/asio/ip/impl/network_v6.hpp create mode 100644 extern/include/asio/ip/impl/network_v6.ipp create mode 100644 extern/include/asio/ip/network_v4.hpp create mode 100644 extern/include/asio/ip/network_v6.hpp create mode 100644 extern/include/asio/ip/resolver_base.hpp create mode 100644 extern/include/asio/is_executor.hpp create mode 100644 extern/include/asio/packaged_task.hpp create mode 100644 extern/include/asio/posix/descriptor.hpp create mode 100644 extern/include/asio/post.hpp delete mode 100644 extern/include/asio/ssl/basic_context.hpp delete mode 100644 extern/include/asio/ssl/context_service.hpp delete mode 100644 extern/include/asio/ssl/old/basic_context.hpp delete mode 100644 extern/include/asio/ssl/old/context_service.hpp delete mode 100644 extern/include/asio/ssl/old/detail/openssl_context_service.hpp delete mode 100644 extern/include/asio/ssl/old/detail/openssl_operation.hpp delete mode 100644 extern/include/asio/ssl/old/detail/openssl_stream_service.hpp delete mode 100644 extern/include/asio/ssl/old/stream.hpp delete mode 100644 extern/include/asio/ssl/old/stream_service.hpp delete mode 100644 extern/include/asio/ssl/stream_service.hpp create mode 100644 extern/include/asio/system_context.hpp create mode 100644 extern/include/asio/system_executor.hpp create mode 100644 extern/include/asio/thread_pool.hpp create mode 100644 extern/include/asio/ts/buffer.hpp create mode 100644 extern/include/asio/ts/executor.hpp create mode 100644 extern/include/asio/ts/internet.hpp create mode 100644 extern/include/asio/ts/io_context.hpp create mode 100644 extern/include/asio/ts/net.hpp create mode 100644 extern/include/asio/ts/netfwd.hpp create mode 100644 extern/include/asio/ts/socket.hpp create mode 100644 extern/include/asio/ts/timer.hpp create mode 100644 extern/include/asio/uses_executor.hpp create mode 100644 extern/include/asio/windows/overlapped_handle.hpp diff --git a/extern/include/asio.hpp b/extern/include/asio.hpp index 59083da3..3356df00 100644 --- a/extern/include/asio.hpp +++ b/extern/include/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -15,6 +15,8 @@ # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) +#include "asio/associated_allocator.hpp" +#include "asio/associated_executor.hpp" #include "asio/async_result.hpp" #include "asio/basic_datagram_socket.hpp" #include "asio/basic_deadline_timer.hpp" @@ -29,6 +31,7 @@ #include "asio/basic_stream_socket.hpp" #include "asio/basic_streambuf.hpp" #include "asio/basic_waitable_timer.hpp" +#include "asio/bind_executor.hpp" #include "asio/buffer.hpp" #include "asio/buffered_read_stream_fwd.hpp" #include "asio/buffered_read_stream.hpp" @@ -43,8 +46,13 @@ #include "asio/datagram_socket_service.hpp" #include "asio/deadline_timer_service.hpp" #include "asio/deadline_timer.hpp" +#include "asio/defer.hpp" +#include "asio/dispatch.hpp" #include "asio/error.hpp" #include "asio/error_code.hpp" +#include "asio/execution_context.hpp" +#include "asio/executor.hpp" +#include "asio/executor_work_guard.hpp" #include "asio/generic/basic_endpoint.hpp" #include "asio/generic/datagram_protocol.hpp" #include "asio/generic/raw_protocol.hpp" @@ -54,10 +62,19 @@ #include "asio/handler_continuation_hook.hpp" #include "asio/handler_invoke_hook.hpp" #include "asio/handler_type.hpp" +#include "asio/high_resolution_timer.hpp" +#include "asio/io_context.hpp" +#include "asio/io_context_strand.hpp" #include "asio/io_service.hpp" +#include "asio/io_service_strand.hpp" #include "asio/ip/address.hpp" #include "asio/ip/address_v4.hpp" +#include "asio/ip/address_v4_iterator.hpp" +#include "asio/ip/address_v4_range.hpp" #include "asio/ip/address_v6.hpp" +#include "asio/ip/address_v6_iterator.hpp" +#include "asio/ip/address_v6_range.hpp" +#include "asio/ip/bad_address_cast.hpp" #include "asio/ip/basic_endpoint.hpp" #include "asio/ip/basic_resolver.hpp" #include "asio/ip/basic_resolver_entry.hpp" @@ -66,24 +83,29 @@ #include "asio/ip/host_name.hpp" #include "asio/ip/icmp.hpp" #include "asio/ip/multicast.hpp" +#include "asio/ip/resolver_base.hpp" #include "asio/ip/resolver_query_base.hpp" #include "asio/ip/resolver_service.hpp" #include "asio/ip/tcp.hpp" #include "asio/ip/udp.hpp" #include "asio/ip/unicast.hpp" #include "asio/ip/v6_only.hpp" +#include "asio/is_executor.hpp" #include "asio/is_read_buffered.hpp" #include "asio/is_write_buffered.hpp" #include "asio/local/basic_endpoint.hpp" #include "asio/local/connect_pair.hpp" #include "asio/local/datagram_protocol.hpp" #include "asio/local/stream_protocol.hpp" +#include "asio/packaged_task.hpp" #include "asio/placeholders.hpp" #include "asio/posix/basic_descriptor.hpp" #include "asio/posix/basic_stream_descriptor.hpp" +#include "asio/posix/descriptor.hpp" #include "asio/posix/descriptor_base.hpp" #include "asio/posix/stream_descriptor.hpp" #include "asio/posix/stream_descriptor_service.hpp" +#include "asio/post.hpp" #include "asio/raw_socket_service.hpp" #include "asio/read.hpp" #include "asio/read_at.hpp" @@ -96,12 +118,19 @@ #include "asio/signal_set_service.hpp" #include "asio/socket_acceptor_service.hpp" #include "asio/socket_base.hpp" +#include "asio/steady_timer.hpp" #include "asio/strand.hpp" #include "asio/stream_socket_service.hpp" #include "asio/streambuf.hpp" +#include "asio/system_context.hpp" #include "asio/system_error.hpp" +#include "asio/system_executor.hpp" +#include "asio/system_timer.hpp" #include "asio/thread.hpp" +#include "asio/thread_pool.hpp" #include "asio/time_traits.hpp" +#include "asio/use_future.hpp" +#include "asio/uses_executor.hpp" #include "asio/version.hpp" #include "asio/wait_traits.hpp" #include "asio/waitable_timer_service.hpp" @@ -111,6 +140,7 @@ #include "asio/windows/basic_stream_handle.hpp" #include "asio/windows/object_handle.hpp" #include "asio/windows/object_handle_service.hpp" +#include "asio/windows/overlapped_handle.hpp" #include "asio/windows/overlapped_ptr.hpp" #include "asio/windows/random_access_handle.hpp" #include "asio/windows/random_access_handle_service.hpp" diff --git a/extern/include/asio/associated_allocator.hpp b/extern/include/asio/associated_allocator.hpp new file mode 100644 index 00000000..8b488bb3 --- /dev/null +++ b/extern/include/asio/associated_allocator.hpp @@ -0,0 +1,131 @@ +// +// associated_allocator.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP +#define ASIO_ASSOCIATED_ALLOCATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include +#include "asio/detail/type_traits.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_allocator_check +{ + typedef void type; +}; + +template +struct associated_allocator_impl +{ + typedef E type; + + static type get(const T&, const E& e) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_allocator_impl::type> +{ + typedef typename T::allocator_type type; + + static type get(const T& t, const E&) ASIO_NOEXCEPT + { + return t.get_allocator(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the allocator associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Allocator shall be a type meeting the Allocator requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c a is an object of type @c + * Allocator. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Allocator requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,a) and with return type @c type. + */ +template > +struct associated_allocator +{ + /// If @c T has a nested type @c allocator_type, T::allocator_type. + /// Otherwise @c Allocator. +#if defined(GENERATING_DOCUMENTATION) + typedef see_below type; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::associated_allocator_impl::type type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// If @c T has a nested type @c allocator_type, returns + /// t.get_allocator(). Otherwise returns @c a. + static type get(const T& t, + const Allocator& a = Allocator()) ASIO_NOEXCEPT + { + return detail::associated_allocator_impl::get(t, a); + } +}; + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t) ASIO_NOEXCEPT +{ + return associated_allocator::get(t); +} + +/// Helper function to obtain an object's associated allocator. +/** + * @returns associated_allocator::get(t, a) + */ +template +inline typename associated_allocator::type +get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT +{ + return associated_allocator::get(t, a); +} + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template > +using associated_allocator_t + = typename associated_allocator::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP diff --git a/extern/include/asio/associated_executor.hpp b/extern/include/asio/associated_executor.hpp new file mode 100644 index 00000000..4c5c2078 --- /dev/null +++ b/extern/include/asio/associated_executor.hpp @@ -0,0 +1,149 @@ +// +// associated_executor.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef ASIO_ASSOCIATED_EXECUTOR_HPP +#define ASIO_ASSOCIATED_EXECUTOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" +#include "asio/is_executor.hpp" +#include "asio/system_executor.hpp" + +#include "asio/detail/push_options.hpp" + +namespace asio { +namespace detail { + +template +struct associated_executor_check +{ + typedef void type; +}; + +template +struct associated_executor_impl +{ + typedef E type; + + static type get(const T&, const E& e) ASIO_NOEXCEPT + { + return e; + } +}; + +template +struct associated_executor_impl::type> +{ + typedef typename T::executor_type type; + + static type get(const T& t, const E&) ASIO_NOEXCEPT + { + return t.get_executor(); + } +}; + +} // namespace detail + +/// Traits type used to obtain the executor associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * Executor shall be a type meeting the Executor requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c e is an object of type @c + * Executor. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * Executor requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,e) and with return type @c type. + */ +template +struct associated_executor +{ + /// If @c T has a nested type @c executor_type, T::executor_type. + /// Otherwise @c Executor. +#if defined(GENERATING_DOCUMENTATION) + typedef see_below type; +#else // defined(GENERATING_DOCUMENTATION) + typedef typename detail::associated_executor_impl::type type; +#endif // defined(GENERATING_DOCUMENTATION) + + /// If @c T has a nested type @c executor_type, returns + /// t.get_executor(). Otherwise returns @c ex. + static type get(const T& t, + const Executor& ex = Executor()) ASIO_NOEXCEPT + { + return detail::associated_executor_impl::get(t, ex); + } +}; + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t) ASIO_NOEXCEPT +{ + return associated_executor::get(t); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ex) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, const Executor& ex, + typename enable_if::value>::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ex); +} + +/// Helper function to obtain an object's associated executor. +/** + * @returns associated_executor::get(t, ctx.get_executor()) + */ +template +inline typename associated_executor::type +get_associated_executor(const T& t, ExecutionContext& ctx, + typename enable_if::value>::type* = 0) ASIO_NOEXCEPT +{ + return associated_executor::get(t, ctx.get_executor()); +} + +#if defined(ASIO_HAS_ALIAS_TEMPLATES) + +template +using associated_executor_t = typename associated_executor::type; + +#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) + +} // namespace asio + +#include "asio/detail/pop_options.hpp" + +#endif // ASIO_ASSOCIATED_EXECUTOR_HPP diff --git a/extern/include/asio/async_result.hpp b/extern/include/asio/async_result.hpp index 37e9c2e0..18acdf20 100644 --- a/extern/include/asio/async_result.hpp +++ b/extern/include/asio/async_result.hpp @@ -2,7 +2,7 @@ // async_result.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,6 +16,7 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" +#include "asio/detail/type_traits.hpp" #include "asio/handler_type.hpp" #include "asio/detail/push_options.hpp" @@ -23,11 +24,94 @@ namespace asio { /// An interface for customising the behaviour of an initiating function. +/** + * The async_result traits class is used for determining: + * + * @li the concrete completion handler type to be called at the end of the + * asynchronous operation; + * + * @li the initiating function return type; and + * + * @li how the return value of the initiating function is obtained. + * + * The trait allows the handler and return types to be determined at the point + * where the specific completion handler signature is known. + * + * This template may be specialised for user-defined completion token types. + * The primary template assumes that the CompletionToken is the completion + * handler. + */ +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +template +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +template +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +class async_result +{ +public: +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + /// The concrete completion handler type for the specific signature. + typedef CompletionToken completion_handler_type; + + /// The return type of the initiating function. + typedef void return_type; +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + // For backward compatibility, determine the concrete completion handler type + // by using the legacy handler_type trait. + typedef typename handler_type::type + completion_handler_type; + + // For backward compatibility, determine the initiating function return type + // using the legacy single-parameter version of async_result. + typedef typename async_result::type return_type; +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + + /// Construct an async result from a given handler. + /** + * When using a specalised async_result, the constructor has an opportunity + * to initialise some state associated with the completion handler, which is + * then returned from the initiating function. + */ + explicit async_result(completion_handler_type& h) +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + // No data members to initialise. +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + : legacy_result_(h) +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + { + (void)h; + } + + /// Obtain the value to be returned from the initiating function. + return_type get() + { +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + // Nothing to do. +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + return legacy_result_.get(); +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + } + +private: + async_result(const async_result&) ASIO_DELETED; + async_result& operator=(const async_result&) ASIO_DELETED; + +#if defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + // No data members. +#else // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) + async_result legacy_result_; +#endif // defined(ASIO_NO_DEPRECATED) || defined(GENERATING_DOCUMENTATION) +}; + +#if !defined(ASIO_NO_DEPRECATED) + +/// (Deprecated: Use two-parameter version of async_result.) An interface for +/// customising the behaviour of an initiating function. /** * This template may be specialised for user-defined handler types. */ template -class async_result +class async_result { public: /// The return type of the initiating function. @@ -49,29 +133,65 @@ class async_result } }; -namespace detail { +#endif // !defined(ASIO_NO_DEPRECATED) -// Helper template to deduce the true type of a handler, capture a local copy -// of the handler, and then create an async_result for the handler. -template -struct async_result_init +/// Helper template to deduce the handler type from a CompletionToken, capture +/// a local copy of the handler, and then create an async_result for the +/// handler. +template +struct async_completion { - explicit async_result_init(ASIO_MOVE_ARG(Handler) orig_handler) - : handler(ASIO_MOVE_CAST(Handler)(orig_handler)), - result(handler) + /// The real handler type to be used for the asynchronous operation. + typedef typename asio::async_result< + typename decay::type, + Signature>::completion_handler_type completion_handler_type; + +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Constructor. + /** + * The constructor creates the concrete completion handler and makes the link + * between the handler and the asynchronous result. + */ + explicit async_completion(CompletionToken& token) + : completion_handler(static_cast::value, + completion_handler_type&, CompletionToken&&>::type>(token)), + result(completion_handler) + { + } +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + explicit async_completion(typename decay::type& token) + : completion_handler(token), + result(completion_handler) { } - typename handler_type::type handler; - async_result::type> result; + explicit async_completion(const typename decay::type& token) + : completion_handler(token), + result(completion_handler) + { + } +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// A copy of, or reference to, a real handler object. +#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + typename conditional< + is_same::value, + completion_handler_type&, completion_handler_type>::type completion_handler; +#else // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + completion_handler_type completion_handler; +#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// The result of the asynchronous operation's initiating function. + async_result::type, Signature> result; }; -template -struct async_result_type_helper +namespace detail { + +template +struct async_result_helper + : async_result::type, Signature> { - typedef typename async_result< - typename handler_type::type - >::type type; }; } // namespace detail @@ -80,15 +200,22 @@ struct async_result_type_helper #include "asio/detail/pop_options.hpp" #if defined(GENERATING_DOCUMENTATION) -# define ASIO_INITFN_RESULT_TYPE(h, sig) \ +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ void_or_deduced #elif defined(_MSC_VER) && (_MSC_VER < 1500) -# define ASIO_INITFN_RESULT_TYPE(h, sig) \ - typename ::asio::detail::async_result_type_helper::type +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ + typename ::asio::detail::async_result_helper< \ + ct, sig>::return_type +#define ASIO_HANDLER_TYPE(ct, sig) \ + typename ::asio::detail::async_result_helper< \ + ct, sig>::completion_handler_type #else -# define ASIO_INITFN_RESULT_TYPE(h, sig) \ +# define ASIO_INITFN_RESULT_TYPE(ct, sig) \ + typename ::asio::async_result< \ + typename ::asio::decay::type, sig>::return_type +#define ASIO_HANDLER_TYPE(ct, sig) \ typename ::asio::async_result< \ - typename ::asio::handler_type::type>::type + typename ::asio::decay::type, sig>::completion_handler_type #endif #endif // ASIO_ASYNC_RESULT_HPP diff --git a/extern/include/asio/basic_datagram_socket.hpp b/extern/include/asio/basic_datagram_socket.hpp index cce9fe0d..346cc353 100644 --- a/extern/include/asio/basic_datagram_socket.hpp +++ b/extern/include/asio/basic_datagram_socket.hpp @@ -2,7 +2,7 @@ // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -18,12 +18,15 @@ #include "asio/detail/config.hpp" #include #include "asio/basic_socket.hpp" -#include "asio/datagram_socket_service.hpp" #include "asio/detail/handler_type_requirements.hpp" #include "asio/detail/throw_error.hpp" #include "asio/detail/type_traits.hpp" #include "asio/error.hpp" +#if defined(ASIO_ENABLE_OLD_SERVICES) +# include "asio/datagram_socket_service.hpp" +#endif // defined(ASIO_ENABLE_OLD_SERVICES) + #include "asio/detail/push_options.hpp" namespace asio { @@ -37,18 +40,19 @@ namespace asio { * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. */ -template > +template )> class basic_datagram_socket - : public basic_socket + : public basic_socket { public: - /// (Deprecated: Use native_handle_type.) The native representation of a - /// socket. - typedef typename DatagramSocketService::native_handle_type native_type; - /// The native representation of a socket. - typedef typename DatagramSocketService::native_handle_type native_handle_type; +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename basic_socket< + Protocol ASIO_SVC_TARG>::native_handle_type native_handle_type; +#endif /// The protocol type. typedef Protocol protocol_type; @@ -61,12 +65,12 @@ class basic_datagram_socket * This constructor creates a datagram socket without opening it. The open() * function must be called before data can be sent or received on the socket. * - * @param io_service The io_service object that the datagram socket will use + * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. */ - explicit basic_datagram_socket(asio::io_service& io_service) - : basic_socket(io_service) + explicit basic_datagram_socket(asio::io_context& io_context) + : basic_socket(io_context) { } @@ -74,7 +78,7 @@ class basic_datagram_socket /** * This constructor creates and opens a datagram socket. * - * @param io_service The io_service object that the datagram socket will use + * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * @@ -82,9 +86,9 @@ class basic_datagram_socket * * @throws asio::system_error Thrown on failure. */ - basic_datagram_socket(asio::io_service& io_service, + basic_datagram_socket(asio::io_context& io_context, const protocol_type& protocol) - : basic_socket(io_service, protocol) + : basic_socket(io_context, protocol) { } @@ -95,7 +99,7 @@ class basic_datagram_socket * to the specified endpoint on the local machine. The protocol used is the * protocol associated with the given endpoint. * - * @param io_service The io_service object that the datagram socket will use + * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * @@ -104,9 +108,9 @@ class basic_datagram_socket * * @throws asio::system_error Thrown on failure. */ - basic_datagram_socket(asio::io_service& io_service, + basic_datagram_socket(asio::io_context& io_context, const endpoint_type& endpoint) - : basic_socket(io_service, endpoint) + : basic_socket(io_context, endpoint) { } @@ -115,7 +119,7 @@ class basic_datagram_socket * This constructor creates a datagram socket object to hold an existing * native socket. * - * @param io_service The io_service object that the datagram socket will use + * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * @@ -125,10 +129,10 @@ class basic_datagram_socket * * @throws asio::system_error Thrown on failure. */ - basic_datagram_socket(asio::io_service& io_service, + basic_datagram_socket(asio::io_context& io_context, const protocol_type& protocol, const native_handle_type& native_socket) - : basic_socket( - io_service, protocol, native_socket) + : basic_socket( + io_context, protocol, native_socket) { } @@ -141,11 +145,10 @@ class basic_datagram_socket * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_service&) constructor. + * constructed using the @c basic_datagram_socket(io_context&) constructor. */ basic_datagram_socket(basic_datagram_socket&& other) - : basic_socket( - ASIO_MOVE_CAST(basic_datagram_socket)(other)) + : basic_socket(std::move(other)) { } @@ -158,12 +161,11 @@ class basic_datagram_socket * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_service&) constructor. + * constructed using the @c basic_datagram_socket(io_context&) constructor. */ basic_datagram_socket& operator=(basic_datagram_socket&& other) { - basic_socket::operator=( - ASIO_MOVE_CAST(basic_datagram_socket)(other)); + basic_socket::operator=(std::move(other)); return *this; } @@ -176,15 +178,13 @@ class basic_datagram_socket * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_service&) constructor. + * constructed using the @c basic_datagram_socket(io_context&) constructor. */ - template + template basic_datagram_socket( - basic_datagram_socket&& other, + basic_datagram_socket&& other, typename enable_if::value>::type* = 0) - : basic_socket( - ASIO_MOVE_CAST2(basic_datagram_socket< - Protocol1, DatagramSocketService1>)(other)) + : basic_socket(std::move(other)) { } @@ -198,20 +198,27 @@ class basic_datagram_socket * will occur. * * @note Following the move, the moved-from object is in the same state as if - * constructed using the @c basic_datagram_socket(io_service&) constructor. + * constructed using the @c basic_datagram_socket(io_context&) constructor. */ - template + template typename enable_if::value, basic_datagram_socket>::type& operator=( - basic_datagram_socket&& other) + basic_datagram_socket&& other) { - basic_socket::operator=( - ASIO_MOVE_CAST2(basic_datagram_socket< - Protocol1, DatagramSocketService1>)(other)); + basic_socket::operator=(std::move(other)); return *this; } #endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Destroys the socket. + /** + * This function destroys the socket, cancelling any outstanding asynchronous + * operations associated with the socket as if by calling @c cancel. + */ + ~basic_datagram_socket() + { + } + /// Send some data on a connected socket. /** * This function is used to send data on the datagram socket. The function @@ -317,7 +324,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram @@ -342,8 +349,18 @@ class basic_datagram_socket // not meet the documented type requirements for a WriteHandler. ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send(this->get_implementation(), buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, 0, init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous send on a connected socket. @@ -368,7 +385,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram @@ -385,8 +402,18 @@ class basic_datagram_socket // not meet the documented type requirements for a WriteHandler. ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send(this->get_implementation(), buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send(this->get_implementation(), + buffers, flags, init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Send a datagram to the specified endpoint. @@ -500,7 +527,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @par Example * To send a single data buffer use the @ref buffer function as follows: @@ -525,9 +552,20 @@ class basic_datagram_socket // not meet the documented type requirements for a WriteHandler. ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send_to( this->get_implementation(), buffers, destination, 0, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to( + this->get_implementation(), buffers, destination, 0, + init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous send. @@ -555,7 +593,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). */ template ASIO_INITFN_RESULT_TYPE(WriteHandler, @@ -568,9 +606,20 @@ class basic_datagram_socket // not meet the documented type requirements for a WriteHandler. ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send_to( this->get_implementation(), buffers, destination, flags, ASIO_MOVE_CAST(WriteHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_send_to( + this->get_implementation(), buffers, destination, flags, + init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Receive some data on a connected socket. @@ -682,7 +731,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected @@ -708,8 +757,18 @@ class basic_datagram_socket // not meet the documented type requirements for a ReadHandler. ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive(this->get_implementation(), buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, 0, init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous receive on a connected socket. @@ -734,7 +793,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected @@ -751,8 +810,18 @@ class basic_datagram_socket // not meet the documented type requirements for a ReadHandler. ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive(this->get_implementation(), buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive(this->get_implementation(), + buffers, flags, init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Receive a datagram with the endpoint of the sender. @@ -869,7 +938,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). * * @par Example * To receive into a single data buffer use the @ref buffer function as @@ -891,9 +960,20 @@ class basic_datagram_socket // not meet the documented type requirements for a ReadHandler. ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, 0, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, 0, + init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous receive. @@ -923,7 +1003,7 @@ class basic_datagram_socket * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using - * asio::io_service::post(). + * asio::io_context::post(). */ template ASIO_INITFN_RESULT_TYPE(ReadHandler, @@ -936,9 +1016,20 @@ class basic_datagram_socket // not meet the documented type requirements for a ReadHandler. ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; +#if defined(ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, flags, ASIO_MOVE_CAST(ReadHandler)(handler)); +#else // defined(ASIO_ENABLE_OLD_SERVICES) + async_completion init(handler); + + this->get_service().async_receive_from( + this->get_implementation(), buffers, sender_endpoint, flags, + init.completion_handler); + + return init.result.get(); +#endif // defined(ASIO_ENABLE_OLD_SERVICES) } }; diff --git a/extern/include/asio/basic_deadline_timer.hpp b/extern/include/asio/basic_deadline_timer.hpp index f75b9bda..5b20066d 100644 --- a/extern/include/asio/basic_deadline_timer.hpp +++ b/extern/include/asio/basic_deadline_timer.hpp @@ -2,7 +2,7 @@ // basic_deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -22,10 +22,17 @@ #include #include "asio/basic_io_object.hpp" -#include "asio/deadline_timer_service.hpp" #include "asio/detail/handler_type_requirements.hpp" #include "asio/detail/throw_error.hpp" #include "asio/error.hpp" +#include "asio/time_traits.hpp" + +#if defined(ASIO_ENABLE_OLD_SERVICES) +# include "asio/deadline_timer_service.hpp" +#else // defined(ASIO_ENABLE_OLD_SERVICES) +# include "asio/detail/deadline_timer_service.hpp" +# define ASIO_SVC_T detail::deadline_timer_service +#endif // defined(ASIO_ENABLE_OLD_SERVICES) #include "asio/detail/push_options.hpp" @@ -50,7 +57,7 @@ namespace asio { * Performing a blocking wait: * @code * // Construct a timer without setting an expiry time. - * asio::deadline_timer timer(io_service); + * asio::deadline_timer timer(io_context); * * // Set an expiry time relative to now. * timer.expires_from_now(boost::posix_time::seconds(5)); @@ -73,7 +80,7 @@ namespace asio { * ... * * // Construct a timer with an absolute expiry time. - * asio::deadline_timer timer(io_service, + * asio::deadline_timer timer(io_context, * boost::posix_time::time_from_string("2005-12-07 23:59:59.000")); * * // Start an asynchronous wait. @@ -120,12 +127,15 @@ namespace asio { * it contains the value asio::error::operation_aborted. */ template , - typename TimerService = deadline_timer_service > + typename TimeTraits = asio::time_traits