Class coro::epoll_owner

Class List > coro > epoll_owner

RAII wrapping for epoll file descriptor.

  • #include <linux.h>

Public Functions

Type Name
epoll_owner () noexcept
create a fd with epoll . Throw if the function fails.
epoll_owner (const epoll_owner &) = delete
epoll_owner (epoll_owner &&) = delete
epoll_owner & operator= (const epoll_owner &) = delete
epoll_owner & operator= (epoll_owner &&) = delete
void remove (uint64_t fd)
unbind the fd to epoll
auto submit (int64_t fd, epoll_event & req) noexcept
return temporary awaitable object for given event
void try_add (uint64_t fd, epoll_event & req) noexcept
bind the fd to epoll
ptrdiff_t wait (uint32_t wait_ms, gsl::span< epoll_event > list) noexcept
fetch all events for the given kqeueue descriptor
~epoll_owner () noexcept
close the current epoll file descriptor

Public Functions Documentation

function epoll_owner [1/3]

coro::epoll_owner::epoll_owner () noexcept

See also: kqeueue

Exception:

  • system_error

function epoll_owner [2/3]

coro::epoll_owner::epoll_owner (
    const epoll_owner &
) = delete

function epoll_owner [3/3]

coro::epoll_owner::epoll_owner (
    epoll_owner &&
) = delete

function operator=

epoll_owner & coro::epoll_owner::operator= (
    const epoll_owner &
) = delete

function operator=

epoll_owner & coro::epoll_owner::operator= (
    epoll_owner &&
) = delete

function remove

void coro::epoll_owner::remove (
    uint64_t fd
) 

Parameters:

  • fd

See also: epoll_ctl

function submit

inline auto coro::epoll_owner::submit (
    int64_t fd,
    epoll_event & req
) noexcept

Parameters:

  • req input for change operation

See also: change There is no guarantee of reusage of returned awaiter object When it is awaited, and req.udata is null(0), the value is set to coroutine_handle<void>

auto edge_in_async(epoll_owner& ep, int64_t fd) -> frame_t {
    epoll_event req{};
    req.events = EPOLLET | EPOLLIN | EPOLLONESHOT;
    req.data.ptr = nullptr;
    co_await ep.submit(fd, req);
}

function try_add

void coro::epoll_owner::try_add (
    uint64_t fd,
    epoll_event & req
) noexcept

Parameters:

  • fd
  • req

See also: epoll_ctl

Exception:

  • system_error

function wait

ptrdiff_t coro::epoll_owner::wait (
    uint32_t wait_ms,
    gsl::span< epoll_event > list
) noexcept

Parameters:

  • wait_ms millisecond to wait
  • list

Returns:

ptrdiff_t

See also: epoll_wait

Exception:

  • system_error Timeout is not an error for this function

function ~epoll_owner

coro::epoll_owner::~epoll_owner () noexcept

The documentation for this class was generated from the following file interface/coroutine/linux.h