コード例 #1
0
ファイル: Service.cs プロジェクト: rahul24/CritiqueForTeams
        /// <summary>
        /// Start the service.
        /// </summary>
        public void Start()
        {
            lock (this.syncLock)
            {
                if (this.started)
                {
                    throw new InvalidOperationException("The service is already started.");
                }

                TBot.AudioVideoPlaybackBot.FrontEnd.Bot.Bot.Instance.Initialize(this.logger);

                // Start HTTP server for calls
                var            callStartOptions = new StartOptions();
                IList <string> urls             = new List <string>()
                {
                    "http://+:12345/"
                };
                foreach (var url in urls)
                {
                    callStartOptions.Urls.Add(url.ToString());
                }

                this.callHttpServer = WebApp.Start(
                    callStartOptions,
                    (appBuilder) =>
                {
                    var startup = new HttpConfigurationInitializer();
                    startup.ConfigureSettings(appBuilder, this.logger);
                });

                this.started = true;
            }
        }
コード例 #2
0
        /// <summary>
        /// Start the service.
        /// </summary>
        public void Start()
        {
            lock (this.syncLock)
            {
                if (this.started)
                {
                    throw new InvalidOperationException("The service is already started.");
                }

                Bot.Bot.Instance.Initialize(this, this.logger);

                // Start HTTP server for calls
                var callStartOptions = new StartOptions();
                foreach (var url in this.Configuration.CallControlListeningUrls)
                {
                    callStartOptions.Urls.Add(url.ToString());
                }

                this.callHttpServer = WebApp.Start(
                    callStartOptions,
                    (appBuilder) =>
                {
                    var startup = new HttpConfigurationInitializer();
                    startup.ConfigureSettings(appBuilder, this.logger);
                });

                this.started = true;
            }
        }
        /// <summary>
        /// Starts the server.
        /// </summary>
        public void StartServer()
        {
            try
            {
                _botService.Initialize();

                var callStartOptions = new StartOptions();

                foreach (var url in ((AzureSettings)_settings).CallControlListeningUrls)
                {
                    callStartOptions.Urls.Add(url);
                    _logger.Info("Listening on: {url}", url);
                }

                _callHttpServer = WebApp.Start(
                    callStartOptions,
                    (appBuilder) =>
                {
                    var startup = new HttpConfigurationInitializer();
                    startup.ConfigureSettings(appBuilder, _logger);
                });
            }
            catch (Exception e)
            {
                _logger.Error(e, "Unhandled exception in StartServer()");
                throw;
            }
        }