public IPEndPoint(IPAddress address, int port) { if (address == null) throw new ArgumentNullException ("address"); if (port < 0 || port > 65535) throw new ArgumentOutOfRangeException ("port"); this.Address = address; this.Port = port; }
public static bool TryParse(string ipString, out IPAddress address) { if (ipString == null) throw new ArgumentNullException ("ipString"); System.Net.IPAddress internalAddress; if (System.Net.IPAddress.TryParse (ipString, out internalAddress)) { address = new IPAddress (internalAddress); return true; } address = null; return false; }
public static bool IsLoopback(IPAddress address) { return System.Net.IPAddress.IsLoopback (address.address); }