Ejemplo n.º 1
0
        protected override async Task EndpointNotFoundAsync(RequestContext request)
        {
            bool abortItem = true;

            try
            {
                if (DemuxFailureHandler != null)
                {
                    try
                    {
                        await DemuxFailureHandler.HandleDemuxFailureAsync(request.RequestMessage, request);

                        abortItem = false;
                    }
                    catch (CommunicationException e)
                    {
                        DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
                    }
                    catch (TimeoutException e)
                    {
                        DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
                    }
                    catch (ObjectDisposedException e)
                    {
                        DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
                    }
                    catch (Exception e)
                    {
                        if (Fx.IsFatal(e))
                        {
                            throw;
                        }
                        throw e;
                    }
                }
            }
            finally
            {
                if (abortItem)
                {
                    AbortItem(request);
                }
            }
        }
Ejemplo n.º 2
0
        protected override async Task EndpointNotFoundAsync(IDuplexSessionChannel channel, Message message)
        {
            bool abortItem = true;

            try
            {
                if (DemuxFailureHandler != null)
                {
                    var duplexSessionRequestContext = new DuplexSessionRequestContext(channel, message);
                    await DemuxFailureHandler.HandleDemuxFailureAsync(message, duplexSessionRequestContext);

                    abortItem = false;
                }
            }
            catch (CommunicationException e)
            {
                DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
            }
            catch (TimeoutException e)
            {
                DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
            }
            catch (ObjectDisposedException e)
            {
                DiagnosticUtility.TraceHandledException(e, TraceEventType.Information);
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                throw;
            }
            finally
            {
                if (abortItem)
                {
                    AbortMessage(message);
                    channel.Abort();
                }
            }
        }