Mixe for Privacy and Anonymity in the Internet
|
This class stores Addresses off different Cache-Proxies. More...
#include <CACacheLoadBalancing.hpp>
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.
Definition at line 45 of file CACacheLoadBalancing.hpp.
|
inline |
Definition at line 48 of file CACacheLoadBalancing.hpp.
References m_ElementCount, and pSelectedEntry.
|
inline |
Definition at line 53 of file CACacheLoadBalancing.hpp.
References clean().
SINT32 CACacheLoadBalancing::add | ( | CASocketAddr *const | pAddr | ) |
Definition at line 36 of file CACacheLoadBalancing.cpp.
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().
|
inline |
Deletes all information.
Definition at line 56 of file CACacheLoadBalancing.hpp.
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().
|
inline |
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.
Definition at line 84 of file CACacheLoadBalancing.hpp.
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().
|
inline |
Definition at line 100 of file CACacheLoadBalancing.hpp.
References m_ElementCount.
Referenced by CALastMixA::loop(), CALastMixB::loop(), and CALastMix::setTargets().
|
private |
Definition at line 108 of file CACacheLoadBalancing.hpp.
|
private |
Definition at line 107 of file CACacheLoadBalancing.hpp.
Referenced by add(), CACacheLoadBalancing(), clean(), and getElementCount().
|
private |
Definition at line 106 of file CACacheLoadBalancing.hpp.
Referenced by add(), CACacheLoadBalancing(), clean(), and get().