语言

UdpSingleSourceMulticastClient.Dispose 方法

定义

注意

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

离开多播组并释放类的当前实例 UdpSingleSourceMulticastClient 和基础 Socket实例使用的所有资源。

public:
 virtual void Dispose();
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public void Dispose();
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

实现

属性

注解

使用Dispose完时调用 UdpSingleSourceMulticastClient 。 该方法 Dispose 保持 UdpSingleSourceMulticastClient 不可用状态。 调用 Dispose后,必须释放对 UdpSingleSourceMulticastClient 垃圾回收器的所有引用,以便垃圾回收器可以回收占用的 UdpSingleSourceMulticastClient 内存。

在发布对 .. 的Dispose上次引用之前,请始终调用UdpSingleSourceMulticastClient。 否则,在垃圾回收器调用 UdpSingleSourceMulticastClient 对象的 Finalize 方法之前,不会释放正在使用的资源。

适用于