private static void OnUpgradeInitiatorOpen(IAsyncResult result) { if (!result.CompletedSynchronously) { ClientFramingDuplexSessionChannel.SendPreambleAsyncResult asyncState = (ClientFramingDuplexSessionChannel.SendPreambleAsyncResult)result.AsyncState; bool flag = false; Exception exception = null; try { flag = asyncState.HandleInitiatorOpen(result); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; exception = exception2; } if (flag) { asyncState.Complete(false, exception); } } }
private static void OnWritePreambleEnd(IAsyncResult result) { if (!result.CompletedSynchronously) { ClientFramingDuplexSessionChannel.SendPreambleAsyncResult asyncState = (ClientFramingDuplexSessionChannel.SendPreambleAsyncResult)result.AsyncState; Exception exception = null; bool flag = false; try { asyncState.connection.EndWrite(result); flag = asyncState.ReadAck(); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; exception = exception2; } if (flag) { asyncState.Complete(false, exception); } } }
private static void OnReadPreambleAck(object state) { bool flag; ClientFramingDuplexSessionChannel.SendPreambleAsyncResult result = (ClientFramingDuplexSessionChannel.SendPreambleAsyncResult)state; Exception exception = null; try { flag = result.HandlePreambleAck(); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; exception = exception2; } if (flag) { result.Complete(false, exception); } }