Share via


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 方法。

適用於