diff --git a/aspnetcore/signalr/version-differences.md b/aspnetcore/signalr/version-differences.md index be572baae62a..85b4b0d42fe5 100644 --- a/aspnetcore/signalr/version-differences.md +++ b/aspnetcore/signalr/version-differences.md @@ -4,7 +4,7 @@ author: bradygaster description: Differences between SignalR and ASP.NET Core SignalR monikerRange: '>= aspnetcore-2.1' ms.author: bradyg -ms.date: 11/12/2019 +ms.date: 11/18/2019 no-loc: [SignalR] uid: signalr/version-differences --- @@ -28,7 +28,34 @@ ASP.NET Core SignalR isn't compatible with clients or servers for ASP.NET Signal ### Automatic reconnects -Automatic reconnects aren't supported in ASP.NET Core SignalR. If the client is disconnected, the user must explicitly start a new connection if they want to reconnect. In ASP.NET SignalR, SignalR attempts to reconnect to the server if the connection is dropped. +::: moniker range=">= aspnetcore-3.0" + +In ASP.NET SignalR: + +* By default, SignalR attempts to reconnect to the server if the connection is dropped. +* Automatic reconnects are opt-in with both the [.NET client](xref:signalr/dotnet-client#automatically-reconnect) and the [JavaScript client](xref:signalr/javascript-client#automatically-reconnect): + +```csharp +HubConnection connection = new HubConnectionBuilder() + .WithUrl(new Uri("http://127.0.0.1:5000/chatHub")) + .WithAutomaticReconnect() + .Build(); +``` + +```javascript +const connection = new signalR.HubConnectionBuilder() + .withUrl("/chatHub") + .withAutomaticReconnect() + .build(); +``` + +::: moniker-end + +::: moniker range="< aspnetcore-3.0" + +Prior to ASP.NET Core 3.0, SignalR doesn't support automatic reconnects. If the client is disconnected, the user must explicitly start a new connection to reconnect. In ASP.NET SignalR, SignalR attempts to reconnect to the server if the connection is dropped. + +::: moniker-end ### Protocol support