Esempio n. 1
0
        static bool ChannelCloseCallback(IAsyncResult result)
        {
            ProcessMessagesAsyncResult <TContract> thisPtr = (ProcessMessagesAsyncResult <TContract>)result.AsyncState;

            FxTrace.Trace.SetAndTraceTransfer(thisPtr.channelExtension.ActivityID, true);
            try
            {
                thisPtr.allCompletedSync = false;
                try
                {
                    thisPtr.ChannelCloseComplete(result);
                }
                catch (Exception exception)
                {
                    if (!thisPtr.HandleCloseFailure(exception))
                    {
                        throw;
                    }
                }

                thisPtr.ProcessWhileSync();
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }

                thisPtr.Fault(e);
            }
            return(false);
        }
Esempio n. 2
0
 void EndProcessMessage <TContract>(IAsyncResult result)
 {
     try
     {
         FxTrace.Trace.SetAndTraceTransfer(this.ChannelExtension.ActivityID, true);
         ProcessMessagesAsyncResult <TContract> .End(result);
     }
     catch (Exception exception)
     {
         if (TD.RoutingServiceProcessingFailureIsEnabled())
         {
             TD.RoutingServiceProcessingFailure(this.eventTraceActivity, OperationContext.Current.Channel.LocalAddress.ToString(), exception);
         }
         throw;
     }
 }
Esempio n. 3
0
        static bool CompleteReceiveContextCallback(IAsyncResult result)
        {
            ProcessMessagesAsyncResult <TContract> thisPtr = (ProcessMessagesAsyncResult <TContract>)result.AsyncState;

            FxTrace.Trace.SetAndTraceTransfer(thisPtr.channelExtension.ActivityID, true);
            try
            {
                thisPtr.allCompletedSync = false;
                if (thisPtr.CompleteReceiveContextCompleted(result))
                {
                    thisPtr.ProcessWhileSync();
                }
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                thisPtr.Fault(e);
            }
            return(false);
        }