示例#1
0
        public void AddSink(string topic, string ip, int port, bool staticRoute)
        {
            IpPortPair ipp = new IpPortPair(ip, port, staticRoute);

            if (this.topicSinkMap.ContainsKey(topic))
            {
                Entry_T dict = this.topicSinkMap[topic];

                //If created as static route, we only add sinks that are static
                if ((!dict.staticRoute) || (dict.staticRoute && staticRoute))
                {
                    //Check if sink already exist
                    if (dict.portMap.ContainsKey(ipp.Key))
                    {
                        dict.portMap[ipp.Key].FeedWatchdog(staticRoute);
                    }
                    else
                    {
                        dict.portMap.Add(ipp.Key, ipp);
                    }
                }
            }
            else
            {
                Entry_T dict = new Entry_T(staticRoute);
                dict.portMap.Add(ipp.Key, ipp);
                this.topicSinkMap.Add(topic, dict);
            }
        }
示例#2
0
        public void AddSink(string topic, string ip, int port)
        {
            IpPortPair ipp = new IpPortPair(ip, port);

            if (this.topicSinkMap.ContainsKey(topic))
            {
                Dictionary<string, IpPortPair> dict = this.topicSinkMap[topic];

                if (dict.ContainsKey(ipp.GetKey()))
                {
                    dict[ipp.GetKey()].FeedWatchdog();
                }
                else
                {
                    dict.Add(ipp.GetKey(), ipp);
                }
            }
            else
            {
                Dictionary<string, IpPortPair> dict = new Dictionary<string,IpPortPair>();
                dict.Add(ipp.GetKey(), ipp);
                this.topicSinkMap.Add(topic, dict);
            }
        }
示例#3
0
        public void AddSink(string topic, string ip, int port)
        {
            IpPortPair ipp = new IpPortPair(ip, port);

            if (this.topicSinkMap.ContainsKey(topic))
            {
                Dictionary <string, IpPortPair> dict = this.topicSinkMap[topic];

                if (dict.ContainsKey(ipp.GetKey()))
                {
                    dict[ipp.GetKey()].FeedWatchdog();
                }
                else
                {
                    dict.Add(ipp.GetKey(), ipp);
                }
            }
            else
            {
                Dictionary <string, IpPortPair> dict = new Dictionary <string, IpPortPair>();
                dict.Add(ipp.GetKey(), ipp);
                this.topicSinkMap.Add(topic, dict);
            }
        }