Export (0) Print
Expand All

IPEndPoint.Create Method

Creates an endpoint from a socket address.

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

public override EndPoint Create(
	SocketAddress socketAddress
)

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 null.

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.
      IPAddress ipAddr = IPAddress.Loopback;
      int port = 80;

      IPEndPoint endpoint = new IPEndPoint(ipAddr,port);

      outputBlock.Text += "IPEndPoint.ToString(): ";
      outputBlock.Text += endpoint.ToString();
      outputBlock.Text += "\n";



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:
© 2014 Microsoft