Exemplo n.º 1
0
        public override void Stop()
        {
            try
            {
                // 子服务管理器
                if (sonServiceManager != null)
                {
                    sonServiceManager.Stop();
                    if (!sonServiceManager.IsRuning)
                    {
                        LogManager.AppendDebug(ServerTypeName.Dispatch, projectName + "子服务管理器已停止");
                        this.sonServiceManager = null;
                    }
                    else
                    {
                        LogManager.AppendErrMsg(ServerTypeName.Dispatch, projectName + "子服务管理器停止失败");
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.AppendErrMsg(ServerTypeName.Dispatch, projectName + "子服务管理器停止失败:" + e.Message);
            }

            IsRuning = false;
        }
Exemplo n.º 2
0
        public override void Start(out string errMsg)
        {
            errMsg = "";
            // 环境检查
            if (!EnvChecker.Check(out errMsg))
            {
                return;
            }

            // 子服务管理器
            if (sonServiceManager != null)
            {
                sonServiceManager.Stop();
            }
            sonServiceManager = new SonServiceManager();
            sonServiceManager.Start(out errMsg);
            if (!string.IsNullOrWhiteSpace(errMsg) || sonServiceManager.IsRuning == false)
            {
                Stop();
                return;
            }
            LogManager.AppendInfo(ServerTypeName.Dispatch, projectName + "子服务管理器已经启动");

            IsRuning = true;
        }