示例#1
0
        /// <summary>
        /// The worker thread that does the actual testing.
        /// </summary>
        void WorkerThreadLoop()
        {
            Log("Server type: " + _server.GetType());
            Log("Starting test...");

            try
            {
                string errmsg;
                var    success = _server.TestConnection(this, out errmsg);

                if (!success)
                {
                    Log("FAILURE: TestConnection returned false, indicating failure. Reason: " + errmsg ?? "[Unknown]");
                    Log("Testing completed UNSUCCESSFULLY. Please close this form when done reading the log.");
                }
                else
                {
                    Log("Testing completed SUCCESSFULLY! Please close this form when done reading the log.");
                }
            }
            catch (Exception ex)
            {
                Log("FAILURE: Exception thrown during testing. Exception:" + Environment.NewLine + ex);
                Log("Testing completed UNSUCCESSFULLY. Please close this form when done reading the log.");
                return;
            }
        }