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

Public Member Functions

 CASocketList ()
 
 CASocketList (bool bThreadSafe)
 
 ~CASocketList ()
 
SINT32 add (CASocket *pSocket, CASymChannelCipher **pCiphers)
 Add a new channel to the channel-list. More...
 
SINT32 get (HCHANNEL in, CONNECTION *out)
 Gets a copy of an entry form the channel-list. More...
 
CASocketremove (HCHANNEL id)
 
SINT32 clear ()
 
CONNECTIONgetFirst ()
 Gets the first entry of the channel-list. More...
 
CONNECTIONgetNext ()
 Gets the next entry of the channel-list. More...
 
UINT32 getSize ()
 
SINT32 setThreadSafe (bool b)
 
SINT32 addSendMeCounter (HCHANNEL in, SINT32 value)
 

Protected Member Functions

SINT32 increasePool ()
 

Protected Attributes

CONNECTIONLISTm_Connections
 
CONNECTIONLISTm_Pool
 
CONNECTIONLISTm_AktEnumPos
 
t_MEMBLOCKm_Memlist
 
CAMutex cs
 
bool m_bThreadSafe
 
UINT32 m_Size
 

Constructor & Destructor Documentation

◆ CASocketList() [1/2]

CASocketList::CASocketList ( )

◆ CASocketList() [2/2]

CASocketList::CASocketList ( bool  bThreadSafe)

◆ ~CASocketList()

CASocketList::~CASocketList ( )

References clear().

Member Function Documentation

◆ add()

SINT32 CASocketList::add ( CASocket pSocket,
CASymChannelCipher **  pCiphers 
)

Add a new channel to the channel-list.

The id for that channel is randomly choosen.

Parameters
pSocketa CASocket assoziated with the channel
pCiphersan array of CASymCipher assoziated with the channel
Returns
E_SUCCESS if no error occurs E_UNKNOWN otherwise

References cs, connlist::currentSendMeCounter, E_SUCCESS, E_UNKNOWN, getRandom(), increasePool(), CAMutex::lock(), m_bThreadSafe, m_Connections, m_Pool, m_Size, connlist::next, connlist::outChannel, connlist::pCiphers, connlist::pSocket, CAMutex::unlock(), and connlist::upstreamBytes.

Referenced by CALocalProxy::loop().

◆ addSendMeCounter()

SINT32 CASocketList::addSendMeCounter ( HCHANNEL  in,
SINT32  value 
)

◆ clear()

SINT32 CASocketList::clear ( )

◆ get()

SINT32 CASocketList::get ( HCHANNEL  in,
CONNECTION out 
)

Gets a copy of an entry form the channel-list.

Parameters
in- the channel-id for wich the entry is requested
out- the object, that will hold the copy
Returns
true - if the channel was found false - otherwise

References cs, E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_bThreadSafe, m_Connections, connlist::next, connlist::outChannel, and CAMutex::unlock().

Referenced by CALocalProxy::loop().

◆ getFirst()

CONNECTION* CASocketList::getFirst ( )

Gets the first entry of the channel-list.

Returns
the first entry of the channel list (this is not a copy!!)

References m_AktEnumPos, and m_Connections.

Referenced by CALocalProxy::loop().

◆ getNext()

CONNECTION* CASocketList::getNext ( )

Gets the next entry of the channel-list.

Returns
the next entry of the channel list (this is not a copy!!)

References m_AktEnumPos, and connlist::next.

Referenced by CALocalProxy::loop().

◆ getSize()

UINT32 CASocketList::getSize ( )

References m_Size.

◆ increasePool()

SINT32 CASocketList::increasePool ( )
protected

◆ remove()

CASocket * CASocketList::remove ( HCHANNEL  id)

◆ setThreadSafe()

SINT32 CASocketList::setThreadSafe ( bool  b)

References E_SUCCESS, and m_bThreadSafe.

Referenced by CASocketList().

Member Data Documentation

◆ cs

CAMutex CASocketList::cs
protected

Referenced by add(), addSendMeCounter(), get(), and remove().

◆ m_AktEnumPos

CONNECTIONLIST* CASocketList::m_AktEnumPos
protected

◆ m_bThreadSafe

bool CASocketList::m_bThreadSafe
protected

◆ m_Connections

CONNECTIONLIST* CASocketList::m_Connections
protected

◆ m_Memlist

t_MEMBLOCK* CASocketList::m_Memlist
protected

Referenced by CASocketList(), clear(), and increasePool().

◆ m_Pool

CONNECTIONLIST* CASocketList::m_Pool
protected

◆ m_Size

UINT32 CASocketList::m_Size
protected

Referenced by add(), CASocketList(), getSize(), and remove().