共用方式為


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

適用於