예제 #1
0
 /// <summary>Initializes a <see cref="System.IO.Pipelines.StreamPipeReaderOptions" /> instance, optionally specifying a memory pool, a minimum buffer size, a minimum read size, and whether the underlying stream should be left open after the <see cref="System.IO.Pipelines.PipeReader" /> completes.</summary>
 /// <param name="pool">The memory pool to use when allocating memory. The default value is <see langword="null" />.</param>
 /// <param name="bufferSize">The minimum buffer size to use when renting memory from the <paramref name="pool" />. The default value is 4096.</param>
 /// <param name="minimumReadSize">The threshold of remaining bytes in the buffer before a new buffer is allocated. The default value is 1024.</param>
 /// <param name="leaveOpen"><see langword="true" /> to leave the underlying stream open after the <see cref="System.IO.Pipelines.PipeReader" /> completes; <see langword="false" /> to close it. The default is <see langword="false" />.</param>
 public StreamPipeReaderOptions(MemoryPool <byte>?pool, int bufferSize, int minimumReadSize, bool leaveOpen) :
     this(pool, bufferSize, minimumReadSize, leaveOpen, useZeroByteReads : false)
 {
 }
예제 #2
0
 public StreamPipeWriter(Stream writingStream, int minimumSegmentSize, MemoryPool <byte> pool = null)
 {
     _minimumSegmentSize = minimumSegmentSize;
     _writingStream      = writingStream;
     _pool = pool ?? MemoryPool <byte> .Shared;
 }
예제 #3
0
 public static DuplexPipePair CreateConnectionPair(MemoryPool memoryPool)
 {
     return(CreateConnectionPair(new PipeOptions(memoryPool), new PipeOptions(memoryPool)));
 }
예제 #4
0
 public static (IDuplexPipe Transport, IDuplexPipe Application) CreateConnectionPair(MemoryPool memoryPool)
 {
     return(CreateConnectionPair(new PipeOptions(memoryPool), new PipeOptions(memoryPool)));
 }
예제 #5
0
 public StreamPipeReaderAdapterOptions(int minimumSegmentSize, int minimumReadThreshold, MemoryPool <byte> memoryPool)
 {
     MinimumSegmentSize   = minimumSegmentSize;
     MinimumReadThreshold = minimumReadThreshold;
     MemoryPool           = memoryPool;
 }