// 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); } } }
public void RegisterPacket(int entry) { if (Packets.Count == 5) { Packets.Dequeue(); } Packets.Enqueue(entry); }
public void Push(IPacket packet) { Packets.Enqueue(packet); }
private void Scanner_NewPacketEntry(object sender, PacketLogItem e) { Packets.Enqueue(e); Packets = new ConcurrentQueue <PacketLogItem>(Packets); }
public void AddPacket(Packet p) { Packets.Enqueue(p); }