The Poller class is responsible for periodically checking for waiting data on a set of file descriptors. More...
Publicly inherits QObject.
Poller | ( ); | |
void | dereg | ( Connection* conn, int fd ); |
void | reg | ( Connection* conn, int fd ); |
~Poller | ( ); |
virtual void | timerEvent | ( QTimerEvent* e ); |
QList<Pair> | _fdList; |
The Poller class is responsible for periodically checking for waiting data on a set of file descriptors.
There is only one, global poller object that handles all of the open file descriptors for the entire application. Connections can register and deregister their file descriptors at any time. Then, every 100ms the poller will check to see if any of the file descriptors have become readable, writable, or had an exception occur. The appropriate connection is then notified of the event.Create a new poller.
Deregister a connection/file descriptor pair. The Poller will no longer query the status of the file descriptor.
Register a connection/file descriptor pair with the Poller. Every 100ms, the Poller will use select to determine if anything interesting has happened to the file descriptor, and it will notify the connection.
Destroy the poller.
Use select() to determine if any of the file descriptors are readable, writable, or an exception has occurred. Notify the appropriate Connection for each type of event.