< Summary

Information
Class: IceRpc.ServerOptions
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/ServerOptions.cs
Tag: 275_13775359185
Line coverage
84%
Covered lines: 11
Uncovered lines: 2
Coverable lines: 13
Total lines: 58
Line coverage: 84.6%
Branch coverage
25%
Covered branches: 1
Total branches: 4
Branch coverage: 25%
Method coverage
90%
Covered methods: 9
Total methods: 10
Method coverage: 90%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ConnectionOptions()100%11100%
get_ConnectTimeout()100%11100%
set_ConnectTimeout(...)50%22100%
get_MaxConnections()100%11100%
get_MaxPendingConnections()100%11100%
get_ServerAddress()100%11100%
get_ServerAuthenticationOptions()100%11100%
get_ShutdownTimeout()100%11100%
set_ShutdownTimeout(...)0%620%
.ctor()100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/ServerOptions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Net.Security;
 4
 5namespace IceRpc;
 6
 7/// <summary>Represents a property bag used to configure a <see cref="Server" />.</summary>
 8public sealed record class ServerOptions
 9{
 10    /// <summary>Gets or sets the connection options for server connections.</summary>
 11    /// <value>The connection options. Defaults to a default constructed <see cref="ConnectionOptions" />.</value>
 105412    public ConnectionOptions ConnectionOptions { get; set; } = new();
 13
 14    /// <summary>Gets or sets the connection establishment timeout for connections accepted by the server.</summary>
 15    /// <value>Defaults to <c>10</c> seconds.</value>
 16    public TimeSpan ConnectTimeout
 17    {
 14218        get => _connectTimeout;
 419        set => _connectTimeout = value != TimeSpan.Zero ? value :
 420            throw new ArgumentException($"0 is not a valid value for {nameof(ConnectTimeout)}", nameof(value));
 21    }
 22
 23    /// <summary>Gets or sets the maximum number of accepted server connections. Once the maximum number of connections
 24    /// has been reached, the server will refuse any new connections.</summary>
 25    /// <value>The maximum number of connections. Defaults to <c>0</c>, meaning unlimited.</value>
 15626    public int MaxConnections { get; set; }
 27
 28    /// <summary>Gets or sets the maximum number of server connections waiting for connection establishment to complete.
 29    /// Once the maximum number of pending connections has been reached, the server will stop accepting new connections
 30    /// to ensure that the transport rejects new connections once its connection backlog is full.</summary>
 31    /// <value>The maximum number of connection waiting for connection establishment to complete. Defaults to
 32    /// <c>100</c>.</value>
 28633    public int MaxPendingConnections { get; set; } = 100;
 34
 35    /// <summary>Gets or sets the server's address. The server address host is usually an IP address, and it cannot be a
 36    /// DNS name.</summary>
 37    /// <value>The <see cref="ServerAddress" /> of this <see cref="Server" />. Defaults to a <see cref="ServerAddress"
 38    /// /> constructed with <see cref="Protocol.IceRpc" />.</value>
 42439    public ServerAddress ServerAddress { get; set; } = new(Protocol.IceRpc);
 40
 41    /// <summary>Gets or sets the SSL server authentication options.</summary>
 42    /// <value>The SSL server authentication options. When not <see langword="null" />, the server will accept only
 43    /// secure connections.</value>
 19244    public SslServerAuthenticationOptions? ServerAuthenticationOptions { get; set; }
 45
 46    /// <summary>Gets or sets the shutdown timeout. This timeout is used when gracefully shutting down a connection
 47    /// managed by the server.</summary>
 48    /// <value>Defaults to <c>10</c> seconds.</value>
 49    public TimeSpan ShutdownTimeout
 50    {
 14251        get => _shutdownTimeout;
 052        set => _shutdownTimeout = value != TimeSpan.Zero ? value :
 053            throw new ArgumentException($"0 is not a valid value for {nameof(ShutdownTimeout)}", nameof(value));
 54    }
 55
 14256    private TimeSpan _connectTimeout = TimeSpan.FromSeconds(10);
 14257    private TimeSpan _shutdownTimeout = TimeSpan.FromSeconds(10);
 58}