internal HttpAnonymousUriPrefixMatcher(HttpAnonymousUriPrefixMatcher objectToClone)
     : this()
 {
     if (objectToClone._anonymousUriPrefixes != null)
     {
         _anonymousUriPrefixes = new UriPrefixTable <Uri>(objectToClone._anonymousUriPrefixes);
     }
 }
Ejemplo n.º 2
0
 // Must be called under lock(ThisLock).
 protected void Fault <TChannelListener>(UriPrefixTable <TChannelListener> addressTable, Exception exception)
     where TChannelListener : ChannelListenerBase
 {
     foreach (KeyValuePair <BaseUriWithWildcard, TChannelListener> pair in addressTable.GetAll())
     {
         TChannelListener listener = pair.Value;
         listener.Fault(exception);
         listener.Abort();
     }
 }
Ejemplo n.º 3
0
 internal UriPrefixTable(UriPrefixTable <TItem> objectToClone)
     : this(objectToClone.includePortInComparison, objectToClone.useWeakReferences)
 {
     if (objectToClone.Count > 0)
     {
         foreach (KeyValuePair <BaseUriWithWildcard, TItem> current in objectToClone.GetAll())
         {
             RegisterUri(current.Key.BaseAddress, current.Key.HostNameComparisonMode, current.Value);
         }
     }
 }
Ejemplo n.º 4
0
        internal static void EnsureRegistered <TChannelListener>(UriPrefixTable <TChannelListener> addressTable,
                                                                 TChannelListener channelListener, HostNameComparisonMode registeredComparisonMode)
            where TChannelListener : TransportChannelListener
        {
            TChannelListener existingFactory;

            if (!addressTable.TryLookupUri(channelListener.Uri, registeredComparisonMode, out existingFactory) ||
                (existingFactory != channelListener))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(
                                                                                                            SR.ListenerFactoryNotRegistered, channelListener.Uri)));
            }
        }
        public void Register(Uri anonymousUriPrefix)
        {
            if (anonymousUriPrefix == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(anonymousUriPrefix));
            }

            if (!anonymousUriPrefix.IsAbsoluteUri)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(nameof(anonymousUriPrefix), SR.UriMustBeAbsolute);
            }

            if (_anonymousUriPrefixes == null)
            {
                _anonymousUriPrefixes = new UriPrefixTable <Uri>(true);
            }

            if (!_anonymousUriPrefixes.IsRegistered(new BaseUriWithWildcard(anonymousUriPrefix, HostNameComparisonMode.Exact)))
            {
                _anonymousUriPrefixes.RegisterUri(anonymousUriPrefix, HostNameComparisonMode.Exact, anonymousUriPrefix);
            }
        }
Ejemplo n.º 6
0
 protected ConnectionOrientedTransportManager()
 {
     addressTable = new UriPrefixTable <TChannelListener>();
 }