Traffic Stats non-zero after disconnect

Options
GameHopper
edited February 2015 in Native
Hi guys,

Im using C++/iOS and on the device, after I disconnect from the cloud the traffic stats are still reporting incoming/outgoing packets.

I'm still calling Service() in the game loop but is this normal?

Comments

  • btw, my guess is the last packet size is just repeated as the stats aren't refreshed when the connection is terminated...

    please confirm :)
  • Kaiserludi
    Options
    Hi GameHopper.

    Yes, I can confirm that this is normal behavior.
    The TrafficStats get initialized on Peer construction and cleaned up on Peer destruction. During the lifetime of a Peer they only get resetted, if you explicitly call resetTrafficStats() on the according Peer instance. It is done this way to make it possible to keep stats after reconnects.
    If you want to reset everything in a client instance during a reconnect, then I would propose that you just deconstruct the old Client instance and construct a new one as replacement.