public void AddAddress(string IP, int port) { UnifiedAddress item = new UnifiedAddress(IP, port); if (!pAddresses.Contains(item)) pAddresses.Add(item); }
public static IPAddress ExtractAddress(UnifiedAddress dnsOrIP) { try { return IPAddress.Parse(dnsOrIP.address); } catch (FormatException) { return Dns.GetHostEntry(dnsOrIP.address).AddressList[0]; } }