< 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: 1321_24790053727
Line coverage
85%
Covered lines: 24
Uncovered lines: 4
Coverable lines: 28
Total lines: 68
Line coverage: 85.7%
Branch coverage
60%
Covered branches: 6
Total branches: 10
Branch coverage: 60%
Method coverage
100%
Covered methods: 7
Fully covered methods: 6
Total methods: 7
Method coverage: 100%
Full method coverage: 85.7%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IdleTimeout()100%11100%
set_IdleTimeout(...)75%6450%
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. The effective idle timeout
 11    /// is negotiated with the peer: use <see cref="Timeout.InfiniteTimeSpan" /> to defer to the peer's idle timeout.
 12    /// Idle timeout monitoring is disabled only when both sides use <see cref="Timeout.InfiniteTimeSpan" />.</summary>
 13    /// <value>The idle timeout. It must be positive or <see cref="Timeout.InfiniteTimeSpan" />.
 14    /// Defaults to <c>30</c> s.</value>
 15    public TimeSpan IdleTimeout
 16    {
 70617        get => _idleTimeout;
 18        set
 619        {
 620            if (value != Timeout.InfiniteTimeSpan && value <= TimeSpan.Zero)
 021            {
 022                throw new ArgumentException(
 023                    $"The {nameof(IdleTimeout)} value must be positive or Timeout.InfiniteTimeSpan.",
 024                    nameof(value));
 25            }
 626            _idleTimeout = value;
 627        }
 28    }
 29
 30    /// <summary>Gets or sets the initial stream window size. It defines the initial size of the stream receive buffer
 31    /// for data that has not been consumed yet by the application. When this buffer is full the sender should stop
 32    /// sending additional data.</summary>
 33    /// <value>The initial window size in bytes. It can't be less than <c>1</c> KB. Defaults to <c>64</c> KB.</value>
 34    public int InitialStreamWindowSize
 35    {
 70636        get => _initialStreamWindowSize;
 937        set => _initialStreamWindowSize =
 938            value < 1024 ?
 939            throw new ArgumentException(
 940                $"The {nameof(InitialStreamWindowSize)} value cannot be less than 1 KB.",
 941                nameof(value)) :
 942            value > MaxWindowSize ?
 943            throw new ArgumentException(
 944                $"The {nameof(InitialStreamWindowSize)} value cannot be larger than {MaxWindowSize}.",
 945                nameof(value)) :
 946            value;
 47    }
 48
 49    /// <summary>Gets or sets the maximum stream frame size in bytes.</summary>
 50    /// <value>The maximum stream frame size in bytes. It can't be less than <c>1</c> KB. Defaults to <c>32</c>
 51    /// KB.</value>
 52    public int MaxStreamFrameSize
 53    {
 70654        get => _maxStreamFrameSize;
 255        set => _maxStreamFrameSize = value >= 1024 ? value :
 256            throw new ArgumentException(
 257                $"The {nameof(MaxStreamFrameSize)} value cannot be less than 1KB.",
 258                nameof(value));
 59    }
 60
 61    // We use the HTTP/2 maximum window size (2GB).
 62    internal const int MaxWindowSize = int.MaxValue;
 63
 75064    private TimeSpan _idleTimeout = TimeSpan.FromSeconds(30);
 65    // The default specified in the HTTP/2 specification.
 75066    private int _initialStreamWindowSize = 65_536;
 75067    private int _maxStreamFrameSize = 32_768;
 68}