Επεξεργασία

Κοινή χρήση μέσω


UdpAnySourceMulticastClient.BeginJoinGroup(AsyncCallback, Object) Method

Definition

Caution

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

Binds the socket and begins a join operation to the multicast group to allow datagrams to be received from any group participant.

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

Parameters

callback
AsyncCallback

A callback method to invoke when the operation completes.

state
Object

Optional state information to pass to the callback method for this operation.

Returns

An IAsyncResult that references this operation.

Attributes

Exceptions

The multicast group has already been joined or a join operation is currently in progress.

An error occurred when attempting to access the socket.

Remarks

The BeginJoinGroup method binds a UDP multicast socket to a local port and joins a multicast group to allow datagrams to be received from any multicast group participant. The local port and multicast group address are specified in the UdpAnySourceMulticastClient constructor.

The method specified in the callback parameter is invoked when the operation to join the multicast group has completed.

If required by the runtime, the BeginJoinGroup method also performs a policy check to verify that the client is allowed to access the multicast group. If the client is not allowed access, a SocketException is thrown with AccessDenied.

Applies to