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 此方法也會執行原則檢查,以確認用戶端是否允許存取多播群組。 如果不允許用戶端存取, SocketException 則會使用 AccessDenied擲回 。

適用於