Example #1
0
 protected override void OnStop()
 {
     Console.WriteLine("in stop");
     stopInterfaces();
     for (int i = 0; i < 10; i++)
     {
         if (WeiService.isAnyInterfaceRunning())
         {
             Thread.Sleep(5000);
         }
     }
     if (serviceHost != null)
     {
         serviceHost.Close();
         serviceHost = null;
     }
 }
        private bool shutdown(bool force)
        {
            WeiService.stopInterfaces();
            for (int i = 0; i < 10; i++)
            {
                if (WeiService.isAnyInterfaceRunning())
                {
                    Thread.Sleep(5000);
                }
                else
                {
                    WeiService.instance.Stop();
                    return(true);
                }
            }

            if (force)
            {
                WeiService.instance.Stop();
                return(true);
            }

            return(false);
        }