hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject [50/50] [abbrv] hadoop git commit: HDFS-8724. Import third_party libraries into the repository.
Date Sat, 11 Jul 2015 00:08:13 GMT
HDFS-8724. Import third_party libraries into the repository.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6f03d4a5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6f03d4a5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6f03d4a5

Branch: refs/heads/HDFS-8707
Commit: 6f03d4a5d92fbe3395f2428eda8cccf5e4786682
Parents: ee192ab
Author: Haohui Mai <wheat9@apache.org>
Authored: Tue Jul 7 11:23:00 2015 -0700
Committer: Haohui Mai <wheat9@apache.org>
Committed: Fri Jul 10 17:05:29 2015 -0700

----------------------------------------------------------------------
 .../src/main/native/CMakeLists.txt              |     2 +
 .../src/main/native/libhdfspp/CMakeLists.txt    |    35 +
 .../libhdfspp/third_party/asio-1.10.2/COPYING   |     4 +
 .../third_party/asio-1.10.2/include/asio.hpp    |   122 +
 .../asio-1.10.2/include/asio/async_result.hpp   |    94 +
 .../include/asio/basic_datagram_socket.hpp      |   949 +
 .../include/asio/basic_deadline_timer.hpp       |   518 +
 .../include/asio/basic_io_object.hpp            |   240 +
 .../include/asio/basic_raw_socket.hpp           |   940 +
 .../include/asio/basic_seq_packet_socket.hpp    |   565 +
 .../include/asio/basic_serial_port.hpp          |   695 +
 .../include/asio/basic_signal_set.hpp           |   384 +
 .../asio-1.10.2/include/asio/basic_socket.hpp   |  1518 ++
 .../include/asio/basic_socket_acceptor.hpp      |  1136 +
 .../include/asio/basic_socket_iostream.hpp      |   286 +
 .../include/asio/basic_socket_streambuf.hpp     |   567 +
 .../include/asio/basic_stream_socket.hpp        |   852 +
 .../include/asio/basic_streambuf.hpp            |   369 +
 .../include/asio/basic_streambuf_fwd.hpp        |    33 +
 .../include/asio/basic_waitable_timer.hpp       |   519 +
 .../asio-1.10.2/include/asio/buffer.hpp         |  2239 ++
 .../include/asio/buffered_read_stream.hpp       |   244 +
 .../include/asio/buffered_read_stream_fwd.hpp   |    25 +
 .../include/asio/buffered_stream.hpp            |   258 +
 .../include/asio/buffered_stream_fwd.hpp        |    25 +
 .../include/asio/buffered_write_stream.hpp      |   236 +
 .../include/asio/buffered_write_stream_fwd.hpp  |    25 +
 .../include/asio/buffers_iterator.hpp           |   481 +
 .../include/asio/completion_condition.hpp       |   218 +
 .../asio-1.10.2/include/asio/connect.hpp        |   823 +
 .../asio-1.10.2/include/asio/coroutine.hpp      |   328 +
 .../include/asio/datagram_socket_service.hpp    |   432 +
 .../asio-1.10.2/include/asio/deadline_timer.hpp |    40 +
 .../include/asio/deadline_timer_service.hpp     |   171 +
 .../include/asio/detail/addressof.hpp           |    38 +
 .../asio-1.10.2/include/asio/detail/array.hpp   |    38 +
 .../include/asio/detail/array_fwd.hpp           |    34 +
 .../asio-1.10.2/include/asio/detail/assert.hpp  |    32 +
 .../include/asio/detail/atomic_count.hpp        |    45 +
 .../asio/detail/base_from_completion_cond.hpp   |    68 +
 .../include/asio/detail/bind_handler.hpp        |   489 +
 .../include/asio/detail/buffer_resize_guard.hpp |    66 +
 .../asio/detail/buffer_sequence_adapter.hpp     |   383 +
 .../asio/detail/buffered_stream_storage.hpp     |   126 +
 .../include/asio/detail/call_stack.hpp          |   125 +
 .../include/asio/detail/chrono_time_traits.hpp  |   190 +
 .../include/asio/detail/completion_handler.hpp  |    81 +
 .../asio-1.10.2/include/asio/detail/config.hpp  |   895 +
 .../include/asio/detail/consuming_buffers.hpp   |   292 +
 .../asio-1.10.2/include/asio/detail/cstdint.hpp |    46 +
 .../include/asio/detail/date_time_fwd.hpp       |    34 +
 .../asio/detail/deadline_timer_service.hpp      |   227 +
 .../include/asio/detail/dependent_type.hpp      |    36 +
 .../include/asio/detail/descriptor_ops.hpp      |   117 +
 .../include/asio/detail/descriptor_read_op.hpp  |   119 +
 .../include/asio/detail/descriptor_write_op.hpp |   119 +
 .../include/asio/detail/dev_poll_reactor.hpp    |   210 +
 .../include/asio/detail/epoll_reactor.hpp       |   242 +
 .../asio-1.10.2/include/asio/detail/event.hpp   |    48 +
 .../asio/detail/eventfd_select_interrupter.hpp  |    83 +
 .../include/asio/detail/fd_set_adapter.hpp      |    39 +
 .../include/asio/detail/fenced_block.hpp        |    76 +
 .../include/asio/detail/function.hpp            |    38 +
 .../asio/detail/gcc_arm_fenced_block.hpp        |    89 +
 .../asio/detail/gcc_hppa_fenced_block.hpp       |    66 +
 .../asio/detail/gcc_sync_fenced_block.hpp       |    63 +
 .../asio/detail/gcc_x86_fenced_block.hpp        |    89 +
 .../asio/detail/handler_alloc_helpers.hpp       |    82 +
 .../asio/detail/handler_cont_helpers.hpp        |    45 +
 .../asio/detail/handler_invoke_helpers.hpp      |    57 +
 .../include/asio/detail/handler_tracking.hpp    |   159 +
 .../asio/detail/handler_type_requirements.hpp   |   488 +
 .../include/asio/detail/hash_map.hpp            |   331 +
 .../detail/impl/buffer_sequence_adapter.ipp     |   118 +
 .../include/asio/detail/impl/descriptor_ops.ipp |   451 +
 .../asio/detail/impl/dev_poll_reactor.hpp       |    78 +
 .../asio/detail/impl/dev_poll_reactor.ipp       |   445 +
 .../include/asio/detail/impl/epoll_reactor.hpp  |    76 +
 .../include/asio/detail/impl/epoll_reactor.ipp  |   662 +
 .../detail/impl/eventfd_select_interrupter.ipp  |   165 +
 .../asio/detail/impl/handler_tracking.ipp       |   305 +
 .../include/asio/detail/impl/kqueue_reactor.hpp |    80 +
 .../include/asio/detail/impl/kqueue_reactor.ipp |   463 +
 .../detail/impl/pipe_select_interrupter.ipp     |   124 +
 .../include/asio/detail/impl/posix_event.ipp    |    47 +
 .../include/asio/detail/impl/posix_mutex.ipp    |    46 +
 .../include/asio/detail/impl/posix_thread.ipp   |    74 +
 .../include/asio/detail/impl/posix_tss_ptr.ipp  |    46 +
 .../detail/impl/reactive_descriptor_service.ipp |   208 +
 .../impl/reactive_serial_port_service.ipp       |   151 +
 .../impl/reactive_socket_service_base.ipp       |   267 +
 .../asio/detail/impl/resolver_service_base.ipp  |   130 +
 .../include/asio/detail/impl/select_reactor.hpp |    87 +
 .../include/asio/detail/impl/select_reactor.ipp |   313 +
 .../asio/detail/impl/service_registry.hpp       |    88 +
 .../asio/detail/impl/service_registry.ipp       |   188 +
 .../asio/detail/impl/signal_set_service.ipp     |   647 +
 .../include/asio/detail/impl/socket_ops.ipp     |  3394 +++
 .../detail/impl/socket_select_interrupter.ipp   |   175 +
 .../include/asio/detail/impl/strand_service.hpp |   118 +
 .../include/asio/detail/impl/strand_service.ipp |   176 +
 .../asio/detail/impl/task_io_service.hpp        |    78 +
 .../asio/detail/impl/task_io_service.ipp        |   474 +
 .../include/asio/detail/impl/throw_error.ipp    |    60 +
 .../asio/detail/impl/timer_queue_ptime.ipp      |    84 +
 .../asio/detail/impl/timer_queue_set.ipp        |   101 +
 .../include/asio/detail/impl/win_event.ipp      |    67 +
 .../detail/impl/win_iocp_handle_service.ipp     |   528 +
 .../asio/detail/impl/win_iocp_io_service.hpp    |   130 +
 .../asio/detail/impl/win_iocp_io_service.ipp    |   531 +
 .../impl/win_iocp_serial_port_service.ipp       |   180 +
 .../impl/win_iocp_socket_service_base.ipp       |   728 +
 .../include/asio/detail/impl/win_mutex.ipp      |    78 +
 .../detail/impl/win_object_handle_service.ipp   |   444 +
 .../asio/detail/impl/win_static_mutex.ipp       |   118 +
 .../include/asio/detail/impl/win_thread.ipp     |   139 +
 .../include/asio/detail/impl/win_tss_ptr.ipp    |    57 +
 .../detail/impl/winrt_ssocket_service_base.ipp  |   612 +
 .../asio/detail/impl/winrt_timer_scheduler.hpp  |    79 +
 .../asio/detail/impl/winrt_timer_scheduler.ipp  |   122 +
 .../include/asio/detail/impl/winsock_init.ipp   |    82 +
 .../include/asio/detail/io_control.hpp          |   134 +
 .../include/asio/detail/keyword_tss_ptr.hpp     |    70 +
 .../include/asio/detail/kqueue_reactor.hpp      |   219 +
 .../asio-1.10.2/include/asio/detail/limits.hpp  |    26 +
 .../asio/detail/local_free_on_block_exit.hpp    |    57 +
 .../include/asio/detail/macos_fenced_block.hpp  |    61 +
 .../asio-1.10.2/include/asio/detail/mutex.hpp   |    48 +
 .../include/asio/detail/noncopyable.hpp         |    43 +
 .../include/asio/detail/null_event.hpp          |    88 +
 .../include/asio/detail/null_fenced_block.hpp   |    45 +
 .../include/asio/detail/null_mutex.hpp          |    64 +
 .../include/asio/detail/null_reactor.hpp        |    67 +
 .../include/asio/detail/null_signal_blocker.hpp |    69 +
 .../include/asio/detail/null_socket_service.hpp |   497 +
 .../include/asio/detail/null_static_mutex.hpp   |    60 +
 .../include/asio/detail/null_thread.hpp         |    61 +
 .../include/asio/detail/null_tss_ptr.hpp        |    68 +
 .../include/asio/detail/object_pool.hpp         |   146 +
 .../include/asio/detail/old_win_sdk_compat.hpp  |   214 +
 .../include/asio/detail/op_queue.hpp            |   156 +
 .../include/asio/detail/operation.hpp           |    38 +
 .../asio/detail/pipe_select_interrupter.hpp     |    89 +
 .../include/asio/detail/pop_options.hpp         |   105 +
 .../include/asio/detail/posix_event.hpp         |   126 +
 .../asio/detail/posix_fd_set_adapter.hpp        |   118 +
 .../include/asio/detail/posix_mutex.hpp         |    76 +
 .../asio/detail/posix_signal_blocker.hpp        |    85 +
 .../include/asio/detail/posix_static_mutex.hpp  |    64 +
 .../include/asio/detail/posix_thread.hpp        |   105 +
 .../include/asio/detail/posix_tss_ptr.hpp       |    79 +
 .../include/asio/detail/push_options.hpp        |   138 +
 .../asio/detail/reactive_descriptor_service.hpp |   322 +
 .../asio/detail/reactive_null_buffers_op.hpp    |    88 +
 .../detail/reactive_serial_port_service.hpp     |   234 +
 .../asio/detail/reactive_socket_accept_op.hpp   |   136 +
 .../asio/detail/reactive_socket_connect_op.hpp  |   106 +
 .../asio/detail/reactive_socket_recv_op.hpp     |   123 +
 .../asio/detail/reactive_socket_recvfrom_op.hpp |   133 +
 .../asio/detail/reactive_socket_recvmsg_op.hpp  |   125 +
 .../asio/detail/reactive_socket_send_op.hpp     |   120 +
 .../asio/detail/reactive_socket_sendto_op.hpp   |   123 +
 .../asio/detail/reactive_socket_service.hpp     |   457 +
 .../detail/reactive_socket_service_base.hpp     |   450 +
 .../asio-1.10.2/include/asio/detail/reactor.hpp |    32 +
 .../include/asio/detail/reactor_fwd.hpp         |    40 +
 .../include/asio/detail/reactor_op.hpp          |    61 +
 .../include/asio/detail/reactor_op_queue.hpp    |   168 +
 .../include/asio/detail/regex_fwd.hpp           |    35 +
 .../include/asio/detail/resolve_endpoint_op.hpp |   121 +
 .../include/asio/detail/resolve_op.hpp          |   131 +
 .../include/asio/detail/resolver_service.hpp    |   129 +
 .../asio/detail/resolver_service_base.hpp       |   129 +
 .../include/asio/detail/scoped_lock.hpp         |   101 +
 .../include/asio/detail/scoped_ptr.hpp          |    79 +
 .../include/asio/detail/select_interrupter.hpp  |    46 +
 .../include/asio/detail/select_reactor.hpp      |   219 +
 .../include/asio/detail/service_registry.hpp    |   156 +
 .../include/asio/detail/shared_ptr.hpp          |    38 +
 .../include/asio/detail/signal_blocker.hpp      |    44 +
 .../include/asio/detail/signal_handler.hpp      |    82 +
 .../include/asio/detail/signal_init.hpp         |    47 +
 .../include/asio/detail/signal_op.hpp           |    49 +
 .../include/asio/detail/signal_set_service.hpp  |   216 +
 .../include/asio/detail/socket_holder.hpp       |    98 +
 .../include/asio/detail/socket_ops.hpp          |   334 +
 .../include/asio/detail/socket_option.hpp       |   316 +
 .../asio/detail/socket_select_interrupter.hpp   |    91 +
 .../include/asio/detail/socket_types.hpp        |   404 +
 .../asio/detail/solaris_fenced_block.hpp        |    61 +
 .../include/asio/detail/static_mutex.hpp        |    52 +
 .../include/asio/detail/std_event.hpp           |   176 +
 .../include/asio/detail/std_mutex.hpp           |    73 +
 .../include/asio/detail/std_static_mutex.hpp    |    81 +
 .../include/asio/detail/std_thread.hpp          |    65 +
 .../include/asio/detail/strand_service.hpp      |   142 +
 .../include/asio/detail/task_io_service.hpp     |   201 +
 .../asio/detail/task_io_service_operation.hpp   |    76 +
 .../asio/detail/task_io_service_thread_info.hpp |    40 +
 .../asio-1.10.2/include/asio/detail/thread.hpp  |    56 +
 .../include/asio/detail/thread_info_base.hpp    |    91 +
 .../include/asio/detail/throw_error.hpp         |    53 +
 .../include/asio/detail/throw_exception.hpp     |    51 +
 .../include/asio/detail/timer_queue.hpp         |   332 +
 .../include/asio/detail/timer_queue_base.hpp    |    68 +
 .../include/asio/detail/timer_queue_ptime.hpp   |    93 +
 .../include/asio/detail/timer_queue_set.hpp     |    66 +
 .../include/asio/detail/timer_scheduler.hpp     |    35 +
 .../include/asio/detail/timer_scheduler_fwd.hpp |    40 +
 .../asio-1.10.2/include/asio/detail/tss_ptr.hpp |    69 +
 .../include/asio/detail/type_traits.hpp         |    58 +
 .../include/asio/detail/variadic_templates.hpp  |    63 +
 .../include/asio/detail/wait_handler.hpp        |    83 +
 .../asio-1.10.2/include/asio/detail/wait_op.hpp |    45 +
 .../include/asio/detail/weak_ptr.hpp            |    38 +
 .../include/asio/detail/win_event.hpp           |   126 +
 .../include/asio/detail/win_fd_set_adapter.hpp  |   149 +
 .../include/asio/detail/win_fenced_block.hpp    |    89 +
 .../asio/detail/win_iocp_handle_read_op.hpp     |   109 +
 .../asio/detail/win_iocp_handle_service.hpp     |   322 +
 .../asio/detail/win_iocp_handle_write_op.hpp    |   101 +
 .../include/asio/detail/win_iocp_io_service.hpp |   315 +
 .../asio/detail/win_iocp_null_buffers_op.hpp    |   119 +
 .../include/asio/detail/win_iocp_operation.hpp  |    95 +
 .../asio/detail/win_iocp_overlapped_op.hpp      |    88 +
 .../asio/detail/win_iocp_overlapped_ptr.hpp     |   144 +
 .../detail/win_iocp_serial_port_service.hpp     |   228 +
 .../asio/detail/win_iocp_socket_accept_op.hpp   |   165 +
 .../asio/detail/win_iocp_socket_connect_op.hpp  |   124 +
 .../asio/detail/win_iocp_socket_recv_op.hpp     |   115 +
 .../asio/detail/win_iocp_socket_recvfrom_op.hpp |   123 +
 .../asio/detail/win_iocp_socket_recvmsg_op.hpp  |   116 +
 .../asio/detail/win_iocp_socket_send_op.hpp     |   109 +
 .../asio/detail/win_iocp_socket_service.hpp     |   525 +
 .../detail/win_iocp_socket_service_base.hpp     |   524 +
 .../asio/detail/win_iocp_thread_info.hpp        |    34 +
 .../include/asio/detail/win_mutex.hpp           |    78 +
 .../asio/detail/win_object_handle_service.hpp   |   183 +
 .../include/asio/detail/win_static_mutex.hpp    |    74 +
 .../include/asio/detail/win_thread.hpp          |   139 +
 .../include/asio/detail/win_tss_ptr.hpp         |    79 +
 .../include/asio/detail/wince_thread.hpp        |   116 +
 .../include/asio/detail/winrt_async_manager.hpp |   294 +
 .../include/asio/detail/winrt_async_op.hpp      |    65 +
 .../include/asio/detail/winrt_resolve_op.hpp    |   117 +
 .../asio/detail/winrt_resolver_service.hpp      |   183 +
 .../asio/detail/winrt_socket_connect_op.hpp     |    90 +
 .../asio/detail/winrt_socket_recv_op.hpp        |   110 +
 .../asio/detail/winrt_socket_send_op.hpp        |   101 +
 .../asio/detail/winrt_ssocket_service.hpp       |   232 +
 .../asio/detail/winrt_ssocket_service_base.hpp  |   355 +
 .../asio/detail/winrt_timer_scheduler.hpp       |   131 +
 .../include/asio/detail/winrt_utils.hpp         |   106 +
 .../include/asio/detail/winsock_init.hpp        |   128 +
 .../include/asio/detail/wrapped_handler.hpp     |   291 +
 .../asio-1.10.2/include/asio/error.hpp          |   331 +
 .../asio-1.10.2/include/asio/error_code.hpp     |   188 +
 .../include/asio/generic/basic_endpoint.hpp     |   193 +
 .../include/asio/generic/datagram_protocol.hpp  |   123 +
 .../include/asio/generic/detail/endpoint.hpp    |   133 +
 .../asio/generic/detail/impl/endpoint.ipp       |   109 +
 .../include/asio/generic/raw_protocol.hpp       |   121 +
 .../asio/generic/seq_packet_protocol.hpp        |   122 +
 .../include/asio/generic/stream_protocol.hpp    |   127 +
 .../include/asio/handler_alloc_hook.hpp         |    81 +
 .../include/asio/handler_continuation_hook.hpp  |    54 +
 .../include/asio/handler_invoke_hook.hpp        |    85 +
 .../asio-1.10.2/include/asio/handler_type.hpp   |   112 +
 .../include/asio/high_resolution_timer.hpp      |    63 +
 .../include/asio/impl/buffered_read_stream.hpp  |   358 +
 .../include/asio/impl/buffered_write_stream.hpp |   338 +
 .../asio-1.10.2/include/asio/impl/connect.hpp   |   428 +
 .../asio-1.10.2/include/asio/impl/error.ipp     |   128 +
 .../include/asio/impl/error_code.ipp            |   128 +
 .../include/asio/impl/handler_alloc_hook.ipp    |    77 +
 .../include/asio/impl/io_service.hpp            |   152 +
 .../include/asio/impl/io_service.ipp            |   155 +
 .../asio-1.10.2/include/asio/impl/read.hpp      |   753 +
 .../asio-1.10.2/include/asio/impl/read_at.hpp   |   810 +
 .../include/asio/impl/read_until.hpp            |  1147 +
 .../include/asio/impl/serial_port_base.hpp      |    59 +
 .../include/asio/impl/serial_port_base.ipp      |   554 +
 .../asio-1.10.2/include/asio/impl/spawn.hpp     |   336 +
 .../asio-1.10.2/include/asio/impl/src.cpp       |    25 +
 .../asio-1.10.2/include/asio/impl/src.hpp       |    74 +
 .../include/asio/impl/use_future.hpp            |   172 +
 .../asio-1.10.2/include/asio/impl/write.hpp     |   765 +
 .../asio-1.10.2/include/asio/impl/write_at.hpp  |   825 +
 .../asio-1.10.2/include/asio/io_service.hpp     |   770 +
 .../asio-1.10.2/include/asio/ip/address.hpp     |   200 +
 .../asio-1.10.2/include/asio/ip/address_v4.hpp  |   241 +
 .../asio-1.10.2/include/asio/ip/address_v6.hpp  |   246 +
 .../include/asio/ip/basic_endpoint.hpp          |   263 +
 .../include/asio/ip/basic_resolver.hpp          |   268 +
 .../include/asio/ip/basic_resolver_entry.hpp    |    94 +
 .../include/asio/ip/basic_resolver_iterator.hpp |   260 +
 .../include/asio/ip/basic_resolver_query.hpp    |   244 +
 .../include/asio/ip/detail/endpoint.hpp         |   139 +
 .../include/asio/ip/detail/impl/endpoint.ipp    |   204 +
 .../include/asio/ip/detail/socket_option.hpp    |   569 +
 .../asio-1.10.2/include/asio/ip/host_name.hpp   |    42 +
 .../asio-1.10.2/include/asio/ip/icmp.hpp        |   115 +
 .../include/asio/ip/impl/address.hpp            |    53 +
 .../include/asio/ip/impl/address.ipp            |   226 +
 .../include/asio/ip/impl/address_v4.hpp         |    53 +
 .../include/asio/ip/impl/address_v4.ipp         |   178 +
 .../include/asio/ip/impl/address_v6.hpp         |    53 +
 .../include/asio/ip/impl/address_v6.ipp         |   298 +
 .../include/asio/ip/impl/basic_endpoint.hpp     |    55 +
 .../include/asio/ip/impl/host_name.ipp          |    54 +
 .../asio-1.10.2/include/asio/ip/multicast.hpp   |   191 +
 .../include/asio/ip/resolver_query_base.hpp     |   130 +
 .../include/asio/ip/resolver_service.hpp        |   176 +
 .../asio-1.10.2/include/asio/ip/tcp.hpp         |   155 +
 .../asio-1.10.2/include/asio/ip/udp.hpp         |   111 +
 .../asio-1.10.2/include/asio/ip/unicast.hpp     |    70 +
 .../asio-1.10.2/include/asio/ip/v6_only.hpp     |    69 +
 .../include/asio/is_read_buffered.hpp           |    59 +
 .../include/asio/is_write_buffered.hpp          |    59 +
 .../include/asio/local/basic_endpoint.hpp       |   239 +
 .../include/asio/local/connect_pair.hpp         |   104 +
 .../include/asio/local/datagram_protocol.hpp    |    80 +
 .../include/asio/local/detail/endpoint.hpp      |   133 +
 .../include/asio/local/detail/impl/endpoint.ipp |   128 +
 .../include/asio/local/stream_protocol.hpp      |    90 +
 .../asio-1.10.2/include/asio/placeholders.hpp   |   123 +
 .../include/asio/posix/basic_descriptor.hpp     |   490 +
 .../asio/posix/basic_stream_descriptor.hpp      |   362 +
 .../include/asio/posix/descriptor_base.hpp      |    97 +
 .../include/asio/posix/stream_descriptor.hpp    |    37 +
 .../asio/posix/stream_descriptor_service.hpp    |   260 +
 .../include/asio/raw_socket_service.hpp         |   432 +
 .../asio-1.10.2/include/asio/read.hpp           |   631 +
 .../asio-1.10.2/include/asio/read_at.hpp        |   664 +
 .../asio-1.10.2/include/asio/read_until.hpp     |   923 +
 .../include/asio/seq_packet_socket_service.hpp  |   380 +
 .../asio-1.10.2/include/asio/serial_port.hpp    |    36 +
 .../include/asio/serial_port_base.hpp           |   167 +
 .../include/asio/serial_port_service.hpp        |   253 +
 .../asio-1.10.2/include/asio/signal_set.hpp     |    28 +
 .../include/asio/signal_set_service.hpp         |   134 +
 .../include/asio/socket_acceptor_service.hpp    |   302 +
 .../asio-1.10.2/include/asio/socket_base.hpp    |   520 +
 .../asio-1.10.2/include/asio/spawn.hpp          |   265 +
 .../asio-1.10.2/include/asio/ssl.hpp            |    30 +
 .../include/asio/ssl/basic_context.hpp          |    40 +
 .../asio-1.10.2/include/asio/ssl/context.hpp    |   787 +
 .../include/asio/ssl/context_base.hpp           |   167 +
 .../include/asio/ssl/context_service.hpp        |    40 +
 .../asio/ssl/detail/buffered_handshake_op.hpp   |   110 +
 .../include/asio/ssl/detail/engine.hpp          |   164 +
 .../include/asio/ssl/detail/handshake_op.hpp    |    68 +
 .../include/asio/ssl/detail/impl/engine.ipp     |   326 +
 .../asio/ssl/detail/impl/openssl_init.ipp       |   145 +
 .../asio-1.10.2/include/asio/ssl/detail/io.hpp  |   347 +
 .../include/asio/ssl/detail/openssl_init.hpp    |   101 +
 .../include/asio/ssl/detail/openssl_types.hpp   |    28 +
 .../asio/ssl/detail/password_callback.hpp       |    72 +
 .../include/asio/ssl/detail/read_op.hpp         |    73 +
 .../include/asio/ssl/detail/shutdown_op.hpp     |    60 +
 .../include/asio/ssl/detail/stream_core.hpp     |   126 +
 .../include/asio/ssl/detail/verify_callback.hpp |    68 +
 .../include/asio/ssl/detail/write_op.hpp        |    73 +
 .../asio-1.10.2/include/asio/ssl/error.hpp      |    68 +
 .../include/asio/ssl/impl/context.hpp           |    71 +
 .../include/asio/ssl/impl/context.ipp           |   950 +
 .../asio-1.10.2/include/asio/ssl/impl/error.ipp |    57 +
 .../asio/ssl/impl/rfc2818_verification.ipp      |   166 +
 .../asio-1.10.2/include/asio/ssl/impl/src.hpp   |    28 +
 .../include/asio/ssl/old/basic_context.hpp      |   434 +
 .../include/asio/ssl/old/context_service.hpp    |   174 +
 .../ssl/old/detail/openssl_context_service.hpp  |   386 +
 .../asio/ssl/old/detail/openssl_operation.hpp   |   524 +
 .../ssl/old/detail/openssl_stream_service.hpp   |   571 +
 .../asio-1.10.2/include/asio/ssl/old/stream.hpp |   501 +
 .../include/asio/ssl/old/stream_service.hpp     |   184 +
 .../include/asio/ssl/rfc2818_verification.hpp   |   100 +
 .../asio-1.10.2/include/asio/ssl/stream.hpp     |   756 +
 .../include/asio/ssl/stream_base.hpp            |    52 +
 .../include/asio/ssl/stream_service.hpp         |    40 +
 .../include/asio/ssl/verify_context.hpp         |    73 +
 .../include/asio/ssl/verify_mode.hpp            |    63 +
 .../asio-1.10.2/include/asio/steady_timer.hpp   |    61 +
 .../asio-1.10.2/include/asio/strand.hpp         |   251 +
 .../include/asio/stream_socket_service.hpp      |   376 +
 .../asio-1.10.2/include/asio/streambuf.hpp      |    33 +
 .../asio-1.10.2/include/asio/system_error.hpp   |   131 +
 .../asio-1.10.2/include/asio/system_timer.hpp   |    57 +
 .../asio-1.10.2/include/asio/thread.hpp         |    92 +
 .../asio-1.10.2/include/asio/time_traits.hpp    |    88 +
 .../asio-1.10.2/include/asio/unyield.hpp        |    21 +
 .../asio-1.10.2/include/asio/use_future.hpp     |    92 +
 .../asio-1.10.2/include/asio/version.hpp        |    23 +
 .../asio-1.10.2/include/asio/wait_traits.hpp    |    41 +
 .../include/asio/waitable_timer_service.hpp     |   168 +
 .../include/asio/windows/basic_handle.hpp       |   281 +
 .../asio/windows/basic_object_handle.hpp        |   178 +
 .../asio/windows/basic_random_access_handle.hpp |   376 +
 .../asio/windows/basic_stream_handle.hpp        |   359 +
 .../include/asio/windows/object_handle.hpp      |    38 +
 .../asio/windows/object_handle_service.hpp      |   177 +
 .../include/asio/windows/overlapped_ptr.hpp     |   116 +
 .../asio/windows/random_access_handle.hpp       |    37 +
 .../windows/random_access_handle_service.hpp    |   220 +
 .../include/asio/windows/stream_handle.hpp      |    37 +
 .../asio/windows/stream_handle_service.hpp      |   218 +
 .../asio-1.10.2/include/asio/write.hpp          |   618 +
 .../asio-1.10.2/include/asio/write_at.hpp       |   670 +
 .../asio-1.10.2/include/asio/yield.hpp          |    23 +
 .../third_party/asio-1.10.2/src/asio.cpp        |    11 +
 .../third_party/asio-1.10.2/src/asio_ssl.cpp    |    11 +
 .../third_party/gmock-1.7.0/CMakeLists.txt      |     2 +
 .../libhdfspp/third_party/gmock-1.7.0/LICENSE   |    28 +
 .../third_party/gmock-1.7.0/gmock-gtest-all.cc  | 11443 ++++++++++
 .../third_party/gmock-1.7.0/gmock/gmock.h       | 14198 ++++++++++++
 .../third_party/gmock-1.7.0/gmock_main.cc       |    54 +
 .../third_party/gmock-1.7.0/gtest/gtest.h       | 20061 +++++++++++++++++
 417 files changed, 132853 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/CMakeLists.txt
