ConnectionEpochs

data class ConnectionEpochs(val departures: Long = 0, val completedHandshakes: Long = 0, val handshakesAtLastDeparture: Long = 0, val lastDepartureState: ConnectionState? = null)(source)

Monotonic counters for connection lifecycle events that cannot be inferred reliably from transient ConnectionState values. A fast disconnect/reconnect may be observed only as the final state, while these counters retain both lifecycle boundaries.

Constructors

Link copied to clipboard
constructor(departures: Long = 0, completedHandshakes: Long = 0, handshakesAtLastDeparture: Long = 0, lastDepartureState: ConnectionState? = null)

Properties

Link copied to clipboard

Number of transitions into ConnectionState.Connected.

Link copied to clipboard

Number of transitions away from ConnectionState.Connected.

Link copied to clipboard

Completed-handshake count captured at the most recent departure. This preserves event ordering when a fast departure/reconnect pair is conflated into one observed state-flow value.

Link copied to clipboard

State entered by the most recent departure. Consumers that react after a fast reconnect can use this event evidence instead of rereading the already-advanced live connection state.

Functions

Link copied to clipboard

Returns the counters after applying one canonical connection-state transition.