public SharedTcpTransportManager(Uri listenUri, TcpChannelListener channelListener)
        {
            this.HostNameComparisonMode = channelListener.HostNameComparisonMode;
            this.listenUri = listenUri;

            // For port sharing, we apply all of the settings from channel listener to the transport manager.
            this.ApplyListenerSettings(channelListener);
        }
 private void ProcessSelection(TcpChannelListener channelListener, IPAddress ipAddressAny, UriHostNameType ipHostNameType, ref ExclusiveTcpTransportManager transportManager, IList<TransportManager> result)
 {
     if (transportManager == null)
     {
         transportManager = new ExclusiveTcpTransportManager(this, channelListener, ipAddressAny, ipHostNameType);
     }
     result.Add(transportManager);
 }
 protected override bool IsCompatible(TcpChannelListener channelListener)
 {
     if ((channelListener.HostedVirtualPath == null) && !channelListener.PortSharingEnabled)
     {
         return false;
     }
     return base.IsCompatible(channelListener);
 }
 private bool IsCompatible(TcpChannelListener channelListener, bool useIPv4, bool useIPv6)
 {
     if (channelListener.InheritBaseAddressSettings)
     {
         return true;
     }
     if (useIPv6 && !channelListener.IsScopeIdCompatible(base.HostNameComparisonMode, base.ListenUri))
     {
         return false;
     }
     return ((((!channelListener.PortSharingEnabled && (useIPv4 || useIPv6)) && ((((this.channelInitializationTimeout == channelListener.ChannelInitializationTimeout) && (this.idleTimeout == channelListener.IdleTimeout)) && ((this.maxPooledConnections == channelListener.MaxPooledConnections) && (this.connectionBufferSize == channelListener.ConnectionBufferSize))) && (!useIPv6 || (this.teredoEnabled == channelListener.TeredoEnabled)))) && (((this.listenBacklog == channelListener.ListenBacklog) && (this.maxPendingConnections == channelListener.MaxPendingConnections)) && (this.maxOutputDelay == channelListener.MaxOutputDelay))) && (this.maxPendingAccepts == channelListener.MaxPendingAccepts));
 }
 public ExclusiveTcpTransportManagerRegistration(Uri listenUri, TcpChannelListener channelListener) : base(listenUri, channelListener.HostNameComparisonMode)
 {
     this.connectionBufferSize = channelListener.ConnectionBufferSize;
     this.channelInitializationTimeout = channelListener.ChannelInitializationTimeout;
     this.teredoEnabled = channelListener.TeredoEnabled;
     this.listenBacklog = channelListener.ListenBacklog;
     this.maxOutputDelay = channelListener.MaxOutputDelay;
     this.maxPendingConnections = channelListener.MaxPendingConnections;
     this.maxPendingAccepts = channelListener.MaxPendingAccepts;
     this.idleTimeout = channelListener.IdleTimeout;
     this.maxPooledConnections = channelListener.MaxPooledConnections;
 }
 protected override void OnSelecting(TcpChannelListener channelListener)
 {
     if (!this.settingsApplied)
     {
         lock (base.ThisLock)
         {
             if (!this.settingsApplied)
             {
                 base.ApplyListenerSettings(channelListener);
                 this.settingsApplied = true;
             }
         }
     }
 }
 protected override void OnSelecting(TcpChannelListener channelListener)
 {
     if (!this.settingsApplied)
     {
         lock (base.ThisLock)
         {
             if (!this.settingsApplied)
             {
                 base.ApplyListenerSettings(channelListener);
                 this.settingsApplied = true;
             }
         }
     }
 }
        protected override void OnSelecting(TcpChannelListener channelListener)
        {
            if (settingsApplied)
            {
                return;
            }

            lock (ThisLock)
            {
                if (settingsApplied)
                {
                    // Use the first one.
                    return;
                }

                this.ApplyListenerSettings(channelListener);
                settingsApplied = true;
            }
        }
        protected override void OnSelecting(TcpChannelListener channelListener)
        {
            if (settingsApplied)
            {
                return;
            }

            lock (ThisLock)
            {
                if (settingsApplied)
                {
                    // Use the first one.
                    return;
                }

                this.ApplyListenerSettings(channelListener);
                settingsApplied = true;
            }
        }
 public ExclusiveTcpTransportManager(ExclusiveTcpTransportManagerRegistration registration, TcpChannelListener channelListener, System.Net.IPAddress ipAddressAny, UriHostNameType ipHostNameType)
 {
     base.ApplyListenerSettings(channelListener);
     this.listenSocket = channelListener.GetListenSocket(ipHostNameType);
     if (this.listenSocket != null)
     {
         this.ipAddress = ((IPEndPoint) this.listenSocket.LocalEndPoint).Address;
     }
     else if (channelListener.Uri.HostNameType == ipHostNameType)
     {
         this.ipAddress = System.Net.IPAddress.Parse(channelListener.Uri.DnsSafeHost);
     }
     else
     {
         this.ipAddress = ipAddressAny;
     }
     this.listenBacklog = channelListener.ListenBacklog;
     this.registration = registration;
 }
 protected virtual void OnSelecting(TcpChannelListener channelListener)
 {
 }
 public SharedTcpTransportManager(Uri listenUri, TcpChannelListener channelListener)
 {
     this.HostNameComparisonMode = channelListener.HostNameComparisonMode;
     this.listenUri = listenUri;
     base.ApplyListenerSettings(channelListener);
 }