IPEndPoint.Create(SocketAddress) Método

Definição

Cria um endpoint a partir de um endereço de socket.

public:
 override System::Net::EndPoint ^ Create(System::Net::SocketAddress ^ socketAddress);
public override System.Net.EndPoint Create(System.Net.SocketAddress socketAddress);
override this.Create : System.Net.SocketAddress -> System.Net.EndPoint
Public Overrides Function Create (socketAddress As SocketAddress) As EndPoint

Parâmetros

socketAddress
SocketAddress

O SocketAddress to use para o endpoint.

Devoluções

Uma EndPoint instância que utiliza o endereço de socket especificado.

Exceções

A Família de Endereços de socketAddress não é igual à Família de Endereços da instância atual.

-ou-

socketAddress. Tamanho < 8.

Exemplos

O exemplo seguinte usa o especificado SocketAddress para criar um IPEndPoint.

// Recreate the connection endpoint from the serialized information.
IPEndPoint endpoint = new IPEndPoint(0,0);
IPEndPoint clonedIPEndPoint = (IPEndPoint) endpoint.Create(socketAddress);
Console.WriteLine("clonedIPEndPoint: " + clonedIPEndPoint.ToString());
' Recreate the connection endpoint from the serialized information.
Dim endpoint As New IPEndPoint(0, 0)
Dim clonedIPEndPoint As IPEndPoint = CType(endpoint.Create(socketAddress), IPEndPoint)
Console.WriteLine(("clonedIPEndPoint: " + clonedIPEndPoint.ToString()))

Aplica-se a

Ver também