語言

UdpAnySourceMulticastClient.BeginJoinGroup(AsyncCallback, Object) 方法

定義

警告

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

綁定套接字並開始與多播群組的連接操作,允許任何群組參與者接收資料報。

public:
 IAsyncResult ^ BeginJoinGroup(AsyncCallback ^ callback, System::Object ^ state);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public IAsyncResult BeginJoinGroup(AsyncCallback callback, object state);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
member this.BeginJoinGroup : AsyncCallback * obj -> IAsyncResult
Public Function BeginJoinGroup (callback As AsyncCallback, state As Object) As IAsyncResult

參數

callback
AsyncCallback

一個操作完成時用來呼叫的回調方法。

state
Object

可選擇性狀態資訊,可傳遞給該操作的方法。callback

傳回

一個 IAsyncResult 參考了這個操作。

屬性

例外狀況

多播群組已經加入,或正在進行合併作業。

這些 UdpAnySourceMulticastClient 已經被處理掉了。

嘗試存取該套接字時發生錯誤。

備註

此 BeginJoinGroup 方法將 UDP 多播套接字綁定到本地埠,並加入多播群組,允許任何多播群組參與者接收資料報。 本地埠與多播群組位址由建構子指定 UdpAnySourceMulticastClient 。

參數中 callback 指定的方法是在加入多播群組的操作完成後被調用。

若執行時需要,該 BeginJoinGroup 方法也會執行政策檢查,以確認客戶端是否被允許存取多播群組。 若客戶端不被允許存取,則拋出 a SocketException 與 AccessDenied。

適用於