index 86f8abc..ef14183 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/CMakeLists.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/CMakeLists.txt
@@ -17,3 +17,5 @@
 #
 
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+
+add_subdirectory(libhdfspp)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
new file mode 100644
index 0000000..96bbaed
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
@@ -0,0 +1,35 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+project (libhdfspp)
+
+add_definitions(-DASIO_STANDALONE)
+
+if(UNIX)
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11 -g -fPIC -fno-strict-aliasing")
+endif()
+
+# Mac OS 10.7 and later deprecates most of the methods in OpenSSL.
+# Add -Wno-deprecated-declarations to avoid the warnings.
+if(APPLE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-deprecated-declarations")
+endif()
+
+include_directories(third_party/gmock-1.7.0)
+
+add_subdirectory(third_party/gmock-1.7.0)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/COPYING
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/COPYING b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/COPYING
new file mode 100644
index 0000000..e86a381
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/COPYING
@@ -0,0 +1,4 @@
+Copyright (c) 2003-2014 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)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio.hpp b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio.hpp
new file mode 100644
index 0000000..1f47840
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio.hpp
@@ -0,0 +1,122 @@
+//
+// asio.hpp
+// ~~~~~~~~
+//
+// Copyright (c) 2003-2014 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_HPP
+#define ASIO_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/async_result.hpp"
+#include "asio/basic_datagram_socket.hpp"
+#include "asio/basic_deadline_timer.hpp"
+#include "asio/basic_io_object.hpp"
+#include "asio/basic_raw_socket.hpp"
+#include "asio/basic_seq_packet_socket.hpp"
+#include "asio/basic_serial_port.hpp"
+#include "asio/basic_signal_set.hpp"
+#include "asio/basic_socket_acceptor.hpp"
+#include "asio/basic_socket_iostream.hpp"
+#include "asio/basic_socket_streambuf.hpp"
+#include "asio/basic_stream_socket.hpp"
+#include "asio/basic_streambuf.hpp"
+#include "asio/basic_waitable_timer.hpp"
+#include "asio/buffer.hpp"
+#include "asio/buffered_read_stream_fwd.hpp"
+#include "asio/buffered_read_stream.hpp"
+#include "asio/buffered_stream_fwd.hpp"
+#include "asio/buffered_stream.hpp"
+#include "asio/buffered_write_stream_fwd.hpp"
+#include "asio/buffered_write_stream.hpp"
+#include "asio/buffers_iterator.hpp"
+#include "asio/completion_condition.hpp"
+#include "asio/connect.hpp"
+#include "asio/coroutine.hpp"
+#include "asio/datagram_socket_service.hpp"
+#include "asio/deadline_timer_service.hpp"
+#include "asio/deadline_timer.hpp"
+#include "asio/error.hpp"
+#include "asio/error_code.hpp"
+#include "asio/generic/basic_endpoint.hpp"
+#include "asio/generic/datagram_protocol.hpp"
+#include "asio/generic/raw_protocol.hpp"
+#include "asio/generic/seq_packet_protocol.hpp"
+#include "asio/generic/stream_protocol.hpp"
+#include "asio/handler_alloc_hook.hpp"
+#include "asio/handler_continuation_hook.hpp"
+#include "asio/handler_invoke_hook.hpp"
+#include "asio/handler_type.hpp"
+#include "asio/io_service.hpp"
+#include "asio/ip/address.hpp"
+#include "asio/ip/address_v4.hpp"
+#include "asio/ip/address_v6.hpp"
+#include "asio/ip/basic_endpoint.hpp"
+#include "asio/ip/basic_resolver.hpp"
+#include "asio/ip/basic_resolver_entry.hpp"
+#include "asio/ip/basic_resolver_iterator.hpp"
+#include "asio/ip/basic_resolver_query.hpp"
+#include "asio/ip/host_name.hpp"
+#include "asio/ip/icmp.hpp"
+#include "asio/ip/multicast.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_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/placeholders.hpp"
+#include "asio/posix/basic_descriptor.hpp"
+#include "asio/posix/basic_stream_descriptor.hpp"
+#include "asio/posix/descriptor_base.hpp"
+#include "asio/posix/stream_descriptor.hpp"
+#include "asio/posix/stream_descriptor_service.hpp"
+#include "asio/raw_socket_service.hpp"
+#include "asio/read.hpp"
+#include "asio/read_at.hpp"
+#include "asio/read_until.hpp"
+#include "asio/seq_packet_socket_service.hpp"
+#include "asio/serial_port.hpp"
+#include "asio/serial_port_base.hpp"
+#include "asio/serial_port_service.hpp"
+#include "asio/signal_set.hpp"
+#include "asio/signal_set_service.hpp"
+#include "asio/socket_acceptor_service.hpp"
+#include "asio/socket_base.hpp"
+#include "asio/strand.hpp"
+#include "asio/stream_socket_service.hpp"
+#include "asio/streambuf.hpp"
+#include "asio/system_error.hpp"
+#include "asio/thread.hpp"
+#include "asio/time_traits.hpp"
+#include "asio/version.hpp"
+#include "asio/wait_traits.hpp"
+#include "asio/waitable_timer_service.hpp"
+#include "asio/windows/basic_handle.hpp"
+#include "asio/windows/basic_object_handle.hpp"
+#include "asio/windows/basic_random_access_handle.hpp"
+#include "asio/windows/basic_stream_handle.hpp"
+#include "asio/windows/object_handle.hpp"
+#include "asio/windows/object_handle_service.hpp"
+#include "asio/windows/overlapped_ptr.hpp"
+#include "asio/windows/random_access_handle.hpp"
+#include "asio/windows/random_access_handle_service.hpp"
+#include "asio/windows/stream_handle.hpp"
+#include "asio/windows/stream_handle_service.hpp"
+#include "asio/write.hpp"
+#include "asio/write_at.hpp"
+
+#endif // ASIO_HPP

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/async_result.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/async_result.hpp b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/async_result.hpp
new file mode 100644
index 0000000..b98d770
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/async_result.hpp
@@ -0,0 +1,94 @@
+//
+// async_result.hpp
+// ~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2014 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_ASYNC_RESULT_HPP
+#define ASIO_ASYNC_RESULT_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include "asio/handler_type.hpp"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// An interface for customising the behaviour of an initiating function.
+/**
+ * This template may be specialised for user-defined handler types.
+ */
+template <typename Handler>
+class async_result
+{
+public:
+  /// The return type of the initiating function.
+  typedef void type;
+
+  /// 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 handler, which is then
+   * returned from the initiating function.
+   */
+  explicit async_result(Handler&)
+  {
+  }
+
+  /// Obtain the value to be returned from the initiating function.
+  type get()
+  {
+  }
+};
+
+namespace detail {
+
+// 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 <typename Handler, typename Signature>
+struct async_result_init
+{
+  explicit async_result_init(ASIO_MOVE_ARG(Handler) orig_handler)
+    : handler(ASIO_MOVE_CAST(Handler)(orig_handler)),
+      result(handler)
+  {
+  }
+
+  typename handler_type<Handler, Signature>::type handler;
+  async_result<typename handler_type<Handler, Signature>::type> result;
+};
+
+template <typename Handler, typename Signature>
+struct async_result_type_helper
+{
+  typedef typename async_result<
+      typename handler_type<Handler, Signature>::type
+    >::type type;
+};
+
+} // namespace detail
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#if defined(GENERATING_DOCUMENTATION)
+# define ASIO_INITFN_RESULT_TYPE(h, 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<h, sig>::type
+#else
+# define ASIO_INITFN_RESULT_TYPE(h, sig) \
+  typename ::asio::async_result< \
+    typename ::asio::handler_type<h, sig>::type>::type
+#endif
+
+#endif // ASIO_ASYNC_RESULT_HPP

