Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes
CASocketGroupEpoll Class Reference

List of all members.

Public Member Functions

 CASocketGroupEpoll (bool bWrite)
 ~CASocketGroupEpoll ()
SINT32 setPoolForWrite (bool bWrite)
SINT32 add (CASocket &s, void *datapointer)
 Adds the socket s to the socket group.
SINT32 add (CAMuxSocket &s, void *datapointer)
 Adds the socket s to the socket group.
SINT32 remove (CASocket &s)
SINT32 remove (CAMuxSocket &s)
SINT32 select ()
SINT32 select (UINT32 time_ms)
 Waits for events on the sockets.
bool isSignaled (void *datapointer)
void * getFirstSignaledSocketData ()
void * getNextSignaledSocketData ()

Private Attributes

SINT32 m_hEPFD
struct epoll_event * m_pEvents
struct epoll_event * m_pEpollEvent
SINT32 m_iNumOfReadyFD
SINT32 m_iAktSignaledSocket
CAMutex m_csFD_SET

Constructor & Destructor Documentation

References m_hEPFD, m_pEpollEvent, and m_pEvents.


Member Function Documentation

SINT32 CASocketGroupEpoll::add ( CASocket s,
void *  datapointer 
)

Adds the socket s to the socket group.

Additional one can set a parameter datapointer, which is assoziated with the socke s

References E_SUCCESS, CASocket::getSocket(), CAMutex::lock(), m_csFD_SET, m_hEPFD, m_pEpollEvent, SOCKET, and CAMutex::unlock().

Referenced by CAFirstMix::doUserLogin_internal(), CAFirstMixB::loop(), and CAFirstMixA::loop().

SINT32 CASocketGroupEpoll::add ( CAMuxSocket s,
void *  datapointer 
)

Adds the socket s to the socket group.

Additional one can set a parameter datapointer, which is assoziated with the socke s

References E_SUCCESS, CAMuxSocket::getSocket(), CAMutex::lock(), m_csFD_SET, m_hEPFD, m_pEpollEvent, SOCKET, and CAMutex::unlock().

bool CASocketGroupEpoll::isSignaled ( void *  datapointer)
Remarks:
temporarlly removed - can be enabled agian than requested...

References m_iNumOfReadyFD, and m_pEvents.

Referenced by CAChain::isSignaledInSocketGroup(), CAFirstMixB::loop(), CAFirstMixA::loop(), and CAFirstMixA::sendToUsers().

Waits for events on the sockets.

If after ms milliseconds no event occurs, E_TIMEDOUT is returned

Parameters:
time_ms- maximum milliseconds to wait
Return values:
E_TIMEDOUT,ifother ms milliseconds no event occurs
E_UNKNOWN,ifan error occured
Returns:
number of read/writeable sockets

References E_TIMEDOUT, E_UNKNOWN, CAMutex::lock(), m_csFD_SET, m_hEPFD, m_iNumOfReadyFD, m_pEvents, MAX_POLLFD, and CAMutex::unlock().

References E_SUCCESS, and m_pEpollEvent.

Referenced by CASocketGroupEpoll().


Member Data Documentation

Referenced by add(), remove(), and select().

struct epoll_event* CASocketGroupEpoll::m_pEpollEvent [private]
struct epoll_event* CASocketGroupEpoll::m_pEvents [private]