LLFIO
v2.00
|
A handle type which can be supplied to poll()
.
More...
#include "byte_io_handle.hpp"
Friends | |
result< size_t > | poll (span< poll_what > out, span< pollable_handle * > handles, span< const poll_what > query, deadline d) noexcept |
Polls a list of pollable handles awaiting a change in state. More... | |
A handle type which can be supplied to poll()
.
|
friend |
Polls a list of pollable handles awaiting a change in state.
is_kernel_handle()
receive poll_what::not_pollable
. out | An array of poll_what set with the results of the poll. The bits in this array are NOT cleared by this operation, so you need to clear this manualy before the call if that's what you need. |
handles | An array of pointers to handle . Individual pointers can be null if you want to skip them. |
query | An array of poll_what to check. |
d | An optional timeout. |
Note that the maximum number of handles which can be passed to this function is 1024 (the platform syscall may refuse even that many). Note that this function is O(N)
to handle count, so more than a few hundred is a bad idea in any case. If you need to wait on more handles than this, you need to implement a byte_io_multiplexer
for your platform.
The sizes of out
, handles
and query
must be the same, or an error is returned.
pipe_handle
is a pollable_handle
, but on Windows it is not. Also, on Windows, you cannot mix socket handles from different networking stacks in the same poll.