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(); } } } }
private static void ChannelCloseCallback(IAsyncResult result) { if (!result.CompletedSynchronously) { ReplySessionDemuxFailureAsyncResult asyncState = (ReplySessionDemuxFailureAsyncResult)result.AsyncState; Exception exception = null; try { asyncState.channel.EndClose(result); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } asyncState.Complete(false, exception); } }
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(); } } }