internal void RemoveSubscriberLink(SubscriberLink link) { SubscriberLink lnk = null; lock (gate) { if (Dropped) { return; } if (subscriberLinks.Contains(link)) { lnk = link; subscriberLinks.Remove(lnk); if (subscriberLinks.Count == 0) { StopPublishLoop(); } } } if (lnk != null) { HandlePeerDisconnect(lnk); } }
public void removeSubscriberLink(SubscriberLink link) { SubscriberLink lnk = null; lock ( subscriber_links_mutex ) { if (Dropped) { return; } if (subscriber_links.Contains(link)) { lnk = link; subscriber_links.Remove(lnk); if (subscriber_links.Count == 0) { PollManager.Instance.RemovePollThreadListener(processPublishQueue); } } } if (lnk != null) { peerDisconnect(lnk); } }
internal void HandlePeerDisconnect(SubscriberLink sub_link) { //Logger.LogDebug("PEER DISCONNECT: [" + sub_link.topic + "]"); foreach (SubscriberCallbacks cbs in callbacks) { if (cbs.OnDisconnect != null && cbs.CallbackQueue != null) { var cb = new PeerConnDisconnCallback(cbs.OnDisconnect, sub_link); cbs.CallbackQueue.AddCallback(cb, cbs); } } }
internal void HandlePeerConnect(SubscriberLink sub_link) { //Logger.LogDebug($"PEER CONNECT: Id: {sub_link.connection_id} Dest: {sub_link.destination_caller_id} Topic: {sub_link.topic}"); foreach (SubscriberCallbacks cbs in callbacks) { if (cbs.OnConnect != null && cbs.CallbackQueue != null) { var cb = new PeerConnDisconnCallback(cbs.OnConnect, sub_link); cbs.CallbackQueue.AddCallback(cb, cbs); } } }
public void peerDisconnect(SubscriberLink sub_link) { //ROS.Debug()( $"[{ThisNode.Name}] PEER DISCONNECT: [{sub_link.topic}]" ); foreach (SubscriberCallbacks cbs in callbacks) { if (cbs.disconnect != null && cbs.CallbackQueue != null) { var cb = new PeerConnDisconnCallback(cbs.disconnect, sub_link); cbs.CallbackId = cb.Uid; cbs.CallbackQueue.AddCallback(cb); } } }
public void peerConnect(SubscriberLink sub_link) { //ROS.Debug()( $"[{ThisNode.Name}] PEER CONNECT: Id: {sub_link.connection_id} Dest: {sub_link.destination_caller_id} Topic: {sub_link.topic}" ); foreach (SubscriberCallbacks cbs in callbacks) { if (cbs.connect != null && cbs.CallbackQueue != null) { var cb = new PeerConnDisconnCallback(cbs.connect, sub_link); cbs.CallbackId = cb.Uid; cbs.CallbackQueue.AddCallback(cb); } } }
internal void AddSubscriberLink(SubscriberLink link) { lock (gate) { if (Dropped) { return; } subscriberLinks.Add(link); this.StartPublishLoop(); } if (Latch && lastMessage != null) { link.EnqueueMessage(lastMessage); } HandlePeerConnect(link); }
public void addSubscriberLink(SubscriberLink link) { lock ( subscriber_links_mutex ) { if (Dropped) { return; } subscriber_links.Add(link); PollManager.Instance.AddPollThreadListener(processPublishQueue); } if (Latch && last_message != null) { link.EnqueueMessage(last_message); } peerConnect(link); }
public PeerConnDisconnCallback(SubscriberStatusCallback callback, SubscriberLink subscriberLink) { this.callback = callback; this.subscriberLink = subscriberLink; }