When debugging web applications utilizing SignalR, we sometimes need to step-through front-end JavaScript code. And when the stepping is in progress, no network requests initiated from other js code are going to be sent, including ping requests for keeping SignalR connection alive. Then we get a dead SignalR connection after stepping-through js code if no proper reconnection logic is implemented.

So to make debugging applications utilizing SignalR a bit easier, we may choose to increase the disconnect timeout for SignalR when in development stage. This can be done on the server side.

Timeout configuration for SignalR can be set in Application_Start method of Global class in Global.asax.cs file.

// Wait a maximum of 30 minutes after a transport connection is lost
// before raising the Disconnected event to terminate the SignalR connection.
GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromMinutes(30);

Note the default value for DisconnectTimeout is 30 seconds.

References