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

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

返回

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

属性

例外

result 是空引用(Visual Basic 中没有任何内容)。

多播组尚未加入。

尝试访问套接字时出错。

注解

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

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

适用于