protected override void InternalProcessRecord() { base.InternalProcessRecord(); TaskLogger.LogEnter(); try { foreach (ReceiveConnector receiveConnector in this.receiveConnectors) { foreach (IPBinding ipbinding in receiveConnector.Bindings) { Exception ex = null; try { IList <IPEndPoint> endPoints = TestSmtpConnectivity.GetEndPoints(this.server, ipbinding); foreach (IPEndPoint endPoint in endPoints) { SmtpConnectivityStatus status = TestSmtpConnectivity.GetStatus(this.server, receiveConnector, ipbinding, endPoint); base.WriteObject(status); if (this.MonitoringContext) { this.AddMonitoringData(status); } } } catch (ManagementException ex2) { ex = ex2; } catch (COMException ex3) { ex = ex3; } catch (UnauthorizedAccessException ex4) { ex = ex4; } if (ex != null) { SmtpConnectivityStatus smtpConnectivityStatus = new SmtpConnectivityStatus(this.server, receiveConnector, ipbinding, ipbinding); smtpConnectivityStatus.StatusCode = SmtpConnectivityStatusCode.UnableToComplete; smtpConnectivityStatus.Details = ex.Message; base.WriteObject(smtpConnectivityStatus); if (this.MonitoringContext) { this.AddMonitoringData(smtpConnectivityStatus); } } } } } finally { if (this.MonitoringContext) { this.WriteMonitoringObject(); } TaskLogger.LogExit(); } }
private void AddMonitoringData(SmtpConnectivityStatus status) { if (this.results == null) { this.results = new List <SmtpConnectivityStatus>(); } this.results.Add(status); }