Create Method
Collapse the table of content
Expand the table of content

IPEndPoint.Create Method

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

Creates an endpoint from a socket address.

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

'Declaration
Public Overrides Function Create ( _
	socketAddress As SocketAddress _
) As EndPoint

Parameters

socketAddress
Type: System.Net.SocketAddress
The SocketAddress to use for the endpoint.

Return Value

Type: System.Net.EndPoint
An EndPoint instance using the specified socket address.

ExceptionCondition
ArgumentException

The AddressFamily of socketAddress is not equal to the AddressFamily of the current instance.

-or-

socketAddress.Size < 8.

ArgumentNullException

The socketAddress parameter is Nothing.

The Create method create a new EndPoint instance from the specified socket address.

The following example uses the specified SocketAddress to create an IPEndPoint.


' Recreate the connection endpoint from the serialized information.
Dim ipAddr As IPAddress = IPAddress.Loopback
Dim port As Integer = 80

Dim endpoint As IPEndPoint = new IPEndPoint(ipAddr,port)

outputBlock.Text &= "IPEndPoint.ToString(): "
outputBlock.Text &= endpoint.ToString()
outputBlock.Text &= vbCrLf


Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft