PipeOptions 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用指定的參數,初始化 PipeOptions 類別的新執行個體。
public PipeOptions (System.Buffers.MemoryPool<byte> pool = default, System.IO.Pipelines.PipeScheduler readerScheduler = default, System.IO.Pipelines.PipeScheduler writerScheduler = default, long pauseWriterThreshold = 32768, long resumeWriterThreshold = 16384, int minimumSegmentSize = 2048, bool useSynchronizationContext = true);
public PipeOptions (System.Buffers.MemoryPool<byte> pool = default, System.IO.Pipelines.PipeScheduler readerScheduler = default, System.IO.Pipelines.PipeScheduler writerScheduler = default, long pauseWriterThreshold = -1, long resumeWriterThreshold = -1, int minimumSegmentSize = -1, bool useSynchronizationContext = true);
public PipeOptions (System.Buffers.MemoryPool<byte>? pool = default, System.IO.Pipelines.PipeScheduler? readerScheduler = default, System.IO.Pipelines.PipeScheduler? writerScheduler = default, long pauseWriterThreshold = -1, long resumeWriterThreshold = -1, int minimumSegmentSize = -1, bool useSynchronizationContext = true);
new System.IO.Pipelines.PipeOptions : System.Buffers.MemoryPool<byte> * System.IO.Pipelines.PipeScheduler * System.IO.Pipelines.PipeScheduler * int64 * int64 * int * bool -> System.IO.Pipelines.PipeOptions
Public Sub New (Optional pool As MemoryPool(Of Byte) = Nothing, Optional readerScheduler As PipeScheduler = Nothing, Optional writerScheduler As PipeScheduler = Nothing, Optional pauseWriterThreshold As Long = 32768, Optional resumeWriterThreshold As Long = 16384, Optional minimumSegmentSize As Integer = 2048, Optional useSynchronizationContext As Boolean = true)
Public Sub New (Optional pool As MemoryPool(Of Byte) = Nothing, Optional readerScheduler As PipeScheduler = Nothing, Optional writerScheduler As PipeScheduler = Nothing, Optional pauseWriterThreshold As Long = -1, Optional resumeWriterThreshold As Long = -1, Optional minimumSegmentSize As Integer = -1, Optional useSynchronizationContext As Boolean = true)
參數
- pool
- MemoryPool<Byte>
要用於緩衝區管理的記憶體區塊集區。
- readerScheduler
- PipeScheduler
要用來執行 PipeReader 回呼和非同步接續的 PipeScheduler。
- writerScheduler
- PipeScheduler
用來執行 PipeWriter 回呼和非同步接續的 PipeScheduler。
- pauseWriterThreshold
- Int64
FlushAsync(CancellationToken) 開始封鎖前 Pipe 中的位元組數。 值為零可防止 FlushAsync(CancellationToken) 封鎖,有效地使無限制的 Pipe 位元組數目。
- resumeWriterThreshold
- Int64
FlushAsync(CancellationToken) 停止封鎖時 Pipe 中的位元組數。
- minimumSegmentSize
- Int32
從 pool
要求的區段大小下限。
- useSynchronizationContext
- Boolean
若非同步接續應在擷取到接續的 SynchronizationContext 上執行,則為 true
;否則為 false
。 這會優先於 ReaderScheduler 和 WriterScheduler 中指定的排程器。