/// <summary> /// Process bytes received /// </summary> /// <param name="data"></param> private void ReceivedBytes(byte[] data) { if (Received == null) { cachedData.Enqueue(data); } else { while (cachedData.TryDequeue(out var res)) { DynamicVCPDU cachedPdu = decoder.ToPdu(res); Received(cachedPdu); } DynamicVCPDU pdu = decoder.ToPdu(data); Received(pdu); } }
/// <summary> /// Process bytes received /// </summary> /// <param name="data"></param> private void ReceivedBytes(byte[] data) { DynamicVCPDU pdu = decoder.ToPdu(data); if (Received != null) { Received(pdu); } }