SendPacketsElement 類別

定義

表示 SendPacketsElement 陣列中的元素。

public ref class SendPacketsElement
public class SendPacketsElement
type SendPacketsElement = class
Public Class SendPacketsElement
繼承
SendPacketsElement

備註

類別 SendPacketsElement 是用來增強 Socket 類別,以供使用異步網路 I/O 的伺服器應用程式使用,以達到最高效能。 類別 SendPacketsElement 會與 屬性搭配 SocketAsyncEventArgs.SendPacketsElements 使用,以取得或設定使用 Socket.SendPacketsAsync 方法傳送的數據緩衝區或檔案。

建構函式

SendPacketsElement(Byte[])

使用指定的緩衝區,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(Byte[], Int32, Int32)

使用指定的緩衝區範圍,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(Byte[], Int32, Int32, Boolean)

使用指定的緩衝區範圍,初始化 SendPacketsElement 類別的新執行個體,可選擇是否要將此元素和下一個元素合併於通訊端層對傳輸提出的同一個傳送要求中。

SendPacketsElement(FileStream)

使用指定的 FileStream 物件,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(FileStream, Int64, Int32)

使用指定的 FileStream 物件範圍,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(FileStream, Int64, Int32, Boolean)

使用指定的 FileStream 物件範圍,初始化 SendPacketsElement 類別的新執行個體,可選擇是否要將此元素和下一個元素合併於通訊端層對傳輸提出的同一個傳送要求中。

SendPacketsElement(ReadOnlyMemory<Byte>)

使用指定的緩衝區,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(ReadOnlyMemory<Byte>, Boolean)

使用指定的緩衝區搭配選項,初始化 類別的新實例 SendPacketsElement ,以將這個專案與從套接字層傳送至傳輸的單一傳送要求中的下一個項目結合。

SendPacketsElement(String)

使用指定的檔案,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(String, Int32, Int32)

使用指定的檔案範圍,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(String, Int32, Int32, Boolean)

使用指定的檔案範圍,初始化 SendPacketsElement 類別的新執行個體,可選擇是否要將此元素和下一個元素合併於通訊端層對傳輸提出的同一個傳送要求中。

SendPacketsElement(String, Int64, Int32)

使用指定的檔案範圍,初始化 SendPacketsElement 類別的新執行個體。

SendPacketsElement(String, Int64, Int32, Boolean)

使用指定的檔案範圍,初始化 SendPacketsElement 類別的新執行個體,可選擇是否要將此元素和下一個元素合併於通訊端層對傳輸提出的同一個傳送要求中。

屬性

Buffer

取得使用 buffer 參數初始化 SendPacketsElement 物件時,要傳送的緩衝區。

Count

取得要傳送的位元組計數。

EndOfPacket

取得布林值,指出這個元素是否要和下一個元素合併於通訊端層對傳輸提出的同一個傳送要求中。

FilePath

取得使用 filepath 參數初始化 SendPacketsElement 物件時,要傳送檔案的檔名。

FileStream

取得使用 FileStream 參數初始化 SendPacketsElement 物件時,要傳送檔案的物件表示。

MemoryBuffer

取得使用 buffer 參數初始化 SendPacketsElement 物件時,要傳送的緩衝區。

Offset

取得位移 (以位元組為單位),這是從資料緩衝區或檔案的開頭,到緩衝區或檔案中要開始傳送資料的位置。

OffsetLong

取得位移 (以位元組為單位),這是從資料緩衝區或檔案的開頭,到緩衝區或檔案中要開始傳送資料的位置。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

執行緒安全性

這個類別的實例是安全線程。

另請參閱