-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Customizable serverTimeoutInMilliseconds in Server-Side Blazor #18840
Copy link
Copy link
Closed
Labels
Blazor ♥ SignalRThis issue is related to the experience of Signal R and Blazor working togetherThis issue is related to the experience of Signal R and Blazor working togetheraffected-mostThis issue impacts most of the customersThis issue impacts most of the customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-serverseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Blazor ♥ SignalRThis issue is related to the experience of Signal R and Blazor working togetherThis issue is related to the experience of Signal R and Blazor working togetheraffected-mostThis issue impacts most of the customersThis issue impacts most of the customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-serverseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
When debugging a server-side blazor app we often see this error pop up in the client (browser) while stepping through code:
Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'.
This can be pretty disruptive, requiring a refresh of the browser to recover after continuing the debug session.
Presumably, this happens because the server isn't sending keepalives on the SignalR connection while I'm stepping through code in the debugger. When running in a 'development' environment, I'd like to be able to customize the serverTimeoutInMilliseconds on the HubConnection to prevent this. I see examples of how to customize the SignalR settings for a server-side Blazor app using code like this:
However, I'm unable to change the serverTimeoutInMilliseconds setting. This setting is available on the HubConnection object, but I don't have access to that object. I only have access to HubConnectionBuilder. And HubConnectionBuilder doesn't have a serverTimeoutInMilliseconds property.
It seems like adding support for configuring the serverTimeoutInMilliseconds via HubConnectionBuilder would be the simplest solution.
Even nicer would be some way to configure this setting in my Startup.cs, probably with a new property available somewhere under the AddServerSideBlazor call, similar to how I can customize the server-side hub settings via AddServerSideBlazor().AddHubOptions(options => ... ).