diff options
author | David Athay <ko2fan@gmail.com> | 2008-11-19 13:36:50 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-11-19 15:02:10 +0000 |
commit | 8481413ea17177945d3d280b1518eb6f1f25cd5d (patch) | |
tree | 77ed689d7587a6d06c07dd81c3ca0d5c49b3284d /src/net/bandwidth.cpp | |
parent | 751cc20a3be820724ca575aab32c2bb424f89a5b (diff) | |
download | manaserv-8481413ea17177945d3d280b1518eb6f1f25cd5d.tar.gz manaserv-8481413ea17177945d3d280b1518eb6f1f25cd5d.tar.bz2 manaserv-8481413ea17177945d3d280b1518eb6f1f25cd5d.tar.xz manaserv-8481413ea17177945d3d280b1518eb6f1f25cd5d.zip |
Added bandwidth monitoring
Diffstat (limited to 'src/net/bandwidth.cpp')
-rw-r--r-- | src/net/bandwidth.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/net/bandwidth.cpp b/src/net/bandwidth.cpp new file mode 100644 index 00000000..5fa580ee --- /dev/null +++ b/src/net/bandwidth.cpp @@ -0,0 +1,44 @@ +/* + * The Mana World Server + * Copyright 2008 The Mana World Development Team + * + * This file is part of The Mana World. + * + * The Mana World is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * The Mana World is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with The Mana World; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "bandwidth.hpp" + +BandwidthMonitor::BandwidthMonitor(): + mAmountOutput(0), + mAmountInput(0) +{ +} + +void BandwidthMonitor::increaseOutput(int size) +{ + mAmountOutput += size; +} + +void BandwidthMonitor::increaseInput(int size) +{ + mAmountInput += size; +} + +void BandwidthMonitor::reset() +{ + mAmountOutput = 0; + mAmountInput = 0; +} |