UdpAnySourceMulticastClient.Dispose 方法



此 API 現已淘汰。

離開多點傳送群組,並釋出目前的 UdpAnySourceMulticastClient 類別執行個體和基礎 Socket 使用的所有資源。Leaves the multicast group and releases all resources used by the current instance of the UdpAnySourceMulticastClient class and the underlying the Socket.

 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 ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()




Dispose 使用完畢時,請呼叫 UdpAnySourceMulticastClientCall Dispose when you are finished using the UdpAnySourceMulticastClient. Dispose 方法會將保留UdpAnySourceMulticastClient在無法使用的狀態。The Dispose method leaves the UdpAnySourceMulticastClient in an unusable state. 呼叫Dispose之後,您必須釋放所有對的UdpAnySourceMulticastClient參考,讓垃圾收集行程可以UdpAnySourceMulticastClient回收所佔用的記憶體。After calling Dispose, you must release all references to the UdpAnySourceMulticastClient so the garbage collector can reclaim the memory that the UdpAnySourceMulticastClient was occupying.

在您釋放最後一個 Dispose 參考之前,請務必呼叫 UdpAnySourceMulticastClientAlways call Dispose before you release your last reference to the UdpAnySourceMulticastClient. 否則工作窗格所使用的資源不會釋放,直到記憶體回收行程呼叫 UdpAnySourceMulticastClient 物件的 Finalize 方法。Otherwise, the resources it is using will not be freed until the garbage collector calls the UdpAnySourceMulticastClient object's Finalize method.