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

Add KeepAliveTimeout support to WebSocketMiddleware #57293

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

BrennanConroy
Copy link
Member

@BrennanConroy BrennanConroy commented Aug 12, 2024

Closes #57072

Feature added recently in dotnet/runtime#105841

Replaced workaround from #48892. ServerWebSocket -> AbortStream. Solves the same issue but in a different way. This is verified by the test WebSocket_Abort_Interrupts_Pending_ReceiveAsync

The AbortStream workaround handles the background keep alive which ServerWebSocket did not. The old workaround only worked when someone called Abort on our websocket impl (ServerWebSocket), which can only happen in user code. With the addition of an abort call from inside the runtimes websocket impl, our ServerWebSocket.Abort function would never be called for keep alive timeouts.

@BrennanConroy BrennanConroy added feature-websockets Includes: WebSockets area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware labels Aug 12, 2024
@dotnet-policy-service dotnet-policy-service bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Aug 12, 2024
Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update the API proposal?

@BrennanConroy BrennanConroy merged commit 506512f into main Aug 13, 2024
26 checks passed
@BrennanConroy BrennanConroy deleted the brecon/keepalive branch August 13, 2024 17:59
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-rc1 milestone Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-websockets Includes: WebSockets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebSocket keep-alive timeout API
3 participants