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

Public Member Functions

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

Private Attributes

EPOLL_HANDLE m_hEPFD
 
struct epoll_event * m_pEvents
 
struct epoll_event * m_pEpollEvent
 
SINT32 m_iNumOfReadyFD
 
SINT32 m_iAktSignaledSocket
 
CAMutexm_pcsFD_SET
 

Constructor & Destructor Documentation

◆ CASocketGroupEpoll()

CASocketGroupEpoll::CASocketGroupEpoll ( bool  bWrite)

◆ ~CASocketGroupEpoll()

CASocketGroupEpoll::~CASocketGroupEpoll ( )

Member Function Documentation

◆ add() [1/4]

SINT32 CASocketGroupEpoll::add ( CASocket s)

Adds the socket s to the socket group.

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

◆ add() [2/4]

SINT32 CASocketGroupEpoll::add ( CAMuxSocket s)

Adds the socket s to the socket group.

References add().

◆ add() [3/4]

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

◆ add() [4/4]

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 socket s

References add(), and CAMuxSocket::getCASocket().

◆ getFirstSignaledSocketData()

void* CASocketGroupEpoll::getFirstSignaledSocketData ( )

◆ getNextSignaledSocketData()

void* CASocketGroupEpoll::getNextSignaledSocketData ( )

◆ isSignaled() [1/4]

bool CASocketGroupEpoll::isSignaled ( CASocket s)

◆ isSignaled() [2/4]

bool CASocketGroupEpoll::isSignaled ( CASocket ps)

◆ isSignaled() [3/4]

bool CASocketGroupEpoll::isSignaled ( CAMuxSocket s)

◆ isSignaled() [4/4]

bool CASocketGroupEpoll::isSignaled ( void *  datapointer)

References data, m_iNumOfReadyFD, and m_pEvents.

◆ remove() [1/2]

SINT32 CASocketGroupEpoll::remove ( CASocket s)

◆ remove() [2/2]

SINT32 CASocketGroupEpoll::remove ( CAMuxSocket s)

◆ select() [1/2]

SINT32 CASocketGroupEpoll::select ( )

◆ select() [2/2]

SINT32 CASocketGroupEpoll::select ( UINT32  time_ms)

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_hEPFD, m_iNumOfReadyFD, m_pcsFD_SET, m_pEvents, MAX_POLLFD, and CAMutex::unlock().

◆ setPoolForWrite()

SINT32 CASocketGroupEpoll::setPoolForWrite ( bool  bWrite)

References E_SUCCESS, and m_pEpollEvent.

Referenced by CASocketGroupEpoll().

Member Data Documentation

◆ m_hEPFD

EPOLL_HANDLE CASocketGroupEpoll::m_hEPFD
private

◆ m_iAktSignaledSocket

SINT32 CASocketGroupEpoll::m_iAktSignaledSocket
private

◆ m_iNumOfReadyFD

SINT32 CASocketGroupEpoll::m_iNumOfReadyFD
private

◆ m_pcsFD_SET

CAMutex* CASocketGroupEpoll::m_pcsFD_SET
private

◆ m_pEpollEvent

struct epoll_event* CASocketGroupEpoll::m_pEpollEvent
private

◆ m_pEvents

struct epoll_event* CASocketGroupEpoll::m_pEvents
private