Amqp.Listener.ListenerLink.SetCredit C# (CSharp) Method

SetCredit() public method

Sets a credit on the link. A flow is sent to the peer to update link flow control state.
public SetCredit ( int credit, bool drain, bool autoRestore = true ) : void
credit int The new link credit.
drain bool Sets the drain flag in the flow performative.
autoRestore bool If true, link credit is auto-restored when a message is accepted/rejected /// by the caller. If false, caller is responsible for manage link credits.
return void
        public void SetCredit(int credit, bool drain, bool autoRestore = true)
        {
            this.ThrowIfDetaching("set-credit");
            lock (this.ThisLock)
            {
                this.credit = (uint)credit;
                this.autoRestore = autoRestore;
                this.restored = 0;
                this.SendFlow(this.deliveryCount, this.credit, drain);
            }
        }