From 9d9808085c00a42ccc9663df7b06af2564c8370b Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 2 Dec 2020 20:00:38 +0100 Subject: [PATCH 1/2] Apply [SupportedOSPlatform("windows10.0.2004")] --- .../ref/System.Net.Http.WinHttpHandler.cs | 3 +++ .../src/System/Net/Http/WinHttpHandler.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs index 12c86997fb1e04..6ae5b23f316864 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs @@ -44,8 +44,11 @@ public WinHttpHandler() { } public System.Func? ServerCertificateValidationCallback { get { throw null; } set { } } public System.Net.ICredentials? ServerCredentials { get { throw null; } set { } } public System.Security.Authentication.SslProtocols SslProtocols { get { throw null; } set { } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] public bool TcpKeepAliveEnabled { get { throw null; } set { } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] public System.TimeSpan TcpKeepAliveTime { get { throw null; } set { } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] public System.TimeSpan TcpKeepAliveInterval { get { throw null; } set { } } public System.Net.Http.WindowsProxyUsePolicy WindowsProxyUsePolicy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs index 1525bc936e01dc..e7bac93376f1f9 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs @@ -7,6 +7,7 @@ using System.Net.Http.Headers; using System.Net.Security; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Text; @@ -418,9 +419,11 @@ public TimeSpan ReceiveDataTimeout /// Gets or sets a value indicating whether TCP keep-alive is enabled. /// /// + /// Only supported on Windows 10 version 2004 or newer. /// If enabled, the values of and will be forwarded /// to set WINHTTP_OPTION_TCP_KEEPALIVE, enabling and configuring TCP keep-alive for the backing TCP socket. /// + [SupportedOSPlatform("windows10.0.2004")] public bool TcpKeepAliveEnabled { get @@ -438,9 +441,11 @@ public bool TcpKeepAliveEnabled /// Gets or sets the TCP keep-alive timeout. /// /// + /// Only supported on Windows 10 version 2004 or newer. /// Has no effect if is . /// The default value of this property is 2 hours. /// + [SupportedOSPlatform("windows10.0.2004")] public TimeSpan TcpKeepAliveTime { get @@ -459,9 +464,11 @@ public TimeSpan TcpKeepAliveTime /// Gets or sets the TCP keep-alive interval. /// /// + /// Only supported on Windows 10 version 2004 or newer. /// Has no effect if is . /// The default value of this property is 1 second. /// + [SupportedOSPlatform("windows10.0.2004")] public TimeSpan TcpKeepAliveInterval { get From 7cee2cb916cc4e86907ee1889c0fd4b087784b71 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 7 Dec 2020 19:18:16 +0100 Subject: [PATCH 2/2] Use Build with [SupportedOSPlatform] --- .../ref/System.Net.Http.WinHttpHandler.cs | 6 +++--- .../src/System/Net/Http/WinHttpHandler.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs index 6ae5b23f316864..c9c63bb27e8267 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs @@ -44,11 +44,11 @@ public WinHttpHandler() { } public System.Func? ServerCertificateValidationCallback { get { throw null; } set { } } public System.Net.ICredentials? ServerCredentials { get { throw null; } set { } } public System.Security.Authentication.SslProtocols SslProtocols { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.19041")] public bool TcpKeepAliveEnabled { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.19041")] public System.TimeSpan TcpKeepAliveTime { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.2004")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows10.0.19041")] public System.TimeSpan TcpKeepAliveInterval { get { throw null; } set { } } public System.Net.Http.WindowsProxyUsePolicy WindowsProxyUsePolicy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs index e7bac93376f1f9..4df57194f60f0c 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs @@ -423,7 +423,7 @@ public TimeSpan ReceiveDataTimeout /// If enabled, the values of and will be forwarded /// to set WINHTTP_OPTION_TCP_KEEPALIVE, enabling and configuring TCP keep-alive for the backing TCP socket. /// - [SupportedOSPlatform("windows10.0.2004")] + [SupportedOSPlatform("windows10.0.19041")] public bool TcpKeepAliveEnabled { get @@ -445,7 +445,7 @@ public bool TcpKeepAliveEnabled /// Has no effect if is . /// The default value of this property is 2 hours. /// - [SupportedOSPlatform("windows10.0.2004")] + [SupportedOSPlatform("windows10.0.19041")] public TimeSpan TcpKeepAliveTime { get @@ -468,7 +468,7 @@ public TimeSpan TcpKeepAliveTime /// Has no effect if is . /// The default value of this property is 1 second. /// - [SupportedOSPlatform("windows10.0.2004")] + [SupportedOSPlatform("windows10.0.19041")] public TimeSpan TcpKeepAliveInterval { get