LLFIO  v2.00
llfio_v2_xxx::pollable_handle Class Referenceabstract

A handle type which can be supplied to poll(). More...

#include "byte_io_handle.hpp"

Inheritance diagram for llfio_v2_xxx::pollable_handle:
llfio_v2_xxx::byte_socket_handle llfio_v2_xxx::listening_byte_socket_handle llfio_v2_xxx::pipe_handle llfio_v2_xxx::tls_socket_handle llfio_v2_xxx::listening_socket_handle_buffer_types_injector< listening_byte_socket_handle, tls_socket_handle_ptr > llfio_v2_xxx::listening_tls_socket_handle

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...
 

Detailed Description

A handle type which can be supplied to poll().

Friends And Related Function Documentation

◆ poll

result<size_t> poll ( span< poll_what >  out,
span< pollable_handle * >  handles,
span< const poll_what >  query,
deadline  d 
)
friend

Polls a list of pollable handles awaiting a change in state.

Returns
The number of handles with changed state. Handles not is_kernel_handle() receive poll_what::not_pollable.
Parameters
outAn 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.
handlesAn array of pointers to handle. Individual pointers can be null if you want to skip them.
queryAn array of poll_what to check.
dAn optional timeout.
Errors returnable\n Whatever POSIX poll() or Windows WSAPoll() can return.

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.

Note
On POSIX 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.

The documentation for this class was generated from the following file: