Can't disable KeepAlive for ClientWebSocket
I ported a project from .net 4.5 to Core. Building worked fine, but execution with .net Core doesn't work. First of all setting KeepAliveInterval to -1 is no longer supported and throws an OutOfRangeException. Setting it to any other value (e.g. 0) keeps KeepAlive on. I looked at the ClientWebSocket-Code. I suspect KeepAliveInterval is never used. So currently there is no way to modify KeepAlive behavior.
cc: @CIPop
@CC84 - I think this is expected since ClientWebSocketOptions has not been fully implemented yet. This is tracked by issue dotnet/corefx#5120. @CIPop can confirm.
Ok, then i'll have to wait. Thx. There even seems to be much more work. When i'm right, currently there is no Unix support at all for the ClientWebSocket. I'm experimenting with an Raspberry... not much fun....
This is actually by design and mirrors the behavior from .Net Desktop (see http://referencesource.microsoft.com/#System/net/System/Net/WebSockets/ClientWebSocket.cs,592).
I'm not sure if this can be controlled on Windows since the implementation is based on WinHTTP. Please open or convert this item to a feature request by changing the title.
Adding behavior-pinning unit/functional tests is still tracked by dotnet/corefx#5120 as @SidharthNabar mentioned.
@CIPop For WinHTTP, there is a flag WINHTTP_DISABLE_KEEP_ALIVE which can be used with WinHttpQueryOption or WinHttpSetOption.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa384066.aspx
Thanks @wulf2468 I have reactivated this issue and changed the type.
Let's actually track this in one place: dotnet/corefx#5120.