Exemplo n.º 1
0
        protected AmqpLink(AmqpSession session, AmqpLinkSettings linkSettings)
        {
            if (linkSettings == null)
            {
                throw new ArgumentNullException("linkSettings");
            }

            this.Session               = session;
            this.settings              = linkSettings;
            this.linkCredit            = this.settings.TransferLimit;
            this.settings.AutoSendFlow = this.linkCredit > 0;
            this.syncRoot              = new object();
            Source source = (Source)this.settings.Source;

            if (source != null)
            {
                this.defaultOutcome = source.DefaultOutcome;
            }

            if (this.defaultOutcome == null)
            {
                this.defaultOutcome = AmqpConstants.ReleasedOutcome;
            }

            this.unsettledMap      = new Dictionary <ArraySegment <byte>, Delivery>(ByteArrayComparer.Instance);
            this.pendingDeliveries = new SerializedWorker <Delivery>(this.TrySendDelivery, this.AbortDelivery, false);
            session.AttachLink(this);
        }
Exemplo n.º 2
0
        protected AmqpLink(AmqpSession session, AmqpLinkSettings linkSettings)
        {
            if (linkSettings == null)
            {
                throw new ArgumentNullException("linkSettings");
            }

            this.Session = session;
            this.settings = linkSettings;
            this.linkCredit = this.settings.TransferLimit;
            this.settings.AutoSendFlow = this.linkCredit > 0;
            this.syncRoot = new object();
            Source source = (Source)this.settings.Source;
            if (source != null)
            {
                this.defaultOutcome = source.DefaultOutcome;
            }

            if (this.defaultOutcome == null)
            {
                this.defaultOutcome = AmqpConstants.ReleasedOutcome;
            }

            this.unsettledMap = new Dictionary<ArraySegment<byte>, Delivery>(ByteArrayComparer.Instance);
            this.pendingDeliveries = new SerializedWorker<Delivery>(this.TrySendDelivery, this.AbortDelivery, false);
            session.AttachLink(this);
        }
Exemplo n.º 3
0
 public void AttachTo(AmqpSession session)
 {
     this.MaxFrameSize = session.Connection.Settings.MaxFrameSize();
     this.Session      = session;
     session.AttachLink(this);
 }