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); } }
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); } }
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); } }