public Task <string> OpenAsync(CancellationToken cancellationToken)
        {
            ServiceEventSource.Current.Message("Initialize");

            EndpointResourceDescription serviceEndpoint = serviceInitializationParameters.CodePackageActivationContext.GetEndpoint("ServiceEndpoint");
            int port = serviceEndpoint.Port;

            this.listeningAddress = string.Format(
                CultureInfo.InvariantCulture,
                "http://+:{0}/{1}",
                port,
                string.IsNullOrWhiteSpace(this.appRoot)
                    ? string.Empty
                    : this.appRoot.TrimEnd('/') + '/');

            this.publishAddress = this.listeningAddress.Replace("+", FabricRuntime.GetNodeContext().IPAddressOrFQDN);

            ServiceEventSource.Current.Message("Starting web server on {0}", this.listeningAddress);

            this.webSocketApp = new WebSocketApp(this.visualObjectsBox);

            this.webApp = WebApp.Start <Startup>(this.listeningAddress);
            this.webSocketApp.Start(this.listeningAddress + this.webSocketRoot);

            return(Task.FromResult(this.publishAddress));
        }
        public Task<string> OpenAsync(CancellationToken cancellationToken)
        {
            ServiceEventSource.Current.Message("Initialize");

            EndpointResourceDescription serviceEndpoint = serviceInitializationParameters.CodePackageActivationContext.GetEndpoint("ServiceEndpoint");
            int port = serviceEndpoint.Port;

            this.listeningAddress = string.Format(
                CultureInfo.InvariantCulture,
                "http://+:{0}/{1}",
                port,
                string.IsNullOrWhiteSpace(this.appRoot)
                    ? string.Empty
                    : this.appRoot.TrimEnd('/') + '/');

            this.publishAddress = this.listeningAddress.Replace("+", FabricRuntime.GetNodeContext().IPAddressOrFQDN);

            ServiceEventSource.Current.Message("Starting web server on {0}", this.listeningAddress);

            this.webSocketApp = new WebSocketApp(this.visualObjectsBox);

            this.webApp = WebApp.Start<Startup>(this.listeningAddress);
            this.webSocketApp.Start(this.listeningAddress + this.webSocketRoot);

            return Task.FromResult(this.publishAddress);
        }
        public Task<string> OpenAsync(CancellationToken cancellationToken)
        {
            ServiceEventSource.Current.Message("Starting web server on {0}", this.listeningAddress);

            this.webSocketApp = new WebSocketApp(this.visualObjectsBox);

            this.webApp = WebApp.Start<Startup>(this.listeningAddress);
            this.webSocketApp.Start(this.listeningAddress + this.webSocketRoot);

            return Task.FromResult(this.publishAddress);
        }
        public Task <string> OpenAsync(CancellationToken cancellationToken)
        {
            ServiceEventSource.Current.Message("Starting web server on {0}", this.listeningAddress);

            this.webSocketApp = new WebSocketApp(this.visualObjectsBox);

            this.webApp = WebApp.Start <Startup>(this.listeningAddress);
            this.webSocketApp.Start(this.listeningAddress + this.webSocketRoot);

            return(Task.FromResult(this.publishAddress));
        }