Class MultiplexingStream.Options
Describes the options that a MultiplexingStream may be created with.
public class MultiplexingStream.Options
- Inheritance
-
MultiplexingStream.Options
- Inherited Members
Constructors
Options()
Initializes a new instance of the MultiplexingStream.Options class.
public Options()
Options(Options)
Initializes a new instance of the MultiplexingStream.Options class and copies the values from another instance into this one.
public Options(MultiplexingStream.Options copyFrom)
Parameters
copyFromMultiplexingStream.OptionsThe instance to copy values from.
Properties
DefaultChannelReceivingWindowSize
Gets or sets the number of received bytes that may be buffered locally per channel (transmitted from the remote party but not yet processed).
public long DefaultChannelReceivingWindowSize { get; set; }
Property Value
- long
Must be a positive value.
Remarks
This value is ignored when ProtocolMajorVersion is set to 1.
Exceptions
- ArgumentOutOfRangeException
Thrown if set to a non-positive value.
DefaultChannelTraceSourceFactory
Gets or sets a factory for TraceSource instances to attach to a newly opened MultiplexingStream.Channel when its TraceSource is null.
[Obsolete("Use DefaultChannelTraceSourceFactoryWithQualifier instead.")]
public Func<int, string, TraceSource?>? DefaultChannelTraceSourceFactory { get; set; }
Property Value
- Func<int, string, TraceSource>
Remarks
The delegate receives a channel ID and name, and may return a TraceSource or null.
This delegate will not be invoked if DefaultChannelTraceSourceFactoryWithQualifier has been set to a non-null value.
DefaultChannelTraceSourceFactoryWithQualifier
Gets or sets a factory for TraceSource instances to attach to a newly opened MultiplexingStream.Channel when its TraceSource is null.
public Func<MultiplexingStream.QualifiedChannelId, string, TraceSource?>? DefaultChannelTraceSourceFactoryWithQualifier { get; set; }
Property Value
Remarks
The delegate receives a channel ID and name, and may return a TraceSource or null.
This delegate supersedes the obsolete DefaultChannelTraceSourceFactory as this one provides detail about whether the channel was offered locally or remotely.
FaultOpenChannelsOnStreamDisposal
Gets or sets a value indicating whether any open channels should be faulted (i.e. their Completion task will be faulted) when the MultiplexingStream is disposed.
public bool FaultOpenChannelsOnStreamDisposal { get; set; }
Property Value
IsFrozen
Gets a value indicating whether this instance is frozen.
public bool IsFrozen { get; }
Property Value
MaxChannelReceivingWindowSize
Gets or sets the largest value that DefaultChannelReceivingWindowSize may grow to for an individual channel that demonstrates a need for it.
public long MaxChannelReceivingWindowSize { get; set; }
Property Value
- long
Must be a positive value. The default is 16 times DefaultChannelReceivingWindowSize's default value.
Remarks
This value is only used when ProtocolMajorVersion is at least 4, which adds the ability for a receiver to enlarge a channel's receiving window after the channel has been established. A channel's window only grows while its remote sender is actually blocked by it, so channels that never saturate their window never consume more than DefaultChannelReceivingWindowSize.
Growth is additionally bounded across all channels by MaxTotalChannelReceivingWindowSize.
Exceptions
- ArgumentOutOfRangeException
Thrown if set to a non-positive value.
MaxTotalChannelReceivingWindowSize
Gets or sets the total number of bytes that all channels on this stream combined may commit to receiving window growth beyond their initial DefaultChannelReceivingWindowSize.
public long MaxTotalChannelReceivingWindowSize { get; set; }
Property Value
- long
Must be a non-negative value. The default is 64 times DefaultChannelReceivingWindowSize's default value.
Remarks
This value is only used when ProtocolMajorVersion is at least 4. It bounds the worst case memory that automatic window growth may commit for the entire stream, so that a stream with many busy channels cannot multiply MaxChannelReceivingWindowSize by an unbounded number of channels.
Exceptions
- ArgumentOutOfRangeException
Thrown if set to a negative value.
ProtocolMajorVersion
Gets or sets the protocol version to be used.
public int ProtocolMajorVersion { get; set; }
Property Value
- int
The default is 1.
Remarks
1 is the original and default version. 2 is a protocol breaking change and adds backpressure support. 3 is a protocol breaking change that removes the initial handshake so no round-trip to establish the connection is necessary. 4 is a protocol breaking change that allows a receiver to enlarge a channel's receiving window after the channel is established.
SeededChannels
Gets a list of options for channels that are to be "seeded" into a new MultiplexingStream.
public IList<MultiplexingStream.ChannelOptions> SeededChannels { get; }
Property Value
Remarks
Seeded channels avoid the need for a round-trip for an offer/accept packet exchange. Seeded channels are accessed within the MultiplexingStream instance by calling AcceptChannel(ulong, ChannelOptions?) with the 0-based index into this list used as the channel ID. They are only supported when ProtocolMajorVersion is at least 3.
StartSuspended
Gets or sets a value indicating whether the MultiplexingStream should not start reading from the stream immediately in order to provide time for the creator to add event handlers such as ChannelOffered.
public bool StartSuspended { get; set; }
Property Value
Remarks
When set to true, the owner must use StartListening() after attaching event handlers to actually being reading from the stream.
TraceSource
Gets or sets the logger used by this instance.
public TraceSource TraceSource { get; set; }
Property Value
- TraceSource
Never null.
Methods
GetFrozenCopy()
Returns a frozen instance of this object.
public MultiplexingStream.Options GetFrozenCopy()
Returns
- MultiplexingStream.Options
This instance if already frozen, otherwise a frozen copy.