UdpAnySourceMulticastClient.EndReceiveFromGroup(IAsyncResult, IPEndPoint) 方法

定义

注意

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

完成从已联接的多播组接收数据包的异步操作并提供接收到的信息。Completes the asynchronous operation of receiving a packet from the joined multicast group and provides the information received.

public:
 int EndReceiveFromGroup(IAsyncResult ^ result, [Runtime::InteropServices::Out] System::Net::IPEndPoint ^ % source);
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public int EndReceiveFromGroup (IAsyncResult result, out System.Net.IPEndPoint source);
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
member this.EndReceiveFromGroup : IAsyncResult * IPEndPoint -> int
Public Function EndReceiveFromGroup (result As IAsyncResult, ByRef source As IPEndPoint) As Integer

参数

result
IAsyncResult

异步接收操作的结果。The result of the asynchronous receive operation.

source
IPEndPoint

从中接收数据包的源终结点。The source endpoint where the packet was received from.

返回

Int32

存储在传递给 BeginReceiveFromGroup(Byte[], Int32, Int32, AsyncCallback, Object) 方法的缓冲区参数中的消息长度(以字节为单位)。The length, in bytes, of the message stored in the buffer parameter passed to the BeginReceiveFromGroup(Byte[], Int32, Int32, AsyncCallback, Object) method.

属性

例外

result 为 null 引用(在 Visual Basic 中为 Nothing)。result is a null reference (Nothing in Visual Basic).

尚未联接多播组。The multicast group has not yet been joined.

尝试访问套接字时出错。An error occurred when attempting to access the socket.

注解

EndReceiveFromGroup方法完成异步操作以接收多播组中的数据包。The EndReceiveFromGroup method completes an asynchronous operation to receive a packet from a multicast group.

如果在执行接收操作时出现套接字错误,则 SocketException 会引发。If there is a socket failure while performing the receive operation, a SocketException is thrown. 收到的错误被指定为枚举的成员 SocketErrorThe error received is specified as a member of the SocketError enumeration.

适用于