MySQL 8.0.39
Source Code Documentation
net::poll_io_service Class Reference

io_service based on the poll() system-call. More...

#include <poll_io_service.h>

Inheritance diagram for net::poll_io_service:
[legend]

Classes

class  FdInterests
 

Public Member Functions

 ~poll_io_service () override
 
bool is_open () const noexcept
 
stdx::expected< void, std::error_code > open () noexcept override
 open the io-service. More...
 
stdx::expected< void, std::error_code > close ()
 
stdx::expected< void, std::error_code > add_fd_interest (native_handle_type fd, impl::socket::wait_type event) override
 
stdx::expected< void, std::error_code > remove_fd (native_handle_type fd) override
 remove fd from interest set. More...
 
std::optional< int32_t > interest (native_handle_type fd) const
 get current fd-interest. More...
 
stdx::expected< fd_event, std::error_code > pop_event ()
 
stdx::expected< fd_event, std::error_code > update_fd_events (std::chrono::milliseconds timeout)
 
stdx::expected< fd_event, std::error_code > poll_one (std::chrono::milliseconds timeout) override
 
void on_notify ()
 
void notify () override
 
stdx::expected< void, std::error_code > remove_fd_interest (native_handle_type fd, short event)
 remove interest of event from fd. More...
 
- Public Member Functions inherited from net::IoServiceBase
virtual ~IoServiceBase ()=default
 

Static Public Member Functions

static stdx::expected< short, std::error_code > poll_event_from_wait_type (impl::socket::wait_type event)
 

Static Public Attributes

static constexpr const short kSettableEvents = POLLIN | POLLOUT
 
static constexpr const short kAlwaysEnabledEvents = POLLHUP | POLLERR
 
static constexpr const short kAllEvents
 

Private Attributes

std::pair< impl::socket::native_handle_type, impl::socket::native_handle_typewakeup_fds_ {impl::socket::kInvalidSocket, impl::socket::kInvalidSocket}
 
FdInterests fd_interests_
 
std::list< fd_eventtriggered_events_
 
std::mutex mtx_
 

Additional Inherited Members

- Public Types inherited from net::IoServiceBase
using native_handle_type = impl::socket::native_handle_type
 

Detailed Description

io_service based on the poll() system-call.

Constructor & Destructor Documentation

◆ ~poll_io_service()

net::poll_io_service::~poll_io_service ( )
inlineoverride

Member Function Documentation

◆ add_fd_interest()

stdx::expected< void, std::error_code > net::poll_io_service::add_fd_interest ( native_handle_type  fd,
impl::socket::wait_type  event 
)
inlineoverridevirtual

Implements net::IoServiceBase.

◆ close()

stdx::expected< void, std::error_code > net::poll_io_service::close ( )
inline

◆ interest()

std::optional< int32_t > net::poll_io_service::interest ( native_handle_type  fd) const
inline

get current fd-interest.

Returns
fd-interest as bitmask of raw POLL* flags

◆ is_open()

bool net::poll_io_service::is_open ( ) const
inlinenoexcept

◆ notify()

void net::poll_io_service::notify ( )
inlineoverridevirtual

Implements net::IoServiceBase.

◆ on_notify()

void net::poll_io_service::on_notify ( )
inline

◆ open()

stdx::expected< void, std::error_code > net::poll_io_service::open ( )
inlineoverridevirtualnoexcept

open the io-service.

MUST be called before any of the other functions is called.

may fail if out of file-descriptors.

Returns
an std::error_code on error

Implements net::IoServiceBase.

◆ poll_event_from_wait_type()

static stdx::expected< short, std::error_code > net::poll_io_service::poll_event_from_wait_type ( impl::socket::wait_type  event)
inlinestatic

◆ poll_one()

stdx::expected< fd_event, std::error_code > net::poll_io_service::poll_one ( std::chrono::milliseconds  timeout)
inlineoverridevirtual

Implements net::IoServiceBase.

◆ pop_event()

stdx::expected< fd_event, std::error_code > net::poll_io_service::pop_event ( )
inline

◆ remove_fd()

stdx::expected< void, std::error_code > net::poll_io_service::remove_fd ( native_handle_type  fd)
inlineoverridevirtual

remove fd from interest set.

Implements net::IoServiceBase.

◆ remove_fd_interest()

stdx::expected< void, std::error_code > net::poll_io_service::remove_fd_interest ( native_handle_type  fd,
short  event 
)
inline

remove interest of event from fd.

mtx_ must be held, when called.

◆ update_fd_events()

stdx::expected< fd_event, std::error_code > net::poll_io_service::update_fd_events ( std::chrono::milliseconds  timeout)
inline

Member Data Documentation

◆ fd_interests_

FdInterests net::poll_io_service::fd_interests_
private

◆ kAllEvents

constexpr const short net::poll_io_service::kAllEvents
staticconstexpr
Initial value:
=
static constexpr const short kAlwaysEnabledEvents
Definition: poll_io_service.h:57
static constexpr const short kSettableEvents
Definition: poll_io_service.h:56

◆ kAlwaysEnabledEvents

constexpr const short net::poll_io_service::kAlwaysEnabledEvents = POLLHUP | POLLERR
staticconstexpr

◆ kSettableEvents

constexpr const short net::poll_io_service::kSettableEvents = POLLIN | POLLOUT
staticconstexpr

◆ mtx_

std::mutex net::poll_io_service::mtx_
private

◆ triggered_events_

std::list<fd_event> net::poll_io_service::triggered_events_
private

◆ wakeup_fds_


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