Пример #1
0
 // Add item to packets queue
 public void AddPacketToQueue(Packet packet, Node destination)
 {
     if (Packets.Count < MaxPackets)
     {
         if (Ip == destination.Ip)
         {
             bool packetExists = false;
             foreach (Packet item in Packets)
             {
                 if (item.Content == packet.Content)
                 {
                     packetExists = true;
                 }
             }
             if (packetExists == false)
             {
                 Packets.Enqueue(packet);
             }
         }
         else
         {
             Packets.Enqueue(packet);
         }
     }
 }
Пример #2
0
 public void RegisterPacket(int entry)
 {
     if (Packets.Count == 5)
     {
         Packets.Dequeue();
     }
     Packets.Enqueue(entry);
 }
Пример #3
0
 public void Push(IPacket packet)
 {
     Packets.Enqueue(packet);
 }
Пример #4
0
        private void Scanner_NewPacketEntry(object sender, PacketLogItem e)
        {
            Packets.Enqueue(e);

            Packets = new ConcurrentQueue <PacketLogItem>(Packets);
        }
 public void AddPacket(Packet p)
 {
     Packets.Enqueue(p);
 }