More experimentation with multicast rate.

This commit is contained in:
Adam Ierymenko 2013-09-12 17:27:10 -04:00
parent 55e7ddba1e
commit 07e1085dcc
2 changed files with 12 additions and 0 deletions

View File

@ -121,6 +121,15 @@ public:
return false;
}
/**
* @return Most recent balance without update
*/
inline uint32_t balance() const
throw()
{
return _balance;
}
private:
double _lastTime;
uint32_t _balance;

View File

@ -581,6 +581,9 @@ public:
bal = _multicastRateAccounts.insert(std::pair< std::pair<Address,MulticastGroup>,BandwidthAccount >(k,BandwidthAccount(r.preload,r.maxBalance,r.accrual))).first;
}
return bal->second.deduct(bytes);
//bool tmp = bal->second.deduct(bytes);
//printf("%s: BAL: %u\n",mg.toString().c_str(),(unsigned int)bal->second.balance());
//return tmp;
}
private: