Esempio n. 1
0
 private static void DemuxFailureHandlerCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ReplyChannelDemuxFailureAsyncResult asyncState = (ReplyChannelDemuxFailureAsyncResult)result.AsyncState;
         bool      flag      = false;
         Exception exception = null;
         try
         {
             asyncState.demuxFailureHandler.EndHandleDemuxFailure(result);
             flag = asyncState.OnDemuxFailureHandled();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             flag      = true;
             exception = exception2;
         }
         if (flag)
         {
             asyncState.Complete(false, exception);
         }
     }
 }
 private void EndpointNotFoundCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         RequestContext asyncState = (RequestContext)result.AsyncState;
         bool           flag       = true;
         try
         {
             ReplyChannelDemuxFailureAsyncResult.End(result);
             flag = false;
         }
         catch (TimeoutException exception)
         {
             if (DiagnosticUtility.ShouldTraceInformation)
             {
                 DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Information);
             }
         }
         catch (CommunicationException exception2)
         {
             if (DiagnosticUtility.ShouldTraceInformation)
             {
                 DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Information);
             }
         }
         catch (ObjectDisposedException exception3)
         {
             if (DiagnosticUtility.ShouldTraceInformation)
             {
                 DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Information);
             }
         }
         catch (Exception exception4)
         {
             if (Fx.IsFatal(exception4))
             {
                 throw;
             }
             base.HandleUnknownException(exception4);
         }
         finally
         {
             if (flag)
             {
                 this.AbortItem(asyncState);
             }
         }
     }
 }
        protected override void EndpointNotFound(RequestContext request)
        {
            bool flag = true;

            try
            {
                if (base.DemuxFailureHandler != null)
                {
                    try
                    {
                        ReplyChannelDemuxFailureAsyncResult result = new ReplyChannelDemuxFailureAsyncResult(base.DemuxFailureHandler, request, Fx.ThunkCallback(new AsyncCallback(this.EndpointNotFoundCallback)), request);
                        result.Start();
                        if (!result.CompletedSynchronously)
                        {
                            flag = false;
                        }
                        else
                        {
                            ReplyChannelDemuxFailureAsyncResult.End(result);
                            flag = false;
                        }
                    }
                    catch (CommunicationException exception)
                    {
                        if (DiagnosticUtility.ShouldTraceInformation)
                        {
                            DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Information);
                        }
                    }
                    catch (TimeoutException exception2)
                    {
                        if (DiagnosticUtility.ShouldTraceInformation)
                        {
                            DiagnosticUtility.ExceptionUtility.TraceHandledException(exception2, TraceEventType.Information);
                        }
                    }
                    catch (ObjectDisposedException exception3)
                    {
                        if (DiagnosticUtility.ShouldTraceInformation)
                        {
                            DiagnosticUtility.ExceptionUtility.TraceHandledException(exception3, TraceEventType.Information);
                        }
                    }
                    catch (Exception exception4)
                    {
                        if (Fx.IsFatal(exception4))
                        {
                            throw;
                        }
                        base.HandleUnknownException(exception4);
                    }
                }
            }
            finally
            {
                if (flag)
                {
                    this.AbortItem(request);
                }
            }
        }