Example #1
0
 public void AddPublisherLink(PublisherLink pub)
 {
     lock (gate)
     {
         publisherLinks.Add(pub);
     }
 }
Example #2
0
 internal void HandleHeader(PublisherLink link, Header header)
 {
     lock (gate)
     {
         if (Md5Sum == "*")
         {
             Md5Sum = link.Md5Sum;
         }
     }
 }
Example #3
0
 public void headerReceived(PublisherLink link, Header header)
 {
     lock ( md5sum_mutex )
     {
         if (md5sum == "*")
         {
             md5sum = link.md5sum;
         }
     }
 }
Example #4
0
        public void RemovePublisherLink(PublisherLink pub)
        {
            lock (gate)
            {
                publisherLinks.Remove(pub);

                if (pub.Latched)
                {
                    latchedMessages.Remove(pub);
                }
            }
        }
Example #5
0
 public void removePublisherLink(PublisherLink pub)
 {
     lock ( publisher_links_mutex )
     {
         if (publisher_links.Contains(pub))
         {
             publisher_links.Remove(pub);
         }
         if (pub.Latched)
         {
             latched_messages.Remove(pub);
         }
     }
 }
Example #6
0
        internal long HandleMessage(
            RosMessage msg,
            bool ser,
            bool nocopy,
            IDictionary <string, string> connectionHeader,
            PublisherLink link
            )
        {
            RosMessage t            = null;
            long       drops        = 0;
            TimeData   receipt_time = ROS.GetTime().data;

            if (msg.Serialized != null) // will be null if self-subscribed
            {
                msg.Deserialize(msg.Serialized);
            }

            lock (gate)
            {
                foreach (CallbackInfo info in callbacks)
                {
                    string ti = info.Helper.type;
                    if (nocopy || ser)
                    {
                        t = msg;
                        t.connection_header = msg.connection_header;
                        t.Serialized        = null;
                        bool wasFull            = false;
                        bool nonconst_need_copy = callbacks.Count > 1;
                        info.SubscriptionQueue.AddToCallbackQueue(info.Helper, t, nonconst_need_copy, ref wasFull, receipt_time);
                        if (wasFull)
                        {
                            ++drops;
                        }
                        else
                        {
                            info.CallbackQueue.AddCallback(info.SubscriptionQueue, info.SubscriptionQueue);
                        }
                    }
                }
            }

            if (t != null && link.Latched)
            {
                LatchInfo li = new LatchInfo
                {
                    Message          = t,
                    Link             = link,
                    ConnectionHeader = connectionHeader,
                    ReceiptTime      = receipt_time
                };
                if (latchedMessages.ContainsKey(link))
                {
                    latchedMessages[link] = li;
                }
                else
                {
                    latchedMessages.Add(link, li);
                }
            }

            return(drops);
        }
Example #7
0
 public void addPublisherLink(PublisherLink pub)
 {
     publisher_links.Add(pub);
 }