PeerClockEstimator class final

Collects probe replies for one peer and reduces each burst to one estimate.

Deliberately holds no timers and does no I/O: bursts are driven from outside via beginBurst and aggregate, and replies arrive through addSample. That keeps the arithmetic — the part worth getting right — testable with injected timestamps rather than sockets and sleeps.

Constructors

PeerClockEstimator({required String peerUId, ClockSyncConfig? config, Random? random})

Properties

config → ClockSyncConfig
final
estimate → ClockOffsetEstimate?
The most recently accepted estimate, or null if no burst has been accepted yet. Null is meaningful: it means "offset unknown", never "offset zero".
no setter
hashCode → int
The hash code for this object.
no setterinherited
peerUId → String
final
repliesThisBurst → int
Replies collected for the burst in flight. Exposed for tests and logging.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
waveId → int
Identifies the burst in flight. Replies quoting any other wave are stale and dropped (time_receiver.cpp:163).
no setter

Methods

addSample(int waveId, ClockProbeSample sample) → bool
Records a reply. Returns false if it was dropped as stale.
aggregate() → ClockOffsetEstimate?
Reduces the burst in flight to at most one estimate.
beginBurst() → int
Starts a new burst and returns its wave id.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Forgets the current estimate — used when a peer reconnects and its clock domain may have changed, mirroring reset_timeoffset_on_recovery.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited