語言

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 的方法後,所使用的資源不會被釋放。

適用於