Brunet.Services.Dht.RpcDhtProxy.Unregister C# (CSharp) Метод

Unregister() публичный Метод

Unregister the proxy entry. Removes the entry from Dictionary and set the stop the timer to disable future reference
public Unregister ( MemBlock key, MemBlock value ) : bool
key MemBlock
value MemBlock
Результат bool
    public bool Unregister(MemBlock key, MemBlock value)
    {
      lock(_sync) {
        if(_entries.ContainsKey(key)) {
          if(_entries[key].ContainsKey(value)) {
            _entries[key][value].Timer.Stop();
            if(_entries[key].Count == 1) {
              _entries.Remove(key);
            } else {
              _entries[key].Remove(value);
            }
          }
        }
      }
      return true;
    }
    

Usage Example

Пример #1
0
        /// <summary>Stops publishing using the dht proxy.</summary>
        override public bool Stop()
        {
            _dht_proxy.Unregister(_private_dht_key, _p2p_address);

            bool first = base.EndFindingTAs();

            if (Interlocked.Exchange(ref _steady_state, 0) == 1)
            {
                FuzzyEvent fe = _fe;
                if (fe != null)
                {
                    _fe.TryCancel();
                }
                first = true;
            }

            return(first);
        }