DtlsPeerState.setEpoch

void setEpoch(ushort newEpoch) @safe pure nothrow @nogc

Sets the current epoch, resetting per-epoch state on change.

Each epoch restarts record sequence numbers at zero, so the anti-replay window must be re-armed whenever the epoch changes (RFC 6347 §4.1; RFC 9147 §4.5.1). Assigning the epoch directly would leave a stale window that drops legitimate low sequence numbers of the new epoch as "replays".

Parameters

newEpochThe epoch negotiated by the handshake sub-engine.