Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't disable KeepAlive for ClientWebSocket #15992

Closed
CC84 opened this issue Dec 27, 2015 · 7 comments
Closed

Can't disable KeepAlive for ClientWebSocket #15992

CC84 opened this issue Dec 27, 2015 · 7 comments
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions
Milestone

Comments

@CC84
Copy link

CC84 commented Dec 27, 2015

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.

@davidsh
Copy link
Contributor

davidsh commented Dec 27, 2015

cc: @CIPop

@SidharthNabar
Copy link

@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.

@CC84
Copy link
Author

CC84 commented Dec 28, 2015

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....

@CIPop
Copy link
Member

CIPop commented Jan 11, 2016

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 CIPop closed this as completed Jan 11, 2016
@Nyatra
Copy link

Nyatra commented May 24, 2016

@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

@CIPop
Copy link
Member

CIPop commented May 24, 2016

Thanks @wulf2468 I have reactivated this issue and changed the type.

@CIPop CIPop reopened this May 24, 2016
@CIPop CIPop assigned himadrisarkar and unassigned CIPop May 24, 2016
@CIPop
Copy link
Member

CIPop commented Jun 2, 2016

Let's actually track this in one place: dotnet/corefx#5120.

@CIPop CIPop closed this as completed Jun 2, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions
Projects
None yet
Development

No branches or pull requests

7 participants