Esempio n. 1
0
        /// <summary>
        /// 服务异常处理
        /// </summary>
        /// <param name="serviceProp"></param>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void HandleServiceException(IService.ServiceProp serviceProp, object sender, UnhandledExceptionEventArgs e)
        {
            SetServiceStatus(serviceProp.Code, "服务异常终止");
            Exception ex = (Exception)e.ExceptionObject;

            //输出信息
            WriteLog(serviceProp.Code, "服务 " + serviceProp.Name + " 发生了未处理的异常:", "error", DateTime.Now);
            WriteLog(serviceProp.Code, ex.ToString(), "error", DateTime.Now);

            //重启服务
            CallRestartService(serviceProp.Code);
        }
Esempio n. 2
0
 public Host(IForm ui, ServiceProp sp)
 {
     UI          = ui;
     serviceProp = sp;
 }