Example #1
0
        public void InitServiceTest()
        {
            new Thread(() => {
                while (true)
                {
                    var pid = "0";
                    try
                    {
                        pid = HttpRequestUtil.GetHttpResponse("http://localhost:8081/pid", 3000);
                    }
                    catch (Exception e) { }

                    var p = Convert.ToInt64(pid);
                    if (p > 0)
                    {
                        CmdUtils.RunCmdStandard("taskkill /f /pid " + p);
                        break;
                    }
                    else
                    {
                        Thread.Sleep(3000);
                    }
                }
            }).Start();

            IRpcService rpc = new RpcServiceImpl();

            rpc.ReCreateJMapQuery();
            rpc.InitService();
        }
Example #2
0
        public bool CloseJMapQuery()
        {
            bool status = false;
            var  ss     = ServiceManager.RegistService(x =>
            {
                int queryCount = 0;
                while (queryCount <= 10)
                {
                    var pid = JMapQueryIsRunning();
                    if (pid > 0)
                    {
                        CloseSupervisor();
                        CmdUtils.RunCmdStandard("taskkill /f /pid " + pid);
                        status = true;
                        break;
                    }
                    else
                    {
                        Thread.Sleep(3000);
                        queryCount++;
                    }
                }
            }, null);

            ServiceManager.ExecuteService(ss.Id);

            return(status);
        }
Example #3
0
 public void RunCmdStandardTest()
 {
     CmdUtils.RunCmdStandard("ipconfig");
 }