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

CompleteAttach() public method

Completes the link attach request. This should be called when the IContainer.AttachLink implementation returns false and the asynchrounous processing completes.
public CompleteAttach ( Amqp.Framing.Attach attach, Error error ) : void
attach Amqp.Framing.Attach The attach to send back.
error Error The error, if any, for the link.
return void
        public void CompleteAttach(Attach attach, Error error)
        {
            if (error != null)
            {
                this.SendAttach(!attach.Role, attach.InitialDeliveryCount, new Attach() { Target = null, Source = null });
            }
            else
            {
                this.SendAttach(!attach.Role, attach.InitialDeliveryCount, new Attach() { Target = attach.Target, Source = attach.Source });
            }

            base.OnAttach(attach.Handle, attach);

            if (error != null)
            {
                this.Close(0, error);
            }
            else
            {
                if (this.credit > 0)
                {
                    this.SendFlow(this.deliveryCount, credit, false);
                }
            }
        }