示例#1
0
 /// <summary>
 /// Check if we received data and try to call the corresponding packet handlers
 /// </summary>
 /// <param name="core">A reference to Core</param>
 /// <param name="plexer">A reference to Plexer</param>
 public void TryTreatPacket(Core core, Plexer plexer)
 {
     if (ReceivedPackets.Any())
     {
         TreatPackets(core, plexer);
     }
 }
示例#2
0
        /// <summary>
        /// Handles the packets and call the PacketHandler
        /// </summary>
        /// <param name="core">A reference to Core</param>
        /// <param name="plexer">A reference to Plexer</param>
        public void TreatPackets(Core core, Plexer plexer)
        {
            while (ReceivedPackets.Any())
            {
                Packet Packet = ReceivedPackets.First();

                ReceivedPackets.Remove(Packet);
                plexer.HandlePackets(core, this, Packet);
            }
        }