11 #ifndef ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP 12 #define ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 31 template <
typename MutableBufferSequence,
typename Endpo
int>
36 const MutableBufferSequence&
buffers, Endpoint& endpoint,
40 protocol_type_(protocol_type),
42 sender_endpoint_(endpoint),
50 static_cast<reactive_socket_recvfrom_op_base*>(base));
53 MutableBufferSequence> bufs(o->buffers_);
55 std::size_t addr_len = o->sender_endpoint_.capacity();
57 bufs.buffers(), bufs.count(), o->flags_,
58 o->sender_endpoint_.data(), &addr_len,
61 if (result && !o->
ec_)
62 o->sender_endpoint_.resize(addr_len);
70 MutableBufferSequence buffers_;
71 Endpoint& sender_endpoint_;
75 template <
typename MutableBufferSequence,
typename Endpo
int,
typename Handler>
83 const MutableBufferSequence&
buffers, Endpoint& endpoint,
86 socket, protocol_type, buffers, endpoint, flags,
98 static_cast<reactive_socket_recvfrom_op*>(base));
99 ptr p = { asio::detail::addressof(o->handler_), o, o };
110 handler(o->handler_, o->ec_, o->bytes_transferred_);
111 p.h = asio::detail::addressof(handler.
handler_);
133 #endif // ASIO_DETAIL_REACTIVE_SOCKET_RECVFROM_OP_HPP reactive_socket_recvfrom_op_base(socket_type socket, int protocol_type, const MutableBufferSequence &buffers, Endpoint &endpoint, socket_base::message_flags flags, func_type complete_func)
int message_flags
Bitmask type for flags that can be passed to send and receive operations.
static void do_complete(io_service_impl *owner, operation *base, const asio::error_code &, std::size_t)
#define ASIO_HANDLER_INVOCATION_END
socket_type socket(int af, int type, int protocol, asio::error_code &ec)
reactive_socket_recvfrom_op(socket_type socket, int protocol_type, const MutableBufferSequence &buffers, Endpoint &endpoint, socket_base::message_flags flags, Handler &handler)
asio::basic_streambuf< Allocator > & b
class task_io_service io_service_impl
void invoke(Function &function, Context &context)
const MutableBufferSequence & buffers
Holds a buffer that can be modified.
#define ASIO_HANDLER_INVOCATION_BEGIN(args)
static bool do_perform(reactor_op *base)
Class to represent an error code value.
task_io_service_operation operation
std::size_t bytes_transferred_
#define ASIO_DEFINE_HANDLER_PTR(op)
#define ASIO_HANDLER_COMPLETION(args)
#define ASIO_MOVE_CAST(type)
bool non_blocking_recvfrom(socket_type s, buf *bufs, size_t count, int flags, socket_addr_type *addr, std::size_t *addrlen, asio::error_code &ec, size_t &bytes_transferred)