Poller

The Poller class is responsible for periodically checking for waiting data on a set of file descriptors. More...

Publicly inherits QObject.

Public Methods

Poller( );
voiddereg( Connection* conn, int fd );
voidreg( Connection* conn, int fd );
~Poller( );

Protected Methods

virtual voidtimerEvent( QTimerEvent* e );

Private Data Members

QList<Pair>_fdList;

Detailed Documentation

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.

Public Methods Documentation

Poller ( );

Create a new poller.

void dereg ( Connection* conn, int fd );

Deregister a connection/file descriptor pair. The Poller will no longer query the status of the file descriptor.

void reg ( Connection* conn, int fd );

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.

~Poller ( );

Destroy the poller.

Protected Methods Documentation

virtual void timerEvent ( QTimerEvent* e );

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.


Return to Index.
Automatically generated on Aug 11 23:32