Esempio n. 1
0
 /// <devdoc>
 ///    <para>
 ///       Creates a new instance of the IPEndPoint class with the specified address and port.
 ///    </para>
 /// </devdoc>
 public IPEndPoint(long address, int port)
 {
     if (!TcpValidationHelpers.ValidatePortNumber(port))
     {
         throw new ArgumentOutOfRangeException(nameof(port));
     }
     _port    = port;
     _address = new IPAddress(address);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of the IPEndPoint class with the specified address and port.
        /// </summary>
        public IPEndPoint(IPAddress address, int port)
        {
            ArgumentNullException.ThrowIfNull(address);

            if (!TcpValidationHelpers.ValidatePortNumber(port))
            {
                throw new ArgumentOutOfRangeException(nameof(port));
            }

            _port    = port;
            _address = address;
        }
Esempio n. 3
0
 /// <devdoc>
 ///    <para>
 ///       Creates a new instance of the IPEndPoint class with the specified address and port.
 ///    </para>
 /// </devdoc>
 public IPEndPoint(IPAddress address, int port)
 {
     if (address == null)
     {
         throw new ArgumentNullException("address");
     }
     if (!TcpValidationHelpers.ValidatePortNumber(port))
     {
         throw new ArgumentOutOfRangeException("port");
     }
     _port    = port;
     _address = address;
 }