コード例 #1
0
        Link IContainer.CreateLink(ListenerConnection connection, ListenerSession session, Attach attach)
        {
            ListenerLink link = new ListenerLink(session, attach);

            link.SafeAddClosed(this.onLinkClosed);
            return(link);
        }
コード例 #2
0
 public void Add(ListenerLink link, T instance)
 {
     link.SafeAddClosed(this.OnLinkClosed);
     lock (this.collection)
     {
         this.collection.Add(link, instance);
     }
 }
コード例 #3
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);
         }
     }
 }