UdpSingleSourceMulticastClient.EndReceiveFromSource 方法

定义

注意

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

完成从已联接的多播组接收数据包的异步操作并提供接收到的信息。

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

参数

result
IAsyncResult

异步接收操作的结果。

sourcePort
Int32

从中接收数据包的源终结点。

返回

存储在传递给 BeginReceiveFromSource(Byte[], Int32, Int32, AsyncCallback, Object) 方法的 buffer 参数中的消息的长度(以字节为单位)。

属性

例外

result 为 null 引用(在 Visual Basic 中为 Nothing)。

尚未联接多播组。

尝试访问套接字时出错。

注解

方法 EndReceiveFromSource 完成异步操作,以从多播组中的单个源接收数据包。

如果在执行接收操作时出现套接字故障, SocketException 则会引发 。 收到的错误指定为 枚举的成员 SocketError

适用于