9 #ifndef anna_comm_CongestionController_hpp 10 #define anna_comm_CongestionController_hpp 30 class LocalConnection;
68 static const int MaxLevel = 4;
97 static const int DefaultLimit = 60;
126 void setLimit(
const int limit) ;
133 if((a_mode = mode) == Mode::Auto) {
137 a_effectiveMode = mode;
144 bool isEmpty()
const {
return a_avgWorkload.isEmpty(); }
154 void setMaxPendingBytes(
const int maxPendingBytes) noexcept(
false);
175 return (clientSocket == NULL) ? Advice::Process : getAdvice(*clientSocket);
190 Workload getAccumulatedWorkload()
const ;
206 Workload getCurrentWorkload(
const ClientSocket& clientSocket)
const ;
218 static int getLoad(
const Workload& workload) {
return workload.second; }
224 static int getLevel(
const Workload& workload) {
return workload.first; }
228 static const int UnusedPendingBytes = -1;
237 int a_discardLevel [MaxLevel];
238 int a_percentage [MaxLevel];
243 unsigned int a_messageCounter;
244 unsigned int a_discardedCounter;
246 int a_maxPendingBytes;
247 int a_incomingSocketCounter;
250 void incrementIncomingSocket() noexcept(
false);
251 void decrementIncomingSocket() noexcept(
false);
_v
Definition: CongestionController.hpp:74
Definition: CongestionController.hpp:84
Definition: Millisecond.hpp:24
#define WHEN_MULTITHREAD(a)
Definition: defines.hpp:96
Definition: NRMutex.hpp:39
std::pair< int, int > Workload
Definition: CongestionController.hpp:95
Definition: LocalConnection.hpp:22
Definition: Singleton.hpp:76
Definition: CongestionController.hpp:75
_v
Definition: CongestionController.hpp:85
Definition: ClientSocket.hpp:38
Definition: CongestionController.hpp:63
static int getLevel(const Workload &workload)
Definition: CongestionController.hpp:224
#define WHEN_SINGLETHREAD(a)
Definition: defines.hpp:97
static int getLoad(const Workload &workload)
Definition: CongestionController.hpp:218
static const int MaxPendingBytes
Definition: CongestionController.hpp:102
Advice::_v getAdvice(const ClientSocket *clientSocket)
Definition: CongestionController.hpp:174
int getMessageCounter() const
Definition: CongestionController.hpp:114
Definition: CongestionController.hpp:73
Definition: CongestionController.hpp:90
xml::Node Node
Definition: Node.hpp:21
Definition: CongestionController.hpp:76
bool isEmpty() const
Definition: CongestionController.hpp:144
void setMode(const Mode::_v mode)
Definition: CongestionController.hpp:132
Mode::_v getMode() const
Definition: CongestionController.hpp:108
int getSuccessCounter() const
Definition: CongestionController.hpp:120