UdpAnySourceMulticastClient.BeginSendToGroup 方法

定義

警告

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

開始將封包傳送至已加入的多點傳送群組之作業,並在封包傳送至群組時,叫用指定的回呼。

public:
 IAsyncResult ^ BeginSendToGroup(cli::array <System::Byte> ^ buffer, int offset, int count, 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 BeginSendToGroup (byte[] buffer, int offset, int count, 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.BeginSendToGroup : byte[] * int * int * AsyncCallback * obj -> IAsyncResult
Public Function BeginSendToGroup (buffer As Byte(), offset As Integer, count As Integer, callback As AsyncCallback, state As Object) As IAsyncResult

參數

buffer
Byte[]

包含要傳送之資料的緩衝區。

offset
Int32

buffer 開頭到讀取要傳送之資料的位移 (以位元組為單位)。

count
Int32

要從 buffer 傳送的位元組數目。

callback
AsyncCallback

作業完成時要叫用的回呼方法。

state
Object

要傳遞給這項作業之 callback 方法的選擇性狀態資訊。

傳回

參考這項作業的 IAsyncResult

屬性

例外狀況

buffer 是 null 參考 (在 Visual Basic 中為 Nothing)。

offset 小於 0

-或-

offset 大於 buffer 的長度。

-或-

count 小於 0

-或-

offset 加上這個計數會大於 buffer 的長度。

尚未聯結多點傳送群組。

嘗試存取通訊端時發生錯誤。

備註

方法 BeginSendToGroup 會開始將 UDP 封包傳送至已加入多播群組的作業。

客戶端必須已完成多播群組的聯結。

收到封包時,會叫用 參數中指定的 callback 方法。

如果接收作業以同步方式失敗,則可能會發生套接字失敗,不過這在 UDP 中並不常見。 如果發生套接字失敗, SocketException 則會擲回 。 收到的錯誤會指定為 列舉的成員 SocketError

適用於