Ejemplo n.º 1
0
        public void Subscribe()
        {
            _monitorMessageCalls      = OperationContext.Current.GetCallbackChannel <IPubSubMonitoringContract>();
            _subscribedMonitorHandler = new MethodRanEventHandler(PublishMethodRanHandler);
            MonitoringMessageEvent    = _subscribedMonitorHandler;

            try
            {
                _monitoredAppMessageCalls.PublishSubscribeMessage();
            }
            catch (Exception ex)
            {
                try
                {
                    _monitorMessageCalls.ErrorOccured($"An error occured in the MonitoringWindowsService:\n{ex.Message}");
                }
                catch (Exception exc)
                {
                    // log the exception.
                }
            }
        }
Ejemplo n.º 2
0
 public void MonitoredApplicationHello()
 {
     // setup a channel to communicate from monitoring service to monitoredApplication.
     _monitoredAppMessageCalls = OperationContext.Current.GetCallbackChannel <IPubSubMonitoringContract>();
 }