private static void OpenChannelCallback(IAsyncResult result) { if (!result.CompletedSynchronously) { SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult asyncState = (SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult)result.AsyncState; bool flag = false; Exception e = null; try { asyncState.channel.EndOpen(result); flag = asyncState.OnChannelOpened(); if (flag) { asyncState.OnOperationComplete(); } } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; e = exception2; asyncState.OnOperationFailure(e); } if (flag) { asyncState.Complete(false, e); } } }
private static void CloseChannelCallback(IAsyncResult result) { if (!result.CompletedSynchronously) { SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult asyncState = (SecuritySessionSecurityTokenProvider.SessionOperationAsyncResult)result.AsyncState; Exception e = null; try { asyncState.channel.EndClose(result); asyncState.OnOperationComplete(); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } e = exception2; asyncState.OnOperationFailure(e); } asyncState.Complete(false, e); } }