IPEndPoint.Create(SocketAddress) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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()))