/// <summary> /// Require lock. /// </summary> /// <param name="packetId"></param> /// <returns></returns> QoSState GetStateAndChecks(int packetId) { if (packetId > _idStore._entries.Length) { throw new ProtocolViolationException("The sender acknowledged a packet id that does not exist."); } QoSState state = _idStore._entries[packetId].Content._state; if (state == QoSState.None) { throw new ProtocolViolationException("The sender acknowledged a packet id that does not exist."); } Debug.Assert(!state.HasFlag(QoSState.Dropped)); return(state); }
static bool WasPacketNeverAcked(QoSState state) => (state & QoSState.PacketAckedMask) == QoSState.None;