private static void OnOpen(IAsyncResult result) { if (!result.CompletedSynchronously) { DuplexSessionOneWayChannelFactory.DuplexSessionOutputChannel.SendAsyncResult asyncState = (DuplexSessionOneWayChannelFactory.DuplexSessionOutputChannel.SendAsyncResult)result.AsyncState; Exception exception = null; bool flag = false; try { asyncState.CompleteOpen(result); flag = asyncState.SendMessage(); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } flag = true; exception = exception2; } if (flag) { asyncState.Cleanup(exception == null); asyncState.Complete(false, exception); } } }
private static void OnInnerSend(IAsyncResult result) { if (!result.CompletedSynchronously) { DuplexSessionOneWayChannelFactory.DuplexSessionOutputChannel.SendAsyncResult asyncState = (DuplexSessionOneWayChannelFactory.DuplexSessionOutputChannel.SendAsyncResult)result.AsyncState; Exception exception = null; try { asyncState.innerChannel.EndSend(result); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } asyncState.Cleanup(exception == null); asyncState.Complete(false, exception); } }