DnsEndPoint Constructor (String, Int32)
Collapse the table of content
Expand the table of content

DnsEndPoint Constructor (String, Int32)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Initializes a new instance of the DnsEndPoint class with the host name or string representation of an IP address and a port number.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

'Declaration
Public Sub New ( _
	host As String, _
	port As Integer _
)

Parameters

host
Type: System.String
The host name or a string representation of the IP address.
port
Type: System.Int32
The port number associated with the address, or 0 to specify any available port. port is in host order.

ExceptionCondition
ArgumentException

The host parameter contains an empty string.

ArgumentNullException

The host parameter is Nothing.

ArgumentOutOfRangeException

port is less than 0

-or-

port is greater than 0xffff.

The DnsEndPoint(String, Int32) constructor can be used to initialize a DnsEndPoint class using either a host name or a string that represents an IP address and a port. This constructor sets the AddressFamily property to Unknown.

When using this constructor with a host name rather than a string representation of an IP address, the address family is determined by the address family of the first IP address that resolves to the endpoint when used by a Socket.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft