Ejemplo n.º 1
0
        private void OperationCompleteBroadcastCallFinishedHandler(Dispatcher dispatcher, IMessage message,
                                                                   ResultCollector resultCollector)
        {
            lock (resultCollector)
            {
                foreach (DictionaryEntry entry in resultCollector.Failed)
                {
                    string mbrUri = (string)entry.Key;
                    Exception ex = null;
                    if (entry.Value is Exception)
                    {
                        ex = (Exception)entry.Value;
                    }
                    else
                    {
                        ex = ((IMethodReturnMessage)entry.Value).Exception;
                    }
                    MarshalByRefObject failedObject =
                        dispatcher.FindObjectByUri(mbrUri);

                    Console.WriteLine(
                        "OperationCompleteBroadcastCallFinishedHandler: Receiver {0} has failed. Error: {1}",
                        mbrUri, ex.Message);
                    // here you have failed MBR object (failedObject)
                    // and Exception (ex)
                }
            }
        }