11 #ifndef ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP 12 #define ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if !defined(ASIO_WINDOWS) \ 21 && !defined(ASIO_WINDOWS_RUNTIME) \ 22 && !defined(__CYGWIN__) 71 reactor::per_descriptor_data reactor_data_;
98 const native_handle_type& native_descriptor,
104 return impl.descriptor_ != -1;
114 return impl.descriptor_;
125 template <
typename IO_Control_Command>
130 command.name(),
static_cast<ioctl_arg_type*
>(command.data()), ec);
145 impl.descriptor_, impl.state_, mode, ec);
160 impl.descriptor_, impl.state_, mode, ec);
165 template <
typename ConstBufferSequence>
170 ConstBufferSequence> bufs(buffers);
173 bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
188 template <
typename ConstBufferSequence,
typename Handler>
190 const ConstBufferSequence&
buffers, Handler& handler)
197 typename op::ptr p = { asio::detail::addressof(handler),
199 sizeof(op), handler), 0 };
200 p.p =
new (p.v) op(impl.descriptor_, buffers, handler);
204 start_op(impl, reactor::write_op, p.p, is_continuation,
true,
206 ConstBufferSequence>::all_empty(buffers));
211 template <
typename Handler>
220 typename op::ptr p = { asio::detail::addressof(handler),
222 sizeof(op), handler), 0 };
223 p.p =
new (p.v) op(handler);
226 &impl,
"async_write_some(null_buffers)"));
228 start_op(impl, reactor::write_op, p.p, is_continuation,
false,
false);
233 template <
typename MutableBufferSequence>
238 MutableBufferSequence> bufs(buffers);
241 bufs.buffers(), bufs.count(), bufs.all_empty(), ec);
256 template <
typename MutableBufferSequence,
typename Handler>
258 const MutableBufferSequence&
buffers, Handler& handler)
265 typename op::ptr p = { asio::detail::addressof(handler),
267 sizeof(op), handler), 0 };
268 p.p =
new (p.v) op(impl.descriptor_, buffers, handler);
272 start_op(impl, reactor::read_op, p.p, is_continuation,
true,
274 MutableBufferSequence>::all_empty(buffers));
279 template <
typename Handler>
288 typename op::ptr p = { asio::detail::addressof(handler),
290 sizeof(op), handler), 0 };
291 p.p =
new (p.v) op(handler);
294 &impl,
"async_read_some(null_buffers)"));
296 start_op(impl, reactor::read_op, p.p, is_continuation,
false,
false);
314 #if defined(ASIO_HEADER_ONLY) 316 #endif // defined(ASIO_HEADER_ONLY) 318 #endif // !defined(ASIO_WINDOWS) 322 #endif // ASIO_DETAIL_REACTIVE_DESCRIPTOR_SERVICE_HPP ASIO_DECL bool set_internal_non_blocking(int d, state_type &state, bool value, asio::error_code &ec)
native_handle_type native_handle(const implementation_type &impl) const
void async_write_some(implementation_type &impl, const null_buffers &, Handler &handler)
void async_write_some(implementation_type &impl, const ConstBufferSequence &buffers, Handler &handler)
asio::error_code native_non_blocking(implementation_type &impl, bool mode, asio::error_code &ec)
Provides core I/O functionality.
Holds a buffer that cannot be modified.
asio::error_code non_blocking(implementation_type &impl, bool mode, asio::error_code &ec)
ASIO_DECL std::size_t sync_write(int d, state_type state, const buf *bufs, std::size_t count, bool all_empty, asio::error_code &ec)
size_t read_some(implementation_type &impl, const null_buffers &, asio::error_code &ec)
size_t read_some(implementation_type &impl, const MutableBufferSequence &buffers, asio::error_code &ec)
ASIO_DECL asio::error_code close(implementation_type &impl, asio::error_code &ec)
size_t write_some(implementation_type &impl, const ConstBufferSequence &buffers, asio::error_code &ec)
size_t write_some(implementation_type &impl, const null_buffers &, asio::error_code &ec)
ASIO_DECL void move_construct(implementation_type &impl, implementation_type &other_impl)
ASIO_DECL asio::error_code cancel(implementation_type &impl, asio::error_code &ec)
const MutableBufferSequence & buffers
ASIO_DECL void move_assign(implementation_type &impl, reactive_descriptor_service &other_service, implementation_type &other_impl)
Holds a buffer that can be modified.
class select_reactor reactor
void async_read_some(implementation_type &impl, const null_buffers &, Handler &handler)
ASIO_DECL std::size_t sync_read(int d, state_type state, buf *bufs, std::size_t count, bool all_empty, asio::error_code &ec)
ASIO_DECL bool set_user_non_blocking(int d, state_type &state, bool value, asio::error_code &ec)
ASIO_DECL int poll_write(int d, state_type state, asio::error_code &ec)
ASIO_DECL int poll_read(int d, state_type state, asio::error_code &ec)
bool is_continuation(Context &context)
Class to represent an error code value.
bool native_non_blocking(const implementation_type &impl) const
asio::error_code io_control(implementation_type &impl, IO_Control_Command &command, asio::error_code &ec)
bool non_blocking(const implementation_type &impl) const
ASIO_DECL asio::error_code assign(implementation_type &impl, const native_handle_type &native_descriptor, asio::error_code &ec)
ASIO_DECL void shutdown_service()
void async_read_some(implementation_type &impl, const MutableBufferSequence &buffers, Handler &handler)
void * allocate(std::size_t s, Handler &h)
ASIO_DECL void construct(implementation_type &impl)
friend class reactive_descriptor_service
ASIO_DECL void destroy(implementation_type &impl)
#define ASIO_HANDLER_CREATION(args)
ASIO_DECL native_handle_type release(implementation_type &impl)
ASIO_DECL int ioctl(int d, state_type &state, long cmd, ioctl_arg_type *arg, asio::error_code &ec)
bool is_open(const implementation_type &impl) const