http://git-wip-us.apache.org/repos/asf/hadoop/blob/6f03d4a5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_datagram_socket.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_datagram_socket.hpp b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_datagram_socket.hpp
new file mode 100644
index 0000000..a1356b9
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_datagram_socket.hpp
@@ -0,0 +1,949 @@
+//
+// basic_datagram_socket.hpp
+// ~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+// Copyright (c) 2003-2014 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_BASIC_DATAGRAM_SOCKET_HPP
+#define ASIO_BASIC_DATAGRAM_SOCKET_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+
+#include "asio/detail/config.hpp"
+#include <cstddef>
+#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"
+
+#include "asio/detail/push_options.hpp"
+
+namespace asio {
+
+/// Provides datagram-oriented socket functionality.
+/**
+ * The basic_datagram_socket class template provides asynchronous and blocking
+ * datagram-oriented socket functionality.
+ *
+ * @par Thread Safety
+ * @e Distinct @e objects: Safe.@n
+ * @e Shared @e objects: Unsafe.
+ */
+template <typename Protocol,
+    typename DatagramSocketService = datagram_socket_service<Protocol> >
+class basic_datagram_socket
+  : public basic_socket<Protocol, DatagramSocketService>
+{
+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;
+
+  /// The protocol type.
+  typedef Protocol protocol_type;
+
+  /// The endpoint type.
+  typedef typename Protocol::endpoint endpoint_type;
+
+  /// Construct a basic_datagram_socket without opening it.
+  /**
+   * 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
+   * to dispatch handlers for any asynchronous operations performed on the
+   * socket.
+   */
+  explicit basic_datagram_socket(asio::io_service& io_service)
+    : basic_socket<Protocol, DatagramSocketService>(io_service)
+  {
+  }
+
+  /// Construct and open a basic_datagram_socket.
+  /**
+   * This constructor creates and opens a datagram socket.
+   *
+   * @param io_service The io_service object that the datagram socket will use
+   * to dispatch handlers for any asynchronous operations performed on the
+   * socket.
+   *
+   * @param protocol An object specifying protocol parameters to be used.
+   *
+   * @throws asio::system_error Thrown on failure.
+   */
+  basic_datagram_socket(asio::io_service& io_service,
+      const protocol_type& protocol)
+    : basic_socket<Protocol, DatagramSocketService>(io_service, protocol)
+  {
+  }
+
+  /// Construct a basic_datagram_socket, opening it and binding it to the given
+  /// local endpoint.
+  /**
+   * This constructor creates a datagram 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.
+   *
+   * @param io_service The io_service object that the datagram socket will use
+   * to dispatch handlers for any asynchronous operations performed on the
+   * socket.
+   *
+   * @param endpoint An endpoint on the local machine to which the datagram
+   * socket will be bound.
+   *
+   * @throws asio::system_error Thrown on failure.
+   */
+  basic_datagram_socket(asio::io_service& io_service,
+      const endpoint_type& endpoint)
+    : basic_socket<Protocol, DatagramSocketService>(io_service, endpoint)
+  {
+  }
+
+  /// Construct a basic_datagram_socket on an existing native 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
+   * to dispatch handlers for any asynchronous operations performed on the
+   * socket.
+   *
+   * @param protocol An object specifying protocol parameters to be used.
+   *
+   * @param native_socket The new underlying socket implementation.
+   *
+   * @throws asio::system_error Thrown on failure.
+   */
+  basic_datagram_socket(asio::io_service& io_service,
+      const protocol_type& protocol, const native_handle_type& native_socket)
+    : basic_socket<Protocol, DatagramSocketService>(
+        io_service, protocol, native_socket)
+  {
+  }
+
+#if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+  /// Move-construct a basic_datagram_socket from another.
+  /**
+   * This constructor moves a datagram socket from one object to another.
+   *
+   * @param other The other basic_datagram_socket object from which the move
+   * 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.
+   */
+  basic_datagram_socket(basic_datagram_socket&& other)
+    : basic_socket<Protocol, DatagramSocketService>(
+        ASIO_MOVE_CAST(basic_datagram_socket)(other))
+  {
+  }
+
+  /// Move-assign a basic_datagram_socket from another.
+  /**
+   * This assignment operator moves a datagram socket from one object to
+   * another.
+   *
+   * @param other The other basic_datagram_socket object from which the move
+   * 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.
+   */
+  basic_datagram_socket& operator=(basic_datagram_socket&& other)
+  {
+    basic_socket<Protocol, DatagramSocketService>::operator=(
+        ASIO_MOVE_CAST(basic_datagram_socket)(other));
+    return *this;
+  }
+
+  /// Move-construct a basic_datagram_socket from a socket of another protocol
+  /// type.
+  /**
+   * This constructor moves a datagram socket from one object to another.
+   *
+   * @param other The other basic_datagram_socket object from which the move
+   * 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.
+   */
+  template <typename Protocol1, typename DatagramSocketService1>
+  basic_datagram_socket(
+      basic_datagram_socket<Protocol1, DatagramSocketService1>&& other,
+      typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
+    : basic_socket<Protocol, DatagramSocketService>(
+        ASIO_MOVE_CAST2(basic_datagram_socket<
+          Protocol1, DatagramSocketService1>)(other))
+  {
+  }
+
+  /// Move-assign a basic_datagram_socket from a socket of another protocol
+  /// type.
+  /**
+   * This assignment operator moves a datagram socket from one object to
+   * another.
+   *
+   * @param other The other basic_datagram_socket object from which the move
+   * 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.
+   */
+  template <typename Protocol1, typename DatagramSocketService1>
+  typename enable_if<is_convertible<Protocol1, Protocol>::value,
+      basic_datagram_socket>::type& operator=(
+        basic_datagram_socket<Protocol1, DatagramSocketService1>&& other)
+  {
+    basic_socket<Protocol, DatagramSocketService>::operator=(
+        ASIO_MOVE_CAST2(basic_datagram_socket<
+          Protocol1, DatagramSocketService1>)(other));
+    return *this;
+  }
+#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
+
+  /// Send some data on a connected socket.
+  /**
+   * This function is used to send data on the datagram socket. The function
+   * call will block until the data has been sent successfully or an error
+   * occurs.
+   *
+   * @param buffers One ore more data buffers to be sent on the socket.
+   *
+   * @returns The number of bytes sent.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @note The send operation can only be used with a connected socket. Use
+   * the send_to function to send data on an unconnected datagram socket.
+   *
+   * @par Example
+   * To send a single data buffer use the @ref buffer function as follows:
+   * @code socket.send(asio::buffer(data, size)); @endcode
+   * See the @ref buffer documentation for information on sending multiple
+   * buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send(const ConstBufferSequence& buffers)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().send(
+        this->get_implementation(), buffers, 0, ec);
+    asio::detail::throw_error(ec, "send");
+    return s;
+  }
+
+  /// Send some data on a connected socket.
+  /**
+   * This function is used to send data on the datagram socket. The function
+   * call will block until the data has been sent successfully or an error
+   * occurs.
+   *
+   * @param buffers One ore more data buffers to be sent on the socket.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @returns The number of bytes sent.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @note The send operation can only be used with a connected socket. Use
+   * the send_to function to send data on an unconnected datagram socket.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send(const ConstBufferSequence& buffers,
+      socket_base::message_flags flags)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().send(
+        this->get_implementation(), buffers, flags, ec);
+    asio::detail::throw_error(ec, "send");
+    return s;
+  }
+
+  /// Send some data on a connected socket.
+  /**
+   * This function is used to send data on the datagram socket. The function
+   * call will block until the data has been sent successfully or an error
+   * occurs.
+   *
+   * @param buffers One or more data buffers to be sent on the socket.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @param ec Set to indicate what error occurred, if any.
+   *
+   * @returns The number of bytes sent.
+   *
+   * @note The send operation can only be used with a connected socket. Use
+   * the send_to function to send data on an unconnected datagram socket.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send(const ConstBufferSequence& buffers,
+      socket_base::message_flags flags, asio::error_code& ec)
+  {
+    return this->get_service().send(
+        this->get_implementation(), buffers, flags, ec);
+  }
+
+  /// Start an asynchronous send on a connected socket.
+  /**
+   * This function is used to asynchronously send data on the datagram socket.
+   * The function call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes sent.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::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
+   * socket.
+   *
+   * @par Example
+   * To send a single data buffer use the @ref buffer function as follows:
+   * @code
+   * socket.async_send(asio::buffer(data, size), handler);
+   * @endcode
+   * See the @ref buffer documentation for information on sending multiple
+   * buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename ConstBufferSequence, typename WriteHandler>
+  ASIO_INITFN_RESULT_TYPE(WriteHandler,
+      void (asio::error_code, std::size_t))
+  async_send(const ConstBufferSequence& buffers,
+      ASIO_MOVE_ARG(WriteHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a WriteHandler.
+    ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+    return this->get_service().async_send(this->get_implementation(),
+        buffers, 0, ASIO_MOVE_CAST(WriteHandler)(handler));
+  }
+
+  /// Start an asynchronous send on a connected socket.
+  /**
+   * This function is used to asynchronously send data on the datagram socket.
+   * The function call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes sent.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::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
+   * socket.
+   */
+  template <typename ConstBufferSequence, typename WriteHandler>
+  ASIO_INITFN_RESULT_TYPE(WriteHandler,
+      void (asio::error_code, std::size_t))
+  async_send(const ConstBufferSequence& buffers,
+      socket_base::message_flags flags,
+      ASIO_MOVE_ARG(WriteHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a WriteHandler.
+    ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+    return this->get_service().async_send(this->get_implementation(),
+        buffers, flags, ASIO_MOVE_CAST(WriteHandler)(handler));
+  }
+
+  /// Send a datagram to the specified endpoint.
+  /**
+   * This function is used to send a datagram to the specified remote endpoint.
+   * The function call will block until the data has been sent successfully or
+   * an error occurs.
+   *
+   * @param buffers One or more data buffers to be sent to the remote endpoint.
+   *
+   * @param destination The remote endpoint to which the data will be sent.
+   *
+   * @returns The number of bytes sent.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @par Example
+   * To send a single data buffer use the @ref buffer function as follows:
+   * @code
+   * asio::ip::udp::endpoint destination(
+   *     asio::ip::address::from_string("1.2.3.4"), 12345);
+   * socket.send_to(asio::buffer(data, size), destination);
+   * @endcode
+   * See the @ref buffer documentation for information on sending multiple
+   * buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send_to(const ConstBufferSequence& buffers,
+      const endpoint_type& destination)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().send_to(
+        this->get_implementation(), buffers, destination, 0, ec);
+    asio::detail::throw_error(ec, "send_to");
+    return s;
+  }
+
+  /// Send a datagram to the specified endpoint.
+  /**
+   * This function is used to send a datagram to the specified remote endpoint.
+   * The function call will block until the data has been sent successfully or
+   * an error occurs.
+   *
+   * @param buffers One or more data buffers to be sent to the remote endpoint.
+   *
+   * @param destination The remote endpoint to which the data will be sent.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @returns The number of bytes sent.
+   *
+   * @throws asio::system_error Thrown on failure.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send_to(const ConstBufferSequence& buffers,
+      const endpoint_type& destination, socket_base::message_flags flags)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().send_to(
+        this->get_implementation(), buffers, destination, flags, ec);
+    asio::detail::throw_error(ec, "send_to");
+    return s;
+  }
+
+  /// Send a datagram to the specified endpoint.
+  /**
+   * This function is used to send a datagram to the specified remote endpoint.
+   * The function call will block until the data has been sent successfully or
+   * an error occurs.
+   *
+   * @param buffers One or more data buffers to be sent to the remote endpoint.
+   *
+   * @param destination The remote endpoint to which the data will be sent.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @param ec Set to indicate what error occurred, if any.
+   *
+   * @returns The number of bytes sent.
+   */
+  template <typename ConstBufferSequence>
+  std::size_t send_to(const ConstBufferSequence& buffers,
+      const endpoint_type& destination, socket_base::message_flags flags,
+      asio::error_code& ec)
+  {
+    return this->get_service().send_to(this->get_implementation(),
+        buffers, destination, flags, ec);
+  }
+
+  /// Start an asynchronous send.
+  /**
+   * This function is used to asynchronously send a datagram to the specified
+   * remote endpoint. The function call always returns immediately.
+   *
+   * @param buffers One or more data buffers to be sent to the remote endpoint.
+   * Although the buffers object may be copied as necessary, ownership of the
+   * underlying memory blocks is retained by the caller, which must guarantee
+   * that they remain valid until the handler is called.
+   *
+   * @param destination The remote endpoint to which the data will be sent.
+   * Copies will be made of the endpoint as required.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes sent.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::post().
+   *
+   * @par Example
+   * To send a single data buffer use the @ref buffer function as follows:
+   * @code
+   * asio::ip::udp::endpoint destination(
+   *     asio::ip::address::from_string("1.2.3.4"), 12345);
+   * socket.async_send_to(
+   *     asio::buffer(data, size), destination, handler);
+   * @endcode
+   * See the @ref buffer documentation for information on sending multiple
+   * buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename ConstBufferSequence, typename WriteHandler>
+  ASIO_INITFN_RESULT_TYPE(WriteHandler,
+      void (asio::error_code, std::size_t))
+  async_send_to(const ConstBufferSequence& buffers,
+      const endpoint_type& destination,
+      ASIO_MOVE_ARG(WriteHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a WriteHandler.
+    ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+    return this->get_service().async_send_to(
+        this->get_implementation(), buffers, destination, 0,
+        ASIO_MOVE_CAST(WriteHandler)(handler));
+  }
+
+  /// Start an asynchronous send.
+  /**
+   * This function is used to asynchronously send a datagram to the specified
+   * remote endpoint. The function call always returns immediately.
+   *
+   * @param buffers One or more data buffers to be sent to the remote endpoint.
+   * Although the buffers object may be copied as necessary, ownership of the
+   * underlying memory blocks is retained by the caller, which must guarantee
+   * that they remain valid until the handler is called.
+   *
+   * @param flags Flags specifying how the send call is to be made.
+   *
+   * @param destination The remote endpoint to which the data will be sent.
+   * Copies will be made of the endpoint as required.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes sent.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::post().
+   */
+  template <typename ConstBufferSequence, typename WriteHandler>
+  ASIO_INITFN_RESULT_TYPE(WriteHandler,
+      void (asio::error_code, std::size_t))
+  async_send_to(const ConstBufferSequence& buffers,
+      const endpoint_type& destination, socket_base::message_flags flags,
+      ASIO_MOVE_ARG(WriteHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a WriteHandler.
+    ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+    return this->get_service().async_send_to(
+        this->get_implementation(), buffers, destination, flags,
+        ASIO_MOVE_CAST(WriteHandler)(handler));
+  }
+
+  /// Receive some data on a connected socket.
+  /**
+   * This function is used to receive data on the datagram socket. The function
+   * call will block until data has been received successfully or an error
+   * occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @returns The number of bytes received.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @note The receive operation can only be used with a connected socket. Use
+   * the receive_from function to receive data on an unconnected datagram
+   * socket.
+   *
+   * @par Example
+   * To receive into a single data buffer use the @ref buffer function as
+   * follows:
+   * @code socket.receive(asio::buffer(data, size)); @endcode
+   * See the @ref buffer documentation for information on receiving into
+   * multiple buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive(const MutableBufferSequence& buffers)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().receive(
+        this->get_implementation(), buffers, 0, ec);
+    asio::detail::throw_error(ec, "receive");
+    return s;
+  }
+
+  /// Receive some data on a connected socket.
+  /**
+   * This function is used to receive data on the datagram socket. The function
+   * call will block until data has been received successfully or an error
+   * occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @returns The number of bytes received.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @note The receive operation can only be used with a connected socket. Use
+   * the receive_from function to receive data on an unconnected datagram
+   * socket.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive(const MutableBufferSequence& buffers,
+      socket_base::message_flags flags)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().receive(
+        this->get_implementation(), buffers, flags, ec);
+    asio::detail::throw_error(ec, "receive");
+    return s;
+  }
+
+  /// Receive some data on a connected socket.
+  /**
+   * This function is used to receive data on the datagram socket. The function
+   * call will block until data has been received successfully or an error
+   * occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @param ec Set to indicate what error occurred, if any.
+   *
+   * @returns The number of bytes received.
+   *
+   * @note The receive operation can only be used with a connected socket. Use
+   * the receive_from function to receive data on an unconnected datagram
+   * socket.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive(const MutableBufferSequence& buffers,
+      socket_base::message_flags flags, asio::error_code& ec)
+  {
+    return this->get_service().receive(
+        this->get_implementation(), buffers, flags, ec);
+  }
+
+  /// Start an asynchronous receive on a connected socket.
+  /**
+   * This function is used to asynchronously receive data from the datagram
+   * socket. The function call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes received.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::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
+   * datagram socket.
+   *
+   * @par Example
+   * To receive into a single data buffer use the @ref buffer function as
+   * follows:
+   * @code
+   * socket.async_receive(asio::buffer(data, size), handler);
+   * @endcode
+   * See the @ref buffer documentation for information on receiving into
+   * multiple buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename MutableBufferSequence, typename ReadHandler>
+  ASIO_INITFN_RESULT_TYPE(ReadHandler,
+      void (asio::error_code, std::size_t))
+  async_receive(const MutableBufferSequence& buffers,
+      ASIO_MOVE_ARG(ReadHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a ReadHandler.
+    ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+    return this->get_service().async_receive(this->get_implementation(),
+        buffers, 0, ASIO_MOVE_CAST(ReadHandler)(handler));
+  }
+
+  /// Start an asynchronous receive on a connected socket.
+  /**
+   * This function is used to asynchronously receive data from the datagram
+   * socket. The function call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes received.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::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
+   * datagram socket.
+   */
+  template <typename MutableBufferSequence, typename ReadHandler>
+  ASIO_INITFN_RESULT_TYPE(ReadHandler,
+      void (asio::error_code, std::size_t))
+  async_receive(const MutableBufferSequence& buffers,
+      socket_base::message_flags flags,
+      ASIO_MOVE_ARG(ReadHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a ReadHandler.
+    ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+    return this->get_service().async_receive(this->get_implementation(),
+        buffers, flags, ASIO_MOVE_CAST(ReadHandler)(handler));
+  }
+
+  /// Receive a datagram with the endpoint of the sender.
+  /**
+   * This function is used to receive a datagram. The function call will block
+   * until data has been received successfully or an error occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @param sender_endpoint An endpoint object that receives the endpoint of
+   * the remote sender of the datagram.
+   *
+   * @returns The number of bytes received.
+   *
+   * @throws asio::system_error Thrown on failure.
+   *
+   * @par Example
+   * To receive into a single data buffer use the @ref buffer function as
+   * follows:
+   * @code
+   * asio::ip::udp::endpoint sender_endpoint;
+   * socket.receive_from(
+   *     asio::buffer(data, size), sender_endpoint);
+   * @endcode
+   * See the @ref buffer documentation for information on receiving into
+   * multiple buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive_from(const MutableBufferSequence& buffers,
+      endpoint_type& sender_endpoint)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().receive_from(
+        this->get_implementation(), buffers, sender_endpoint, 0, ec);
+    asio::detail::throw_error(ec, "receive_from");
+    return s;
+  }
+  
+  /// Receive a datagram with the endpoint of the sender.
+  /**
+   * This function is used to receive a datagram. The function call will block
+   * until data has been received successfully or an error occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @param sender_endpoint An endpoint object that receives the endpoint of
+   * the remote sender of the datagram.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @returns The number of bytes received.
+   *
+   * @throws asio::system_error Thrown on failure.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive_from(const MutableBufferSequence& buffers,
+      endpoint_type& sender_endpoint, socket_base::message_flags flags)
+  {
+    asio::error_code ec;
+    std::size_t s = this->get_service().receive_from(
+        this->get_implementation(), buffers, sender_endpoint, flags, ec);
+    asio::detail::throw_error(ec, "receive_from");
+    return s;
+  }
+  
+  /// Receive a datagram with the endpoint of the sender.
+  /**
+   * This function is used to receive a datagram. The function call will block
+   * until data has been received successfully or an error occurs.
+   *
+   * @param buffers One or more buffers into which the data will be received.
+   *
+   * @param sender_endpoint An endpoint object that receives the endpoint of
+   * the remote sender of the datagram.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @param ec Set to indicate what error occurred, if any.
+   *
+   * @returns The number of bytes received.
+   */
+  template <typename MutableBufferSequence>
+  std::size_t receive_from(const MutableBufferSequence& buffers,
+      endpoint_type& sender_endpoint, socket_base::message_flags flags,
+      asio::error_code& ec)
+  {
+    return this->get_service().receive_from(this->get_implementation(),
+        buffers, sender_endpoint, flags, ec);
+  }
+
+  /// Start an asynchronous receive.
+  /**
+   * This function is used to asynchronously receive a datagram. The function
+   * call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param sender_endpoint An endpoint object that receives the endpoint of
+   * the remote sender of the datagram. Ownership of the sender_endpoint object
+   * is retained by the caller, which must guarantee that it is valid until the
+   * handler is called.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes received.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::post().
+   *
+   * @par Example
+   * To receive into a single data buffer use the @ref buffer function as
+   * follows:
+   * @code socket.async_receive_from(
+   *     asio::buffer(data, size), sender_endpoint, handler); @endcode
+   * See the @ref buffer documentation for information on receiving into
+   * multiple buffers in one go, and how to use it with arrays, boost::array or
+   * std::vector.
+   */
+  template <typename MutableBufferSequence, typename ReadHandler>
+  ASIO_INITFN_RESULT_TYPE(ReadHandler,
+      void (asio::error_code, std::size_t))
+  async_receive_from(const MutableBufferSequence& buffers,
+      endpoint_type& sender_endpoint,
+      ASIO_MOVE_ARG(ReadHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a ReadHandler.
+    ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+    return this->get_service().async_receive_from(
+        this->get_implementation(), buffers, sender_endpoint, 0,
+        ASIO_MOVE_CAST(ReadHandler)(handler));
+  }
+
+  /// Start an asynchronous receive.
+  /**
+   * This function is used to asynchronously receive a datagram. The function
+   * call always returns immediately.
+   *
+   * @param 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.
+   *
+   * @param sender_endpoint An endpoint object that receives the endpoint of
+   * the remote sender of the datagram. Ownership of the sender_endpoint object
+   * is retained by the caller, which must guarantee that it is valid until the
+   * handler is called.
+   *
+   * @param flags Flags specifying how the receive call is to be made.
+   *
+   * @param 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:
+   * @code void handler(
+   *   const asio::error_code& error, // Result of operation.
+   *   std::size_t bytes_transferred           // Number of bytes received.
+   * ); @endcode
+   * Regardless of whether the asynchronous operation completes immediately or
+   * not, the handler will not be invoked from within this function. Invocation
+   * of the handler will be performed in a manner equivalent to using
+   * asio::io_service::post().
+   */
+  template <typename MutableBufferSequence, typename ReadHandler>
+  ASIO_INITFN_RESULT_TYPE(ReadHandler,
+      void (asio::error_code, std::size_t))
+  async_receive_from(const MutableBufferSequence& buffers,
+      endpoint_type& sender_endpoint, socket_base::message_flags flags,
+      ASIO_MOVE_ARG(ReadHandler) handler)
+  {
+    // If you get an error on the following line it means that your handler does
+    // not meet the documented type requirements for a ReadHandler.
+    ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+    return this->get_service().async_receive_from(
+        this->get_implementation(), buffers, sender_endpoint, flags,
+        ASIO_MOVE_CAST(ReadHandler)(handler));
+  }
+};
+
+} // namespace asio
+
+#include "asio/detail/pop_options.hpp"
+
+#endif // ASIO_BASIC_DATAGRAM_SOCKET_HPP


Mime
View raw message