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.
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.
| Exception | Condition |
|---|---|
| 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 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
Show: