< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.TcpTransportDefaults
Assembly: CoreWCF.NetTcp
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Channels/TransportDefaults.cs
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 70
Line coverage: 50%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
GetListenBacklog()100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Channels/TransportDefaults.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Net.Security;
 6using System.Security.Authentication;
 7
 8namespace CoreWCF.Channels
 9{
 10    internal static class TransportDefaults
 11    {
 12        internal const bool ExtractGroupsForWindowsAccounts = true; //SspiSecurityTokenProvider.DefaultExtractWindowsGro
 13        internal const long MaxReceivedMessageSize = 65536;
 14        internal const HostNameComparisonMode HostNameComparisonMode = CoreWCF.HostNameComparisonMode.Exact;
 15        internal const int MaxDrainSize = (int)MaxReceivedMessageSize;
 16        internal const long MaxBufferPoolSize = 512 * 1024;
 17        internal const int MaxBufferSize = (int)MaxReceivedMessageSize;
 18
 19        internal const SslProtocols SslProtocols = System.Security.Authentication.SslProtocols.None; // Let the OS decid
 20
 21        internal static MessageEncoderFactory GetDefaultMessageEncoderFactory()
 22        {
 23            return new BinaryMessageEncodingBindingElement().CreateMessageEncoderFactory();
 24        }
 25    }
 26
 27    internal static class ConnectionOrientedTransportDefaults
 28    {
 29        internal const int ConnectionBufferSize = 8192;
 30        internal const HostNameComparisonMode HostNameComparisonMode = CoreWCF.HostNameComparisonMode.StrongWildcard;
 31        internal static TimeSpan IdleTimeout { get { return TimeSpan.FromMinutes(2); } }
 32        internal static TimeSpan ChannelInitializationTimeout { get { return TimeSpan.FromSeconds(30); } }
 33        internal const int MaxContentTypeSize = 256;
 34        internal const int MaxOutboundConnectionsPerEndpoint = 10;
 35        internal static TimeSpan MaxOutputDelay { get { return TimeSpan.FromMilliseconds(200); } }
 36
 37        internal const int MaxViaSize = 2048;
 38        internal const ProtectionLevel ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;
 39        internal const TransferMode TransferMode = CoreWCF.TransferMode.Buffered;
 40
 41        internal static int GetMaxConnections()
 42        {
 43            return GetMaxPendingConnections();
 44        }
 45
 46        internal static int GetMaxPendingConnections()
 47        {
 48            return 12 * Environment.ProcessorCount;
 49        }
 50
 51        internal static int GetMaxPendingAccepts()
 52        {
 53            return 2 * Environment.ProcessorCount;
 54        }
 55    }
 56
 57    internal static class TcpTransportDefaults
 58    {
 59        internal const int ListenBacklogConst = 0;
 060        internal static TimeSpan ConnectionLeaseTimeout { get { return TimeSpan.FromMinutes(5); } }
 61        internal const string ConnectionLeaseTimeoutString = "00:05:00";
 62        //internal const bool PortSharingEnabled = false;
 63        //internal const bool TeredoEnabled = false;
 64
 65        internal static int GetListenBacklog()
 66        {
 12067            return 12 * Environment.ProcessorCount;
 68        }
 69    }
 70}