I created a hubConnection, and added the .WithAutomaticReconnect() so when the connection is lost it will automaticaly reconnect. When testing i wrote the .Reconnecting event, and when i stop the server, the client signalR connection is going immediately in the Disconnected state, and in the Closed event without going in the Reconnecting event, and does not reconnect. This is only when i stop the server, if the server is not stoped, and the connection is somehow lost, it does try to recconect and it goes in the Reconnecting event. So, why the Reconnecting event is not fired when i stop the server? I am asking this because i want to make sure the client will reconnect even if I restart the server after some updates. With only the .WithAutomaticReconnect() method, the client does not reconnect if the server was restarted.
This is my code for the signalR connection build:
_hubConnection = new HubConnectionBuilder().WithUrl(Url, options =>
{
options.AccessTokenProvider = () => Task.FromResult(token);
})
.WithAutomaticReconnect()
.Build();
I am working with signalR 3.0 and have a .net core console app as client.