public void Unregister(RelayedOnewayChannelListener channelListener)
 {
     RelayedOnewayListener.RelayedOnewayChannelListenerCollection relayedOnewayChannelListenerCollection;
     lock (base.ThisLock)
     {
         if (this.listenerTable.TryLookupUri(channelListener.Uri, HostNameComparisonMode.Exact, out relayedOnewayChannelListenerCollection) && relayedOnewayChannelListenerCollection.Uri == channelListener.Uri)
         {
             relayedOnewayChannelListenerCollection.RemoveListener(channelListener);
             if (relayedOnewayChannelListenerCollection.Count == 0)
             {
                 this.listenerTable.UnregisterUri(channelListener.Uri, HostNameComparisonMode.Exact);
             }
         }
     }
 }
 public void Register(RelayedOnewayChannelListener channelListener)
 {
     RelayedOnewayListener.RelayedOnewayChannelListenerCollection relayedOnewayChannelListenerCollection;
     lock (base.ThisLock)
     {
         if (!this.listenerTable.TryLookupUri(channelListener.Uri, HostNameComparisonMode.Exact, out relayedOnewayChannelListenerCollection) || !(relayedOnewayChannelListenerCollection.Uri == channelListener.Uri))
         {
             relayedOnewayChannelListenerCollection = new RelayedOnewayListener.RelayedOnewayChannelListenerCollection(channelListener.Uri, channelListener.NameSettings.ServiceSettings.ListenerType == ListenerType.Multicast);
             this.listenerTable.RegisterUri(channelListener.Uri, HostNameComparisonMode.Exact, relayedOnewayChannelListenerCollection);
         }
         else if (!relayedOnewayChannelListenerCollection.Multicast)
         {
             throw Fx.Exception.AsError(new AddressAlreadyInUseException(), null);
         }
         relayedOnewayChannelListenerCollection.AddListener(channelListener);
         base.AddRef();
     }
 }
        public static IRelayedOnewayListener RegisterListener(BindingContext context, RelayedOnewayTransportBindingElement transportBindingElement, RelayedOnewayChannelListener channelListener)
        {
            IRelayedOnewayListener relayedOnewayListener;

            lock (RelayedOnewayManager.listenerTable)
            {
                if (!RelayedOnewayManager.listenerTable.TryLookupUri(channelListener.BaseAddress, HostNameComparisonMode.Exact, out relayedOnewayListener) || !(RelayedOnewayManager.AppendSlash(relayedOnewayListener.Uri).ToString() == RelayedOnewayManager.AppendSlash(channelListener.BaseAddress).ToString()))
                {
                    relayedOnewayListener          = new RelayedOnewayListener(context, transportBindingElement, channelListener.BaseAddress, new EventTraceActivity());
                    relayedOnewayListener.Closing += new EventHandler(RelayedOnewayManager.OnListenerClosing);
                    RelayedOnewayManager.listenerTable.RegisterUri(channelListener.BaseAddress, HostNameComparisonMode.Exact, relayedOnewayListener);
                }
                else if (!relayedOnewayListener.NameSettings.IsCompatible(channelListener.NameSettings))
                {
                    throw Fx.Exception.AsError(new AddressAlreadyInUseException(SRClient.IncompatibleChannelListener), null);
                }
                relayedOnewayListener.Register(channelListener);
            }
            return(relayedOnewayListener);
        }
 public void RemoveListener(RelayedOnewayChannelListener channelListener)
 {
     this.listeners.Remove(channelListener);
 }
 public void AddListener(RelayedOnewayChannelListener channelListener)
 {
     this.listeners.Add(channelListener);
 }
 public RelayedOnewayInputChannel(RelayedOnewayChannelListener channelListener, EndpointAddress localAddress) : base(channelListener, localAddress)
 {
 }