This answer is specific to “SignalR version 2” the latest version “ASP.NET Core SignalR” may differ.
SignalR version 2:
The JS client attempts to reconnect for a certain time period, which defaults to 110 seconds. You can subscribe to the connection.stateChanged event, and get updates on when the state changes so that you can display it to the user, or validate SignalR’s response to different disconnection scenarios.
In my testing, the state was correctly updated to disconnected and reconnecting etc., as you would expect.
More information on signalr connections
function connectionStateChanged(state) {
var stateConversion = {0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected'};
console.log('SignalR state changed from: ' + stateConversion[state.oldState]
+ ' to: ' + stateConversion[state.newState]);
}
connection = $.connection(signalR_Endpoint);
connection.stateChanged(connectionStateChanged);
connection.start({ waitForPageLoad: false });