Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions aspnetcore/blazor/fundamentals/signalr.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,43 +346,6 @@ When a circuit ends because a user has disconnected and the framework is cleanin

We recommend using the [Azure SignalR Service](xref:signalr/scale#azure-signalr-service) for Blazor Server apps hosted in Microsoft Azure. The service works in conjunction with the app's Blazor Hub for scaling up a Blazor Server app to a large number of concurrent SignalR connections. In addition, the SignalR Service's global reach and high-performance data centers significantly aid in reducing latency due to geography. For prerendering support with the Azure SignalR Service, configure the app to use *sticky sessions*. For more information, see <xref:blazor/host-and-deploy/server>.

## Long Polling

In earlier versions of ASP.NET Core, Long Polling was enabled as a fallback transport for situations in which the WebSockets transport wasn't available. If an app must use Long Polling, make the following changes:

In the app's `Program.cs` file, replace `app.MapBlazorHub()` with the following code:

```csharp
app.MapBlazorHub(configureOptions: options =>
{
options.Transports =
HttpTransportType.WebSockets | HttpTransportType.LongPolling;
});
```

Locate the Blazor script tag in the `Pages/_Layout.cshtml` file. Add the `autostart="false"` attribute to the tag:

```html
<script src="_framework/blazor.server.js" autostart="false"></script>
```

Add the following script to the `Pages/_Layout.cshtml` file immediately inside the closing `</body>` tag. WebSockets (`1`) and Long Polling (`4`) are the supported `HTTPTransportTypes`. The following example:

* Specifies support for both WebSockets and Long Polling transports (`1 | 4`).
* Defaults to the WebSockets transport when a WebSockets connection can be established.

```html
<script>
(function start() {
Blazor.start({
configureSignalR: builder => builder.withUrl('_blazor', 1 | 4)
});
})()
</script>
```

For more information, see [Disable Long Polling Fallback Transport for Blazor Server (ASP.NET Announcements)](https://github.com/aspnet/Announcements/issues/470).

## Additional resources

* <xref:signalr/introduction>
Expand Down