File Descriptor functions.
Namespace: | dmFileDescriptor |
Include: | #include <dmsdk/dlib/file_descriptor.h> |
ENUMS | |
---|---|
PollEvent | Poll events |
STRUCTS | |
---|---|
struct Poller | Poller |
FUNCTIONS | |
---|---|
void PollerClearEvent(Poller* poller, PollEvent event, int fd) | Clear event from poller. |
bool PollerHasEvent(Poller* poller, PollEvent event, int fd) | Check if event exists for file descriptor |
void PollerReset(Poller* spoller) | Reset poller. |
void PollerSetEvent(Poller* poller, PollEvent event, int fd) | Set file descriptor event to poll for |
Result Wait(Poller* poller, int timeout) | Wait for event |
void PollerClearEvent(Poller* poller, PollEvent event, int fd)
Clear event from poller.
PARAMETERS
Poller* |
poller |
Poller |
PollEvent |
event |
Event to clear |
int |
fd |
File descriptor to clear |
RETURNS
void |
bool PollerHasEvent(Poller* poller, PollEvent event, int fd)
Check if event exists for file descriptor
PARAMETERS
Poller* |
poller |
Poller |
PollEvent |
event |
Event to check |
int |
fd |
File descriptor to clear |
RETURNS
bool |
True if event exists. |
void PollerReset(Poller* spoller)
Reset poller.
PARAMETERS
Poller* |
spoller |
Poller |
RETURNS
void |
void PollerSetEvent(Poller* poller, PollEvent event, int fd)
Set file descriptor event to poll for
PARAMETERS
Poller* |
poller |
Poller |
PollEvent |
event |
Event to set |
int |
fd |
File descriptor to clear |
RETURNS
void |
Result Wait(Poller* poller, int timeout)
Wait for event
PARAMETERS
Poller* |
poller |
Poller |
int |
timeout |
Timeout. For blocking pass -1. (milliseconds) |
RETURNS
Result |
Non-negative value on success, 0 on timeout and -1 on error with errno set to indicate the error |
TYPE
struct Poller
Poller
Poll events
EVENT_READ |
|
EVENT_WRITE |
|
EVENT_ERROR |