[ENet-discuss] Network sent/received bytes

Sebastian Ahlman sebastian.ahlman at gmail.com
Tue Oct 16 00:31:15 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20121016/80338cf0/attachment.html>


More information about the ENet-discuss mailing list