Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/02/11 18:42:44 (13 years ago)
Author:
ascheibe
Message:

#1233 slave: catch more errors and log them to the windows event log

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveCommunicationService.cs

    r6371 r6945  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.ServiceModel;
     
    5455
    5556    public void LogMessage(string message) {
    56       subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
    57         if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
    58           callback.OnMessageLogged(message);
    59         } else {
    60           subscribers.Remove(callback);
    61         }
    62       });
     57      try {
     58        subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
     59          if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
     60            callback.OnMessageLogged(message);
     61          } else {
     62            subscribers.Remove(callback);
     63          }
     64        });
     65      }
     66      catch (Exception ex) {
     67        EventLogManager.LogException(ex);
     68      }
    6369    }
    6470
    6571    public void StatusChanged(StatusCommons status) {
    66       subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
    67         if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
    68           callback.OnStatusChanged(status);
    69         } else {
    70           subscribers.Remove(callback);
    71         }
    72       });
     72      try {
     73        subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) {
     74          if (((ICommunicationObject)callback).State == CommunicationState.Opened) {
     75            callback.OnStatusChanged(status);
     76          } else {
     77            subscribers.Remove(callback);
     78          }
     79        });
     80      }
     81      catch (Exception ex) {
     82        EventLogManager.LogException(ex);
     83      }
    7384    }
    7485
Note: See TracChangeset for help on using the changeset viewer.