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

Public Member Functions

 CASocketGroup (bool bWrite)
 ~CASocketGroup ()
SINT32 setPoolForWrite (bool bWrite)
SINT32 add (CASocket &s)
SINT32 add (CAMuxSocket &s)
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)

Private Attributes

fd_set m_fdset
fd_set m_signaled_set
fd_set * m_set_read
fd_set * m_set_write
SINT32 m_max
CAMutex m_csFD_SET

Constructor & Destructor Documentation

◆ CASocketGroup()

CASocketGroup::CASocketGroup ( bool  bWrite)

◆ ~CASocketGroup()

CASocketGroup::~CASocketGroup ( )

References setPoolForWrite().

Member Function Documentation

◆ add() [1/2]

SINT32 CASocketGroup::add ( CASocket s)

◆ add() [2/2]

SINT32 CASocketGroup::add ( CAMuxSocket s)

◆ isSignaled() [1/3]

bool CASocketGroup::isSignaled ( CASocket s)

◆ isSignaled() [2/3]

bool CASocketGroup::isSignaled ( CASocket ps)

◆ isSignaled() [3/3]

bool CASocketGroup::isSignaled ( CAMuxSocket s)

◆ remove() [1/2]

SINT32 CASocketGroup::remove ( CASocket s)

◆ remove() [2/2]

SINT32 CASocketGroup::remove ( CAMuxSocket s)

◆ select() [1/2]

SINT32 CASocketGroup::select ( )

◆ select() [2/2]

SINT32 CASocketGroup::select ( UINT32  time_ms)

Waits for events on the sockets.

If after ms milliseconds no event occurs, E_TIMEDOUT is returned

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

References E_TIMEDOUT, E_UNKNOWN, GET_NET_ERROR, CAMutex::lock(), m_csFD_SET, m_fdset, m_max, m_set_read, m_set_write, m_signaled_set, CAMsg::printMsg(), select(), SOCKET_ERROR, and CAMutex::unlock().

◆ setPoolForWrite()

SINT32 CASocketGroup::setPoolForWrite ( bool  bWrite)

Member Data Documentation

◆ m_csFD_SET

CAMutex CASocketGroup::m_csFD_SET

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

◆ m_fdset

fd_set CASocketGroup::m_fdset

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

◆ m_max

SINT32 CASocketGroup::m_max

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

◆ m_set_read

fd_set* CASocketGroup::m_set_read

Referenced by select(), and setPoolForWrite().

◆ m_set_write

fd_set * CASocketGroup::m_set_write

Referenced by select(), and setPoolForWrite().

◆ m_signaled_set

fd_set CASocketGroup::m_signaled_set