UdpClient.Close Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Closes the UDP connection.
public:
void Close();
public void Close ();
member this.Close : unit -> unit
Public Sub Close ()
Exceptions
An error occurred when accessing the socket.
Examples
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()
Remarks
The Close disables the underlying Socket and releases all managed and unmanaged resources associated with the UdpClient.
Note
If you receive a SocketException, use SocketException.ErrorCode to obtain the specific error code. 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.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru