Traffic Stats non-zero after disconnect
Options
Comments
-
btw, my guess is the last packet size is just repeated as the stats aren't refreshed when the connection is terminated...
please confirm0 -
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.0