Mixes for Privacy and Anonymity in the Internet
|
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) |
CASocketAddrINet * | get () |
Gets the 'next' Address according to the Load-Balancing algorithm. More... | |
UINT32 | getElementCount () |
Private Attributes | |
CACHE_LB_ENTRY * | pSelectedEntry |
UINT32 | m_ElementCount |
CAMutex | m_csLock |
This class stores Addresses off different Cache-Proxies.
It can be used for Load Balancing between them. Currently a simple Ropund Robin is implemented.
CACacheLoadBalancing::CACacheLoadBalancing | ( | ) |
References m_ElementCount, and pSelectedEntry.
CACacheLoadBalancing::~CACacheLoadBalancing | ( | ) |
References clean().
SINT32 CACacheLoadBalancing::add | ( | CASocketAddr *const | pAddr | ) |
References CASocketAddr::clone(), E_SUCCESS, E_UNKNOWN, CASocketAddr::getType(), CAMutex::lock(), m_csLock, m_ElementCount, t_cachelb_list::next, t_cachelb_list::pAddr, pSelectedEntry, and CAMutex::unlock().
Referenced by CALastMix::setTargets().
SINT32 CACacheLoadBalancing::clean | ( | ) |
Deletes all information.
References E_SUCCESS, CAMutex::lock(), m_csLock, m_ElementCount, t_cachelb_list::next, t_cachelb_list::pAddr, pSelectedEntry, and CAMutex::unlock().
Referenced by CALastMix::setTargets(), and ~CACacheLoadBalancing().
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.
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().
UINT32 CACacheLoadBalancing::getElementCount | ( | ) |
References m_ElementCount.
Referenced by CALastMixA::loop(), CALastMixB::loop(), and CALastMix::setTargets().
|
private |
Referenced by add(), CACacheLoadBalancing(), clean(), and getElementCount().
|
private |
Referenced by add(), CACacheLoadBalancing(), clean(), and get().