Brunet.Messaging.MultiSource.Unsubscribe C# (CSharp) Method

Unsubscribe() public method

Unsubscribes the the IDataHandler if it is the current IDatahandler.
public Unsubscribe ( IDataHandler h ) : void
h IDataHandler
return void
    public void Unsubscribe(IDataHandler h) {
      Subscriber s = new Subscriber(h, null);
    //We have to lock so there is no race between the read and the write
      lock( _sync ) {
        int idx = _subs.IndexOf(s);
        _subs = Brunet.Collections.Functional.RemoveAt(_subs, idx);
      }
    }