コード例 #1
0
 private void EndpointNotFoundCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ChannelAndRequestAsyncState asyncState = (ChannelAndRequestAsyncState)result.AsyncState;
         bool flag = true;
         try
         {
             ReplySessionDemuxFailureAsyncResult.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.request);
                 asyncState.channel.Abort();
             }
         }
     }
 }
コード例 #2
0
        protected override void EndpointNotFound(IReplySessionChannel channel, RequestContext request)
        {
            bool flag = true;

            try
            {
                if (base.DemuxFailureHandler != null)
                {
                    try
                    {
                        ReplySessionDemuxFailureAsyncResult result = new ReplySessionDemuxFailureAsyncResult(base.DemuxFailureHandler, request, channel, Fx.ThunkCallback(new AsyncCallback(this.EndpointNotFoundCallback)), new ChannelAndRequestAsyncState(channel, request));
                        result.Start();
                        if (!result.CompletedSynchronously)
                        {
                            flag = false;
                        }
                        else
                        {
                            ReplySessionDemuxFailureAsyncResult.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);
                    channel.Abort();
                }
            }
        }