コード例 #1
0
        private void EnsureBaseAddresses()
        {
            if (_serverAddresses != null)
            {
                foreach (var addr in _serverAddresses.Addresses)
                {
                    var  uri  = new Uri(addr);
                    bool skip = false;
                    foreach (var baseAddress in InternalBaseAddresses)
                    {
                        if (baseAddress.Port == uri.Port && baseAddress.Scheme != uri.Scheme)
                        {
                            // ASP.NET Core adds net.tcp uri's as http{s} uri's
                            skip = true;
                            break;
                        }
                    }
                    if (!skip && !InternalBaseAddresses.Contains(uri))
                    {
                        InternalBaseAddresses.Add(uri);
                    }
                }

                if (_serverAddresses.Addresses.Count > 0)
                {
                    // It was populated by ASP.NET Core so can skip re-adding in future.
                    _serverAddresses = null;
                }
            }
        }
コード例 #2
0
ファイル: ServiceHostBase.cs プロジェクト: wpenbert/CoreWCF
 protected void AddBaseAddress(Uri baseAddress)
 {
     if (_initializeDescriptionHasFinished)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(
                                                                       SR.SFxCannotCallAddBaseAddress));
     }
     InternalBaseAddresses.Add(baseAddress);
 }
コード例 #3
0
ファイル: ServiceHostBase.cs プロジェクト: wpenbert/CoreWCF
        //public int IncrementManualFlowControlLimit(int incrementBy)
        //{
        //    throw new PlatformNotSupportedException();
        //}

        protected void InitializeDescription(UriSchemeKeyedCollection baseAddresses)
        {
            foreach (Uri baseAddress in baseAddresses)
            {
                InternalBaseAddresses.Add(baseAddress);
            }

            Description = CreateDescription(out _implementedContracts);
            _initializeDescriptionHasFinished = true;
        }