< Summary

Information
Class: IceRpc.Transports.Slic.SlicTransportOptions
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/Slic/SlicTransportOptions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 24
Uncovered lines: 0
Coverable lines: 24
Total lines: 60
Line coverage: 100%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage
100%
Covered methods: 7
Total methods: 7
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IdleTimeout()100%11100%
set_IdleTimeout(...)50%22100%
get_InitialStreamWindowSize()100%11100%
set_InitialStreamWindowSize(...)50%44100%
get_MaxStreamFrameSize()100%11100%
set_MaxStreamFrameSize(...)50%22100%
.ctor()100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/Slic/SlicTransportOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc.Transports.Slic;
 4
 5/// <summary>A property bag used to configure a <see cref="SlicClientTransport" /> or
 6/// <see cref="SlicServerTransport" />.</summary>
 7public sealed record class SlicTransportOptions
 8{
 9    /// <summary>Gets or sets the idle timeout. This timeout is used to monitor the transport connection health. If no
 10    /// data is received within the idle timeout period, the transport connection is aborted.
 11    /// </summary>
 12    /// <value>The idle timeout. Defaults to <c>30</c> s.</value>
 13    public TimeSpan IdleTimeout
 14    {
 137315        get => _idleTimeout;
 1216        set => _idleTimeout = value != TimeSpan.Zero ? value :
 1217            throw new ArgumentException(
 1218                $"The value '0' is not a valid for {nameof(IdleTimeout)} property.",
 1219                nameof(value));
 20    }
 21
 22    /// <summary>Gets or sets the initial stream window size. It defines the initial size of the stream receive buffer
 23    /// for data that has not been consumed yet by the application. When this buffer is full the sender should stop
 24    /// sending additional data.</summary>
 25    /// <value>The initial window size in bytes. It can't be less than <c>1</c> KB. Defaults to <c>64</c> KB.</value>
 26    public int InitialStreamWindowSize
 27    {
 137328        get => _initialStreamWindowSize;
 1829        set => _initialStreamWindowSize =
 1830            value < 1024 ?
 1831            throw new ArgumentException(
 1832                $"The {nameof(InitialStreamWindowSize)} value cannot be less than 1 KB.",
 1833                nameof(value)) :
 1834            value > MaxWindowSize ?
 1835            throw new ArgumentException(
 1836                $"The {nameof(InitialStreamWindowSize)} value cannot be larger than {MaxWindowSize}.",
 1837                nameof(value)) :
 1838            value;
 39    }
 40
 41    /// <summary>Gets or sets the maximum stream frame size in bytes.</summary>
 42    /// <value>The maximum stream frame size in bytes. It can't be less than <c>1</c> KB. Defaults to <c>32</c>
 43    /// KB.</value>
 44    public int MaxStreamFrameSize
 45    {
 137346        get => _maxStreamFrameSize;
 447        set => _maxStreamFrameSize = value >= 1024 ? value :
 448            throw new ArgumentException(
 449                $"The {nameof(MaxStreamFrameSize)} value cannot be less than 1KB.",
 450                nameof(value));
 51    }
 52
 53    // We use the HTTP/2 maximum window size (2GB).
 54    internal const int MaxWindowSize = int.MaxValue;
 55
 137856    private TimeSpan _idleTimeout = TimeSpan.FromSeconds(30);
 57    // The default specified in the HTTP/2 specification.
 137858    private int _initialStreamWindowSize = 65_536;
 137859    private int _maxStreamFrameSize = 32_768;
 60}