Interface PingPongObserver

[[PingPongObserver]] implements callbacks for when [[PingPong]] pongs are received or missed.

interface PingPongObserver {
    didMissPongs(consecutiveMissed: number): void;
    didReceivePong(id: number, latencyMs: number, clockSkewMs: number): void;
}

Implemented by

Methods

  • Called when one or more pongs are missed in a row. This can be an indication that the underlying connection has failed.

    Parameters

    • consecutiveMissed: number

    Returns void

  • Called when a pong is received with the measured latency from the ping as well as an estimate of the local clock skew compared to the server clock.

    Parameters

    • id: number
    • latencyMs: number
    • clockSkewMs: number

    Returns void