语言

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 还会执行策略检查,以验证客户端是否允许访问多播组。 如果不允许客户端访问,则会引发 <a0/>。

适用于