Sanet.Transport.SignalR.Server
1.7.0
dotnet add package Sanet.Transport.SignalR.Server --version 1.7.0
NuGet\Install-Package Sanet.Transport.SignalR.Server -Version 1.7.0
<PackageReference Include="Sanet.Transport.SignalR.Server" Version="1.7.0" />
<PackageVersion Include="Sanet.Transport.SignalR.Server" Version="1.7.0" />
<PackageReference Include="Sanet.Transport.SignalR.Server" />
paket add Sanet.Transport.SignalR.Server --version 1.7.0
#r "nuget: Sanet.Transport.SignalR.Server, 1.7.0"
#:package Sanet.Transport.SignalR.Server@1.7.0
#addin nuget:?package=Sanet.Transport.SignalR.Server&version=1.7.0
#tool nuget:?package=Sanet.Transport.SignalR.Server&version=1.7.0
Sanet.Transport.SignalR.Server
Provides the server-side components (SignalR Hub, Host Manager, Server Publisher) for the Sanet.Transport SignalR implementation. This package includes the necessary ASP.NET Core dependencies to host a SignalR hub.
Overview
This library contains the server infrastructure required to host a SignalR hub for Sanet.Transport. It uses Microsoft.NET.Sdk.Web and includes:
TransportHub: The core SignalR Hub.SignalRHostManager: Manages a self-contained SignalR host.SignalRServerPublisher: ImplementsITransportPublisherfor the server-side, broadcasting messages to connected clients.
Note: This package depends on Sanet.Transport.SignalR.Client for network discovery broadcasting functionality.
Features
- Host a self-contained SignalR Hub.
- Manage the SignalR host lifecycle.
- Broadcast
TransportMessageobjects to all connected clients. - Receive messages from clients.
- Integrates with network discovery (via
Sanet.Transport.SignalR.Client).
Installation
dotnet add package Sanet.Transport.SignalR.Server
Or via the Package Manager Console:
Install-Package Sanet.Transport.SignalR.Server
Usage
Server-side (Host)
// Create a SignalR host (server)
var hostManager = await SignalRTransportFactory.CreateHostAsync(port: 5000);
// Get the server-side publisher
ITransportPublisher serverPublisher = hostManager.Publisher;
// (Optional) Make the host discoverable using the discovery service from the Client package
// var discoveryService = new Sanet.Transport.SignalR.Client.Discovery.BroadcastDiscoveryService();
// discoveryService.BroadcastPresence(hostManager.HubUrl);
// Subscribe to messages from clients
serverPublisher.Subscribe(message => {
Console.WriteLine($"Server received: {message.CommandType}");
// Broadcast a response to all clients
serverPublisher.PublishMessage(new TransportMessage {
CommandType = "ServerResponse",
SourceId = Guid.NewGuid(),
Payload = "{\"server\": \"response\"}",
Timestamp = DateTime.UtcNow
});
});
Connection State
ConnectionState reports whether the host publisher is active: Connected while running
and Closed after disposal (with ConnectionStateChanged firing once). It does not
indicate whether any client is attached — a running host is Connected even with zero
clients, and clients joining/leaving never change the reported state.
License
This project is licensed under the MIT License - see the LICENSE file for details.
| 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
- Sanet.Transport (>= 1.7.0)
- Sanet.Transport.SignalR.Client (>= 1.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.7.0 | 200 | 8/28/2026 |
| 1.6.0 | 308 | 8/26/2026 |
| 1.5.1 | 151 | 8/22/2026 |
| 1.5.0 | 103 | 8/22/2026 |
| 1.4.2 | 149 | 8/18/2026 |
| 1.4.1 | 119 | 8/17/2026 |
| 1.4.0 | 108 | 8/16/2026 |
| 1.3.2 | 92 | 8/15/2026 |
| 1.3.1 | 94 | 8/15/2026 |
| 1.3.0 | 117 | 8/13/2026 |
| 1.2.0 | 107 | 8/13/2026 |
| 1.1.1 | 327 | 7/24/2026 |
| 1.1.0 | 1,283 | 5/17/2026 |
| 0.5.0 | 2,231 | 4/7/2025 |