11 #ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP 12 #define ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 19 #include "asio/detail/bind_handler.hpp" 20 #include "asio/detail/buffer_sequence_adapter.hpp" 21 #include "asio/detail/fenced_block.hpp" 22 #include "asio/detail/handler_alloc_helpers.hpp" 23 #include "asio/detail/handler_invoke_helpers.hpp" 24 #include "asio/detail/handler_work.hpp" 25 #include "asio/detail/memory.hpp" 26 #include "asio/detail/reactor_op.hpp" 27 #include "asio/detail/socket_ops.hpp" 28 #include "asio/socket_base.hpp" 30 #include "asio/detail/push_options.hpp" 35 template <
typename MutableBufferSequence>
40 socket_type socket,
const MutableBufferSequence& buffers,
44 &reactive_socket_recvmsg_op_base::do_perform, complete_func),
55 static_cast<reactive_socket_recvmsg_op_base*>(base));
58 MutableBufferSequence> bufs(o->buffers_);
60 status result = socket_ops::non_blocking_recvmsg(o->socket_,
61 bufs.buffers(), bufs.count(),
62 o->in_flags_, o->out_flags_,
63 o->ec_, o->bytes_transferred_) ? done : not_done;
65 ASIO_HANDLER_REACTOR_OPERATION((*o,
"non_blocking_recvmsg",
66 o->ec_, o->bytes_transferred_));
73 MutableBufferSequence buffers_;
78 template <
typename MutableBufferSequence,
typename Handler,
typename IoExecutor>
86 socket_type socket,
const MutableBufferSequence& buffers,
89 const IoExecutor& io_ex)
91 success_ec, socket, buffers, in_flags, out_flags,
92 &reactive_socket_recvmsg_op::do_complete),
93 handler_(ASIO_MOVE_CAST(Handler)(handler)),
94 work_(handler_, io_ex)
98 static void do_complete(
void* owner, operation* base,
104 static_cast<reactive_socket_recvmsg_op*>(base));
105 ptr p = { asio::detail::addressof(o->handler_), o, o };
107 ASIO_HANDLER_COMPLETION((*o));
121 handler(o->handler_, o->ec_, o->bytes_transferred_);
122 p.h = asio::detail::addressof(handler.handler_);
129 ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_));
130 w.complete(handler, handler.handler_);
131 ASIO_HANDLER_INVOCATION_END;
143 #include "asio/detail/pop_options.hpp" 145 #endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVMSG_OP_HPP int message_flags
Bitmask type for flags that can be passed to send and receive operations.
Definition: socket_base.hpp:53
Definition: reactive_socket_recvmsg_op.hpp:79
Definition: reactive_socket_recvmsg_op.hpp:36
Definition: buffer_sequence_adapter.hpp:103
Holds a buffer that can be modified.
Definition: buffer.hpp:92
Definition: null_fenced_block.hpp:25
Class to represent an error code value.
Definition: error_code.hpp:80
Definition: reactor_op.hpp:26
Definition: any_io_executor.hpp:28
Definition: bind_handler.hpp:144