Exemple #1
0
 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);
     }
 }
Exemple #2
0
                void OnObjectOpen(IAsyncResult result)
                {
                    AmqpObject amqpObject = (AmqpObject)result.AsyncState;

                    amqpObject.EndOpen(result);
                    if (amqpObject is AmqpLink)
                    {
                        this.Complete(false);
                    }
                }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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();
            }
        }
Exemple #5
0
        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();
            }
        }
Exemple #6
0
 public AmqpObjectAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState)
     : base(timeout, callback, asyncState)
 {
     this.amqpObject = amqpObject;
 }
Exemple #7
0
 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);
     }
 }
Exemple #8
0
 public AmqpObjectAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState)
     : base(timeout, callback, asyncState)
 {
     this.amqpObject = amqpObject;
 }
Exemple #9
0
 public OpenAsyncResult(AmqpObject amqpObject, TimeSpan timeout, AsyncCallback callback, object asyncState) : base(amqpObject, timeout, callback, asyncState)
 {
     amqpObject.pendingOpen = this;
     base.Start();
 }