'TCP socket option not working in Windows Server 2016 Standard

This code workes fine in my Windows 10, Windows 11, Windows Server 2012R2 and Windows Server 2019 Standard:

TcpClient _client = new TcpClient();
_client.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 16);

... but ir does not work in Windows Server 2016 Standard x64. I get this error:

"An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call."

Any idea why this doesn't work on Windows Server 2016?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source