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

InitializeReceiver() public method

Initializes the receiver state for the link.
public InitializeReceiver ( uint credit, Action onMessage, object state ) : void
credit uint The link credit to send to the peer.
onMessage Action The callback to be invoked for received messages.
state object The user state attached to the link.
return void
        public void InitializeReceiver(uint credit, Action<ListenerLink, Message, DeliveryState, object> onMessage, object state)
        {
            ThrowIfNotNull(this.linkEndpoint, "endpoint");
            ThrowIfNotNull(this.onMessage, "receiver");
            this.credit = credit;
            this.autoRestore = true;
            this.onMessage = onMessage;
            this.state = state;
        }

Usage Example

Beispiel #1
0
            public void AddLink(ListenerLink link, string address)
            {
                if (!link.Role)
                {
                    throw new AmqpException(ErrorCode.NotAllowed, "Only sender link can be attached at " + address);
                }

                link.InitializeReceiver((uint)processor.Credit, dispatchMessage, this);
                link.Closed += OnLinkClosed;
                lock (this.links)
                {
                    this.links.Add(link);
                }
            }
All Usage Examples Of Amqp.Listener.ListenerLink::InitializeReceiver