| | | 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 | | |
| | | 4 | | using System.Threading; |
| | | 5 | | |
| | | 6 | | namespace System.Net.Http |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Additional default values used used only in this assembly. |
| | | 10 | | /// </summary> |
| | | 11 | | internal static partial class HttpHandlerDefaults |
| | | 12 | | { |
| | 0 | 13 | | public static readonly int DefaultMaxConnectionsPerServer = GlobalHttpSettings.SocketsHttpHandler.MaxConnections |
| | | 14 | | |
| | 0 | 15 | | public static readonly TimeSpan DefaultKeepAlivePingTimeout = TimeSpan.FromSeconds(20); |
| | 0 | 16 | | public static readonly TimeSpan DefaultKeepAlivePingDelay = Timeout.InfiniteTimeSpan; |
| | | 17 | | public const HttpKeepAlivePingPolicy DefaultKeepAlivePingPolicy = HttpKeepAlivePingPolicy.Always; |
| | | 18 | | |
| | | 19 | | // This is the default value for SocketsHttpHandler.InitialHttp2StreamWindowSize, |
| | | 20 | | // which defines the value we communicate in stream SETTINGS frames. |
| | | 21 | | // Should not be confused with Http2Connection.DefaultInitialWindowSize, which defines the RFC default. |
| | | 22 | | // Unlike that value, DefaultInitialHttp2StreamWindowSize might be changed in the future. |
| | | 23 | | public const int DefaultInitialHttp2StreamWindowSize = 65535; |
| | | 24 | | |
| | | 25 | | // This is the default value for SocketsHttpHandler.InitialHttp2MaxConcurrentStreams. |
| | | 26 | | // It defines how many concurrent streams a new HTTP/2 connection may use before it |
| | | 27 | | // observes the server's SETTINGS_MAX_CONCURRENT_STREAMS value. |
| | | 28 | | // 100 is the lowest limit servers are recommended to advertise by |
| | | 29 | | // https://www.rfc-editor.org/rfc/rfc9113.html#section-6.5.2 ("It is recommended that this |
| | | 30 | | // value be no smaller than 100, so as to not unnecessarily limit parallelism"), which makes |
| | | 31 | | // it a safe assumption for servers we haven't talked to yet. |
| | | 32 | | public const int DefaultInitialHttp2MaxConcurrentStreams = 100; |
| | | 33 | | } |
| | | 34 | | } |
| | | 35 | | |