11 #ifndef ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP 12 #define ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if !defined(ASIO_HAS_IOCP) \ 21 && !defined(ASIO_WINDOWS_RUNTIME) 128 template <
typename IO_Control_Command>
174 template <
typename ConstBufferSequence>
176 const ConstBufferSequence&
buffers,
180 ConstBufferSequence> bufs(buffers);
183 bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
198 template <
typename ConstBufferSequence,
typename Handler>
200 const ConstBufferSequence&
buffers,
208 typename op::ptr p = { asio::detail::addressof(handler),
210 sizeof(op), handler), 0 };
211 p.p =
new (p.v) op(impl.
socket_, buffers, flags, handler);
215 start_op(impl, reactor::write_op, p.p, is_continuation,
true,
218 ConstBufferSequence>::all_empty(buffers)));
223 template <
typename Handler>
232 typename op::ptr p = { asio::detail::addressof(handler),
234 sizeof(op), handler), 0 };
235 p.p =
new (p.v) op(handler);
238 &impl,
"async_send(null_buffers)"));
240 start_op(impl, reactor::write_op, p.p, is_continuation,
false,
false);
245 template <
typename MutableBufferSequence>
247 const MutableBufferSequence&
buffers,
251 MutableBufferSequence> bufs(buffers);
254 bufs.buffers(), bufs.count(), flags, bufs.all_empty(), ec);
269 template <
typename MutableBufferSequence,
typename Handler>
271 const MutableBufferSequence&
buffers,
279 typename op::ptr p = { asio::detail::addressof(handler),
281 sizeof(op), handler), 0 };
282 p.p =
new (p.v) op(impl.
socket_, impl.
state_, buffers, flags, handler);
287 (flags & socket_base::message_out_of_band)
288 ? reactor::except_op : reactor::read_op,
289 p.p, is_continuation,
290 (flags & socket_base::message_out_of_band) == 0,
293 MutableBufferSequence>::all_empty(buffers)));
298 template <
typename Handler>
307 typename op::ptr p = { asio::detail::addressof(handler),
309 sizeof(op), handler), 0 };
310 p.p =
new (p.v) op(handler);
313 &impl,
"async_receive(null_buffers)"));
316 (flags & socket_base::message_out_of_band)
317 ? reactor::except_op : reactor::read_op,
318 p.p, is_continuation,
false,
false);
324 template <
typename MutableBufferSequence>
326 const MutableBufferSequence&
buffers,
331 MutableBufferSequence> bufs(buffers);
334 bufs.buffers(), bufs.count(), in_flags, out_flags, ec);
354 template <
typename MutableBufferSequence,
typename Handler>
364 typename op::ptr p = { asio::detail::addressof(handler),
366 sizeof(op), handler), 0 };
367 p.p =
new (p.v) op(impl.
socket_, buffers, in_flags, out_flags, handler);
370 &impl,
"async_receive_with_flags"));
373 (in_flags & socket_base::message_out_of_band)
374 ? reactor::except_op : reactor::read_op,
375 p.p, is_continuation,
376 (in_flags & socket_base::message_out_of_band) == 0,
false);
381 template <
typename Handler>
391 typename op::ptr p = { asio::detail::addressof(handler),
393 sizeof(op), handler), 0 };
394 p.p =
new (p.v) op(handler);
397 "async_receive_with_flags(null_buffers)"));
404 (in_flags & socket_base::message_out_of_band)
405 ? reactor::except_op : reactor::read_op,
406 p.p, is_continuation,
false,
false);
427 reactor_op* op,
bool is_continuation,
bool peer_is_open);
443 #if defined(ASIO_HEADER_ONLY) 445 #endif // defined(ASIO_HEADER_ONLY) 447 #endif // !defined(ASIO_HAS_IOCP) 450 #endif // ASIO_DETAIL_REACTIVE_SOCKET_SERVICE_BASE_HPP int message_flags
Bitmask type for flags that can be passed to send and receive operations.
bool set_user_non_blocking(socket_type s, state_type &state, bool value, asio::error_code &ec)
ASIO_DECL void start_op(base_implementation_type &impl, int op_type, reactor_op *op, bool is_continuation, bool is_non_blocking, bool noop)
bool at_mark(const base_implementation_type &impl, asio::error_code &ec) const
size_t send(base_implementation_type &impl, const null_buffers &, socket_base::message_flags, asio::error_code &ec)
socket_type native_handle_type
Provides core I/O functionality.
size_t sync_recv(socket_type s, state_type state, buf *bufs, size_t count, int flags, bool all_empty, asio::error_code &ec)
Holds a buffer that cannot be modified.
ASIO_DECL void shutdown_service()
bool sockatmark(socket_type s, asio::error_code &ec)
size_t sync_send(socket_type s, state_type state, const buf *bufs, size_t count, int flags, bool all_empty, asio::error_code &ec)
ASIO_DECL void destroy(base_implementation_type &impl)
size_t receive(base_implementation_type &impl, const null_buffers &, socket_base::message_flags, asio::error_code &ec)
asio::error_code listen(base_implementation_type &impl, int backlog, asio::error_code &ec)
ASIO_DECL reactive_socket_service_base(asio::io_service &io_service)
socket_ops::state_type state_
int poll_read(socket_type s, state_type state, asio::error_code &ec)
size_t receive(base_implementation_type &impl, const MutableBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec)
int listen(socket_type s, int backlog, asio::error_code &ec)
sockaddr socket_addr_type
size_t send(base_implementation_type &impl, const ConstBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec)
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)
ASIO_DECL asio::error_code do_assign(base_implementation_type &impl, int type, const native_handle_type &native_socket, asio::error_code &ec)
asio::error_code io_control(base_implementation_type &impl, IO_Control_Command &command, asio::error_code &ec)
ASIO_DECL void start_connect_op(base_implementation_type &impl, reactor_op *op, bool is_continuation, const socket_addr_type *addr, size_t addrlen)
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 MutableBufferSequence & buffers
ASIO_DECL void base_move_construct(base_implementation_type &impl, base_implementation_type &other_impl)
int ioctl(socket_type s, state_type &state, int cmd, ioctl_arg_type *arg, asio::error_code &ec)
ASIO_DECL void construct(base_implementation_type &impl)
ASIO_DECL asio::error_code do_open(base_implementation_type &impl, int af, int type, int protocol, asio::error_code &ec)
size_t receive_with_flags(base_implementation_type &impl, const MutableBufferSequence &buffers, socket_base::message_flags in_flags, socket_base::message_flags &out_flags, asio::error_code &ec)
native_handle_type native_handle(base_implementation_type &impl)
Holds a buffer that can be modified.
class select_reactor reactor
int poll_write(socket_type s, state_type state, asio::error_code &ec)
shutdown_type
Different ways a socket may be shutdown.
size_t available(socket_type s, asio::error_code &ec)
bool is_continuation(Context &context)
bool is_open(const base_implementation_type &impl) const
size_t receive_with_flags(base_implementation_type &impl, const null_buffers &, socket_base::message_flags, socket_base::message_flags &out_flags, asio::error_code &ec)
Class to represent an error code value.
size_t sync_recvmsg(socket_type s, state_type state, buf *bufs, size_t count, int in_flags, int &out_flags, asio::error_code &ec)
ASIO_DECL void base_move_assign(base_implementation_type &impl, reactive_socket_service_base &other_service, base_implementation_type &other_impl)
void async_receive(base_implementation_type &impl, const null_buffers &, socket_base::message_flags flags, Handler &handler)
void async_send(base_implementation_type &impl, const ConstBufferSequence &buffers, socket_base::message_flags flags, Handler &handler)
ASIO_DECL void start_accept_op(base_implementation_type &impl, reactor_op *op, bool is_continuation, bool peer_is_open)
ASIO_DECL asio::error_code close(base_implementation_type &impl, asio::error_code &ec)
bool native_non_blocking(const base_implementation_type &impl) const
asio::error_code non_blocking(base_implementation_type &impl, bool mode, asio::error_code &ec)
void async_receive(base_implementation_type &impl, const MutableBufferSequence &buffers, socket_base::message_flags flags, Handler &handler)
void * allocate(std::size_t s, Handler &h)
int shutdown(socket_type s, int what, asio::error_code &ec)
ASIO_DECL asio::error_code cancel(base_implementation_type &impl, asio::error_code &ec)
bool non_blocking(const base_implementation_type &impl) const
asio::error_code native_non_blocking(base_implementation_type &impl, bool mode, asio::error_code &ec)
#define ASIO_HANDLER_CREATION(args)
bool set_internal_non_blocking(socket_type s, state_type &state, bool value, asio::error_code &ec)
std::size_t available(const base_implementation_type &impl, asio::error_code &ec) const
asio::error_code shutdown(base_implementation_type &impl, socket_base::shutdown_type what, asio::error_code &ec)
reactor::per_descriptor_data reactor_data_
void async_send(base_implementation_type &impl, const null_buffers &, socket_base::message_flags, Handler &handler)