Example #1
0
        /// <summary>
        /// stop HTTP Localhost
        /// </summary>
        public void Stop()
        {
            if (_http == null)
            {
                return;
            }

            // method to wait for still running events before shutdown
            //new Thread(new ThreadStart(delegate ()
            //{
            //    // Wait a few seconds and if threads are not terminated, kill the process
            //    for (int i = 0; i < 20; i++)
            //    {
            //        Thread.Sleep(100);
            //        if (_http == null)
            //            return;
            //    }
            //    Process.GetCurrentProcess().Kill();
            //})).Start();


            _http.Stop();
            _http = null;

            IsRunning = false;
        }
Example #2
0
 private void StartHttpServer()
 {
     if (_http != null)
     {
         return;
     }
     _http = new PersonalAnalyticsHttp();
     _http.Start();
 }
Example #3
0
 private void StartHttpServer()
 {
     if (_http != null) return;
     _http = new PersonalAnalyticsHttp();
     _http.Start();
 }
Example #4
0
        /// <summary>
        /// stop HTTP Localhost
        /// </summary>
        public void Stop()
        {
            if (_http == null) return;

            // method to wait for still running events before shutdown
            //new Thread(new ThreadStart(delegate ()
            //{
            //    // Wait a few seconds and if threads are not terminated, kill the process
            //    for (int i = 0; i < 20; i++)
            //    {
            //        Thread.Sleep(100);
            //        if (_http == null)
            //            return;
            //    }
            //    Process.GetCurrentProcess().Kill();
            //})).Start();

            _http.Stop();
            _http = null;

            IsRunning = false;
        }