< 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: 592_20856082467
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    {
 70015        get => _idleTimeout;
 616        set => _idleTimeout = value != TimeSpan.Zero ? value :
 617            throw new ArgumentException(
 618                $"The value '0' is not a valid for {nameof(IdleTimeout)} property.",
 619                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    {
 70028        get => _initialStreamWindowSize;
 929        set => _initialStreamWindowSize =
 930            value < 1024 ?
 931            throw new ArgumentException(
 932                $"The {nameof(InitialStreamWindowSize)} value cannot be less than 1 KB.",
 933                nameof(value)) :
 934            value > MaxWindowSize ?
 935            throw new ArgumentException(
 936                $"The {nameof(InitialStreamWindowSize)} value cannot be larger than {MaxWindowSize}.",
 937                nameof(value)) :
 938            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    {
 70046        get => _maxStreamFrameSize;
 247        set => _maxStreamFrameSize = value >= 1024 ? value :
 248            throw new ArgumentException(
 249                $"The {nameof(MaxStreamFrameSize)} value cannot be less than 1KB.",
 250                nameof(value));
 51    }
 52
 53    // We use the HTTP/2 maximum window size (2GB).
 54    internal const int MaxWindowSize = int.MaxValue;
 55
 74256    private TimeSpan _idleTimeout = TimeSpan.FromSeconds(30);
 57    // The default specified in the HTTP/2 specification.
 74258    private int _initialStreamWindowSize = 65_536;
 74259    private int _maxStreamFrameSize = 32_768;
 60}