UdpAnySourceMulticastClient.BlockSource(IPAddress) 方法

定義

警告

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

封鎖來源,這樣就不會再收到源自它的多點傳送封包。

public:
 void BlockSource(System::Net::IPAddress ^ sourceAddress);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public void BlockSource (System.Net.IPAddress sourceAddress);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
member this.BlockSource : System.Net.IPAddress -> unit
Public Sub BlockSource (sourceAddress As IPAddress)

參數

sourceAddress
IPAddress

要封鎖之來源的位址。

屬性

例外狀況

尚未聯結多點傳送群組。

嘗試存取通訊端時發生錯誤。

備註

方法 BlockSource 會封鎖來自指定來源位址的多播封包,而無法接收。 客戶端必須已完成多播群組的聯結。

參數 sourceAddress 可以是IPv6或IPv4位址,但 sourceAddress 參數必須符合用戶端加入之多播群組的位址系列。

在收到封包時,會叫用 參數中指定的 callback 方法。

如果執行區塊來源作業時發生套接字失敗, SocketException 則會擲回 。 收到的錯誤會指定為 列舉的成員 SocketError

適用於