示例#1
0
 public void ClearError()
 {
     lock (lockobj)
     {
         try
         {
             if (cr != null)
             {
                 cr.Kill();
                 cr.Dispose();
                 cr = null;
             }
         }
         catch (ImproperException)
         {
             Console.WriteLine("Caught improper exception due to invalid exit before");
         }
     }
 }
示例#2
0
        /// <summary>
        /// Starts the Chef-Client run
        /// </summary>
        /// <param name="ChefArgs"></param>
        public void StartChef(string ChefArgs)
        {
            ValidateClientIPAddress();

            lock (lockobj)
            {
                if (cr != null)
                {
                    cr.Dispose();
                    cr = null;
                }
                cr = new ChefRunner(ChefArgs);
                cr.StartChef();
            }
        }