static bool OperationCallback(IAsyncResult result)
        {
            ProcessRequestAsyncResult <TContract> thisPtr = (ProcessRequestAsyncResult <TContract>)result.AsyncState;

            FxTrace.Trace.SetAndTraceTransfer(thisPtr.service.ChannelExtension.ActivityID, true);
            thisPtr.allCompletedSync = false;

            try
            {
                if (thisPtr.OperationComplete(result))
                {
                    return(true);
                }
            }
            catch (Exception exception)
            {
                if (Fx.IsFatal(exception))
                {
                    throw;
                }

                if (!thisPtr.HandleClientOperationFailure(exception))
                {
                    throw;
                }
            }

            while (thisPtr.StartProcessing())
            {
            }

            return(false);
        }
Exemple #2
0
 Message EndProcessRequest <TContract>(IAsyncResult result)
 {
     try
     {
         FxTrace.Trace.SetAndTraceTransfer(this.ChannelExtension.ActivityID, true);
         return(ProcessRequestAsyncResult <TContract> .End(result));
     }
     catch (Exception exception)
     {
         if (TD.RoutingServiceProcessingFailureIsEnabled())
         {
             TD.RoutingServiceProcessingFailure(this.eventTraceActivity, OperationContext.Current.Channel.LocalAddress.ToString(), exception);
         }
         throw;
     }
 }
        internal static Message End(IAsyncResult result)
        {
            ProcessRequestAsyncResult <TContract> processRequest = AsyncResult.End <ProcessRequestAsyncResult <TContract> >(result);

            return(processRequest.replyMessage);
        }