public bool EndTryReply(IAsyncResult result) { bool succeeded = false; try { bool retval = TryReplyAsyncResult.End(result); succeeded = true; return(retval); } finally { if (!succeeded) { this.Abort(); } } }
static void OnSendResponseCompleted(IAsyncResult result) { if (result.CompletedSynchronously) { return; } TryReplyAsyncResult thisPtr = (TryReplyAsyncResult)result.AsyncState; Exception completionException = null; try { thisPtr.OnSendResponseCompletedCore(result); } catch (Exception e) { completionException = e; } thisPtr.Complete(false, completionException); }
public static bool End(IAsyncResult result) { TryReplyAsyncResult thisPtr = AsyncResult.End <TryReplyAsyncResult>(result); return(thisPtr.retval); }