Esempio n. 1
0
 public void Remove(PacketWaitEntry we)
 {
     lock ( _waitEntryLock )
     {
         _waitEntries.Remove(we);
         WaitEntryRemovedEvent?.Invoke(we);
     }
 }
        public PacketWaitEntry Add(PacketFilterInfo pfi, PacketDirection direction, bool autoRemove = false)
        {
            PacketWaitEntry we = new PacketWaitEntry
            {
                PFI = pfi, Lock = new AutoResetEvent(false), PacketDirection = direction, AutoRemove = autoRemove
            };

            lock ( _waitEntryLock )
            {
                _waitEntries.Add(we);
                WaitEntryAddedEvent?.Invoke(we);
            }

            return(we);
        }