Exemplo n.º 1
0
 private static void DemuxFailureHandlerCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         DuplexSessionDemuxFailureAsyncResult asyncState = (DuplexSessionDemuxFailureAsyncResult)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);
         }
     }
 }
Exemplo n.º 2
0
 private void EndpointNotFoundCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         ChannelAndMessageAsyncState asyncState = (ChannelAndMessageAsyncState)result.AsyncState;
         bool flag = true;
         try
         {
             DuplexSessionDemuxFailureAsyncResult.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.message);
                 asyncState.channel.Abort();
             }
         }
     }
 }
Exemplo n.º 3
0
 private static void ChannelCloseCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         DuplexSessionDemuxFailureAsyncResult asyncState = (DuplexSessionDemuxFailureAsyncResult)result.AsyncState;
         Exception exception = null;
         try
         {
             asyncState.channel.EndClose(result);
             asyncState.message.Close();
         }
         catch (Exception exception2)
         {
             if (Fx.IsFatal(exception2))
             {
                 throw;
             }
             exception = exception2;
         }
         asyncState.Complete(false, exception);
     }
 }
Exemplo n.º 4
0
        protected override void EndpointNotFound(IDuplexSessionChannel channel, Message message)
        {
            bool flag = true;

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