예제 #1
0
            protected override AmqpLink CreateLink(AmqpSession session)
            {
                AmqpLinkSettings settings = new AmqpLinkSettings();

                settings.LinkName = Guid.NewGuid().ToString("N");
                settings.Source   = new Source()
                {
                    Address = this.Node
                };
                settings.Role = true;
                ReceivingAmqpLink link = new ReceivingAmqpLink(session, settings);

                link.RegisterMessageListener(this.OnMessage);
                return(link);
            }
예제 #2
0
            // Find a matching client side link; otherwise wait
            AmqpLink AcceptLink(string node, bool isReceiver, Action <AmqpMessage> messageListener)
            {
                LinkAsyncResult result = null;

                if (this.TryMatchLink(node, true, isReceiver, (r) => { return(new AcceptLinkAsyncResult(r, messageListener, null, null)); }, out result))
                {
                    if (isReceiver)
                    {
                        ReceivingAmqpLink link = (ReceivingAmqpLink)result.Link;
                        link.RegisterMessageListener(messageListener);
                    }

                    result.Signal(null);
                    return(result.Link);
                }

                return(AcceptLinkAsyncResult.End(result));
            }
예제 #3
0
 protected override AmqpLink CreateLink(AmqpSession session)
 {
     AmqpLinkSettings settings = new AmqpLinkSettings();
     settings.LinkName = Guid.NewGuid().ToString("N");
     settings.Source = new Source() { Address = this.Node };
     settings.Role = true;
     ReceivingAmqpLink link = new ReceivingAmqpLink(session, settings);
     link.RegisterMessageListener(this.OnMessage);
     return link;
 }