System.Net.Sockets.UdpClient.Close Method

Closes the UDP connection.

Syntax

public void Close ()

Remarks

The UdpClient.Close disables the underlying System.Net.Sockets.Socket and releases all managed and unmanaged resources associated with the System.Net.Sockets.UdpClient.

Note:

If you receive a System.Net.Sockets.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 in MSDN for a detailed description of the error.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0