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); } }