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
コード例 #1
0
ファイル: ContainerHost.cs プロジェクト: mbassit/amqpnetlite
            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);
                }
            }
コード例 #2
0
 public void AddLink(ListenerLink link, string address, Attach attach)
 {
     if (!link.Role)
     {
         string replyTo = ((Target)attach.Target).Address;
         AddProcessor(this.responseLinks, replyTo, link);
         link.SettleOnSend = true;
         link.InitializeSender((c, s) => { }, null, Tuple.Create(this, replyTo));
         link.SafeAddClosed((s, e) => OnLinkClosed(s, e));
     }
     else
     {
         link.InitializeReceiver(300, dispatchRequest, this);
         link.SafeAddClosed((s, e) => OnLinkClosed(s, e));
         lock (this.requestLinks)
         {
             this.requestLinks.Add(link);
         }
     }
 }