Skip to content

Commit

Permalink
Mention SignalR Core 3.0's auto reconnect support (#15703)
Browse files Browse the repository at this point in the history
* Mention SignalR Core 3.0's auto reconnect support

* Nits

* Update aspnetcore/signalr/version-differences.md

Co-Authored-By: Scott Addie <10702007+scottaddie@users.noreply.github.com>

* Update version-differences.md

* Update version-differences.md

* minor edits
  • Loading branch information
halter73 authored and scottaddie committed Nov 18, 2019
1 parent 857ebe2 commit d490144
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions aspnetcore/signalr/version-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand All @@ -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

Expand Down

0 comments on commit d490144

Please # to comment.