Exemple #1
0
                void OnObjectOpen(IAsyncResult result)
                {
                    AmqpObject amqpObject = (AmqpObject)result.AsyncState;

                    amqpObject.EndOpen(result);
                    if (amqpObject is AmqpLink)
                    {
                        this.Complete(false);
                    }
                }
Exemple #2
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);
            }
        }