diff options
author | Diogo Pedrosa <diogo12pedrosa@gmail.com> | 2023-03-09 17:57:35 +0000 |
---|---|---|
committer | Diogo Pedrosa <diogo12pedrosa@gmail.com> | 2023-03-10 14:41:51 +0000 |
commit | 826ebb8d352245a36ecaec32b6af61e7abf4696e (patch) | |
tree | d4e984dd100f3257ce784c9e30aefb6e60a93ab5 /implementation/helper/1.76/boost/asio/detail | |
parent | fc73f40fa1501dc53210c63cb7c0d7623d106370 (diff) | |
download | vSomeIP-826ebb8d352245a36ecaec32b6af61e7abf4696e.tar.gz |
vsomeip 3.3.0
Diffstat (limited to 'implementation/helper/1.76/boost/asio/detail')
20 files changed, 0 insertions, 5541 deletions
diff --git a/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp b/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp deleted file mode 100644 index 67fe6bd..0000000 --- a/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext.hpp +++ /dev/null @@ -1,586 +0,0 @@ -// -// detail/handler_type_requirements_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_HPP -#define BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -// Older versions of gcc have difficulty compiling the sizeof expressions where -// we test the handler type requirements. We'll disable checking of handler type -// requirements for those compilers, but otherwise enable it by default. -#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) -# if !defined(__GNUC__) || (__GNUC__ >= 4) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1 -# endif // !defined(__GNUC__) || (__GNUC__ >= 4) -#endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -// With C++0x we can use a combination of enhanced SFINAE and static_assert to -// generate better template error messages. As this technique is not yet widely -// portable, we'll only enable it for tested compilers. -#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(BOOST_ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(BOOST_ASIO_MSVC) -# if defined(__clang__) -# if __has_feature(__cxx_static_assert__) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // __has_feature(cxx_static_assert) -# endif // defined(__clang__) -#endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) -# include <boost/asio/async_result.hpp> -#endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -namespace boost { -namespace asio { -namespace detail { - -#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -# if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template <typename Handler> -auto zero_arg_copyable_handler_test(Handler h, void*) - -> decltype( - sizeof(Handler(static_cast<const Handler&>(h))), - ((h)()), - char(0)); - -template <typename Handler> -char (&zero_arg_copyable_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1> -auto one_arg_handler_test(Handler h, Arg1* a1) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1)), - char(0)); - -template <typename Handler> -char (&one_arg_handler_test(Handler h, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2> -auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, *a2)), - char(0)); - -template <typename Handler> -char (&two_arg_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2> -auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))), - char(0)); - -template <typename Handler> -char (&two_arg_move_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2, typename Arg3> -auto three_arg_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, *a2, *a3)), - char(0)); - -template <typename Handler> -char (&three_arg_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2, typename Arg3> -auto three_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3 *a3) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3))), - char(0)); - -template <typename Handler> -char (&three_arg_move_handler_test(Handler, ...))[2]; - -# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \ - static_assert(expr, msg); - -# else // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) - -# endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template <typename T> T& lvref(); -template <typename T> T& lvref(T); -template <typename T> const T& clvref(); -template <typename T> const T& clvref(T); -#if defined(BOOST_ASIO_HAS_MOVE) -template <typename T> T rvref(); -template <typename T> T rvref(T); -#else // defined(BOOST_ASIO_HAS_MOVE) -template <typename T> const T& rvref(); -template <typename T> const T& rvref(T); -#endif // defined(BOOST_ASIO_HAS_MOVE) -template <typename T> char argbyv(T); - -#if 0 -template <int> -struct handler_type_requirements -{ -}; -#endif - -#define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void()) asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::zero_arg_copyable_handler_test( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>(), 0)) == 1, \ - "CompletionHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()(), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_READ_HANDLER_CHECK_EXT( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t, \ - boost::asio::ip::address)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::three_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0), \ - static_cast<const boost::asio::ip::address*>(0))) == 1, \ - "ReadHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>(), \ - boost::asio::detail::lvref<const boost::asio::ip::address>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0))) == 1, \ - "WriteHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#if 0 -#define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "AcceptHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, socket_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_move_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<socket_type*>(0))) == 1, \ - "MoveAcceptHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::rvref<socket_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF -#endif - -#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "ConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, endpoint_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, endpoint_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const endpoint_type*>(0))) == 1, \ - "RangeConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const endpoint_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, iter_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const iter_type*>(0))) == 1, \ - "IteratorConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const iter_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, range_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, range_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const range_type*>(0))) == 1, \ - "ResolveHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const range_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "WaitHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, int)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const int*>(0))) == 1, \ - "SignalHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const int>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "HandshakeHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0))) == 1, \ - "BufferedHandshakeHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "ShutdownHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -#define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_READ_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#endif // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -} // namespace detail -} // namespace asio -} // namespace boost - -#endif // BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp deleted file mode 100644 index 65640ad..0000000 --- a/implementation/helper/1.76/boost/asio/detail/handler_type_requirements_ext_local.hpp +++ /dev/null @@ -1,588 +0,0 @@ -// -// detail/handler_type_requirements_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -// Older versions of gcc have difficulty compiling the sizeof expressions where -// we test the handler type requirements. We'll disable checking of handler type -// requirements for those compilers, but otherwise enable it by default. -#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) -# if !defined(__GNUC__) || (__GNUC__ >= 4) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1 -# endif // !defined(__GNUC__) || (__GNUC__ >= 4) -#endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -// With C++0x we can use a combination of enhanced SFINAE and static_assert to -// generate better template error messages. As this technique is not yet widely -// portable, we'll only enable it for tested compilers. -#if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) -# if defined(__GNUC__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# if defined(__GXX_EXPERIMENTAL_CXX0X__) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) -# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4) -# endif // defined(__GNUC__) -# if defined(BOOST_ASIO_MSVC) -# if (_MSC_VER >= 1600) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // (_MSC_VER >= 1600) -# endif // defined(BOOST_ASIO_MSVC) -# if defined(__clang__) -# if __has_feature(__cxx_static_assert__) -# define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1 -# endif // __has_feature(cxx_static_assert) -# endif // defined(__clang__) -#endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS) - -#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) -# include <boost/asio/async_result.hpp> -#endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -namespace boost { -namespace asio { -namespace detail { - -#if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -# if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template <typename Handler> -auto zero_arg_copyable_handler_test(Handler h, void*) - -> decltype( - sizeof(Handler(static_cast<const Handler&>(h))), - ((h)()), - char(0)); - -template <typename Handler> -char (&zero_arg_copyable_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1> -auto one_arg_handler_test(Handler h, Arg1* a1) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1)), - char(0)); - -template <typename Handler> -char (&one_arg_handler_test(Handler h, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2> -auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, *a2)), - char(0)); - -template <typename Handler> -char (&two_arg_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2> -auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))), - char(0)); - -template <typename Handler> -char (&two_arg_move_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2, typename Arg3, typename Arg4> -auto four_arg_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3, Arg4* a4) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, *a2, *a3, *a4)), - char(0)); - -template <typename Handler> -char (&four_arg_handler_test(Handler, ...))[2]; - -template <typename Handler, typename Arg1, typename Arg2, typename Arg3, typename Arg4> -auto four_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2, Arg3* a3, Arg4* a4) - -> decltype( - sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))), - ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2), BOOST_ASIO_MOVE_CAST(Arg3)(*a3), BOOST_ASIO_MOVE_CAST(Arg4)(*a4))), - char(0)); - -template <typename Handler> -char (&four_arg_move_handler_test(Handler, ...))[2]; - -# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \ - static_assert(expr, msg); - -# else // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -# define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) - -# endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT) - -template <typename T> T& lvref(); -template <typename T> T& lvref(T); -template <typename T> const T& clvref(); -template <typename T> const T& clvref(T); -#if defined(BOOST_ASIO_HAS_MOVE) -template <typename T> T rvref(); -template <typename T> T rvref(T); -#else // defined(BOOST_ASIO_HAS_MOVE) -template <typename T> const T& rvref(); -template <typename T> const T& rvref(T); -#endif // defined(BOOST_ASIO_HAS_MOVE) -template <typename T> char argbyv(T); - -#if 0 -template <int> -struct handler_type_requirements -{ -}; -#endif - -#define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void()) asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::zero_arg_copyable_handler_test( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>(), 0)) == 1, \ - "CompletionHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()(), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_READ_HANDLER_CHECK_EXT_LOCAL( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t, \ - std::uint32_t, std::uint32_t)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::four_arg_handler_test( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0), \ - static_cast<const std::uint32_t*>(0), \ - static_cast<const std::uint32_t*>(0))) == 1, \ - "ReadHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::clvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>(), \ - boost::asio::detail::lvref<const std::uint32_t>(), \ - boost::asio::detail::lvref<const std::uint32_t>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0))) == 1, \ - "WriteHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#if 0 -#define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "AcceptHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, socket_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_move_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<socket_type*>(0))) == 1, \ - "MoveAcceptHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::rvref<socket_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF -#endif - -#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "ConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, endpoint_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, endpoint_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const endpoint_type*>(0))) == 1, \ - "RangeConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const endpoint_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, iter_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const iter_type*>(0))) == 1, \ - "IteratorConnectHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const iter_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, range_type) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, range_type)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const range_type*>(0))) == 1, \ - "ResolveHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const range_type>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "WaitHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, int)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const int*>(0))) == 1, \ - "SignalHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const int>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "HandshakeHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code, std::size_t)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::two_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0), \ - static_cast<const std::size_t*>(0))) == 1, \ - "BufferedHandshakeHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>(), \ - boost::asio::detail::lvref<const std::size_t>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - \ - typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \ - void(boost::system::error_code)) \ - asio_true_handler_type; \ - \ - BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \ - sizeof(boost::asio::detail::one_arg_handler_test( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>(), \ - static_cast<const boost::system::error_code*>(0))) == 1, \ - "ShutdownHandler type requirements not met") \ - \ - typedef boost::asio::detail::handler_type_requirements< \ - sizeof( \ - boost::asio::detail::argbyv( \ - boost::asio::detail::rvref< \ - asio_true_handler_type>())) + \ - sizeof( \ - boost::asio::detail::lvref< \ - asio_true_handler_type>()( \ - boost::asio::detail::lvref<const boost::system::error_code>()), \ - char(0))> BOOST_ASIO_UNUSED_TYPEDEF - -#else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -#define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_READ_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WRITE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \ - handler_type, handler, socket_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_CONNECT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \ - handler_type, handler, iter_type) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_WAIT_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \ - handler_type, handler) \ - typedef int BOOST_ASIO_UNUSED_TYPEDEF - -#endif // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS) - -} // namespace detail -} // namespace asio -} // namespace boost - -#endif // BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext.ipp b/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext.ipp deleted file mode 100644 index 04036ad..0000000 --- a/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext.ipp +++ /dev/null @@ -1,302 +0,0 @@ -// -// detail/reactive_socket_service_base_ext.ipp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_IPP -#define BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_IPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) \ - && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#include <boost/asio/detail/reactive_socket_service_base_ext.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -reactive_socket_service_base_ext::reactive_socket_service_base_ext( - execution_context& context) - : reactor_(use_service<reactor>(context)) -{ - reactor_.init_task(); -} - -void reactive_socket_service_base_ext::base_shutdown() -{ -} - -void reactive_socket_service_base_ext::construct( - reactive_socket_service_base_ext::base_implementation_type& impl) -{ - impl.socket_ = invalid_socket; - impl.state_ = 0; -} - -void reactive_socket_service_base_ext::base_move_construct( - reactive_socket_service_base_ext::base_implementation_type& impl, - reactive_socket_service_base_ext::base_implementation_type& other_impl) -{ - impl.socket_ = other_impl.socket_; - other_impl.socket_ = invalid_socket; - - impl.state_ = other_impl.state_; - other_impl.state_ = 0; - - reactor_.move_descriptor(impl.socket_, - impl.reactor_data_, other_impl.reactor_data_); -} - -void reactive_socket_service_base_ext::base_move_assign( - reactive_socket_service_base_ext::base_implementation_type& impl, - reactive_socket_service_base_ext& other_service, - reactive_socket_service_base_ext::base_implementation_type& other_impl) -{ - destroy(impl); - - impl.socket_ = other_impl.socket_; - other_impl.socket_ = invalid_socket; - - impl.state_ = other_impl.state_; - other_impl.state_ = 0; - - other_service.reactor_.move_descriptor(impl.socket_, - impl.reactor_data_, other_impl.reactor_data_); -} - -void reactive_socket_service_base_ext::destroy( - reactive_socket_service_base_ext::base_implementation_type& impl) -{ - if (impl.socket_ != invalid_socket) - { - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "close")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, - (impl.state_ & socket_ops::possible_dup) == 0); - - boost::system::error_code ignored_ec; - socket_ops::close(impl.socket_, impl.state_, true, ignored_ec); - - reactor_.cleanup_descriptor_data(impl.reactor_data_); - } -} - -boost::system::error_code reactive_socket_service_base_ext::close( - reactive_socket_service_base_ext::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (is_open(impl)) - { - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "close")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, - (impl.state_ & socket_ops::possible_dup) == 0); - - socket_ops::close(impl.socket_, impl.state_, false, ec); - - reactor_.cleanup_descriptor_data(impl.reactor_data_); - } - else - { - ec = boost::system::error_code(); - } - - // The descriptor is closed by the OS even if close() returns an error. - // - // (Actually, POSIX says the state of the descriptor is unspecified. On - // Linux the descriptor is apparently closed anyway; e.g. see - // http://lkml.org/lkml/2005/9/10/129 - // We'll just have to assume that other OSes follow the same behaviour. The - // known exception is when Windows's closesocket() function fails with - // WSAEWOULDBLOCK, but this case is handled inside socket_ops::close(). - construct(impl); - - return ec; -} -/* -socket_type reactive_socket_service_base::release( - reactive_socket_service_base::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (!is_open(impl)) - { - ec = boost::asio::error::bad_descriptor; - return invalid_socket; - } - - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "release")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, false); - reactor_.cleanup_descriptor_data(impl.reactor_data_); - socket_type sock = impl.socket_; - construct(impl); - ec = boost::system::error_code(); - return sock; -} -*/ -boost::system::error_code reactive_socket_service_base_ext::cancel( - reactive_socket_service_base_ext::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (!is_open(impl)) - { - ec = boost::asio::error::bad_descriptor; - return ec; - } - - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "cancel")); - - reactor_.cancel_ops(impl.socket_, impl.reactor_data_); - ec = boost::system::error_code(); - return ec; -} - -boost::system::error_code reactive_socket_service_base_ext::do_open( - reactive_socket_service_base_ext::base_implementation_type& impl, - int af, int type, int protocol, boost::system::error_code& ec) -{ - if (is_open(impl)) - { - ec = boost::asio::error::already_open; - return ec; - } - - socket_holder sock(socket_ops::socket(af, type, protocol, ec)); - if (sock.get() == invalid_socket) - return ec; - - if (int err = reactor_.register_descriptor(sock.get(), impl.reactor_data_)) - { - ec = boost::system::error_code(err, - boost::asio::error::get_system_category()); - return ec; - } - - impl.socket_ = sock.release(); - switch (type) - { - case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; - case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; - default: impl.state_ = 0; break; - } - ec = boost::system::error_code(); - return ec; -} - -boost::system::error_code reactive_socket_service_base_ext::do_assign( - reactive_socket_service_base_ext::base_implementation_type& impl, int type, - const reactive_socket_service_base_ext::native_handle_type& native_socket, - boost::system::error_code& ec) -{ - if (is_open(impl)) - { - ec = boost::asio::error::already_open; - return ec; - } - - if (int err = reactor_.register_descriptor( - native_socket, impl.reactor_data_)) - { - ec = boost::system::error_code(err, - boost::asio::error::get_system_category()); - return ec; - } - - impl.socket_ = native_socket; - switch (type) - { - case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; - case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; - default: impl.state_ = 0; break; - } - impl.state_ |= socket_ops::possible_dup; - ec = boost::system::error_code(); - return ec; -} - -void reactive_socket_service_base_ext::start_op( - reactive_socket_service_base_ext::base_implementation_type& impl, - int op_type, reactor_op* op, bool is_continuation, - bool is_non_blocking, bool noop) -{ - if (!noop) - { - if ((impl.state_ & socket_ops::non_blocking) - || socket_ops::set_internal_non_blocking( - impl.socket_, impl.state_, true, op->ec_)) - { - reactor_.start_op(op_type, impl.socket_, - impl.reactor_data_, op, is_continuation, is_non_blocking); - return; - } - } - - reactor_.post_immediate_completion(op, is_continuation); -} - -void reactive_socket_service_base_ext::start_accept_op( - reactive_socket_service_base_ext::base_implementation_type& impl, - reactor_op* op, bool is_continuation, bool peer_is_open) -{ - if (!peer_is_open) - start_op(impl, reactor::read_op, op, is_continuation, true, false); - else - { - op->ec_ = boost::asio::error::already_open; - reactor_.post_immediate_completion(op, is_continuation); - } -} - -void reactive_socket_service_base_ext::start_connect_op( - reactive_socket_service_base_ext::base_implementation_type& impl, - reactor_op* op, bool is_continuation, - const socket_addr_type* addr, size_t addrlen) -{ - if ((impl.state_ & socket_ops::non_blocking) - || socket_ops::set_internal_non_blocking( - impl.socket_, impl.state_, true, op->ec_)) - { - if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0) - { - if (op->ec_ == boost::asio::error::in_progress - || op->ec_ == boost::asio::error::would_block) - { - op->ec_ = boost::system::error_code(); - reactor_.start_op(reactor::connect_op, impl.socket_, - impl.reactor_data_, op, is_continuation, false); - return; - } - } - } - - reactor_.post_immediate_completion(op, is_continuation); -} - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - // && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_IPP diff --git a/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext_local.ipp b/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext_local.ipp deleted file mode 100644 index 288cf19..0000000 --- a/implementation/helper/1.76/boost/asio/detail/impl/reactive_socket_service_base_ext_local.ipp +++ /dev/null @@ -1,302 +0,0 @@ -// -// detail/reactive_socket_service_base_ext_local.ipp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_IPP -#define BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_IPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) \ - && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#include <boost/asio/detail/reactive_socket_service_base_ext_local.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -reactive_socket_service_base_ext_local::reactive_socket_service_base_ext_local( - execution_context& context) - : reactor_(use_service<reactor>(context)) -{ - reactor_.init_task(); -} - -void reactive_socket_service_base_ext_local::base_shutdown() -{ -} - -void reactive_socket_service_base_ext_local::construct( - reactive_socket_service_base_ext_local::base_implementation_type& impl) -{ - impl.socket_ = invalid_socket; - impl.state_ = 0; -} - -void reactive_socket_service_base_ext_local::base_move_construct( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - reactive_socket_service_base_ext_local::base_implementation_type& other_impl) -{ - impl.socket_ = other_impl.socket_; - other_impl.socket_ = invalid_socket; - - impl.state_ = other_impl.state_; - other_impl.state_ = 0; - - reactor_.move_descriptor(impl.socket_, - impl.reactor_data_, other_impl.reactor_data_); -} - -void reactive_socket_service_base_ext_local::base_move_assign( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - reactive_socket_service_base_ext_local& other_service, - reactive_socket_service_base_ext_local::base_implementation_type& other_impl) -{ - destroy(impl); - - impl.socket_ = other_impl.socket_; - other_impl.socket_ = invalid_socket; - - impl.state_ = other_impl.state_; - other_impl.state_ = 0; - - other_service.reactor_.move_descriptor(impl.socket_, - impl.reactor_data_, other_impl.reactor_data_); -} - -void reactive_socket_service_base_ext_local::destroy( - reactive_socket_service_base_ext_local::base_implementation_type& impl) -{ - if (impl.socket_ != invalid_socket) - { - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "close")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, - (impl.state_ & socket_ops::possible_dup) == 0); - - boost::system::error_code ignored_ec; - socket_ops::close(impl.socket_, impl.state_, true, ignored_ec); - - reactor_.cleanup_descriptor_data(impl.reactor_data_); - } -} - -boost::system::error_code reactive_socket_service_base_ext_local::close( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (is_open(impl)) - { - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "close")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, - (impl.state_ & socket_ops::possible_dup) == 0); - - socket_ops::close(impl.socket_, impl.state_, false, ec); - - reactor_.cleanup_descriptor_data(impl.reactor_data_); - } - else - { - ec = boost::system::error_code(); - } - - // The descriptor is closed by the OS even if close() returns an error. - // - // (Actually, POSIX says the state of the descriptor is unspecified. On - // Linux the descriptor is apparently closed anyway; e.g. see - // http://lkml.org/lkml/2005/9/10/129 - // We'll just have to assume that other OSes follow the same behaviour. The - // known exception is when Windows's closesocket() function fails with - // WSAEWOULDBLOCK, but this case is handled inside socket_ops::close(). - construct(impl); - - return ec; -} -/* -socket_type reactive_socket_service_base::release( - reactive_socket_service_base::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (!is_open(impl)) - { - ec = boost::asio::error::bad_descriptor; - return invalid_socket; - } - - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "release")); - - reactor_.deregister_descriptor(impl.socket_, impl.reactor_data_, false); - reactor_.cleanup_descriptor_data(impl.reactor_data_); - socket_type sock = impl.socket_; - construct(impl); - ec = boost::system::error_code(); - return sock; -} -*/ -boost::system::error_code reactive_socket_service_base_ext_local::cancel( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - boost::system::error_code& ec) -{ - if (!is_open(impl)) - { - ec = boost::asio::error::bad_descriptor; - return ec; - } - - BOOST_ASIO_HANDLER_OPERATION((reactor_.context(), - "socket", &impl, impl.socket_, "cancel")); - - reactor_.cancel_ops(impl.socket_, impl.reactor_data_); - ec = boost::system::error_code(); - return ec; -} - -boost::system::error_code reactive_socket_service_base_ext_local::do_open( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - int af, int type, int protocol, boost::system::error_code& ec) -{ - if (is_open(impl)) - { - ec = boost::asio::error::already_open; - return ec; - } - - socket_holder sock(socket_ops::socket(af, type, protocol, ec)); - if (sock.get() == invalid_socket) - return ec; - - if (int err = reactor_.register_descriptor(sock.get(), impl.reactor_data_)) - { - ec = boost::system::error_code(err, - boost::asio::error::get_system_category()); - return ec; - } - - impl.socket_ = sock.release(); - switch (type) - { - case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; - case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; - default: impl.state_ = 0; break; - } - ec = boost::system::error_code(); - return ec; -} - -boost::system::error_code reactive_socket_service_base_ext_local::do_assign( - reactive_socket_service_base_ext_local::base_implementation_type& impl, int type, - const reactive_socket_service_base_ext_local::native_handle_type& native_socket, - boost::system::error_code& ec) -{ - if (is_open(impl)) - { - ec = boost::asio::error::already_open; - return ec; - } - - if (int err = reactor_.register_descriptor( - native_socket, impl.reactor_data_)) - { - ec = boost::system::error_code(err, - boost::asio::error::get_system_category()); - return ec; - } - - impl.socket_ = native_socket; - switch (type) - { - case SOCK_STREAM: impl.state_ = socket_ops::stream_oriented; break; - case SOCK_DGRAM: impl.state_ = socket_ops::datagram_oriented; break; - default: impl.state_ = 0; break; - } - impl.state_ |= socket_ops::possible_dup; - ec = boost::system::error_code(); - return ec; -} - -void reactive_socket_service_base_ext_local::start_op( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - int op_type, reactor_op* op, bool is_continuation, - bool is_non_blocking, bool noop) -{ - if (!noop) - { - if ((impl.state_ & socket_ops::non_blocking) - || socket_ops::set_internal_non_blocking( - impl.socket_, impl.state_, true, op->ec_)) - { - reactor_.start_op(op_type, impl.socket_, - impl.reactor_data_, op, is_continuation, is_non_blocking); - return; - } - } - - reactor_.post_immediate_completion(op, is_continuation); -} - -void reactive_socket_service_base_ext_local::start_accept_op( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - reactor_op* op, bool is_continuation, bool peer_is_open) -{ - if (!peer_is_open) - start_op(impl, reactor::read_op, op, is_continuation, true, false); - else - { - op->ec_ = boost::asio::error::already_open; - reactor_.post_immediate_completion(op, is_continuation); - } -} - -void reactive_socket_service_base_ext_local::start_connect_op( - reactive_socket_service_base_ext_local::base_implementation_type& impl, - reactor_op* op, bool is_continuation, - const socket_addr_type* addr, size_t addrlen) -{ - if ((impl.state_ & socket_ops::non_blocking) - || socket_ops::set_internal_non_blocking( - impl.socket_, impl.state_, true, op->ec_)) - { - if (socket_ops::connect(impl.socket_, addr, addrlen, op->ec_) != 0) - { - if (op->ec_ == boost::asio::error::in_progress - || op->ec_ == boost::asio::error::would_block) - { - op->ec_ = boost::system::error_code(); - reactor_.start_op(reactor::connect_op, impl.socket_, - impl.reactor_data_, op, is_continuation, false); - return; - } - } - } - - reactor_.post_immediate_completion(op, is_continuation); -} - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - // && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#endif // BOOST_ASIO_DETAIL_IMPL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_IPP diff --git a/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext.ipp b/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext.ipp deleted file mode 100644 index 39e2ed8..0000000 --- a/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext.ipp +++ /dev/null @@ -1,234 +0,0 @@ -// -// detail/impl/socket_ops_ext.ipp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_IPP -#define BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_IPP - -#include <boost/asio/detail/impl/socket_ops.ipp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { -namespace socket_ops { - -signed_size_type recvfrom(socket_type s, buf* bufs, size_t count, - int flags, socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, boost::asio::ip::address& da) -{ - -#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - GUID WSARecvMsg_GUID = WSAID_WSARECVMSG; - LPFN_WSARECVMSG WSARecvMsg; - DWORD NumberOfBytes; - signed_size_type result; - - result = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, - &WSARecvMsg_GUID, sizeof WSARecvMsg_GUID, - &WSARecvMsg, sizeof WSARecvMsg, - &NumberOfBytes, NULL, NULL); - get_last_error(ec, true); - if (ec.value() == SOCKET_ERROR) { - WSARecvMsg = NULL; - return 0; - } - - WSABUF wsaBuf; - WSAMSG msg; - char controlBuffer[1024]; - msg.name = addr; - msg.namelen = *addrlen; - wsaBuf.buf = bufs->buf; - wsaBuf.len = bufs->len; - msg.lpBuffers = &wsaBuf; - msg.dwBufferCount = count; - msg.Control.len = sizeof controlBuffer; - msg.Control.buf = controlBuffer; - msg.dwFlags = flags; - - DWORD dwNumberOfBytesRecvd; - result = WSARecvMsg(s, &msg, &dwNumberOfBytesRecvd, NULL, NULL); - get_last_error(ec, true); - - if (result >= 0) { - ec = boost::system::error_code(); - - // Find destination address - for (LPWSACMSGHDR cmsg = WSA_CMSG_FIRSTHDR(&msg); - cmsg != NULL; - cmsg = WSA_CMSG_NXTHDR(&msg, cmsg)) - { - if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) - { - struct in_pktinfo *pi = (struct in_pktinfo *) WSA_CMSG_DATA(cmsg); - if (pi) - { - da = boost::asio::ip::address_v4(ntohl(pi->ipi_addr.s_addr)); - } - } else - if (cmsg->cmsg_level == IPPROTO_IPV6 && cmsg->cmsg_type == IPV6_PKTINFO) - { - struct in6_pktinfo *pi = (struct in6_pktinfo *) WSA_CMSG_DATA(cmsg); - if (pi) - { - boost::asio::ip::address_v6::bytes_type b; - memcpy(b.data(), pi->ipi6_addr.s6_addr, sizeof(pi->ipi6_addr.s6_addr)); - da = boost::asio::ip::address_v6(b); - } - } - } - } else { - dwNumberOfBytesRecvd = -1; - } - return dwNumberOfBytesRecvd; -#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - char cmbuf[0x100]; - msghdr msg = msghdr(); - init_msghdr_msg_name(msg.msg_name, addr); - msg.msg_namelen = static_cast<int>(*addrlen); - msg.msg_iov = bufs; - msg.msg_iovlen = static_cast<int>(count); - msg.msg_control = cmbuf; - msg.msg_controllen = sizeof(cmbuf); - signed_size_type result = ::recvmsg(s, &msg, flags); - get_last_error(ec, true); - *addrlen = msg.msg_namelen; - if (result >= 0) { - ec.assign(0, ec.category()); - - // Find destination address - for (struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); - cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) - { - if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) - { - struct in_pktinfo *pi = (struct in_pktinfo *) CMSG_DATA(cmsg); - if (pi) - { - da = boost::asio::ip::address_v4(ntohl(pi->ipi_addr.s_addr)); - } - } else - if (cmsg->cmsg_level == IPPROTO_IPV6 && cmsg->cmsg_type == IPV6_PKTINFO) - { - struct in6_pktinfo *pi = (struct in6_pktinfo *) CMSG_DATA(cmsg); - if (pi) - { - boost::asio::ip::address_v6::bytes_type b; - memcpy(b.data(), pi->ipi6_addr.s6_addr, sizeof(pi->ipi6_addr.s6_addr)); - da = boost::asio::ip::address_v6(b); - } - } - } - } - return result; -#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) -} - -size_t sync_recvfrom(socket_type s, state_type state, buf* bufs, - size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, boost::asio::ip::address& da) -{ - if (s == invalid_socket) - { - ec = boost::asio::error::bad_descriptor; - return 0; - } - - // Read some data. - for (;;) - { - // Try to complete the operation without blocking. - signed_size_type bytes = socket_ops::recvfrom( - s, bufs, count, flags, addr, addrlen, ec, da); - - // Check if operation succeeded. - if (bytes >= 0) - return bytes; - - // Operation failed. - if ((state & user_set_non_blocking) - || (ec != boost::asio::error::would_block - && ec != boost::asio::error::try_again)) - return 0; - - // Wait for socket to become ready. - if (socket_ops::poll_read(s, 0, -1, ec) < 0) - return 0; - } -} - -#if defined(BOOST_ASIO_HAS_IOCP) - -void complete_iocp_recvfrom( - const weak_cancel_token_type& cancel_token, - boost::system::error_code& ec, boost::asio::ip::address& da) -{ - // Map non-portable errors to their portable counterparts. - if (ec.value() == ERROR_NETNAME_DELETED) - { - if (cancel_token.expired()) - ec = boost::asio::error::operation_aborted; - else - ec = boost::asio::error::connection_reset; - } - else if (ec.value() == ERROR_PORT_UNREACHABLE) - { - ec = boost::asio::error::connection_refused; - } -} - -#else // defined(BOOST_ASIO_HAS_IOCP) - -bool non_blocking_recvfrom(socket_type s, - buf* bufs, size_t count, int flags, - socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, size_t& bytes_transferred, boost::asio::ip::address& da) -{ - for (;;) - { - // Read some data. - signed_size_type bytes = socket_ops::recvfrom( - s, bufs, count, flags, addr, addrlen, ec, da); - - // Retry operation if interrupted by signal. - if (ec == boost::asio::error::interrupted) - continue; - - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - - // Operation is complete. - if (bytes >= 0) - { - ec = boost::system::error_code(); - bytes_transferred = bytes; - } - else - bytes_transferred = 0; - - return true; - } -} - -#endif // defined(BOOST_ASIO_HAS_IOCP) - -} // namespace socket_ops -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_IPP diff --git a/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext_local.ipp b/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext_local.ipp deleted file mode 100644 index 83a673b..0000000 --- a/implementation/helper/1.76/boost/asio/detail/impl/socket_ops_ext_local.ipp +++ /dev/null @@ -1,307 +0,0 @@ -// -// detail/impl/socket_ops_ext_local.ipp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_IPP -#define BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_IPP - -#include <boost/asio/detail/impl/socket_ops.ipp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { -namespace socket_ops { - -signed_size_type recv(socket_type s, buf* bufs, size_t count, - int flags, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid) -{ - uid = 0xFFFFFFFF; - gid = 0xFFFFFFFF; - struct ucred *ucredp; - -#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - // Receive some data. - DWORD recv_buf_count = static_cast<DWORD>(count); - DWORD bytes_transferred = 0; - DWORD recv_flags = flags; - int result = ::WSARecv(s, bufs, - recv_buf_count, &bytes_transferred, &recv_flags, 0, 0); - get_last_error(ec, true); - if (ec.value() == ERROR_NETNAME_DELETED) - ec = boost::asio::error::connection_reset; - else if (ec.value() == ERROR_PORT_UNREACHABLE) - ec = boost::asio::error::connection_refused; - if (result != 0) - return socket_error_retval; - ec.assign(0, ec.category()); - return bytes_transferred; -#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - msghdr msg = msghdr(); - msg.msg_iov = bufs; - msg.msg_iovlen = static_cast<int>(count); - - union { - struct cmsghdr cmh; - char control[CMSG_SPACE(sizeof(struct ucred))]; - } control_un; - - // Set 'control_un' to describe ancillary data that we want to receive - control_un.cmh.cmsg_len = CMSG_LEN(sizeof(struct ucred)); - control_un.cmh.cmsg_level = SOL_SOCKET; - control_un.cmh.cmsg_type = SCM_CREDENTIALS; - - // Set 'msg' fields to describe 'control_un' - msg.msg_control = control_un.control; - msg.msg_controllen = sizeof(control_un.control); - - signed_size_type result = ::recvmsg(s, &msg, flags); - get_last_error(ec, true); - if (result >= 0) { - ec.assign(0, ec.category()); - - // Find UID / GID - for (struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); - cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) - { - if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_CREDENTIALS - || cmsg->cmsg_len != CMSG_LEN(sizeof(struct ucred))) - continue; - - ucredp = (struct ucred *) CMSG_DATA(cmsg); - if (ucredp) { - uid = ucredp->uid; - gid = ucredp->gid; - } - } - } - return result; -#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) -} - -signed_size_type recvfrom(socket_type s, buf* bufs, size_t count, - int flags, socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid) -{ - uid = 0xFFFFFFFF; - gid = 0xFFFFFFFF; - struct ucred *ucredp; - clear_last_error(); -#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - // Receive some data. - DWORD recv_buf_count = static_cast<DWORD>(count); - DWORD bytes_transferred = 0; - DWORD recv_flags = flags; - int tmp_addrlen = (int)*addrlen; - int result = ::WSARecvFrom(s, bufs, recv_buf_count, - &bytes_transferred, &recv_flags, addr, &tmp_addrlen, 0, 0); - get_last_error(ec, true); - *addrlen = (std::size_t)tmp_addrlen; - if (ec.value() == ERROR_NETNAME_DELETED) - ec = boost::asio::error::connection_reset; - else if (ec.value() == ERROR_PORT_UNREACHABLE) - ec = boost::asio::error::connection_refused; - if (result != 0) - return socket_error_retval; - ec.assign(0, ec.category()); - return bytes_transferred; -#else // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) - msghdr msg = msghdr(); - init_msghdr_msg_name(msg.msg_name, addr); - msg.msg_namelen = static_cast<int>(*addrlen); - msg.msg_iov = bufs; - msg.msg_iovlen = static_cast<int>(count); - - union { - struct cmsghdr cmh; - char control[CMSG_SPACE(sizeof(struct ucred))]; - } control_un; - - // Set 'control_un' to describe ancillary data that we want to receive - control_un.cmh.cmsg_len = CMSG_LEN(sizeof(struct ucred)); - control_un.cmh.cmsg_level = SOL_SOCKET; - control_un.cmh.cmsg_type = SCM_CREDENTIALS; - - // Set 'msg' fields to describe 'control_un' - msg.msg_control = control_un.control; - msg.msg_controllen = sizeof(control_un.control); - - signed_size_type result = ::recvmsg(s, &msg, flags); - get_last_error(ec, true); - *addrlen = msg.msg_namelen; - if (result >= 0) { - ec.assign(0, ec.category()); - - // Find UID / GID - for (struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); - cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) - { - if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_CREDENTIALS - || cmsg->cmsg_len != CMSG_LEN(sizeof(struct ucred))) - continue; - - ucredp = (struct ucred *) CMSG_DATA(cmsg); - if (ucredp) { - uid = ucredp->uid; - gid = ucredp->gid; - } - } - } - return result; -#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) -} - -size_t sync_recvfrom(socket_type s, state_type state, buf* bufs, - size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid) -{ - if (s == invalid_socket) - { - ec = boost::asio::error::bad_descriptor; - return 0; - } - - // Read some data. - for (;;) - { - // Try to complete the operation without blocking. - signed_size_type bytes = socket_ops::recvfrom( - s, bufs, count, flags, addr, addrlen, ec, uid, gid); - - // Check if operation succeeded. - if (bytes >= 0) - return bytes; - - // Operation failed. - if ((state & user_set_non_blocking) - || (ec != boost::asio::error::would_block - && ec != boost::asio::error::try_again)) - return 0; - - // Wait for socket to become ready. - if (socket_ops::poll_read(s, 0, -1, ec) < 0) - return 0; - } -} - -#if defined(BOOST_ASIO_HAS_IOCP) - -void complete_iocp_recvfrom( - const weak_cancel_token_type& cancel_token, - boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid) -{ - uid = 0xFFFFFFFF; - gid = 0xFFFFFFFF; - // Map non-portable errors to their portable counterparts. - if (ec.value() == ERROR_NETNAME_DELETED) - { - if (cancel_token.expired()) - ec = boost::asio::error::operation_aborted; - else - ec = boost::asio::error::connection_reset; - } - else if (ec.value() == ERROR_PORT_UNREACHABLE) - { - ec = boost::asio::error::connection_refused; - } -} - -#else // defined(BOOST_ASIO_HAS_IOCP) - -bool non_blocking_recv(socket_type s, - buf* bufs, size_t count, int flags, bool is_stream, - boost::system::error_code& ec, size_t& bytes_transferred, - std::uint32_t& uid, std::uint32_t& gid) -{ - for (;;) - { - // Read some data. - signed_size_type bytes = socket_ops::recv(s, bufs, count, flags, ec, uid, gid); - - // Check for end of stream. - if (is_stream && bytes == 0) - { - ec = boost::asio::error::eof; - return true; - } - - // Retry operation if interrupted by signal. - if (ec == boost::asio::error::interrupted) - continue; - - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - - // Operation is complete. - if (bytes >= 0) - { - ec = boost::system::error_code(); - bytes_transferred = bytes; - } - else - bytes_transferred = 0; - - return true; - } -} - -bool non_blocking_recvfrom(socket_type s, - buf* bufs, size_t count, int flags, - socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, size_t& bytes_transferred, - std::uint32_t& uid, std::uint32_t& gid) -{ - for (;;) - { - // Read some data. - signed_size_type bytes = socket_ops::recvfrom( - s, bufs, count, flags, addr, addrlen, ec, uid, gid); - - // Retry operation if interrupted by signal. - if (ec == boost::asio::error::interrupted) - continue; - - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - - // Operation is complete. - if (bytes >= 0) - { - ec = boost::system::error_code(); - bytes_transferred = bytes; - } - else - bytes_transferred = 0; - - return true; - } -} - -#endif // defined(BOOST_ASIO_HAS_IOCP) - -} // namespace socket_ops -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_IPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext.hpp deleted file mode 100644 index 1167d57..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// detail/reactive_socket_recv_op_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/handler_alloc_helpers.hpp> -#include <boost/asio/detail/handler_invoke_helpers.hpp> -#include <boost/asio/detail/handler_work.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext.hpp> -#include <boost/asio/detail/socket_ops_ext.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence> -class reactive_socket_recv_op_base_ext : public reactor_op_ext -{ -public: - reactive_socket_recv_op_base_ext(const boost::system::error_code& success_ec, - socket_type socket, socket_ops::state_type state, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, func_type complete_func) - : reactor_op_ext(success_ec, &reactive_socket_recv_op_base_ext::do_perform, complete_func), - socket_(socket), - state_(state), - buffers_(buffers), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recv_op_base_ext* o( - static_cast<reactive_socket_recv_op_base_ext*>(base)); - - typedef buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs_type; - - status result; - if (bufs_type::is_single_buffer) - { - result = socket_ops::non_blocking_recv1(o->socket_, - bufs_type::first(o->buffers_).data(), - bufs_type::first(o->buffers_).size(), o->flags_, - (o->state_ & socket_ops::stream_oriented) != 0, - o->ec_, o->bytes_transferred_) ? done : not_done; - } - else - { - bufs_type bufs(o->buffers_); - result = socket_ops::non_blocking_recv(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - (o->state_ & socket_ops::stream_oriented) != 0, - o->ec_, o->bytes_transferred_) ? done : not_done; - } - - if (result == done) - if ((o->state_ & socket_ops::stream_oriented) != 0) - if (o->bytes_transferred_ == 0) - result = done_and_exhausted; - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recv", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - socket_ops::state_type state_; - MutableBufferSequence buffers_; - socket_base::message_flags flags_; -}; - -template <typename MutableBufferSequence, typename Handler, typename IoExecutor> -class reactive_socket_recv_op_ext : - public reactive_socket_recv_op_base_ext<MutableBufferSequence> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recv_op_ext); - - reactive_socket_recv_op_ext(const boost::system::error_code& success_ec, - socket_type socket, socket_ops::state_type state, - const MutableBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - : reactive_socket_recv_op_base_ext<MutableBufferSequence>(success_ec, - socket, state, buffers, flags, - &reactive_socket_recv_op_ext::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recv_op_ext* o(static_cast<reactive_socket_recv_op_ext*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder3<Handler, boost::system::error_code, std::size_t, boost::asio::ip::address> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->da_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3_)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext_local.hpp deleted file mode 100644 index bedbd29..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recv_op_ext_local.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// -// detail/reactive_socket_recv_op_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/handler_alloc_helpers.hpp> -#include <boost/asio/detail/handler_invoke_helpers.hpp> -#include <boost/asio/detail/handler_work.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext_local.hpp> -#include <boost/asio/detail/socket_ops_ext_local.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence> -class reactive_socket_recv_op_base_ext_local : public reactor_op_ext_local -{ -public: - reactive_socket_recv_op_base_ext_local(const boost::system::error_code& success_ec, - socket_type socket, socket_ops::state_type state, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, func_type complete_func) - : reactor_op_ext_local(success_ec, &reactive_socket_recv_op_base_ext_local::do_perform, complete_func), - socket_(socket), - state_(state), - buffers_(buffers), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recv_op_base_ext_local* o( - static_cast<reactive_socket_recv_op_base_ext_local*>(base)); - - typedef buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs_type; - - status result; - if (bufs_type::is_single_buffer) - { - result = socket_ops::non_blocking_recv1(o->socket_, - bufs_type::first(o->buffers_).data(), - bufs_type::first(o->buffers_).size(), o->flags_, - (o->state_ & socket_ops::stream_oriented) != 0, - o->ec_, o->bytes_transferred_) ? done : not_done; - } - else - { - bufs_type bufs(o->buffers_); - result = socket_ops::non_blocking_recv(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - (o->state_ & socket_ops::stream_oriented) != 0, - o->ec_, o->bytes_transferred_) ? done : not_done; - } - - if (result == done) - if ((o->state_ & socket_ops::stream_oriented) != 0) - if (o->bytes_transferred_ == 0) - result = done_and_exhausted; - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recv", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - socket_ops::state_type state_; - MutableBufferSequence buffers_; - socket_base::message_flags flags_; -}; - -template <typename MutableBufferSequence, typename Handler, typename IoExecutor> -class reactive_socket_recv_op_ext_local : - public reactive_socket_recv_op_base_ext_local<MutableBufferSequence> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recv_op_ext_local); - - reactive_socket_recv_op_ext_local(const boost::system::error_code& success_ec, - socket_type socket, socket_ops::state_type state, - const MutableBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - : reactive_socket_recv_op_base_ext_local<MutableBufferSequence>(success_ec, - socket, state, buffers, flags, - &reactive_socket_recv_op_ext_local::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recv_op_ext_local* o(static_cast<reactive_socket_recv_op_ext_local*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder4<Handler, boost::system::error_code, std::size_t, std::uint32_t, std::uint32_t> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->uid_, o->gid_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3, handler.arg4)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECV_OP_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext.hpp deleted file mode 100644 index 875fe14..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext.hpp +++ /dev/null @@ -1,153 +0,0 @@ -// -// detail/reactive_socket_recvfrom_op_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/handler_alloc_helpers.hpp> -#include <boost/asio/detail/handler_invoke_helpers.hpp> -#include <boost/asio/detail/handler_work.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext.hpp> -#include <boost/asio/detail/socket_ops_ext.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence, typename Endpoint> -class reactive_socket_recvfrom_op_base_ext : public reactor_op_ext -{ -public: - reactive_socket_recvfrom_op_base_ext(const boost::system::error_code& success_ec, - socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, func_type complete_func) - : reactor_op_ext(success_ec, &reactive_socket_recvfrom_op_base_ext::do_perform, complete_func), - socket_(socket), - protocol_type_(protocol_type), - buffers_(buffers), - sender_endpoint_(endpoint), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvfrom_op_base_ext* o( - static_cast<reactive_socket_recvfrom_op_base_ext*>(base)); - - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(o->buffers_); - - std::size_t addr_len = o->sender_endpoint_.capacity(); - status result = socket_ops::non_blocking_recvfrom(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - o->sender_endpoint_.data(), &addr_len, - o->ec_, o->bytes_transferred_, o->da_) ? done : not_done; - - if (result && !o->ec_) - o->sender_endpoint_.resize(addr_len); - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvfrom", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - int protocol_type_; - MutableBufferSequence buffers_; - Endpoint& sender_endpoint_; - socket_base::message_flags flags_; -}; - -template <typename MutableBufferSequence, typename Endpoint, - typename Handler, typename IoExecutor> -class reactive_socket_recvfrom_op_ext : - public reactive_socket_recvfrom_op_base_ext<MutableBufferSequence, Endpoint> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvfrom_op_ext); - - reactive_socket_recvfrom_op_ext(const boost::system::error_code& success_ec, - socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, Handler& handler, - const IoExecutor& io_ex) - : reactive_socket_recvfrom_op_base_ext<MutableBufferSequence, Endpoint>( - success_ec, socket, protocol_type, buffers, endpoint, flags, - &reactive_socket_recvfrom_op_ext::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvfrom_op_ext* o( - static_cast<reactive_socket_recvfrom_op_ext*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder3<Handler, boost::system::error_code, std::size_t, boost::asio::ip::address> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->da_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3_)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext_local.hpp deleted file mode 100644 index f9fef2b..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvfrom_op_ext_local.hpp +++ /dev/null @@ -1,148 +0,0 @@ -// -// detail/reactive_socket_recvfrom_op_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext_local.hpp> -#include <boost/asio/detail/socket_ops_ext_local.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence, typename Endpoint> -class reactive_socket_recvfrom_op_base_ext_local : public reactor_op_ext_local -{ -public: - reactive_socket_recvfrom_op_base_ext_local(socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, func_type complete_func) - : reactor_op_ext_local(&reactive_socket_recvfrom_op_base_ext_local::do_perform, complete_func), - socket_(socket), - protocol_type_(protocol_type), - buffers_(buffers), - sender_endpoint_(endpoint), - flags_(flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvfrom_op_base_ext_local* o( - static_cast<reactive_socket_recvfrom_op_base_ext_local*>(base)); - - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(o->buffers_); - - std::size_t addr_len = o->sender_endpoint_.capacity(); - status result = socket_ops::non_blocking_recvfrom(o->socket_, - bufs.buffers(), bufs.count(), o->flags_, - o->sender_endpoint_.data(), &addr_len, - o->ec_, o->bytes_transferred_, o->uid_, o->gid_) ? done : not_done; - - if (result && !o->ec_) - o->sender_endpoint_.resize(addr_len); - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvfrom", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - int protocol_type_; - MutableBufferSequence buffers_; - Endpoint& sender_endpoint_; - socket_base::message_flags flags_; -}; - -template <typename MutableBufferSequence, typename Endpoint, - typename Handler, typename IoExecutor> -class reactive_socket_recvfrom_op_ext_local : - public reactive_socket_recvfrom_op_base_ext_local<MutableBufferSequence, Endpoint> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvfrom_op_ext_local); - - reactive_socket_recvfrom_op_ext_local(socket_type socket, int protocol_type, - const MutableBufferSequence& buffers, Endpoint& endpoint, - socket_base::message_flags flags, Handler& handler, - const IoExecutor& io_ex) - : reactive_socket_recvfrom_op_base_ext_local<MutableBufferSequence, Endpoint>( - socket, protocol_type, buffers, endpoint, flags, - &reactive_socket_recvfrom_op_ext_local::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvfrom_op_ext_local* o( - static_cast<reactive_socket_recvfrom_op_ext_local*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder4<Handler, boost::system::error_code, std::size_t, std::uint32_t, std::uint32_t> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->uid_, o->gid_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3_, handler.arg4_)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext.hpp deleted file mode 100644 index bd315dc..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext.hpp +++ /dev/null @@ -1,144 +0,0 @@ -// -// detail/reactive_socket_recvmsg_op_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/handler_alloc_helpers.hpp> -#include <boost/asio/detail/handler_invoke_helpers.hpp> -#include <boost/asio/detail/handler_work.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext.hpp> -#include <boost/asio/detail/socket_ops_ext.hpp> -#include <boost/asio/socket_base.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence> -class reactive_socket_recvmsg_op_base_ext : public reactor_op_ext -{ -public: - reactive_socket_recvmsg_op_base_ext(const boost::system::error_code& success_ec, - socket_type socket, const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, func_type complete_func) - : reactor_op_ext(&reactive_socket_recvmsg_op_base_ext::do_perform, complete_func), - socket_(socket), - buffers_(buffers), - in_flags_(in_flags), - out_flags_(out_flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvmsg_op_base_ext* o( - static_cast<reactive_socket_recvmsg_op_base_ext*>(base)); - - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(o->buffers_); - - status result = socket_ops::non_blocking_recvmsg(o->socket_, - bufs.buffers(), bufs.count(), - o->in_flags_, o->out_flags_, - o->ec_, o->bytes_transferred_) ? done : not_done; - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvmsg", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - MutableBufferSequence buffers_; - socket_base::message_flags in_flags_; - socket_base::message_flags& out_flags_; -}; - -template <typename MutableBufferSequence, typename Handler, typename IoExecutor> -class reactive_socket_recvmsg_op_ext : - public reactive_socket_recvmsg_op_base_ext<MutableBufferSequence> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op_ext); - - reactive_socket_recvmsg_op_ext(const boost::system::error_code& success_ec, - socket_type socket, const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - : reactive_socket_recvmsg_op_base_ext<MutableBufferSequence>(socket, buffers, - in_flags, out_flags, &reactive_socket_recvmsg_op_ext::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvmsg_op_ext* o( - static_cast<reactive_socket_recvmsg_op_ext*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder3<Handler, boost::system::error_code, std::size_t, boost::asio::ip::address> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->da_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3_)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext_local.hpp deleted file mode 100644 index 8148690..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_recvmsg_op_ext_local.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// -// detail/reactive_socket_recvmsg_op_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> -#include <boost/asio/detail/bind_handler.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/fenced_block.hpp> -#include <boost/asio/detail/handler_alloc_helpers.hpp> -#include <boost/asio/detail/handler_invoke_helpers.hpp> -#include <boost/asio/detail/handler_work.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactor_op_ext_local.hpp> -#include <boost/asio/detail/socket_ops_ext_local.hpp> -#include <boost/asio/socket_base.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename MutableBufferSequence> -class reactive_socket_recvmsg_op_base_ext_local : public reactor_op_ext_local -{ -public: - reactive_socket_recvmsg_op_base_ext_local(const boost::system::error_code& success_ec, - socket_type socket, const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, func_type complete_func) - : reactor_op_ext_local(success_ec, &reactive_socket_recvmsg_op_base_ext_local::do_perform, complete_func), - socket_(socket), - buffers_(buffers), - in_flags_(in_flags), - out_flags_(out_flags) - { - } - - static status do_perform(reactor_op* base) - { - reactive_socket_recvmsg_op_base_ext_local* o( - static_cast<reactive_socket_recvmsg_op_base_ext_local*>(base)); - - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(o->buffers_); - - status result = socket_ops::non_blocking_recvmsg(o->socket_, - bufs.buffers(), bufs.count(), - o->in_flags_, o->out_flags_, - o->ec_, o->bytes_transferred_) ? done : not_done; - - BOOST_ASIO_HANDLER_REACTOR_OPERATION((*o, "non_blocking_recvmsg", - o->ec_, o->bytes_transferred_)); - - return result; - } - -private: - socket_type socket_; - MutableBufferSequence buffers_; - socket_base::message_flags in_flags_; - socket_base::message_flags& out_flags_; -}; - -template <typename MutableBufferSequence, typename Handler, typename IoExecutor> -class reactive_socket_recvmsg_op_ext_local : - public reactive_socket_recvmsg_op_base_ext_local<MutableBufferSequence> -{ -public: - BOOST_ASIO_DEFINE_HANDLER_PTR(reactive_socket_recvmsg_op_ext_local); - - reactive_socket_recvmsg_op_ext_local(const boost::system::error_code& success_ec, - socket_type socket, const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - : reactive_socket_recvmsg_op_base_ext_local<MutableBufferSequence>(success_ec, - socket, buffers, in_flags, out_flags, - &reactive_socket_recvmsg_op_ext_local::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), - work_(handler_, io_ex) - { - } - - static void do_complete(void* owner, operation* base, - const boost::system::error_code& /*ec*/, - std::size_t /*bytes_transferred*/) - { - // Take ownership of the handler object. - reactive_socket_recvmsg_op_ext_local* o( - static_cast<reactive_socket_recvmsg_op_ext_local*>(base)); - ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - - BOOST_ASIO_HANDLER_COMPLETION((*o)); - - // Take ownership of the operation's outstanding work. - handler_work<Handler, IoExecutor> w( - BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)( - o->work_)); - - // Make a copy of the handler so that the memory can be deallocated before - // the upcall is made. Even if we're not about to make an upcall, a - // sub-object of the handler may be the true owner of the memory associated - // with the handler. Consequently, a local copy of the handler is required - // to ensure that any owning sub-object remains valid until after we have - // deallocated the memory here. - detail::binder4<Handler, boost::system::error_code, std::size_t, std::uint32_t, std::uint32_t> - handler(o->handler_, o->ec_, o->bytes_transferred_, o->uid_, o->gid_); - p.h = boost::asio::detail::addressof(handler.handler_); - p.reset(); - - // Make the upcall if required. - if (owner) - { - fenced_block b(fenced_block::half); - BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_, handler.arg3_, handler.arg4_)); - w.complete(handler, handler.handler_); - BOOST_ASIO_HANDLER_INVOCATION_END; - } - } - -private: - Handler handler_; - handler_work<Handler, IoExecutor> work_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext.hpp deleted file mode 100644 index 2e68a87..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext.hpp +++ /dev/null @@ -1,524 +0,0 @@ -// -// detail/reactive_socket_service_base.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) \ - && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#include <boost/asio/buffer.hpp> -#include <boost/asio/error.hpp> -#include <boost/asio/execution_context.hpp> -#include <boost/asio/socket_base.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactive_null_buffers_op.hpp> -#include <boost/asio/detail/reactive_socket_recv_op_ext.hpp> -#include <boost/asio/detail/reactive_socket_recvmsg_op_ext.hpp> -#include <boost/asio/detail/reactive_socket_send_op.hpp> -#include <boost/asio/detail/reactive_wait_op.hpp> -#include <boost/asio/detail/reactor.hpp> -#include <boost/asio/detail/reactor_op.hpp> -#include <boost/asio/detail/socket_holder.hpp> -#include <boost/asio/detail/socket_ops_ext.hpp> -#include <boost/asio/detail/socket_types.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -class reactive_socket_service_base_ext -{ -public: - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct base_implementation_type - { - // The native socket representation. - socket_type socket_; - - // The current state of the socket. - socket_ops::state_type state_; - - // Per-descriptor data used by the reactor. - reactor::per_descriptor_data reactor_data_; - }; - - // Constructor. - BOOST_ASIO_DECL reactive_socket_service_base_ext(execution_context& context); - - // Destroy all user-defined handler objects owned by the service. - BOOST_ASIO_DECL void base_shutdown(); - - // Construct a new socket implementation. - BOOST_ASIO_DECL void construct(base_implementation_type& impl); - - // Move-construct a new socket implementation. - BOOST_ASIO_DECL void base_move_construct(base_implementation_type& impl, - base_implementation_type& other_impl); - - // Move-assign from another socket implementation. - BOOST_ASIO_DECL void base_move_assign(base_implementation_type& impl, - reactive_socket_service_base_ext& other_service, - base_implementation_type& other_impl); - - // Destroy a socket implementation. - BOOST_ASIO_DECL void destroy(base_implementation_type& impl); - - // Determine whether the socket is open. - bool is_open(const base_implementation_type& impl) const - { - return impl.socket_ != invalid_socket; - } - - // Destroy a socket implementation. - BOOST_ASIO_DECL boost::system::error_code close( - base_implementation_type& impl, boost::system::error_code& ec); - - // Release ownership of the socket. - BOOST_ASIO_DECL socket_type release( - base_implementation_type& impl, boost::system::error_code& ec); - - // Get the native socket representation. - native_handle_type native_handle(base_implementation_type& impl) - { - return impl.socket_; - } - - // Cancel all operations associated with the socket. - BOOST_ASIO_DECL boost::system::error_code cancel( - base_implementation_type& impl, boost::system::error_code& ec); - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const base_implementation_type& impl, - boost::system::error_code& ec) const - { - return socket_ops::sockatmark(impl.socket_, ec); - } - - // Determine the number of bytes available for reading. - std::size_t available(const base_implementation_type& impl, - boost::system::error_code& ec) const - { - return socket_ops::available(impl.socket_, ec); - } - - // Place the socket into the state where it will listen for new connections. - boost::system::error_code listen(base_implementation_type& impl, - int backlog, boost::system::error_code& ec) - { - socket_ops::listen(impl.socket_, backlog, ec); - return ec; - } - - // Perform an IO control command on the socket. - template <typename IO_Control_Command> - boost::system::error_code io_control(base_implementation_type& impl, - IO_Control_Command& command, boost::system::error_code& ec) - { - socket_ops::ioctl(impl.socket_, impl.state_, command.name(), - static_cast<ioctl_arg_type*>(command.data()), ec); - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::user_set_non_blocking) != 0; - } - - // Sets the non-blocking mode of the socket. - boost::system::error_code non_blocking(base_implementation_type& impl, - bool mode, boost::system::error_code& ec) - { - socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::internal_non_blocking) != 0; - } - - // Sets the non-blocking mode of the native socket implementation. - boost::system::error_code native_non_blocking(base_implementation_type& impl, - bool mode, boost::system::error_code& ec) - { - socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Wait for the socket to become ready to read, ready to write, or to have - // pending error conditions. - boost::system::error_code wait(base_implementation_type& impl, - socket_base::wait_type w, boost::system::error_code& ec) - { - switch (w) - { - case socket_base::wait_read: - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_write: - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_error: - socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); - break; - default: - ec = boost::asio::error::invalid_argument; - break; - } - - return ec; - } - - // Asynchronously wait for the socket to become ready to read, ready to - // write, or to have pending error conditions. - template <typename Handler, typename IoExecutor> - void async_wait(base_implementation_type& impl, - socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_wait_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_wait")); - - int op_type; - switch (w) - { - case socket_base::wait_read: - op_type = reactor::read_op; - break; - case socket_base::wait_write: - op_type = reactor::write_op; - break; - case socket_base::wait_error: - op_type = reactor::except_op; - break; - default: - p.p->ec_ = boost::asio::error::invalid_argument; - reactor_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - return; - } - - start_op(impl, op_type, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Send the given data to the peer. - template <typename ConstBufferSequence> - size_t send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence> bufs(buffers); - - return socket_ops::sync_send(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be sent without blocking. - size_t send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template <typename ConstBufferSequence, typename Handler, typename IoExecutor> - void async_send(base_implementation_type& impl, - const ConstBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_send_op< - ConstBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, - buffers, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence>::all_empty(buffers))); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template <typename Handler, typename IoExecutor> - void async_send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data from the peer. Returns the number of bytes received. - template <typename MutableBufferSequence> - size_t receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - return socket_ops::sync_recv(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be received without blocking. - size_t receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recv_op_ext< - MutableBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, - buffers, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (flags & socket_base::message_out_of_band) == 0, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence>::all_empty(buffers))); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive(null_buffers)")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data with associated flags. Returns the number of bytes - // received. - template <typename MutableBufferSequence> - size_t receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - return socket_ops::sync_recvmsg(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), in_flags, out_flags, ec); - } - - // Wait until data can be received without blocking. - size_t receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags& out_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvmsg_op_ext< - MutableBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, buffers, - in_flags, out_flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags")); - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (in_flags & socket_base::message_out_of_band) == 0, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - -protected: - // Open a new socket implementation. - BOOST_ASIO_DECL boost::system::error_code do_open( - base_implementation_type& impl, int af, - int type, int protocol, boost::system::error_code& ec); - - // Assign a native socket to a socket implementation. - BOOST_ASIO_DECL boost::system::error_code do_assign( - base_implementation_type& impl, int type, - const native_handle_type& native_socket, boost::system::error_code& ec); - - // Start the asynchronous read or write operation. - BOOST_ASIO_DECL void start_op(base_implementation_type& impl, int op_type, - reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); - - // Start the asynchronous accept operation. - BOOST_ASIO_DECL void start_accept_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, bool peer_is_open); - - // Start the asynchronous connect operation. - BOOST_ASIO_DECL void start_connect_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, - const socket_addr_type* addr, size_t addrlen); - - // The selector that performs event demultiplexing for the service. - reactor& reactor_; - - // Cached success value to avoid accessing category singleton. - const boost::system::error_code success_ec_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#if defined(BOOST_ASIO_HEADER_ONLY) -# include <boost/asio/detail/impl/reactive_socket_service_base_ext.ipp> -#endif // defined(BOOST_ASIO_HEADER_ONLY) - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - // && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext_local.hpp deleted file mode 100644 index a71fce5..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_base_ext_local.hpp +++ /dev/null @@ -1,524 +0,0 @@ -// -// detail/reactive_socket_service_base_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) \ - && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#include <boost/asio/buffer.hpp> -#include <boost/asio/error.hpp> -#include <boost/asio/execution_context.hpp> -#include <boost/asio/socket_base.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/reactive_null_buffers_op.hpp> -#include <boost/asio/detail/reactive_socket_recv_op_ext_local.hpp> -#include <boost/asio/detail/reactive_socket_recvmsg_op_ext_local.hpp> -#include <boost/asio/detail/reactive_socket_send_op.hpp> -#include <boost/asio/detail/reactive_wait_op.hpp> -#include <boost/asio/detail/reactor.hpp> -#include <boost/asio/detail/reactor_op.hpp> -#include <boost/asio/detail/socket_holder.hpp> -#include <boost/asio/detail/socket_ops_ext_local.hpp> -#include <boost/asio/detail/socket_types.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -class reactive_socket_service_base_ext_local -{ -public: - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct base_implementation_type - { - // The native socket representation. - socket_type socket_; - - // The current state of the socket. - socket_ops::state_type state_; - - // Per-descriptor data used by the reactor. - reactor::per_descriptor_data reactor_data_; - }; - - // Constructor. - BOOST_ASIO_DECL reactive_socket_service_base_ext_local(execution_context& context); - - // Destroy all user-defined handler objects owned by the service. - BOOST_ASIO_DECL void base_shutdown(); - - // Construct a new socket implementation. - BOOST_ASIO_DECL void construct(base_implementation_type& impl); - - // Move-construct a new socket implementation. - BOOST_ASIO_DECL void base_move_construct(base_implementation_type& impl, - base_implementation_type& other_impl); - - // Move-assign from another socket implementation. - BOOST_ASIO_DECL void base_move_assign(base_implementation_type& impl, - reactive_socket_service_base_ext_local& other_service, - base_implementation_type& other_impl); - - // Destroy a socket implementation. - BOOST_ASIO_DECL void destroy(base_implementation_type& impl); - - // Determine whether the socket is open. - bool is_open(const base_implementation_type& impl) const - { - return impl.socket_ != invalid_socket; - } - - // Destroy a socket implementation. - BOOST_ASIO_DECL boost::system::error_code close( - base_implementation_type& impl, boost::system::error_code& ec); - - // Release ownership of the socket. - BOOST_ASIO_DECL socket_type release( - base_implementation_type& impl, boost::system::error_code& ec); - - // Get the native socket representation. - native_handle_type native_handle(base_implementation_type& impl) - { - return impl.socket_; - } - - // Cancel all operations associated with the socket. - BOOST_ASIO_DECL boost::system::error_code cancel( - base_implementation_type& impl, boost::system::error_code& ec); - - // Determine whether the socket is at the out-of-band data mark. - bool at_mark(const base_implementation_type& impl, - boost::system::error_code& ec) const - { - return socket_ops::sockatmark(impl.socket_, ec); - } - - // Determine the number of bytes available for reading. - std::size_t available(const base_implementation_type& impl, - boost::system::error_code& ec) const - { - return socket_ops::available(impl.socket_, ec); - } - - // Place the socket into the state where it will listen for new connections. - boost::system::error_code listen(base_implementation_type& impl, - int backlog, boost::system::error_code& ec) - { - socket_ops::listen(impl.socket_, backlog, ec); - return ec; - } - - // Perform an IO control command on the socket. - template <typename IO_Control_Command> - boost::system::error_code io_control(base_implementation_type& impl, - IO_Control_Command& command, boost::system::error_code& ec) - { - socket_ops::ioctl(impl.socket_, impl.state_, command.name(), - static_cast<ioctl_arg_type*>(command.data()), ec); - return ec; - } - - // Gets the non-blocking mode of the socket. - bool non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::user_set_non_blocking) != 0; - } - - // Sets the non-blocking mode of the socket. - boost::system::error_code non_blocking(base_implementation_type& impl, - bool mode, boost::system::error_code& ec) - { - socket_ops::set_user_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Gets the non-blocking mode of the native socket implementation. - bool native_non_blocking(const base_implementation_type& impl) const - { - return (impl.state_ & socket_ops::internal_non_blocking) != 0; - } - - // Sets the non-blocking mode of the native socket implementation. - boost::system::error_code native_non_blocking(base_implementation_type& impl, - bool mode, boost::system::error_code& ec) - { - socket_ops::set_internal_non_blocking(impl.socket_, impl.state_, mode, ec); - return ec; - } - - // Wait for the socket to become ready to read, ready to write, or to have - // pending error conditions. - boost::system::error_code wait(base_implementation_type& impl, - socket_base::wait_type w, boost::system::error_code& ec) - { - switch (w) - { - case socket_base::wait_read: - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_write: - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - break; - case socket_base::wait_error: - socket_ops::poll_error(impl.socket_, impl.state_, -1, ec); - break; - default: - ec = boost::asio::error::invalid_argument; - break; - } - - return ec; - } - - // Asynchronously wait for the socket to become ready to read, ready to - // write, or to have pending error conditions. - template <typename Handler, typename IoExecutor> - void async_wait(base_implementation_type& impl, - socket_base::wait_type w, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_wait_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_wait")); - - int op_type; - switch (w) - { - case socket_base::wait_read: - op_type = reactor::read_op; - break; - case socket_base::wait_write: - op_type = reactor::write_op; - break; - case socket_base::wait_error: - op_type = reactor::except_op; - break; - default: - p.p->ec_ = boost::asio::error::invalid_argument; - reactor_.post_immediate_completion(p.p, is_continuation); - p.v = p.p = 0; - return; - } - - start_op(impl, op_type, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Send the given data to the peer. - template <typename ConstBufferSequence> - size_t send(base_implementation_type& impl, - const ConstBufferSequence& buffers, - socket_base::message_flags flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence> bufs(buffers); - - return socket_ops::sync_send(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be sent without blocking. - size_t send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template <typename ConstBufferSequence, typename Handler, typename IoExecutor> - void async_send(base_implementation_type& impl, - const ConstBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_send_op< - ConstBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, - buffers, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence>::all_empty(buffers))); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template <typename Handler, typename IoExecutor> - void async_send(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data from the peer. Returns the number of bytes received. - template <typename MutableBufferSequence> - size_t receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - return socket_ops::sync_recv(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec); - } - - // Wait until data can be received without blocking. - size_t receive(base_implementation_type& impl, const null_buffers&, - socket_base::message_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recv_op_ext_local< - MutableBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, - buffers, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (flags & socket_base::message_out_of_band) == 0, - ((impl.state_ & socket_ops::stream_oriented) - && buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence>::all_empty(buffers))); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive(null_buffers)")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive some data with associated flags. Returns the number of bytes - // received. - template <typename MutableBufferSequence> - size_t receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, - socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - return socket_ops::sync_recvmsg(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), in_flags, out_flags, ec); - } - - // Wait until data can be received without blocking. - size_t receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags, - socket_base::message_flags& out_flags, boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received - // must be valid for the lifetime of the asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive_with_flags(base_implementation_type& impl, - const MutableBufferSequence& buffers, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvmsg_op_ext_local< - MutableBufferSequence, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, buffers, - in_flags, out_flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags")); - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, - (in_flags & socket_base::message_out_of_band) == 0, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive_with_flags(base_implementation_type& impl, - const null_buffers&, socket_base::message_flags in_flags, - socket_base::message_flags& out_flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_with_flags(null_buffers)")); - - // Clear out_flags, since we cannot give it any other sensible value when - // performing a null_buffers operation. - out_flags = 0; - - start_op(impl, - (in_flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - -protected: - // Open a new socket implementation. - BOOST_ASIO_DECL boost::system::error_code do_open( - base_implementation_type& impl, int af, - int type, int protocol, boost::system::error_code& ec); - - // Assign a native socket to a socket implementation. - BOOST_ASIO_DECL boost::system::error_code do_assign( - base_implementation_type& impl, int type, - const native_handle_type& native_socket, boost::system::error_code& ec); - - // Start the asynchronous read or write operation. - BOOST_ASIO_DECL void start_op(base_implementation_type& impl, int op_type, - reactor_op* op, bool is_continuation, bool is_non_blocking, bool noop); - - // Start the asynchronous accept operation. - BOOST_ASIO_DECL void start_accept_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, bool peer_is_open); - - // Start the asynchronous connect operation. - BOOST_ASIO_DECL void start_connect_op(base_implementation_type& impl, - reactor_op* op, bool is_continuation, - const socket_addr_type* addr, size_t addrlen); - - // The selector that performs event demultiplexing for the service. - reactor& reactor_; - - // Cached success value to avoid accessing category singleton. - const boost::system::error_code success_ec_; -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#if defined(BOOST_ASIO_HEADER_ONLY) -# include <boost/asio/detail/impl/reactive_socket_service_base_ext_local.ipp> -#endif // defined(BOOST_ASIO_HEADER_ONLY) - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - // && !defined(BOOST_ASIO_WINDOWS_RUNTIME) - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext.hpp deleted file mode 100644 index 7254ccd..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext.hpp +++ /dev/null @@ -1,508 +0,0 @@ -// -// detail/reactive_socket_service_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) - -#include <boost/asio/buffer.hpp> -#include <boost/asio/error.hpp> -#include <boost/asio/execution_context.hpp> -#include <boost/asio/socket_base.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/noncopyable.hpp> -#include <boost/asio/detail/reactive_null_buffers_op.hpp> -#include <boost/asio/detail/reactive_socket_accept_op.hpp> -#include <boost/asio/detail/reactive_socket_connect_op.hpp> -#include <boost/asio/detail/reactive_socket_recvfrom_op_ext.hpp> -#include <boost/asio/detail/reactive_socket_sendto_op.hpp> -#include <boost/asio/detail/reactive_socket_service_base_ext.hpp> -#include <boost/asio/detail/reactor.hpp> -#include <boost/asio/detail/reactor_op.hpp> -#include <boost/asio/detail/socket_holder.hpp> -#include <boost/asio/detail/socket_ops.hpp> -#include <boost/asio/detail/socket_types.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename Protocol> -class reactive_socket_service_ext : - public execution_context_service_base<reactive_socket_service_ext<Protocol> >, - public reactive_socket_service_base_ext -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct implementation_type : - reactive_socket_service_base_ext::base_implementation_type - { - // Default constructor. - implementation_type() - : protocol_(endpoint_type().protocol()) - { - } - - // The protocol associated with the socket. - protocol_type protocol_; - }; - - // Constructor. - reactive_socket_service_ext(execution_context& context) - : execution_context_service_base< - reactive_socket_service_ext<Protocol> >(context), - reactive_socket_service_base_ext(context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type& impl, - reactive_socket_service_base_ext& other_service, - implementation_type& other_impl) - { - this->base_move_assign(impl, other_service, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-construct a new socket implementation from another protocol type. - template <typename Protocol1> - void converting_move_construct(implementation_type& impl, - reactive_socket_service_ext<Protocol1>&, - typename reactive_socket_service_ext< - Protocol1>::implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = protocol_type(other_impl.protocol_); - other_impl.protocol_ = typename Protocol1::endpoint().protocol(); - } - - // Open a new socket implementation. - boost::system::error_code open(implementation_type& impl, - const protocol_type& protocol, boost::system::error_code& ec) - { - if (!do_open(impl, protocol.family(), - protocol.type(), protocol.protocol(), ec)) - impl.protocol_ = protocol; - return ec; - } - - // Assign a native socket to a socket implementation. - boost::system::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - boost::system::error_code& ec) - { - if (!do_assign(impl, protocol.type(), native_socket, ec)) - impl.protocol_ = protocol; - return ec; - } - - // Get the native socket representation. - native_handle_type native_handle(implementation_type& impl) - { - return impl.socket_; - } - - // Bind the socket to the specified local endpoint. - boost::system::error_code bind(implementation_type& impl, - const endpoint_type& endpoint, boost::system::error_code& ec) - { - socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); - return ec; - } - - // Set a socket option. - template <typename Option> - boost::system::error_code set_option(implementation_type& impl, - const Option& option, boost::system::error_code& ec) - { - socket_ops::setsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), option.size(impl.protocol_), ec); - return ec; - } - - // Set a socket option. - template <typename Option> - boost::system::error_code get_option(const implementation_type& impl, - Option& option, boost::system::error_code& ec) const - { - std::size_t size = option.size(impl.protocol_); - socket_ops::getsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), &size, ec); - if (!ec) - option.resize(impl.protocol_, size); - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - boost::system::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - boost::system::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getpeername(impl.socket_, - endpoint.data(), &addr_len, false, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Disable sends or receives on the socket. - boost::system::error_code shutdown(base_implementation_type& impl, - socket_base::shutdown_type what, boost::system::error_code& ec) - { - socket_ops::shutdown(impl.socket_, what, ec); - return ec; - } - - // Send a datagram to the specified endpoint. Returns the number of bytes - // sent. - template <typename ConstBufferSequence> - size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence> bufs(buffers); - - return socket_ops::sync_sendto(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, - destination.data(), destination.size(), ec); - } - - // Wait until data can be sent without blocking. - size_t send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template <typename ConstBufferSequence, typename Handler, typename IoExecutor> - void async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_sendto_op<ConstBufferSequence, - endpoint_type, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, buffers, - destination, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template <typename Handler, typename IoExecutor> - void async_send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive a datagram with the endpoint of the sender. Returns the number of - // bytes received. - template <typename MutableBufferSequence> - size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - std::size_t addr_len = sender_endpoint.capacity(); - std::size_t bytes_recvd = socket_ops::sync_recvfrom( - impl.socket_, impl.state_, bufs.buffers(), bufs.count(), - flags, sender_endpoint.data(), &addr_len, ec); - - if (!ec) - sender_endpoint.resize(addr_len); - - return bytes_recvd; - } - - // Wait until data can be received without blocking. - size_t receive_from(implementation_type& impl, const null_buffers&, - endpoint_type& sender_endpoint, socket_base::message_flags, - boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received and - // the sender_endpoint object must both be valid for the lifetime of the - // asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvfrom_op_ext<MutableBufferSequence, - endpoint_type, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - int protocol = impl.protocol_.type(); - p.p = new (p.v) op(success_ec_, impl.socket_, protocol, buffers, - sender_endpoint, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive_from(implementation_type& impl, const null_buffers&, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from(null_buffers)")); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Accept a new connection. - template <typename Socket> - boost::system::error_code accept(implementation_type& impl, - Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& ec) - { - // We cannot accept a socket that is already open. - if (peer.is_open()) - { - ec = boost::asio::error::already_open; - return ec; - } - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return ec; - } - - // Start an asynchronous accept. The peer and peer_endpoint objects must be - // valid until the accept's handler is invoked. - template <typename Socket, typename Handler, typename IoExecutor> - void async_accept(implementation_type& impl, Socket& peer, - endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_accept_op<Socket, Protocol, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, peer, - impl.protocol_, peer_endpoint, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, peer.is_open()); - p.v = p.p = 0; - } - -#if defined(BOOST_ASIO_HAS_MOVE) - // Start an asynchronous accept. The peer_endpoint object must be valid until - // the accept's handler is invoked. - template <typename PeerIoExecutor, typename Handler, typename IoExecutor> - void async_move_accept(implementation_type& impl, - const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_move_accept_op<Protocol, - PeerIoExecutor, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, peer_io_ex, impl.socket_, impl.state_, - impl.protocol_, peer_endpoint, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, false); - p.v = p.p = 0; - } -#endif // defined(BOOST_ASIO_HAS_MOVE) - - // Connect the socket to the specified endpoint. - boost::system::error_code connect(implementation_type& impl, - const endpoint_type& peer_endpoint, boost::system::error_code& ec) - { - socket_ops::sync_connect(impl.socket_, - peer_endpoint.data(), peer_endpoint.size(), ec); - return ec; - } - - // Start an asynchronous connect. - template <typename Handler, typename IoExecutor> - void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_connect_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_connect")); - - start_connect_op(impl, p.p, is_continuation, - peer_endpoint.data(), peer_endpoint.size()); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext_local.hpp deleted file mode 100644 index 8ac3265..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactive_socket_service_ext_local.hpp +++ /dev/null @@ -1,508 +0,0 @@ -// -// detail/reactive_socket_service_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// 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 BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#if !defined(BOOST_ASIO_HAS_IOCP) - -#include <boost/asio/buffer.hpp> -#include <boost/asio/error.hpp> -#include <boost/asio/execution_context.hpp> -#include <boost/asio/socket_base.hpp> -#include <boost/asio/detail/buffer_sequence_adapter.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/noncopyable.hpp> -#include <boost/asio/detail/reactive_null_buffers_op.hpp> -#include <boost/asio/detail/reactive_socket_accept_op.hpp> -#include <boost/asio/detail/reactive_socket_connect_op.hpp> -#include <boost/asio/detail/reactive_socket_recvfrom_op_ext_local.hpp> -#include <boost/asio/detail/reactive_socket_sendto_op.hpp> -#include <boost/asio/detail/reactive_socket_service_base_ext_local.hpp> -#include <boost/asio/detail/reactor.hpp> -#include <boost/asio/detail/reactor_op.hpp> -#include <boost/asio/detail/socket_holder.hpp> -#include <boost/asio/detail/socket_ops.hpp> -#include <boost/asio/detail/socket_types.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { - -template <typename Protocol> -class reactive_socket_service_ext_local : - public execution_context_service_base<reactive_socket_service_ext_local<Protocol> >, - public reactive_socket_service_base_ext_local -{ -public: - // The protocol type. - typedef Protocol protocol_type; - - // The endpoint type. - typedef typename Protocol::endpoint endpoint_type; - - // The native type of a socket. - typedef socket_type native_handle_type; - - // The implementation type of the socket. - struct implementation_type : - reactive_socket_service_base_ext_local::base_implementation_type - { - // Default constructor. - implementation_type() - : protocol_(endpoint_type().protocol()) - { - } - - // The protocol associated with the socket. - protocol_type protocol_; - }; - - // Constructor. - reactive_socket_service_ext_local(execution_context& context) - : execution_context_service_base< - reactive_socket_service_ext_local<Protocol> >(context), - reactive_socket_service_base_ext_local(context) - { - } - - // Destroy all user-defined handler objects owned by the service. - void shutdown() - { - this->base_shutdown(); - } - - // Move-construct a new socket implementation. - void move_construct(implementation_type& impl, - implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-assign from another socket implementation. - void move_assign(implementation_type& impl, - reactive_socket_service_base_ext_local& other_service, - implementation_type& other_impl) - { - this->base_move_assign(impl, other_service, other_impl); - - impl.protocol_ = other_impl.protocol_; - other_impl.protocol_ = endpoint_type().protocol(); - } - - // Move-construct a new socket implementation from another protocol type. - template <typename Protocol1> - void converting_move_construct(implementation_type& impl, - reactive_socket_service_ext_local<Protocol1>&, - typename reactive_socket_service_ext_local< - Protocol1>::implementation_type& other_impl) - { - this->base_move_construct(impl, other_impl); - - impl.protocol_ = protocol_type(other_impl.protocol_); - other_impl.protocol_ = typename Protocol1::endpoint().protocol(); - } - - // Open a new socket implementation. - boost::system::error_code open(implementation_type& impl, - const protocol_type& protocol, boost::system::error_code& ec) - { - if (!do_open(impl, protocol.family(), - protocol.type(), protocol.protocol(), ec)) - impl.protocol_ = protocol; - return ec; - } - - // Assign a native socket to a socket implementation. - boost::system::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_handle_type& native_socket, - boost::system::error_code& ec) - { - if (!do_assign(impl, protocol.type(), native_socket, ec)) - impl.protocol_ = protocol; - return ec; - } - - // Get the native socket representation. - native_handle_type native_handle(implementation_type& impl) - { - return impl.socket_; - } - - // Bind the socket to the specified local endpoint. - boost::system::error_code bind(implementation_type& impl, - const endpoint_type& endpoint, boost::system::error_code& ec) - { - socket_ops::bind(impl.socket_, endpoint.data(), endpoint.size(), ec); - return ec; - } - - // Set a socket option. - template <typename Option> - boost::system::error_code set_option(implementation_type& impl, - const Option& option, boost::system::error_code& ec) - { - socket_ops::setsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), option.size(impl.protocol_), ec); - return ec; - } - - // Set a socket option. - template <typename Option> - boost::system::error_code get_option(const implementation_type& impl, - Option& option, boost::system::error_code& ec) const - { - std::size_t size = option.size(impl.protocol_); - socket_ops::getsockopt(impl.socket_, impl.state_, - option.level(impl.protocol_), option.name(impl.protocol_), - option.data(impl.protocol_), &size, ec); - if (!ec) - option.resize(impl.protocol_, size); - return ec; - } - - // Get the local endpoint. - endpoint_type local_endpoint(const implementation_type& impl, - boost::system::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getsockname(impl.socket_, endpoint.data(), &addr_len, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Get the remote endpoint. - endpoint_type remote_endpoint(const implementation_type& impl, - boost::system::error_code& ec) const - { - endpoint_type endpoint; - std::size_t addr_len = endpoint.capacity(); - if (socket_ops::getpeername(impl.socket_, - endpoint.data(), &addr_len, false, ec)) - return endpoint_type(); - endpoint.resize(addr_len); - return endpoint; - } - - // Disable sends or receives on the socket. - boost::system::error_code shutdown(base_implementation_type& impl, - socket_base::shutdown_type what, boost::system::error_code& ec) - { - socket_ops::shutdown(impl.socket_, what, ec); - return ec; - } - - // Send a datagram to the specified endpoint. Returns the number of bytes - // sent. - template <typename ConstBufferSequence> - size_t send_to(implementation_type& impl, const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::const_buffer, - ConstBufferSequence> bufs(buffers); - - return socket_ops::sync_sendto(impl.socket_, impl.state_, - bufs.buffers(), bufs.count(), flags, - destination.data(), destination.size(), ec); - } - - // Wait until data can be sent without blocking. - size_t send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_write(impl.socket_, impl.state_, -1, ec); - - return 0; - } - - // Start an asynchronous send. The data being sent must be valid for the - // lifetime of the asynchronous operation. - template <typename ConstBufferSequence, typename Handler, typename IoExecutor> - void async_send_to(implementation_type& impl, - const ConstBufferSequence& buffers, - const endpoint_type& destination, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_sendto_op<ConstBufferSequence, - endpoint_type, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, buffers, - destination, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to")); - - start_op(impl, reactor::write_op, p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Start an asynchronous wait until data can be sent without blocking. - template <typename Handler, typename IoExecutor> - void async_send_to(implementation_type& impl, const null_buffers&, - const endpoint_type&, socket_base::message_flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_send_to(null_buffers)")); - - start_op(impl, reactor::write_op, p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Receive a datagram with the endpoint of the sender. Returns the number of - // bytes received. - template <typename MutableBufferSequence> - size_t receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - boost::system::error_code& ec) - { - buffer_sequence_adapter<boost::asio::mutable_buffer, - MutableBufferSequence> bufs(buffers); - - std::size_t addr_len = sender_endpoint.capacity(); - std::size_t bytes_recvd = socket_ops::sync_recvfrom( - impl.socket_, impl.state_, bufs.buffers(), bufs.count(), - flags, sender_endpoint.data(), &addr_len, ec); - - if (!ec) - sender_endpoint.resize(addr_len); - - return bytes_recvd; - } - - // Wait until data can be received without blocking. - size_t receive_from(implementation_type& impl, const null_buffers&, - endpoint_type& sender_endpoint, socket_base::message_flags, - boost::system::error_code& ec) - { - // Wait for socket to become ready. - socket_ops::poll_read(impl.socket_, impl.state_, -1, ec); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - return 0; - } - - // Start an asynchronous receive. The buffer for the data being received and - // the sender_endpoint object must both be valid for the lifetime of the - // asynchronous operation. - template <typename MutableBufferSequence, - typename Handler, typename IoExecutor> - void async_receive_from(implementation_type& impl, - const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, Handler& handler, - const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_recvfrom_op_ext_local<MutableBufferSequence, - endpoint_type, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - int protocol = impl.protocol_.type(); - p.p = new (p.v) op(success_ec_, impl.socket_, protocol, buffers, - sender_endpoint, flags, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from")); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, true, false); - p.v = p.p = 0; - } - - // Wait until data can be received without blocking. - template <typename Handler, typename IoExecutor> - void async_receive_from(implementation_type& impl, const null_buffers&, - endpoint_type& sender_endpoint, socket_base::message_flags flags, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_null_buffers_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_receive_from(null_buffers)")); - - // Reset endpoint since it can be given no sensible value at this time. - sender_endpoint = endpoint_type(); - - start_op(impl, - (flags & socket_base::message_out_of_band) - ? reactor::except_op : reactor::read_op, - p.p, is_continuation, false, false); - p.v = p.p = 0; - } - - // Accept a new connection. - template <typename Socket> - boost::system::error_code accept(implementation_type& impl, - Socket& peer, endpoint_type* peer_endpoint, boost::system::error_code& ec) - { - // We cannot accept a socket that is already open. - if (peer.is_open()) - { - ec = boost::asio::error::already_open; - return ec; - } - - std::size_t addr_len = peer_endpoint ? peer_endpoint->capacity() : 0; - socket_holder new_socket(socket_ops::sync_accept(impl.socket_, - impl.state_, peer_endpoint ? peer_endpoint->data() : 0, - peer_endpoint ? &addr_len : 0, ec)); - - // On success, assign new connection to peer socket object. - if (new_socket.get() != invalid_socket) - { - if (peer_endpoint) - peer_endpoint->resize(addr_len); - peer.assign(impl.protocol_, new_socket.get(), ec); - if (!ec) - new_socket.release(); - } - - return ec; - } - - // Start an asynchronous accept. The peer and peer_endpoint objects must be - // valid until the accept's handler is invoked. - template <typename Socket, typename Handler, typename IoExecutor> - void async_accept(implementation_type& impl, Socket& peer, - endpoint_type* peer_endpoint, Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_accept_op<Socket, Protocol, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, impl.state_, peer, - impl.protocol_, peer_endpoint, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, peer.is_open()); - p.v = p.p = 0; - } - -#if defined(BOOST_ASIO_HAS_MOVE) - // Start an asynchronous accept. The peer_endpoint object must be valid until - // the accept's handler is invoked. - template <typename PeerIoExecutor, typename Handler, typename IoExecutor> - void async_move_accept(implementation_type& impl, - const PeerIoExecutor& peer_io_ex, endpoint_type* peer_endpoint, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_move_accept_op<Protocol, - PeerIoExecutor, Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, peer_io_ex, impl.socket_, impl.state_, - impl.protocol_, peer_endpoint, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_accept")); - - start_accept_op(impl, p.p, is_continuation, false); - p.v = p.p = 0; - } -#endif // defined(BOOST_ASIO_HAS_MOVE) - - // Connect the socket to the specified endpoint. - boost::system::error_code connect(implementation_type& impl, - const endpoint_type& peer_endpoint, boost::system::error_code& ec) - { - socket_ops::sync_connect(impl.socket_, - peer_endpoint.data(), peer_endpoint.size(), ec); - return ec; - } - - // Start an asynchronous connect. - template <typename Handler, typename IoExecutor> - void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, - Handler& handler, const IoExecutor& io_ex) - { - bool is_continuation = - boost_asio_handler_cont_helpers::is_continuation(handler); - - // Allocate and construct an operation to wrap the handler. - typedef reactive_socket_connect_op<Handler, IoExecutor> op; - typename op::ptr p = { boost::asio::detail::addressof(handler), - op::ptr::allocate(handler), 0 }; - p.p = new (p.v) op(success_ec_, impl.socket_, handler, io_ex); - - BOOST_ASIO_HANDLER_CREATION((reactor_.context(), *p.p, "socket", - &impl, impl.socket_, "async_connect")); - - start_connect_op(impl, p.p, is_continuation, - peer_endpoint.data(), peer_endpoint.size()); - p.v = p.p = 0; - } -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#endif // !defined(BOOST_ASIO_HAS_IOCP) - -#endif // BOOST_ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp b/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp deleted file mode 100644 index 697cd9f..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactor_op_ext.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// -// detail/reactor_op_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP -#define BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/reactor_op.hpp> - -namespace boost { -namespace asio { -namespace detail { - -class reactor_op_ext - : public reactor_op -{ -public: - // The destination address - boost::asio::ip::address da_; - - reactor_op_ext(const boost::system::error_code& success_ec, - perform_func_type perform_func, func_type complete_func) - : reactor_op(success_ec, perform_func, complete_func) - { - } -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#endif // BOOST_ASIO_DETAIL_REACTOR_OP_EXT_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp deleted file mode 100644 index 3d9ae5f..0000000 --- a/implementation/helper/1.76/boost/asio/detail/reactor_op_ext_local.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// detail/reactor_op_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (c) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_REACTOR_OP_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_REACTOR_OP_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/reactor_op.hpp> - -namespace boost { -namespace asio { -namespace detail { - -class reactor_op_ext_local - : public reactor_op -{ -public: - // Credentials - std::uint32_t uid_; - std::uint32_t gid_; - - reactor_op_ext_local(const boost::system::error_code& success_ec, - perform_func_type perform_func, func_type complete_func) - : reactor_op(success_ec, perform_func, complete_func) - { - } -}; - -} // namespace detail -} // namespace asio -} // namespace boost - -#endif // BOOST_ASIO_DETAIL_REACTOR_OP_EXT_LOCAL_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/socket_ops_ext.hpp b/implementation/helper/1.76/boost/asio/detail/socket_ops_ext.hpp deleted file mode 100644 index 9285fed..0000000 --- a/implementation/helper/1.76/boost/asio/detail/socket_ops_ext.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// detail/socket_ops_ext.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_HPP -#define BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/socket_ops.hpp> - -namespace boost { -namespace asio { -namespace detail { -namespace socket_ops { - -BOOST_ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs, - size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, - boost::asio::ip::address& da); - -BOOST_ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state, - buf* bufs, size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, boost::asio::ip::address& da); - -#if defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL void complete_iocp_recvfrom( - const weak_cancel_token_type& cancel_token, - boost::system::error_code& ec, - boost::asio::ip::address& da); - -#else // defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL bool non_blocking_recvfrom(socket_type s, - buf* bufs, size_t count, int flags, - socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, size_t& bytes_transferred, - boost::asio::ip::address& da); - -#endif // defined(BOOST_ASIO_HAS_IOCP) - -} // namespace socket_ops -} // namespace detail -} // namespace asio -} // namespace boost - - -#if defined(BOOST_ASIO_HEADER_ONLY) -# include <boost/asio/detail/impl/socket_ops_ext.ipp> -#endif // defined(BOOST_ASIO_HEADER_ONLY) - -#endif // BOOST_EXT_ASIO_DETAIL_SOCKET_OPS_HPP diff --git a/implementation/helper/1.76/boost/asio/detail/socket_ops_ext_local.hpp b/implementation/helper/1.76/boost/asio/detail/socket_ops_ext_local.hpp deleted file mode 100644 index a937bb6..0000000 --- a/implementation/helper/1.76/boost/asio/detail/socket_ops_ext_local.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// -// detail/socket_ops_ext_local.hpp -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// Copyright (C) 2016-2019 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_boost or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_HPP -#define BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_HPP - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) - -#include <boost/asio/detail/config.hpp> - -#include <boost/system/error_code.hpp> -#include <boost/asio/detail/memory.hpp> -#include <boost/asio/detail/socket_types.hpp> - -#include <boost/asio/detail/push_options.hpp> - -namespace boost { -namespace asio { -namespace detail { -namespace socket_ops { - -BOOST_ASIO_DECL signed_size_type recv(socket_type s, buf* bufs, - size_t count, int flags, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid); - -BOOST_ASIO_DECL size_t sync_recv(socket_type s, state_type state, buf* bufs, - size_t count, int flags, bool all_empty, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid); - -#if defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL void complete_iocp_recv(state_type state, - const weak_cancel_token_type& cancel_token, bool all_empty, - boost::system::error_code& ec, size_t bytes_transferred, - std::uint32_t& uid, std::uint32_t& gid); - -#else // defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL bool non_blocking_recv(socket_type s, - buf* bufs, size_t count, int flags, bool is_stream, - boost::system::error_code& ec, size_t& bytes_transferred, - std::uint32_t& uid, std::uint32_t& gid); - -#endif // defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL signed_size_type recvfrom(socket_type s, buf* bufs, - size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid); - -BOOST_ASIO_DECL size_t sync_recvfrom(socket_type s, state_type state, - buf* bufs, size_t count, int flags, socket_addr_type* addr, - std::size_t* addrlen, boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid); - -#if defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL void complete_iocp_recvfrom( - const weak_cancel_token_type& cancel_token, - boost::system::error_code& ec, - std::uint32_t& uid, std::uint32_t& gid); - -#else // defined(BOOST_ASIO_HAS_IOCP) - -BOOST_ASIO_DECL bool non_blocking_recvfrom(socket_type s, - buf* bufs, size_t count, int flags, - socket_addr_type* addr, std::size_t* addrlen, - boost::system::error_code& ec, size_t& bytes_transferred, - std::uint32_t& uid, std::uint32_t& gid); - -#endif // defined(BOOST_ASIO_HAS_IOCP) - - -} // namespace socket_ops -} // namespace detail -} // namespace asio -} // namespace boost - -#include <boost/asio/detail/pop_options.hpp> - -#if defined(BOOST_ASIO_HEADER_ONLY) -# include <boost/asio/detail/impl/socket_ops_ext_local.ipp> -#endif // defined(BOOST_ASIO_HEADER_ONLY) - -#endif // BOOST_ASIO_DETAIL_SOCKET_OPS_EXT_LOCAL_HPP |