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

屬性

例外狀況

多點傳送群組已經加入,或加入作業目前正在進行中。

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

備註

方法 BeginJoinGroup 會將 UDP 多播套接字系結至本機埠,並聯結多播群組,以允許從任何多播群組參與者接收數據報。 本機埠和多播群組位址是在建構函式中 UdpAnySourceMulticastClient 指定。

當聯結多播群組的作業完成時,會叫用 參數中指定的 callback 方法。

如果運行時間需要, BeginJoinGroup 此方法也會執行原則檢查,以確認用戶端是否允許存取多播群組。 如果不允許用戶端存取, SocketException 則會使用 AccessDenied擲回 。

適用於