Exemple #1
0
        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;
        }
Exemple #2
0
        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;
        }
Exemple #3
0
 public static bool IsLoopback(IPAddress address)
 {
     return System.Net.IPAddress.IsLoopback (address.address);
 }