public sealed class RoundTripEstimatorSmoothed round-trip time and jitter, from samples.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The estimator TCP uses (RFC 6298): an exponentially weighted average of the samples, and beside it an exponentially weighted average of how far each sample fell from that average. The second number is the one that matters here — the interpolation buffer and the tick lead are sized from the variance, because a steady 200 ms link is easy and a link that swings between 40 and 90 ms is not.
The weights are the standard 1/8 and 1/4, which is a deliberate refusal to invent: they have been load-bearing in every TCP stack for thirty years, and a netcode-specific constant chosen by eye would be worse and unjustifiable.
Fields and properties (5)
public TimeSpan RoundTripThe smoothed round trip.
public TimeSpan OneWayHalf the smoothed round trip — how old the newest thing from the server is.
public TimeSpan JitterHow far samples typically fall from the average. The number that sizes buffers.
public long SampleCountHow many samples have been taken.
public bool HasSamplesWhether anything has been measured yet.
Methods (2)
public void Add(TimeSpan sample)Takes a sample.
public void Reset()Forgets everything measured, for a reconnect to a different server.
Used by (10)
- LocalMatchMultiplayer
- NetworkMatchMultiplayer
- NetworkMetricsVixen.Net
- NetworkPlayerVixen.Net
- NetworkSessionVixen.Net
- SessionTestsVixen.Net.Tests
- TickManagerVixen.Net
- TickManagerTestsVixen.Net.Tests
- UdpConnectionVixen.Net.Transport.Udp
- UdpTransportVixen.Net.Transport.Udp