TransportR.Hub.SignalR
0.6.0
dotnet add package TransportR.Hub.SignalR --version 0.6.0
NuGet\Install-Package TransportR.Hub.SignalR -Version 0.6.0
<PackageReference Include="TransportR.Hub.SignalR" Version="0.6.0" />
<PackageVersion Include="TransportR.Hub.SignalR" Version="0.6.0" />
<PackageReference Include="TransportR.Hub.SignalR" />
paket add TransportR.Hub.SignalR --version 0.6.0
#r "nuget: TransportR.Hub.SignalR, 0.6.0"
#:package TransportR.Hub.SignalR@0.6.0
#addin nuget:?package=TransportR.Hub.SignalR&version=0.6.0
#tool nuget:?package=TransportR.Hub.SignalR&version=0.6.0
TransportR.Hub.SignalR
Server-side hub implementation for TransportR, providing SignalR control plane and HTTP streaming data plane.
Purpose
Provides the hub services that:
- Manage client connections and discovery
- Orchestrate transfer handshakes between senders and receivers
- Act as a "dumb pipe" for data transfer (no deserialization)
- Redirect a client to the instance holding its transfer when several hubs share a state store (affinity handoff)
Architecture
┌─────────────────────────────────────────────────────────────┐
│ DataHub Server │
├─────────────────────────────────────────────────────────────┤
│ CommandHub (SignalR) │
│ ├── /hub/command │
│ │ ├── Connect(clientId, groups) │
│ │ ├── GetReceivers() → List<ClientInfo> │
│ │ ├── InitTransfer(targetId, batchSize, timeoutMs) │
│ │ └── Heartbeat() → bool │
│ │
│ StreamController (HTTP) │
│ ├── POST /api/stream/{id}/send │
│ ├── GET /api/stream/{id}/receive │
│ └── POST /api/stream/{id}/abort │
│ │
│ ClientController (HTTP) │
│ └── PUT /api/client/{id}/token │
├─────────────────────────────────────────────────────────────┤
│ Services (via interfaces for testability) │
│ ├── IStateStore → InMemory/Redis/TestProxy │
│ ├── ITransferManager → TransferManager │
│ └── SignalRDataServer (dumb pipe bridge) │
└─────────────────────────────────────────────────────────────┘
Integration
var builder = WebApplication.CreateBuilder(args);
// The hub forwards opaque chunks and never deserializes a payload, so it registers no
// serializer: that is a client-side decision between the two ends of a transfer.
// Build() is required: it registers the identity provider (JWT by default, UseDevMode() for development).
builder.Services.AddDataHub().Build();
// For HA deployment (Redis + Affinity):
// builder.Services.AddDataHub()
// .UseRedisStore("localhost:6379")
// .UseAffinityHandoff()
// .Build();
var app = builder.Build();
// With the JWT default the host also configures JwtBearer authentication, calls UseAuthentication()
// and UseAuthorization(), and maps with requireAuth: true (see SecurityArchitecture.md).
app.MapDataHub();
app.Run();
Testability
Hub components take their collaborators through interfaces and a TimeProvider, so a test can
build one by hand and move the clock instead of waiting:
var clock = new FakeTimeProvider();
var stateStore = new InMemoryStateStore(timeProvider: clock);
var transferManager = new TransferManager(stateStore, clock);
var policy = new AccessPolicy(Options.Create(new AccessOptions()), clock); // IFlowControlService is optional
var hub = new CommandHub(
stateStore,
transferManager,
identityProvider, // IClientIdentityProvider
initiator, // SignalRTransferInitiator
policy,
new ConnectionRegistry(),
Options.Create(new AffinityOptions()),
logger, // ILogger<CommandHub>
clock);
Dumb Pipe Design
The hub never deserializes batch payloads:
- Receives raw bytes from sender
- Forwards directly to receiver
- Forwards control messages (ACK) bidirectionally
Dependencies
TransportR- Core interfacesMicrosoft.AspNetCore.App- ASP.NET Core framework
| 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
- TransportR (>= 0.6.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TransportR.Hub.SignalR:
| Package | Downloads |
|---|---|
|
TransportR.Storage.Redis
Redis-backed state store for TransportR: shares client registrations and transfer sessions between hubs behind a sticky load balancer |
GitHub repositories
This package is not used by any popular GitHub repositories.