uvw 2.12.1
|
The PollHandle handle. More...
#include <poll.h>
Public Member Functions | |
bool | init () |
Initializes the handle. | |
void | start (Flags< Event > flags) |
Starts polling the file descriptor. | |
void | start (Event event) |
Starts polling the file descriptor. | |
void | stop () |
Stops polling the file descriptor. | |
![]() | |
HandleCategory | category () const noexcept |
Gets the category of the handle. | |
HandleType | type () const noexcept |
Gets the type of the handle. | |
bool | active () const noexcept |
Checks if the handle is active. | |
bool | closing () const noexcept |
Checks if a handle is closing or closed. | |
void | close () noexcept |
Request handle to be closed. | |
void | reference () noexcept |
Reference the given handle. | |
void | unreference () noexcept |
Unreference the given handle. | |
bool | referenced () const noexcept |
Checks if the given handle referenced. | |
std::size_t | size () const noexcept |
Returns the size of the underlying handle type. | |
int | sendBufferSize () |
Gets the size of the send buffer used for the socket. | |
bool | sendBufferSize (int value) |
Sets the size of the send buffer used for the socket. | |
int | recvBufferSize () |
Gets the size of the receive buffer used for the socket. | |
bool | recvBufferSize (int value) |
Sets the size of the receive buffer used for the socket. | |
OSFileDescriptor | fd () const |
Gets the platform dependent file descriptor equivalent. | |
![]() | |
std::shared_ptr< R > | data () const |
Gets user-defined data. uvw won't use this field in any case. | |
void | data (std::shared_ptr< void > uData) |
Sets arbitrary data. uvw won't use this field in any case. | |
![]() | |
Loop & | loop () const noexcept |
Gets the loop from which the resource was originated. | |
const uv_poll_t * | raw () const noexcept |
Gets the underlying raw data structure. | |
uv_poll_t * | raw () noexcept |
Gets the underlying raw data structure. | |
![]() | |
Connection< E > | on (Listener< E > f) |
Registers a long-lived listener with the event emitter. | |
Connection< E > | once (Listener< E > f) |
Registers a short-lived listener with the event emitter. | |
void | erase (Connection< E > conn) noexcept |
Disconnects a listener from the event emitter. | |
void | clear () noexcept |
Disconnects all the listeners for the given event type. | |
void | clear () noexcept |
Disconnects all the listeners. | |
bool | empty () const noexcept |
Checks if there are listeners registered for the specific event. | |
bool | empty () const noexcept |
Checks if there are listeners registered with the event emitter. | |
Additional Inherited Members | |
![]() | |
![]() | |
static std::shared_ptr< PollHandle > | create (Args &&...args) |
Creates a new resource of the given type. | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() |
The PollHandle handle.
Poll handles are used to watch file descriptors for readability, writability and disconnection.
To create a PollHandle
through a Loop
, arguments follow:
int
file descriptorOSSocketHandle
socket descriptorSee the official documentation for further details.
bool uvw::PollHandle::init | ( | ) |
Initializes the handle.
void uvw::PollHandle::start | ( | Event | event | ) |
Starts polling the file descriptor.
Available flags are:
PollHandle::Event::READABLE
PollHandle::Event::WRITABLE
PollHandle::Event::DISCONNECT
PollHandle::Event::PRIORITIZED
As soon as an event is detected, a PollEvent is emitted by the handle.
It could happen that ErrorEvent events are emitted while running.
Calling more than once this method will update the flags to which the caller is interested.
event | The event to which the caller is interested. |
void uvw::PollHandle::start | ( | Flags< Event > | flags | ) |
Starts polling the file descriptor.
Available flags are:
PollHandle::Event::READABLE
PollHandle::Event::WRITABLE
PollHandle::Event::DISCONNECT
PollHandle::Event::PRIORITIZED
As soon as an event is detected, a PollEvent is emitted by the handle.
It could happen that ErrorEvent events are emitted while running.
Calling more than once this method will update the flags to which the caller is interested.
flags | The events to which the caller is interested. |