語言

UdpSingleSourceMulticastClient.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 參考了這個操作。

屬性

例外狀況

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

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

備註

此 BeginJoinGroup 方法將 UDP 多播套接字綁定至本地埠,並加入多播群組,使資料報能從單一來源位址接收。 多播群組位址、單一來源位址及綁定的本地埠皆在建構子中 UdpSingleSourceMulticastClient 指定。

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

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

適用於