Blazor Server Kestrel keep-alive client-server communication after disconnect
emetrix opened this issue · 1 comments
I'm creating a .net 6 AspNet Core Blazor server application hosted by Kestrel within a docker container which uses a custom timeout handling on client side. Once the application is not used for e.g. 30 minutes a dialog is displayed and the page needs a reload for further usage.
For saving server and network resources after the client timeout occurs I'm trying to stop the application/connection by calling "Blazor.disconnect();" on the client side.
But I've noticed that after calling Blazor.disconnect() and displaying the information message the client the server the client and the server are still exchanging keep-alive data like this:
Sent a ping message to the client. [Microsoft.AspNetCore.SignalR.HubConnectionContext]
Sending payload: 3 bytes [Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsTransport]
Message received. Type: Binary, size: 3, EndOfMessage: True [Microsoft.AspNetCore.Http.Connections.Internal.Transports.WebSocketsTransport]
Therefore I'm looking for a way to completely disconnect the client and free resouces of the connection on the server.
@emetrix thanks for contacting us.
Disconnect only releases resources from the Blazor session on the server, but it does not sever the underlying connection.
I'm marking this as a duplicate since we have another issue where we are tracking improvements in this area #30287
Please upvote that issue instead