[ENet-discuss] Network sent/received bytes

Lee Salzman lsalzman at gmail.com
Tue Oct 16 01:59:02 PDT 2012


It's mainly just for those particular stats (totalSent*, totalReceived*),
since they're only 32 bit, and like all bandwidth stats, increase fast,
eventually they will roll-over, hence the value in resetting them to zero
to keep that from occurring. You don't have to reset them, of course, in
that ENet doesn't depend on them in any way internally, it will just help
you prevent the roll-over if your app needs to use them.

On Tue, Oct 16, 2012 at 10:31 AM, Sebastian Ahlman <
sebastian.ahlman at gmail.com> wrote:

> In my engine I want to track the bytes sent and received over the network.
> To do this I have the methods void addBytesSent(unsigned int bytes) and
> void addBytesReceived(unsigned int bytes). This should be all data,
> including enet headers, not only the payload. I found the members
> totalSentData and totalReceivedData of ENetHost. These both have a remark
> "User should reset to 0 as needed to prevent overflow."
>
> Does this mean that I can track the stats like this?: Every update in my
> engine check if totalSentData and totalReceivedData are larger than zero
> and if they are I call my functions with the values and set totalSentData
> and totalReceivedData back to zero? This should give me the delta in sent
> receiving bytes, right? Or do I break anything if I set them back to zero?
>
> Also, if the above is correct, are there any other data members in enet
> that I should reset to zero every now and then?
>
> Thanks,
> Sebastian Ahlman
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20121016/cd2428f3/attachment.html>


More information about the ENet-discuss mailing list