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

This class stores Addresses off different Cache-Proxies. More...

Public Member Functions

 CACacheLoadBalancing ()
 
 ~CACacheLoadBalancing ()
 
SINT32 clean ()
 Deletes all information. More...
 
SINT32 add (CASocketAddr *const pAddr)
 
CASocketAddrINetget ()
 Gets the 'next' Address according to the Load-Balancing algorithm. More...
 
UINT32 getElementCount ()
 

Private Attributes

CACHE_LB_ENTRYpSelectedEntry
 
UINT32 m_ElementCount
 
CAMutex m_csLock
 

Detailed Description

This class stores Addresses off different Cache-Proxies.

It can be used for Load Balancing between them. Currently a simple Ropund Robin is implemented.

Constructor & Destructor Documentation

◆ CACacheLoadBalancing()

CACacheLoadBalancing::CACacheLoadBalancing ( )

References m_ElementCount, and pSelectedEntry.

◆ ~CACacheLoadBalancing()

CACacheLoadBalancing::~CACacheLoadBalancing ( )

References clean().

Member Function Documentation

◆ add()

SINT32 CACacheLoadBalancing::add ( CASocketAddr *const  pAddr)

◆ clean()

SINT32 CACacheLoadBalancing::clean ( )

◆ get()

CASocketAddrINet* CACacheLoadBalancing::get ( )

Gets the 'next' Address according to the Load-Balancing algorithm.

This is the Address which should be used for a connection to a cache proxy.

Returns
next Address of a Cache-Proxy

References CAMutex::lock(), m_csLock, t_cachelb_list::next, t_cachelb_list::pAddr, pSelectedEntry, and CAMutex::unlock().

Referenced by CALastMixA::loop(), CALastMixB::loop(), and CALastMix::setTargets().

◆ getElementCount()

UINT32 CACacheLoadBalancing::getElementCount ( )

Member Data Documentation

◆ m_csLock

CAMutex CACacheLoadBalancing::m_csLock
private

Referenced by add(), clean(), and get().

◆ m_ElementCount

UINT32 CACacheLoadBalancing::m_ElementCount
private

◆ pSelectedEntry

CACHE_LB_ENTRY* CACacheLoadBalancing::pSelectedEntry
private

Referenced by add(), CACacheLoadBalancing(), clean(), and get().