internal void ConfigureToUseUniqueServiceUrl()

in src/Microsoft.ServiceFabric.AspNetCore/AspNetCoreCommunicationListener.cs [146:161]


        internal void ConfigureToUseUniqueServiceUrl()
        {
            if (!this.configuredToUseUniqueServiceUrl)
            {
                this.urlSuffix = string.Format(CultureInfo.InvariantCulture, "/{0}/{1}", this.serviceContext.PartitionId, this.serviceContext.ReplicaOrInstanceId);

                if (this.ServiceContext is StatefulServiceContext)
                {
                    // For stateful service, also append a Guid, Guid makes the url unique in scenarios for stateful services when Listener is
                    // created to support read on secondary and change role happens from Primary->Secondary for the replica.
                    this.urlSuffix += "/" + Guid.NewGuid();
                }

                this.configuredToUseUniqueServiceUrl = true;
            }
        }