private static void AddComplete(IAsyncResult result) { if (!result.CompletedSynchronously) { ReliableOutputConnection.AddAsyncResult asyncState = (ReliableOutputConnection.AddAsyncResult)result.AsyncState; bool flag = false; Exception exception = null; try { flag = asyncState.CompleteAdd(result); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } if (flag || (exception != null)) { asyncState.Complete(false, exception); } } }
private static void SendComplete(IAsyncResult result) { if (!result.CompletedSynchronously) { ReliableOutputConnection.AddAsyncResult asyncState = (ReliableOutputConnection.AddAsyncResult)result.AsyncState; Exception exception = null; try { asyncState.CompleteSend(result); } catch (Exception exception2) { if (Fx.IsFatal(exception2)) { throw; } exception = exception2; } asyncState.Complete(false, exception); } }