|
SASC
DVBSoftCAM
|
#include <tools.h>
Public Member Functions | |
| cPoller (int FileHandle=-1, bool Out=false) | |
| bool | Add (int FileHandle, bool Out) |
| bool | Poll (int TimeoutMs=0) |
| cPoller::cPoller | ( | int | FileHandle = -1, |
| bool | Out = false |
||
| ) |
| bool cPoller::Add | ( | int | FileHandle, |
| bool | Out | ||
| ) |
Definition at line 637 of file tools.cpp.
References esyslog, fd, and i.
Referenced by cPoller().
{
if (FileHandle >= 0) {
for (int i = 0; i < numFileHandles; i++) {
if (pfd[i].fd == FileHandle && pfd[i].events == (Out ? POLLOUT : POLLIN))
return true;
}
if (numFileHandles < MaxPollFiles) {
pfd[numFileHandles].fd = FileHandle;
pfd[numFileHandles].events = Out ? POLLOUT : POLLIN;
pfd[numFileHandles].revents = 0;
numFileHandles++;
return true;
}
esyslog("ERROR: too many file handles in cPoller");
}
return false;
}
| bool cPoller::Poll | ( | int | TimeoutMs = 0 | ) |
Definition at line 656 of file tools.cpp.
Referenced by WriteAllOrNothing().
{
if (numFileHandles) {
if (poll(pfd, numFileHandles, TimeoutMs) != 0)
return true; // returns true even in case of an error, to let the caller
// access the file and thus see the error code
}
return false;
}