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

Public Member Functions

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

Member Function Documentation

◆ add() [1/3]

SINT32 CASocketGroup::add ( CAMuxSocket s)

◆ add() [2/3]

SINT32 CASocketGroup::add ( CASocket s)

◆ add() [3/3]

SINT32 CASocketGroup::add ( SOCKET s)

◆ isSignaled() [1/3]

bool CASocketGroup::isSignaled ( CAMuxSocket s)

◆ isSignaled() [2/3]

bool CASocketGroup::isSignaled ( CASocket s)

◆ isSignaled() [3/3]

bool CASocketGroup::isSignaled ( CASocket ps)

◆ remove() [1/2]

SINT32 CASocketGroup::remove ( CAMuxSocket s)

◆ remove() [2/2]

SINT32 CASocketGroup::remove ( CASocket 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

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, 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
private

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

◆ m_fdset

fd_set CASocketGroup::m_fdset
private

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

◆ m_max

SINT32 CASocketGroup::m_max
private

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

◆ m_set_read

fd_set* CASocketGroup::m_set_read
private

Referenced by select(), and setPoolForWrite().

◆ m_set_write

fd_set * CASocketGroup::m_set_write
private

Referenced by select(), and setPoolForWrite().

◆ m_signaled_set

fd_set CASocketGroup::m_signaled_set
private