| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using System.Buffers; |
| | 4 | |
|
| | 5 | | namespace IceRpc.Transports; |
| | 6 | |
|
| | 7 | | /// <summary>A property bag used to configure a <see cref="IMultiplexedConnection" />.</summary> |
| | 8 | | public record class MultiplexedConnectionOptions |
| | 9 | | { |
| | 10 | | /// <summary>Gets or sets the maximum allowed number of simultaneous remote bidirectional streams that can be |
| | 11 | | /// opened.</summary> |
| | 12 | | /// <value>The maximum number of remote bidirectional streams. Defaults to <c>100</c>.</value> |
| 3306 | 13 | | public int MaxBidirectionalStreams { get; set; } = DefaultMaxBidirectionalStreams; |
| | 14 | |
|
| | 15 | | /// <summary>Gets or sets the maximum allowed number of simultaneous remote unidirectional streams that can be |
| | 16 | | /// opened.</summary> |
| | 17 | | /// <value>The maximum number of remote unidirectional streams. Defaults to <c>100</c>.</value> |
| 3258 | 18 | | public int MaxUnidirectionalStreams { get; set; } = DefaultMaxUnidirectionalStreams; |
| | 19 | |
|
| | 20 | | /// <summary>Gets or sets the minimum size of the segment requested from the <see cref="Pool" />.</summary> |
| | 21 | | /// <value>The minimum size in bytes of the segment requested from the <see cref="Pool" />. Defaults to <c>4</c> |
| | 22 | | /// KB.</value> |
| 7392 | 23 | | public int MinSegmentSize { get; set; } = 4096; |
| | 24 | |
|
| | 25 | | /// <summary>Gets or sets the <see cref="MemoryPool{T}" /> object used for buffer management.</summary> |
| | 26 | | /// <value>A pool of memory blocks used for buffer management. Defaults to <see cref="MemoryPool{T}.Shared" |
| | 27 | | /// />.</value> |
| 7392 | 28 | | public MemoryPool<byte> Pool { get; set; } = MemoryPool<byte>.Shared; |
| | 29 | |
|
| | 30 | | internal const int DefaultMaxBidirectionalStreams = 100; |
| | 31 | | internal const int DefaultMaxUnidirectionalStreams = 100; |
| | 32 | | } |