UdpAnySourceMulticastClient.Dispose 方法

定义

注意

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 方法之前,该对象正在使用的资源不会被释放。

适用于