示例#1
0
        public async Task <Packet> ReceiveAsync(SocketSession session)
        {
            Packet packet = await innerConverter.ReceiveAsync(session);

            while (packet.Type < 0)
            {
                packets.Add(packet);
                packet = await innerConverter.ReceiveAsync(session);

                if (packet.Type == PacketPartPackets.PacketEnd)
                {
                    Packet packet2 = GetPacket();
                    return(packet2);
                }
            }

            return(packet);
        }