IPEndPoint.Create Method

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


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: