UdpSingleSourceMulticastClient.Dispose 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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 的方法後,所使用的資源不會被釋放。