mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
Use Mbps for max bandwith
This commit is contained in:
parent
a3b771c4dc
commit
86b425143b
3 changed files with 5 additions and 5 deletions
|
@ -82,11 +82,11 @@ void AssetServer::completeSetup() {
|
|||
auto maxBandwidthFloat = maxBandwidthValue.toDouble(-1);
|
||||
|
||||
if (maxBandwidthFloat > 0.0) {
|
||||
const int BYTES_PER_MEGABITS = (1024 * 1024) / 8;
|
||||
int maxBandwidth = maxBandwidthFloat * BYTES_PER_MEGABITS;
|
||||
const int BITS_PER_MEGABITS = 1000 * 1000;
|
||||
int maxBandwidth = maxBandwidthFloat * BITS_PER_MEGABITS;
|
||||
nodeList->setConnectionMaxBandwidth(maxBandwidth);
|
||||
qInfo() << "Set maximum bandwith per connection to" << maxBandwidthFloat << "Mb/s."
|
||||
" (" << maxBandwidth << "bytes/sec)";
|
||||
" (" << maxBandwidth << "bits/s)";
|
||||
}
|
||||
|
||||
// get the path to the asset folder from the domain server settings
|
||||
|
|
|
@ -19,7 +19,7 @@ using namespace std::chrono;
|
|||
static const double USECS_PER_SECOND = 1000000.0;
|
||||
|
||||
void CongestionControl::setMaxBandwidth(int maxBandwidth) {
|
||||
_maxBandwidth = maxBandwidth;
|
||||
_maxBandwidth = maxBandwidth / 8;
|
||||
setPacketSendPeriod(_packetSendPeriod);
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ void Socket::setCongestionControlFactory(std::unique_ptr<CongestionControlVirtua
|
|||
|
||||
|
||||
void Socket::setConnectionMaxBandwidth(int maxBandwidth) {
|
||||
qInfo() << "Setting socket's maximum bandwith to" << maxBandwidth << ". ("
|
||||
qInfo() << "Setting socket's maximum bandwith to" << maxBandwidth << "bps. ("
|
||||
<< _connectionsHash.size() << "live connections)";
|
||||
_maxBandwidth = maxBandwidth;
|
||||
for (auto& pair : _connectionsHash) {
|
||||
|
|
Loading…
Reference in a new issue