public override bool SendData(byte[] bytes, int size, Topic t) { bool result = true; if (this.topicSinkMap.ContainsKey(t.GetName())) { Entry_T dict = this.topicSinkMap[t.GetName()]; List <string> sinksToDelete = new List <string>(); // Loop over all sinks and send data, remove items that isn't "alive". foreach (KeyValuePair <string, IpPortPair> kvp in dict.portMap) { // Check if this sink is alive if (kvp.Value.IsAlive()) { result &= SendData(bytes, size, InetAddress.GetByName(kvp.Value.Ip), kvp.Value.Port); } else //Remove it. { sinksToDelete.Add(kvp.Key); } } foreach (string key in sinksToDelete) { dict.portMap.Remove(key); } } return(result); }
public bool SendTo(byte[] bytes, int offset, int size, string ip, int port) { try { return(SendTo(bytes, offset, size, InetAddress.GetByName(ip), port)); } catch (Exception ex) { Logger.ExceptionLogger.LogException(ex); return(false); } }
public bool SendTo(byte[] bytes, int offset, int size, string ip, int port) { try { return(this.SendTo(bytes, offset, size, InetAddress.GetByName(ip), port)); } catch (Exception) { return(false); } }
public McSendDataHandler(Topic t, string localInterface) { sender = new MulticastSender(0, localInterface, 1, t.GetOutSocketBufferSize()); // Make ttl configurable sinkIP = InetAddress.GetByName(t.GetDomainAddress()); }
public TcpSendDataHandler(Topic t, string localInterface) { sender = new TcpServerSender(t.GetDomainAddress(), t.GetPort(), t.GetOutSocketBufferSize()); sinkIP = InetAddress.GetByName(t.GetDomainAddress()); }
public McSendDataHandler(Topic t, string localInterface, int ttl) { sender = new MulticastSender(0, localInterface, ttl, t.GetOutSocketBufferSize()); sinkIP = InetAddress.GetByName(t.GetDomainAddress()); }