Commit b494fd35 authored by Francis Dupont's avatar Francis Dupont

[4009] Added boost to asio (tentative)

parent a07e3014
......@@ -1241,10 +1241,6 @@ AC_SUBST(GTEST_SOURCE)
#
# ASIO: we extensively use it as the C++ event management module.
#
# Use local ASIO headers from ext
#
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/asio"
#
# Use our 'coroutine' header from ext
CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
#
......@@ -1380,8 +1376,6 @@ AC_CONFIG_FILES([compatcheck/Makefile
doc/guide/Makefile
doc/Makefile
doc/version.ent
ext/asio/asio/Makefile
ext/asio/Makefile
ext/gtest/Makefile
ext/Makefile
m4macros/Makefile
......
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
SUBDIRS = . asio
if HAVE_GTEST_SOURCE
SUBDIRS += gtest
SUBDIRS = gtest
endif
# As we are copying ASIO headers to the installation directory, copy across
# the licence file as well.
asio_datadir = $(pkgincludedir)/asio
asio_data_DATA = LICENSE_1_0.txt
EXTRA_DIST = LICENSE_1_0.txt
SUBDIRS = . asio
# As we are copying across the ASIO files to the installation directory, copy
# across the README that tells us where we got them from.
asio_datadir = $(pkgincludedir)/asio
asio_data_DATA = README
ASIO library header files
Version 1.4.8 (2011-04-19)
Downloaded from http://sourceforge.net/projects/asio/files
Project page: http://think-async.com/Asio
Local modifications:
Imported a kqueue bug fix from Asio 1.5.1.
git commit e4b2c2633ebb3859286e9a4c19e97e17bcac41b3
See
http://sourceforge.net/p/asio/git/ci/a50b53864f77fe762f21e44a281235982dd7e733/
Added ASIO_DECL to a number of function definitions
git commit c32718be9f5409b6f72d98ddcd0b1ccd4c5c2293
See also the bug report at:
http://sourceforge.net/tracker/?func=detail&aid=3291113&group_id=122478&atid=694037
Imported a fix from Asio 1.5.2.
git commit cf00216570a36d2e3e688b197deea781bfbe7d8d
See
http://sourceforge.net/p/asio/git/ci/4820fd6f0d257a6bb554fcd1f97f170330be0448/log/?path=/asio/include/asio/detail/impl/socket_ops.ipp
//
// asio.hpp
// ~~~~~~~~
//
// Copyright (c) 2003-2011 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/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_serial_port.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/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/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/handler_alloc_hook.hpp"
#include "asio/handler_invoke_hook.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/serial_port.hpp"
#include "asio/serial_port_base.hpp"
#include "asio/serial_port_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/windows/basic_handle.hpp"
#include "asio/windows/basic_random_access_handle.hpp"
#include "asio/windows/basic_stream_handle.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
SUBDIRS = .
# Copy across the BIND 10 copy of ASIO to the installation directory, as some
# header files used by user-libraries may use parts of it.
asio_includedir = $(pkgincludedir)/asio
nobase_asio_include_HEADERS = \
basic_datagram_socket.hpp \
basic_deadline_timer.hpp \
basic_io_object.hpp \
basic_raw_socket.hpp \
basic_serial_port.hpp \
basic_socket.hpp \
basic_socket_acceptor.hpp \
basic_socket_iostream.hpp \
basic_socket_streambuf.hpp \
basic_stream_socket.hpp \
basic_streambuf.hpp \
basic_streambuf_fwd.hpp \
buffer.hpp \
buffered_read_stream.hpp \
buffered_read_stream_fwd.hpp \
buffered_stream.hpp \
buffered_stream_fwd.hpp \
buffered_write_stream.hpp \
buffered_write_stream_fwd.hpp \
buffers_iterator.hpp \
completion_condition.hpp \
datagram_socket_service.hpp \
deadline_timer.hpp \
deadline_timer_service.hpp \
detail/array_fwd.hpp \
detail/base_from_completion_cond.hpp \
detail/bind_handler.hpp \
detail/buffer_resize_guard.hpp \
detail/buffer_sequence_adapter.hpp \
detail/buffered_stream_storage.hpp \
detail/call_stack.hpp \
detail/completion_handler.hpp \
detail/config.hpp \
detail/consuming_buffers.hpp \
detail/deadline_timer_service.hpp \
detail/descriptor_ops.hpp \
detail/descriptor_read_op.hpp \
detail/descriptor_write_op.hpp \
detail/dev_poll_reactor.hpp \
detail/dev_poll_reactor_fwd.hpp \
detail/epoll_reactor.hpp \
detail/epoll_reactor_fwd.hpp \
detail/event.hpp \
detail/eventfd_select_interrupter.hpp \
detail/fd_set_adapter.hpp \
detail/fenced_block.hpp \
detail/gcc_arm_fenced_block.hpp \
detail/gcc_fenced_block.hpp \
detail/gcc_hppa_fenced_block.hpp \
detail/gcc_sync_fenced_block.hpp \
detail/gcc_x86_fenced_block.hpp \
detail/handler_alloc_helpers.hpp \
detail/handler_invoke_helpers.hpp \
detail/hash_map.hpp \
detail/impl/descriptor_ops.ipp \
detail/impl/dev_poll_reactor.hpp \
detail/impl/dev_poll_reactor.ipp \
detail/impl/epoll_reactor.hpp \
detail/impl/epoll_reactor.ipp \
detail/impl/eventfd_select_interrupter.ipp \
detail/impl/kqueue_reactor.hpp \
detail/impl/kqueue_reactor.ipp \
detail/impl/pipe_select_interrupter.ipp \
detail/impl/posix_event.ipp \
detail/impl/posix_mutex.ipp \
detail/impl/posix_thread.ipp \
detail/impl/posix_tss_ptr.ipp \
detail/impl/reactive_descriptor_service.ipp \
detail/impl/reactive_serial_port_service.ipp \
detail/impl/reactive_socket_service_base.ipp \
detail/impl/resolver_service_base.ipp \
detail/impl/select_reactor.hpp \
detail/impl/select_reactor.ipp \
detail/impl/service_registry.hpp \
detail/impl/service_registry.ipp \
detail/impl/socket_ops.ipp \
detail/impl/socket_select_interrupter.ipp \
detail/impl/strand_service.hpp \
detail/impl/strand_service.ipp \
detail/impl/task_io_service.hpp \
detail/impl/task_io_service.ipp \
detail/impl/throw_error.ipp \
detail/impl/timer_queue.ipp \
detail/impl/timer_queue_set.ipp \
detail/impl/win_event.ipp \
detail/impl/win_iocp_handle_service.ipp \
detail/impl/win_iocp_io_service.hpp \
detail/impl/win_iocp_io_service.ipp \
detail/impl/win_iocp_serial_port_service.ipp \
detail/impl/win_iocp_socket_service_base.ipp \
detail/impl/win_mutex.ipp \
detail/impl/win_thread.ipp \
detail/impl/win_tss_ptr.ipp \
detail/impl/winsock_init.ipp \
detail/io_control.hpp \
detail/kqueue_reactor.hpp \
detail/kqueue_reactor_fwd.hpp \
detail/local_free_on_block_exit.hpp \
detail/macos_fenced_block.hpp \
detail/mutex.hpp \
detail/noncopyable.hpp \
detail/null_buffers_op.hpp \
detail/null_event.hpp \
detail/null_fenced_block.hpp \
detail/null_mutex.hpp \
detail/null_signal_blocker.hpp \
detail/null_thread.hpp \
detail/null_tss_ptr.hpp \
detail/object_pool.hpp \
detail/old_win_sdk_compat.hpp \
detail/op_queue.hpp \
detail/operation.hpp \
detail/pipe_select_interrupter.hpp \
detail/pop_options.hpp \
detail/posix_event.hpp \
detail/posix_fd_set_adapter.hpp \
detail/posix_mutex.hpp \
detail/posix_signal_blocker.hpp \
detail/posix_thread.hpp \
detail/posix_tss_ptr.hpp \
detail/push_options.hpp \
detail/reactive_descriptor_service.hpp \
detail/reactive_null_buffers_op.hpp \
detail/reactive_serial_port_service.hpp \
detail/reactive_socket_accept_op.hpp \
detail/reactive_socket_connect_op.hpp \
detail/reactive_socket_recv_op.hpp \
detail/reactive_socket_recvfrom_op.hpp \
detail/reactive_socket_send_op.hpp \
detail/reactive_socket_sendto_op.hpp \
detail/reactive_socket_service.hpp \
detail/reactive_socket_service_base.hpp \
detail/reactor.hpp \
detail/reactor_fwd.hpp \
detail/reactor_op.hpp \
detail/reactor_op_queue.hpp \
detail/regex_fwd.hpp \
detail/resolve_endpoint_op.hpp \
detail/resolve_op.hpp \
detail/resolver_service.hpp \
detail/resolver_service_base.hpp \
detail/scoped_lock.hpp \
detail/select_interrupter.hpp \
detail/select_reactor.hpp \
detail/select_reactor_fwd.hpp \
detail/service_base.hpp \
detail/service_id.hpp \
detail/service_registry.hpp \
detail/service_registry_fwd.hpp \
detail/shared_ptr.hpp \
detail/signal_blocker.hpp \
detail/signal_init.hpp \
detail/socket_holder.hpp \
detail/socket_ops.hpp \
detail/socket_option.hpp \
detail/socket_select_interrupter.hpp \
detail/socket_types.hpp \
detail/solaris_fenced_block.hpp \
detail/strand_service.hpp \
detail/task_io_service.hpp \
detail/task_io_service_fwd.hpp \
detail/task_io_service_operation.hpp \
detail/thread.hpp \
detail/throw_error.hpp \
detail/timer_op.hpp \
detail/timer_queue.hpp \
detail/timer_queue_base.hpp \
detail/timer_queue_fwd.hpp \
detail/timer_queue_set.hpp \
detail/timer_scheduler.hpp \
detail/timer_scheduler_fwd.hpp \
detail/tss_ptr.hpp \
detail/wait_handler.hpp \
detail/weak_ptr.hpp \
detail/win_event.hpp \
detail/win_fd_set_adapter.hpp \
detail/win_fenced_block.hpp \
detail/win_iocp_handle_read_op.hpp \
detail/win_iocp_handle_service.hpp \
detail/win_iocp_handle_write_op.hpp \
detail/win_iocp_io_service.hpp \
detail/win_iocp_io_service_fwd.hpp \
detail/win_iocp_null_buffers_op.hpp \
detail/win_iocp_operation.hpp \
detail/win_iocp_overlapped_op.hpp \
detail/win_iocp_overlapped_ptr.hpp \
detail/win_iocp_serial_port_service.hpp \
detail/win_iocp_socket_accept_op.hpp \
detail/win_iocp_socket_recv_op.hpp \
detail/win_iocp_socket_recvfrom_op.hpp \
detail/win_iocp_socket_send_op.hpp \
detail/win_iocp_socket_service.hpp \
detail/win_iocp_socket_service_base.hpp \
detail/win_mutex.hpp \
detail/win_signal_blocker.hpp \
detail/win_thread.hpp \
detail/win_tss_ptr.hpp \
detail/wince_thread.hpp \
detail/winsock_init.hpp \
detail/wrapped_handler.hpp \
error.hpp \
error_code.hpp \
handler_alloc_hook.hpp \
handler_invoke_hook.hpp \
impl/error.ipp \
impl/error_code.ipp \
impl/io_service.hpp \
impl/io_service.ipp \
impl/read.hpp \
impl/read.ipp \
impl/read_at.hpp \
impl/read_at.ipp \
impl/read_until.hpp \
impl/read_until.ipp \
impl/serial_port_base.hpp \
impl/serial_port_base.ipp \
impl/src.cpp \
impl/src.hpp \
impl/write.hpp \
impl/write.ipp \
impl/write_at.hpp \
impl/write_at.ipp \
io_service.hpp \
ip/address.hpp \
ip/address_v4.hpp \
ip/address_v6.hpp \
ip/basic_endpoint.hpp \
ip/basic_resolver.hpp \
ip/basic_resolver_entry.hpp \
ip/basic_resolver_iterator.hpp \
ip/basic_resolver_query.hpp \
ip/detail/endpoint.hpp \
ip/detail/impl/endpoint.ipp \
ip/detail/socket_option.hpp \
ip/host_name.hpp \
ip/icmp.hpp \
ip/impl/address.hpp \
ip/impl/address.ipp \
ip/impl/address_v4.hpp \
ip/impl/address_v4.ipp \
ip/impl/address_v6.hpp \
ip/impl/address_v6.ipp \
ip/impl/basic_endpoint.hpp \
ip/impl/host_name.ipp \
ip/multicast.hpp \
ip/resolver_query_base.hpp \
ip/resolver_service.hpp \
ip/tcp.hpp \
ip/udp.hpp \
ip/unicast.hpp \
ip/v6_only.hpp \
is_read_buffered.hpp \
is_write_buffered.hpp \
local/basic_endpoint.hpp \
local/connect_pair.hpp \
local/datagram_protocol.hpp \
local/detail/endpoint.hpp \
local/detail/impl/endpoint.ipp \
local/stream_protocol.hpp \
placeholders.hpp \
posix/basic_descriptor.hpp \
posix/basic_stream_descriptor.hpp \
posix/descriptor_base.hpp \
posix/stream_descriptor.hpp \
posix/stream_descriptor_service.hpp \
raw_socket_service.hpp \
read.hpp \
read_at.hpp \
read_until.hpp \
serial_port.hpp \
serial_port_base.hpp \
serial_port_service.hpp \
socket_acceptor_service.hpp \
socket_base.hpp \
ssl.hpp \
ssl/basic_context.hpp \
ssl/context.hpp \
ssl/context_base.hpp \
ssl/context_service.hpp \
ssl/detail/openssl_context_service.hpp \
ssl/detail/openssl_init.hpp \
ssl/detail/openssl_operation.hpp \
ssl/detail/openssl_stream_service.hpp \
ssl/detail/openssl_types.hpp \
ssl/stream.hpp \
ssl/stream_base.hpp \
ssl/stream_service.hpp \
strand.hpp \
stream_socket_service.hpp \
streambuf.hpp \
system_error.hpp \
thread.hpp \
time_traits.hpp \
version.hpp \
windows/basic_handle.hpp \
windows/basic_random_access_handle.hpp \
windows/basic_stream_handle.hpp \
windows/overlapped_ptr.hpp \
windows/random_access_handle.hpp \
windows/random_access_handle_service.hpp \
windows/stream_handle.hpp \
windows/stream_handle_service.hpp \
write.hpp \
write_at.hpp
This diff is collapsed.
//
// basic_deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2011 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_DEADLINE_TIMER_HPP
#define ASIO_BASIC_DEADLINE_TIMER_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_io_object.hpp"
#include "asio/deadline_timer_service.hpp"
#include "asio/detail/throw_error.hpp"
#include "asio/error.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
/// Provides waitable timer functionality.
/**
* The basic_deadline_timer class template provides the ability to perform a
* blocking or asynchronous wait for a timer to expire.
*
* A deadline timer is always in one of two states: "expired" or "not expired".
* If the wait() or async_wait() function is called on an expired timer, the
* wait operation will complete immediately.
*
* Most applications will use the asio::deadline_timer typedef.
*
* @par Thread Safety
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
* @par Examples
* Performing a blocking wait:
* @code
* // Construct a timer without setting an expiry time.
* asio::deadline_timer timer(io_service);
*
* // Set an expiry time relative to now.
* timer.expires_from_now(boost::posix_time::seconds(5));
*
* // Wait for the timer to expire.
* timer.wait();
* @endcode