UdpAnySourceMulticastClient.Dispose 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
离开多播组并释放类的当前实例 UdpAnySourceMulticastClient 和基础 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完时调用 UdpAnySourceMulticastClient 。 Dispose 方法将保持 UdpAnySourceMulticastClient 不可用状态。 调用 Dispose后,必须释放对 UdpAnySourceMulticastClient 垃圾回收器的所有引用,以便垃圾回收器可以回收占用的 UdpAnySourceMulticastClient 内存。
在发布对 .. 的Dispose上次引用之前,请始终调用UdpAnySourceMulticastClient。 否则,在垃圾回收器调用 UdpAnySourceMulticastClient 对象的 Finalize 方法之前,不会释放正在使用的资源。