Exemplo n.º 1
0
        public Task StartStreamChannel(CancellationToken token)
        {
            var httpGatewayListenAddress = ConfigStore.ReadUnencryptedString("FabricNode", "HttpGatewayListenAddress");

            if (!string.IsNullOrWhiteSpace(httpGatewayListenAddress))
            {
                var parts = httpGatewayListenAddress.Split(':');
                if (parts != null && parts.Count() == 2)
                {
                    this.httpGatewayListenHost = parts[0];
                    int.TryParse(parts[1], out this.httpGatewayListenPort);
                }
            }

            if (!string.IsNullOrWhiteSpace(this.httpGatewayListenHost) && this.httpGatewayListenPort > 0)
            {
                this.httpGatewayListenAddressResolved = true;
                Trace.WriteInfo(TraceType, "Resolved HttpGatewayListenAddress endpoint {0}:{1}", this.httpGatewayListenHost, this.httpGatewayListenPort);
            }
            else
            {
                this.httpGatewayListenAddressResolved = false;
                Trace.WriteWarning(TraceType, "Resolve HttpGatewayListenAddress endpoint failed {0}", httpGatewayListenAddress);
            }

            return(StartStreamChannelInternalAsync(token));
        }