+
+private:
+ class initiate_async_send
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_send(basic_raw_socket* self)
+ : self_(self)
+ {
+ }
+
+ executor_type get_executor() const BOOST_ASIO_NOEXCEPT
+ {
+ return self_->get_executor();
+ }
+
+ template <typename WriteHandler, typename ConstBufferSequence>
+ void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
+ const ConstBufferSequence& buffers,
+ socket_base::message_flags flags) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a WriteHandler.
+ BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+ detail::non_const_lvalue<WriteHandler> handler2(handler);
+ self_->impl_.get_service().async_send(
+ self_->impl_.get_implementation(), buffers, flags,
+ handler2.value, self_->impl_.get_implementation_executor());
+ }
+
+ private:
+ basic_raw_socket* self_;
+ };
+
+ class initiate_async_send_to
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_send_to(basic_raw_socket* self)
+ : self_(self)
+ {
+ }
+
+ executor_type get_executor() const BOOST_ASIO_NOEXCEPT
+ {
+ return self_->get_executor();
+ }
+
+ template <typename WriteHandler, typename ConstBufferSequence>
+ void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
+ const ConstBufferSequence& buffers, const endpoint_type& destination,
+ socket_base::message_flags flags) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a WriteHandler.
+ BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
+
+ detail::non_const_lvalue<WriteHandler> handler2(handler);
+ self_->impl_.get_service().async_send_to(
+ self_->impl_.get_implementation(), buffers, destination, flags,
+ handler2.value, self_->impl_.get_implementation_executor());
+ }
+
+ private:
+ basic_raw_socket* self_;
+ };
+
+ class initiate_async_receive
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_receive(basic_raw_socket* self)
+ : self_(self)
+ {
+ }
+
+ executor_type get_executor() const BOOST_ASIO_NOEXCEPT
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReadHandler, typename MutableBufferSequence>
+ void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
+ const MutableBufferSequence& buffers,
+ socket_base::message_flags flags) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a ReadHandler.
+ BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+ detail::non_const_lvalue<ReadHandler> handler2(handler);
+ self_->impl_.get_service().async_receive(
+ self_->impl_.get_implementation(), buffers, flags,
+ handler2.value, self_->impl_.get_implementation_executor());
+ }
+
+ private:
+ basic_raw_socket* self_;
+ };
+
+ class initiate_async_receive_from
+ {
+ public:
+ typedef Executor executor_type;
+
+ explicit initiate_async_receive_from(basic_raw_socket* self)
+ : self_(self)
+ {
+ }
+
+ executor_type get_executor() const BOOST_ASIO_NOEXCEPT
+ {
+ return self_->get_executor();
+ }
+
+ template <typename ReadHandler, typename MutableBufferSequence>
+ void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
+ const MutableBufferSequence& buffers, endpoint_type* sender_endpoint,
+ socket_base::message_flags flags) const
+ {
+ // If you get an error on the following line it means that your handler
+ // does not meet the documented type requirements for a ReadHandler.
+ BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
+
+ detail::non_const_lvalue<ReadHandler> handler2(handler);
+ self_->impl_.get_service().async_receive_from(
+ self_->impl_.get_implementation(), buffers, *sender_endpoint, flags,
+ handler2.value, self_->impl_.get_implementation_executor());
+ }
+
+ private:
+ basic_raw_socket* self_;
+ };