#include <Poller.h>
Inherits Object.
Inherited by Core.
Inheritance diagram for Poller:


Public Member Functions | |
| Poller () | |
| virtual | ~Poller () |
| int | add (Socket *sock) |
| int | remove (Socket *sock) |
| int | poll () |
Private Types | |
| typedef set< Socket * > | SocketList |
Private Attributes | |
| SocketList | _sockets |
| int | _maxSocket |
| fd_set | _allSet |
| timeval | _tv |
Definition at line 28 of file Poller.h.
typedef set<Socket *> Poller::SocketList [private] |
| Poller::Poller | ( | ) |
Definition at line 23 of file Poller.cpp.
References _allSet, _maxSocket, _tv, DEBUG, and POLLER_SESSION_TIMEOUT.
| Poller::~Poller | ( | ) | [virtual] |
Definition at line 35 of file Poller.cpp.
| int Poller::add | ( | Socket * | sock | ) |
Definition at line 39 of file Poller.cpp.
References _allSet, _maxSocket, _sockets, DEBUG, ERROR, MSG_NULL_POINTER, OK, and Socket::socket().
| int Poller::remove | ( | Socket * | sock | ) |
Definition at line 58 of file Poller.cpp.
References _allSet, _sockets, DEBUG, ERROR, MSG_NULL_POINTER, MSG_POLLER_UNKNOWN_CONNECTION, OK, and Socket::socket().
Referenced by poll().
| int Poller::poll | ( | ) |
Definition at line 79 of file Poller.cpp.
References _allSet, _maxSocket, Socket::_socket, _sockets, TcpConnection::_status, _tv, TcpServer::accept(), DEBUG, ERROR, ERROR_BACKTRACE(), FAILED(), Connection::isAlive(), MSG_NO_INTERFACE, MSG_POLLER_SELECT, OK, remove(), TcpConnection::setConnected(), Connection::setDataReady(), Connection::setDead(), TCP_CONNECTION_STATUS_DISCONNECTED, and TCP_SERVER.
Referenced by Core::dispatch().
SocketList Poller::_sockets [private] |
int Poller::_maxSocket [private] |
fd_set Poller::_allSet [private] |
struct timeval Poller::_tv [private] |
1.5.1