public CloseAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState) : base(amqpObject, timeout, callback, asyncState) { amqpObject.closeCompleteCallback = this.OnComplete; if (amqpObject.CloseInternal()) { this.OnComplete(true, null); } }
void OnObjectOpen(IAsyncResult result) { AmqpObject amqpObject = (AmqpObject)result.AsyncState; amqpObject.EndOpen(result); if (amqpObject is AmqpLink) { this.Complete(false); } }
private void OnOperationComplete(AmqpObject link, IAsyncResult result, bool isOpen) { Exception exception = null; try { if (!isOpen) { link.EndClose(result); } else { link.EndOpen(result); } } catch (Exception exception2) { Exception exception1 = exception2; if (Fx.IsFatal(exception1)) { throw; } exception = exception1; } bool flag = true; if (exception == null) { AmqpObjectState amqpObjectState = (isOpen ? AmqpObjectState.OpenSent : AmqpObjectState.CloseSent); lock (base.ThisLock) { flag = (this.sender.State == amqpObjectState ? false : this.receiver.State != amqpObjectState); } } if (flag) { if (isOpen) { base.CompleteOpen(false, exception); return; } base.CompleteClose(false, exception); } }
private static void OnSafeCloseComplete(IAsyncResult result) { AmqpObject asyncState = (AmqpObject)result.AsyncState; try { asyncState.EndClose(result); } catch (Exception exception1) { Exception exception = exception1; if (Fx.IsFatal(exception)) { throw; } Fx.Exception.AsError(exception, null); asyncState.Abort(); } }
static void OnTryCloseComplete(IAsyncResult result) { AmqpObject thisPtr = (AmqpObject)result.AsyncState; try { thisPtr.EndClose(result); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } Fx.Exception.AsError(exception); } finally { thisPtr.NotifyClosed(); } }
public AmqpObjectAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState) : base(timeout, callback, asyncState) { this.amqpObject = amqpObject; }
public OpenAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState) : base(amqpObject, timeout, callback, asyncState) { amqpObject.pendingOpen = this; base.Start(); }