public InitializeReceiver ( uint credit, Action |
||
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 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); } }
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); } } }