Sanet.Transport
1.7.0
dotnet add package Sanet.Transport --version 1.7.0
NuGet\Install-Package Sanet.Transport -Version 1.7.0
<PackageReference Include="Sanet.Transport" Version="1.7.0" />
<PackageVersion Include="Sanet.Transport" Version="1.7.0" />
<PackageReference Include="Sanet.Transport" />
paket add Sanet.Transport --version 1.7.0
#r "nuget: Sanet.Transport, 1.7.0"
#:package Sanet.Transport@1.7.0
#addin nuget:?package=Sanet.Transport&version=1.7.0
#tool nuget:?package=Sanet.Transport&version=1.7.0
Sanet.Transport
Core abstractions for message-based communication in distributed systems.
Overview
Sanet.Transport provides the core interfaces and message definitions for a simple, extensible architecture for publishing and subscribing to messages between different parts of an application or between distributed systems.
Key Components
- ITransportPublisher: Core interface for publishing and subscribing to messages
- TransportConnectionState: Describes the connectivity state of a transport connection
- IPublisherFactory: Creates transport publishers from transport-specific options
- PublisherOptions: Marker base type for transport-specific publisher options
- TransportMessage: Standard message format for all transport implementations
Connection State
Every ITransportPublisher exposes:
TransportConnectionState ConnectionState- the current connectivity stateevent Action<TransportConnectionState>? ConnectionStateChanged- raised on every connection-state transition
The states are:
Connecting- the connection is being establishedConnected- the connection is established and operationalReconnecting- the connection was lost and is being re-established (non-terminal)Disconnected- the connection is not active (non-terminal)Closed- the connection has been closed (terminal, a new publisher must be created)
The event reports transport connectivity only — it is not raised when peers or hosts join or leave a room. Implementations report these states differently; see the package-specific READMEs for the exact mapping.
publisher.ConnectionStateChanged += state =>
{
switch (state)
{
case TransportConnectionState.Closed:
// Terminal - recreate the publisher before continuing
break;
case TransportConnectionState.Disconnected:
case TransportConnectionState.Reconnecting:
// Transient - disable sending, show a reconnecting indicator
break;
case TransportConnectionState.Connected:
// Re-enable sending
break;
}
};
Basic Usage
// Subscribe to messages
publisher.Subscribe(message => {
Console.WriteLine($"Received message: {message.CommandType}");
// Process the message
});
// Publish a message
publisher.PublishMessage(new TransportMessage {
CommandType = "SomeCommand",
SourceId = Guid.NewGuid(),
Payload = "{\"key\": \"value\"}",
Timestamp = DateTime.UtcNow
});
Available Implementations
- Sanet.Transport.Rx - Reactive Extensions implementation
- Sanet.Transport.Channel - System.Threading.Channels implementation
- Sanet.Transport.SignalR - ASP.NET Core SignalR implementation
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
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Sanet.Transport:
| Package | Downloads |
|---|---|
|
Sanet.Transport.Rx
Reactive Extensions implementation of the Sanet.Transport abstractions |
|
|
Sanet.Transport.SignalR.Client
Client components for SignalR implementation of the Sanet.Transport abstractions. Includes discovery and client publisher. |
|
|
Sanet.Transport.SignalR.Server
Server components for SignalR implementation of the Sanet.Transport abstractions. Includes Hub, HostManager and server publisher. |
|
|
Sanet.Transport.SignalR
SignalR implementation of the Sanet.Transport abstractions |
|
|
Sanet.Transport.Channel
System.Threading.Channels implementation of the Sanet.Transport abstractions |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.7.0 | 426 | 8/28/2026 |
| 1.6.0 | 2,283 | 8/26/2026 |
| 1.5.1 | 722 | 8/22/2026 |
| 1.5.0 | 152 | 8/22/2026 |
| 1.4.2 | 696 | 8/18/2026 |
| 1.4.1 | 333 | 8/17/2026 |
| 1.4.0 | 250 | 8/16/2026 |
| 1.3.2 | 132 | 8/15/2026 |
| 1.3.1 | 136 | 8/15/2026 |
| 1.3.0 | 287 | 8/13/2026 |
| 1.2.1 | 133 | 8/13/2026 |
| 1.2.0 | 115 | 8/13/2026 |
| 1.1.1 | 2,270 | 7/24/2026 |
| 1.1.0 | 14,043 | 5/17/2026 |
| 1.0.2 | 39,441 | 3/31/2025 |
| 1.0.1 | 24,090 | 3/27/2025 |
| 1.0.0 | 245 | 3/26/2025 |