как мне восстановить соединение без обновления браузера клиентского приложения , если внутренний сервер отключается и возвращается через 5 минут или около того ...
const connection = new signalR.HubConnectionBuilder()
.withUrl(`/place/${props.match.params.id}`)
.withAutomaticReconnect()
.build();
connection.onreconnecting(function() {
setError('connection lost..');
var reconnectionInterval = setInterval(() => {
if (connection.state == signalR.HubConnectionState.Disconnected) {
connection.stop();
try {
console.log('try to reconnect');
connection.start();
} catch (e) {
//doesn't go here, how to handle if the server still down
console.log('failed to reconnect');
}
}
}, 5000);
});