UdpClient.Close Método
Definição
Fecha a conexão UDP.Closes the UDP connection.
public:
void Close();
public void Close ();
member this.Close : unit -> unit
Public Sub Close ()
Exceções
Ocorreu um erro ao acessar o soquete.An error occurred when accessing the socket.
Exemplos
O exemplo a seguir demonstra o fechamento de um UdpClient chamando o Close método.The following example demonstrates closing a UdpClient by calling the Close method.
// Closes the UDP client by calling the public method Close().
udpClient->Close();
// Closes the UDP client by calling the public method Close().
udpClient.Close();
' Closes the UDP client by calling the public method Close().
udpClient.Close()
Comentários
O Close desabilita o subjacente Socket e libera todos os recursos gerenciados e não gerenciados associados ao UdpClient .The Close disables the underlying Socket and releases all managed and unmanaged resources associated with the UdpClient.
Observação
Se você receber um SocketException , use SocketException.ErrorCode para obter o código de erro específico.If you receive a SocketException, use SocketException.ErrorCode to obtain the specific error code. Depois de obter esse código, você pode consultar a documentação do código de erro da API do Windows Sockets versão 2 para obter uma descrição detalhada do erro.Once you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation for a detailed description of the error.