Soenneker.SignalR.Web.Client
4.0.808
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.SignalR.Web.Client --version 4.0.808
NuGet\Install-Package Soenneker.SignalR.Web.Client -Version 4.0.808
<PackageReference Include="Soenneker.SignalR.Web.Client" Version="4.0.808" />
<PackageVersion Include="Soenneker.SignalR.Web.Client" Version="4.0.808" />
<PackageReference Include="Soenneker.SignalR.Web.Client" />
paket add Soenneker.SignalR.Web.Client --version 4.0.808
#r "nuget: Soenneker.SignalR.Web.Client, 4.0.808"
#:package Soenneker.SignalR.Web.Client@4.0.808
#addin nuget:?package=Soenneker.SignalR.Web.Client&version=4.0.808
#tool nuget:?package=Soenneker.SignalR.Web.Client&version=4.0.808
Soenneker.SignalR.Web.Client
A SignalR client wrapper that retries initial connections, recovers closed connections, and exposes callbacks for restoring application state after a connection returns.
Installation
dotnet add package Soenneker.SignalR.Web.Client
Usage
using Microsoft.AspNetCore.Http.Connections;
using Soenneker.SignalR.Web.Client;
using Soenneker.SignalR.Web.Client.Options;
var options = new SignalRWebClientOptions
{
HubUrl = "https://api.example.com/hubs/updates",
AccessTokenProvider = () => Task.FromResult(accessToken),
TransportType = HttpTransportType.WebSockets,
ConnectionRestored = async context =>
{
// Reload authoritative state after the initial connection or a reconnect.
await SynchronizeAsync(context.IsReconnect);
},
RetriesExhausted = () => NotifyConnectionFailure()
};
await using var client = new SignalRWebClient(options);
client.Connection.On<OrderUpdated>("OrderUpdated", update =>
{
Apply(update);
});
await client.StartConnection(cancellationToken);
await client.Connection.InvokeAsync("Subscribe", accountId, cancellationToken);
The wrapper owns its HubConnection; dispose the wrapper when the connection is no longer needed. Use Connection to register handlers with On(...) and call hub methods with InvokeAsync(...).
Reconnection behavior
Each connection cycle retries a failed start up to MaxRetryAttempts times using exponential backoff. After an unexpected close, ReconnectIndefinitely starts another cycle after InitialRetryDelay; set it to false to stop after the first exhausted cycle. RetriesExhausted is invoked when recovery stops, and ConnectionRestored runs after both an initial connection and a successful recovery.
Enable StatefulReconnect only when the server supports it. StatefulReconnectBufferSize controls the client-side buffered message bytes used by that mode.
Call StopConnection for an intentional disconnect. This suppresses closed-connection recovery until StartConnection is called again.
Authentication and headers
AccessTokenProvider is evaluated by SignalR when it needs a bearer token. Static request headers can be supplied through Headers; avoid placing secrets in headers that may be sent by transports or intermediaries you do not control.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.SignalR.Client (>= 10.0.11)
- Polly (>= 8.7.0)
- Soenneker.Atomics.ValueBools (>= 4.0.38)
- Soenneker.Extensions.Task (>= 4.0.128)
- Soenneker.Extensions.ValueTask (>= 4.0.120)
- Soenneker.Utils.Random (>= 4.0.129)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.SignalR.Web.Client:
| Package | Downloads |
|---|---|
|
Soenneker.SignalR.Web.Clients
Providing async thread-safe resilient and dependable SignalR web client singletons |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.810 | 28 | 9/1/2026 |
| 4.0.809 | 96 | 8/31/2026 |
| 4.0.808 | 85 | 8/30/2026 |
| 4.0.807 | 73 | 8/30/2026 |
| 4.0.806 | 90 | 8/30/2026 |
| 4.0.805 | 88 | 8/30/2026 |
| 4.0.804 | 86 | 8/30/2026 |
| 4.0.803 | 86 | 8/30/2026 |
| 4.0.802 | 76 | 8/29/2026 |
| 4.0.801 | 72 | 8/29/2026 |
| 4.0.800 | 79 | 8/29/2026 |
| 4.0.799 | 77 | 8/29/2026 |
| 4.0.798 | 145 | 8/26/2026 |
| 4.0.797 | 393 | 8/12/2026 |
| 4.0.796 | 108 | 8/11/2026 |
| 4.0.795 | 260 | 7/28/2026 |
| 4.0.794 | 135 | 7/28/2026 |
| 4.0.793 | 99 | 7/28/2026 |
| 4.0.792 | 126 | 7/27/2026 |
| 4.0.791 | 101 | 7/27/2026 |
Improve SignalR client usage guidance