11 #ifndef ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP 12 #define ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 32 template <
typename Socket,
typename Protocol>
38 typename Protocol::endpoint* peer_endpoint, func_type complete_func)
44 peer_endpoint_(peer_endpoint)
51 static_cast<reactive_socket_accept_op_base*>(base));
53 std::size_t addrlen = o->peer_endpoint_ ? o->peer_endpoint_->capacity() : 0;
56 o->state_, o->peer_endpoint_ ? o->peer_endpoint_->data() : 0,
57 o->peer_endpoint_ ? &addrlen : 0, o->
ec_, new_socket);
63 if (o->peer_endpoint_)
64 o->peer_endpoint_->resize(addrlen);
65 if (!o->peer_.assign(o->protocol_, new_socket, o->
ec_))
77 typename Protocol::endpoint* peer_endpoint_;
80 template <
typename Socket,
typename Protocol,
typename Handler>
89 typename Protocol::endpoint* peer_endpoint, Handler& handler)
102 ptr p = { asio::detail::addressof(o->handler_), o, o };
113 handler(o->handler_, o->ec_);
114 p.h = asio::detail::addressof(handler.
handler_);
136 #endif // ASIO_DETAIL_REACTIVE_SOCKET_ACCEPT_OP_HPP
#define ASIO_HANDLER_INVOCATION_END
socket_type socket(int af, int type, int protocol, asio::error_code &ec)
asio::basic_streambuf< Allocator > & b
class task_io_service io_service_impl
void invoke(Function &function, Context &context)
static bool do_perform(reactor_op *base)
#define ASIO_HANDLER_INVOCATION_BEGIN(args)
Class to represent an error code value.
reactive_socket_accept_op(socket_type socket, socket_ops::state_type state, Socket &peer, const Protocol &protocol, typename Protocol::endpoint *peer_endpoint, Handler &handler)
task_io_service_operation operation
reactive_socket_accept_op_base(socket_type socket, socket_ops::state_type state, Socket &peer, const Protocol &protocol, typename Protocol::endpoint *peer_endpoint, func_type complete_func)
#define ASIO_DEFINE_HANDLER_PTR(op)
#define ASIO_HANDLER_COMPLETION(args)
#define ASIO_MOVE_CAST(type)
static void do_complete(io_service_impl *owner, operation *base, const asio::error_code &, std::size_t)
bool non_blocking_accept(socket_type s, state_type state, socket_addr_type *addr, std::size_t *addrlen, asio::error_code &ec, socket_type &new_socket)