Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Documentation says:
- When changing the values of the server timeout (ServerTimeout) or the Keep-Alive interval (KeepAliveInterval:
The server timeout should be at least double the value assigned to the Keep-Alive interval.
The Keep-Alive interval should be less than or equal to half the value assigned to the server timeout
When specifying the Keep-Alive interval as 5000ms and Server Timeout as 30000ms, the Keep-Alive still defaults to 15 seconds
Expected Behavior
Keep-Alive interval is honored. Currently if a user disconnects from SignalR or has a connection issue, when a button is pressed in Server-side blazor application the UI hangs for 15 seconds before displaying the reconnection modal.
One solution using the Keep-Alive should be to send more frequent pings so that it is quicker to tell when a client is not receiving DOM updates.
Steps To Reproduce
<script src="_framework/blazor.{HOSTING MODEL}.js" autostart="false"></script>
<script>
Blazor.start({
configureSignalR: function (builder) {
let c = builder.build();
c.serverTimeoutInMilliseconds = 30000;
c.keepAliveIntervalInMilliseconds = 5000;
builder.build = () => {
return c;
};
}
});
</script>
Using the script above if you inspect the WS connection in JS console, you will see pings of 15 seconds, regardless of Keep-Alive
Exceptions (if any)
No response
.NET Version
7.0.32
Anything else?
No response