11 #ifndef ASIO_DETAIL_DEV_POLL_REACTOR_HPP 12 #define ASIO_DETAIL_DEV_POLL_REACTOR_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_DEV_POLL) 24 #include <sys/devpoll.h> 43 class dev_poll_reactor
47 enum op_types { read_op = 0, write_op = 1,
48 connect_op = 1, except_op = 2, max_ops = 3 };
51 struct per_descriptor_data
77 ASIO_DECL int register_internal_descriptor(
79 per_descriptor_data& descriptor_data, reactor_op* op);
83 per_descriptor_data& target_descriptor_data,
84 per_descriptor_data& source_descriptor_data);
89 io_service_.post_immediate_completion(op, is_continuation);
95 per_descriptor_data&, reactor_op* op,
96 bool is_continuation,
bool allow_speculative);
106 per_descriptor_data&,
bool closing);
110 ASIO_DECL void deregister_internal_descriptor(
114 template <
typename Time_Traits>
115 void add_timer_queue(timer_queue<Time_Traits>& queue);
118 template <
typename Time_Traits>
119 void remove_timer_queue(timer_queue<Time_Traits>& queue);
123 template <
typename Time_Traits>
124 void schedule_timer(timer_queue<Time_Traits>& queue,
125 const typename Time_Traits::time_type& time,
126 typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op);
130 template <
typename Time_Traits>
131 std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
132 typename timer_queue<Time_Traits>::per_timer_data& timer,
133 std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
136 ASIO_DECL void run(
bool block, op_queue<operation>& ops);
144 ASIO_DECL static int do_dev_poll_create();
147 ASIO_DECL void do_add_timer_queue(timer_queue_base& queue);
150 ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue);
164 ASIO_DECL ::pollfd& add_pending_event_change(
int descriptor);
176 std::vector< ::pollfd> pending_event_changes_;
179 hash_map<int, std::size_t> pending_event_change_index_;
185 reactor_op_queue<socket_type> op_queue_[max_ops];
188 timer_queue_set timer_queues_;
200 #if defined(ASIO_HEADER_ONLY) 202 #endif // defined(ASIO_HEADER_ONLY) 204 #endif // defined(ASIO_HAS_DEV_POLL) 206 #endif // ASIO_DETAIL_DEV_POLL_REACTOR_HPP
Provides core I/O functionality.
class task_io_service io_service_impl
pipe_select_interrupter select_interrupter
fork_event
Fork-related event notifications.
bool is_continuation(Context &context)
Class to represent an error code value.