예제 #1
0
 public static async Task PullPackets(this StreamBufferController streamBuffer, IEnumerable <Packet> source)
 {
     foreach (var packet in source)
     {
         streamBuffer.DataOut(packet);
         await Task.Yield();
     }
 }
예제 #2
0
        private async Task <bool> ProcessNextPacket(CancellationToken token)
        {
            if (currentPacket == null)
            {
                currentPacket = packetStorage.GetPacket(streamType, token);
            }

            var shouldContinue = await ProcessPacket(currentPacket, token);

            streamBufferController.DataOut(currentPacket);
            barrier.PacketPushed(currentPacket);

            currentPacket.Dispose();
            currentPacket = null;

            return(shouldContinue);
        }