CodeWF.EventBus.Socket
1.2.1
dotnet add package CodeWF.EventBus.Socket --version 1.2.1
NuGet\Install-Package CodeWF.EventBus.Socket -Version 1.2.1
<PackageReference Include="CodeWF.EventBus.Socket" Version="1.2.1" />
<PackageVersion Include="CodeWF.EventBus.Socket" Version="1.2.1" />
<PackageReference Include="CodeWF.EventBus.Socket" />
paket add CodeWF.EventBus.Socket --version 1.2.1
#r "nuget: CodeWF.EventBus.Socket, 1.2.1"
#:package CodeWF.EventBus.Socket@1.2.1
#addin nuget:?package=CodeWF.EventBus.Socket&version=1.2.1
#tool nuget:?package=CodeWF.EventBus.Socket&version=1.2.1
CodeWF.EventBus.Socket
English | 简体中文
CodeWF.EventBus.Socket is a lightweight TCP event bus for C# processes. It provides Publish/Subscribe messaging and Query-style request/response over sockets, so local processes or lightweight services can communicate without introducing RabbitMQ, Kafka, Redis, or other external MQ infrastructure.
Highlights
- TCP socket transport based on
CodeWF.NetWrapper - Publish/Subscribe for cross-process notifications
- Query/response flow on the same subject
- Query correlation by request
TaskId, including concurrent queries on the same subject - Reuses
CodeWF.NetWrappertransport objects such asTcpSocketServer,TcpSocketClient,SocketCommand, andHeartbeat - No external MQ dependency
- Demo application in
src/EventBusDemo
Installation
dotnet add package CodeWF.EventBus.Socket
or
Install-Package CodeWF.EventBus.Socket
Quick Start
Start the server
using CodeWF.EventBus.Socket;
IEventServer eventServer = new EventServer();
await eventServer.StartAsync("127.0.0.1", 9100);
Connect a client
using CodeWF.EventBus.Socket;
IEventClient eventClient = new EventClient();
await eventClient.ConnectAsync("127.0.0.1", 9100);
Subscribe and publish
eventClient.Subscribe<NewEmailCommand>("event.email.new", command =>
{
Console.WriteLine($"Received: {command.Subject}");
});
eventClient.Publish("event.email.new", new NewEmailCommand
{
Subject = "Welcome",
Content = "Your account is ready",
SendTime = DateTime.Now
}, out _);
Query and respond
eventClient.Subscribe<EmailQuery>("event.email.query", query =>
{
var response = new EmailQueryResponse
{
Emails = EmailManager.QueryEmail(query.Subject)
};
eventClient.Publish("event.email.query", response, out _);
});
var result = await eventClient.QueryAsync<EmailQuery, EmailQueryResponse>(
"event.email.query",
new EmailQuery { Subject = "Account" },
3000);
Documentation
Communication Protocol
Data packets are exchanged over TCP.
Notes
- This library is designed for lightweight event distribution and IPC-style communication.
- The transport layer is implemented with
CodeWF.NetWrapper, and same-name transport objects are reused directly instead of being duplicated locally. - Event-bus-specific request/query/update packets remain defined in this project because they carry library-specific semantics.
- Messages are kept in memory only. There is no persistence, broker-side retry queue, or delivery guarantee after a process restart.
- For production use, consider whether you need authentication, encryption, retry, monitoring, and back-pressure around the socket transport.
Third-Party Open Source Audit (2026-05-20)
Checked with dotnet restore CodeWF.EventBus.Socket.slnx, dotnet list package --include-transitive, NuGet .nuspec metadata, NuGet.org, and upstream source/license links. MIT / Apache-2.0 / BSD are preferred; other source-open licenses are noted when source and transitive dependencies are traceable.
Remediation:
- Migrated the solution from
CodeWF.EventBus.Socket.slntoCodeWF.EventBus.Socket.slnx. - Added
Directory.Packages.propsand centralized direct package versions. - Upgraded the demo package line to
Avalonia 12.0.3,Semi.Avalonia 12.0.1,Irihi.Ursa 2.0.0,ReactiveUI.Avalonia 12.0.1,CodeWF.NetWrapper 2.1.1,CodeWF.EventBus 3.4.5.5, andCodeWF.LogViewer.Avalonia 12.0.3.1. - Removed
Avalonia.Diagnosticsbecause it does not have an Avalonia 12 package line. - Kept
Prism.Avalonia/Prism.DryIoc.Avaloniaon MIT8.1.97.11073; the newer 9.x line is intentionally not used. - Removed unused
Irihi.Ursa.PrismExtension 9.0.1and pinned old transitive system packages to10.0.8.
| Package | Usage | License | Source | Status |
|---|---|---|---|---|
CodeWF.EventBus / CodeWF.NetWrapper / CodeWF.NetWeaver / CodeWF.Log.Core / CodeWF.LogViewer.Avalonia |
Event bus, socket transport, demo logging | MIT | CodeWF repositories | Own open-source packages; approved |
Avalonia / Avalonia.Desktop / Avalonia.Markup.Xaml.Loader |
Demo UI | MIT | https://github.com/AvaloniaUI/Avalonia | Approved, 12.0.3 |
Semi.Avalonia |
Demo theme | MIT | https://github.com/irihitech/Semi.Avalonia | Approved, only the open core package is used |
Irihi.Ursa / Irihi.Ursa.Themes.Semi |
Demo controls and theme | MIT | https://github.com/irihitech/Ursa.Avalonia | Approved, 2.0.0 |
Prism.Avalonia / Prism.DryIoc.Avalonia |
Demo DI / Prism shell | MIT | https://github.com/AvaloniaCommunity/Prism.Avalonia | Approved, pinned to the 8.x open line |
ReactiveUI.Avalonia |
Demo MVVM | MIT | https://github.com/reactiveui/reactiveui | Approved |
System.Configuration.ConfigurationManager / System.Drawing.Common / System.Security.Cryptography.ProtectedData / System.Security.Permissions / System.Windows.Extensions |
Transitive compatibility pins | MIT | https://github.com/dotnet/dotnet | Approved, pinned to 10.0.8 |
Tmds.DBus.Protocol |
Avalonia Linux desktop transport | MIT | https://github.com/tmds/Tmds.DBus | Approved, pinned to 0.93.0 |
YY-Thunks |
Windows compatibility | MIT | https://github.com/Chuyu-Team/YY-Thunks | Source-open; approved |
Microsoft.NET.Test.Sdk / coverlet.collector |
Tests | MIT | https://github.com/microsoft/vstest / https://github.com/coverlet-coverage/coverlet | Approved |
xunit / xunit.runner.visualstudio |
Tests | Apache-2.0 | https://github.com/xunit/xunit | Approved |
Transitive dependency check: the effective dependency graph does not contain Prism 9 preview packages, or old System.Drawing.Common 4.7.0 / System.Configuration.ConfigurationManager 4.7.0 / System.Security.Cryptography.ProtectedData 4.7.0 chains. CodeWF.NetWrapper is now resolved to 2.1.1.
| 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
- CodeWF.EventBus (>= 3.4.5.5)
- CodeWF.Log.Core (>= 12.0.3.1)
- CodeWF.NetWrapper (>= 2.1.1)
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.2.1 | 32 | 5/20/2026 |
| 1.2.0 | 107 | 4/26/2026 |
| 1.1.0 | 112 | 4/17/2026 |
| 1.0.0 | 129 | 2/13/2026 |
| 0.2.2 | 471 | 12/9/2025 |
| 0.2.1.1 | 276 | 2/17/2025 |
| 0.2.1 | 266 | 10/12/2024 |
| 0.2.0.1 | 199 | 9/4/2024 |
| 0.2.0 | 187 | 8/3/2024 |
| 0.1.0 | 171 | 8/3/2024 |
| 0.0.4 | 177 | 7/29/2024 |
| 0.0.3 | 176 | 7/27/2024 |
| 0.0.2 | 172 | 7/27/2024 |
| 0.0.1 | 131 | 7/27/2024 |