NetPro.ZeroMQ
6.0.16
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Core 3.1
This package targets .NET Core 3.1. The package is compatible with this framework or higher.
dotnet add package NetPro.ZeroMQ --version 6.0.16
NuGet\Install-Package NetPro.ZeroMQ -Version 6.0.16
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetPro.ZeroMQ" Version="6.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.ZeroMQ --version 6.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NetPro.ZeroMQ, 6.0.16"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetPro.ZeroMQ as a Cake Addin #addin nuget:?package=NetPro.ZeroMQ&version=6.0.16 // Install NetPro.ZeroMQ as a Cake Tool #tool nuget:?package=NetPro.ZeroMQ&version=6.0.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetPro.ZeroMQ使用
使用
appsetting.json
"ZeroMQOption": {
"PublishPort": 81,
"PushPort": 82
}
启用服务
没有基于NetPro.Web.Api 的使用场景,必须手动进行初始化,如下:
IConfiguration Configuration;
public void ConfigureServices(IServiceCollection services)
{
var option= new ZeroMQOption(configuration);
services.AddZeroMQForPublisher(option);
services.AddZeroMQForPushSocket(option);
}
基于NetPro.Web.Api的使用,只需要添加引用后配置以上appsetting.josn配置ZeroMQOption节点即可
使用说明
public class ZeroMQService: IZeroMQService
{
private readonly static object _lock = new();//zeromq socket is thread-unsafe
private readonly PublisherSocket _publisherSocket;
private readonly PushSocket _pushSocket;
public ZeroMQService( PublisherSocket publisherSocket
, PushSocket pushSocket)
{
_publisherSocket = publisherSocket;
_pushSocket = pushSocket;
}
/// <summary>
/// publish-subscribtion
/// </summary>
public void Publish(string sql)
{
lock (_lock)
{
_publisherSocket.SendMoreFrame("A:b") // Topic支持特殊符号,topic命名最佳实践:模块名/功能命/功能层级
.SendFrame(DateTimeOffset.Now.ToString());
}
}
/// <summary>
/// push-pull
/// </summary>
/// <returns></returns>
[HttpGet("PushSocket")]
[ProducesResponseType(200, Type = typeof(ResponseResult))]
public IActionResult PushSocket()
{
lock (_lock)
{
//推数据 https://github.com/zeromq/netmq/blob/ea0a5a7e1b77a1ade9311f187f4ff37a20d5d964/src/NetMQ.Tests/PushPullTests.cs
_pushSocket.SendFrame("Hello Clients"); ;
}
return Ok();
}
}
更新中...
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- NetMQ (>= 4.0.1.8)
- NetPro.Startup (>= 6.0.16)
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- NetMQ (>= 4.0.1.8)
- NetPro.Startup (>= 6.0.16)
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 |
---|---|---|
6.0.16 | 242 | 7/24/2023 |
6.0.15 | 437 | 7/19/2022 |
6.0.14 | 453 | 7/10/2022 |
6.0.13 | 458 | 6/15/2022 |
6.0.12 | 439 | 6/15/2022 |
6.0.11 | 434 | 6/15/2022 |
6.0.10 | 436 | 6/11/2022 |
6.0.9 | 454 | 6/8/2022 |
6.0.8 | 449 | 5/26/2022 |
6.0.8-beta.3 | 122 | 5/24/2022 |
6.0.8-beta.2 | 126 | 5/24/2022 |
6.0.7 | 434 | 5/18/2022 |
6.0.6 | 425 | 4/28/2022 |
6.0.5 | 448 | 3/30/2022 |
6.0.5-beta.20 | 126 | 4/27/2022 |
6.0.5-beta.19 | 130 | 4/25/2022 |
6.0.5-beta.18 | 124 | 4/22/2022 |
6.0.5-beta.17 | 128 | 4/16/2022 |
6.0.5-beta.16 | 137 | 4/8/2022 |
6.0.5-beta.15 | 130 | 4/8/2022 |
6.0.5-beta.14 | 148 | 4/7/2022 |
6.0.5-beta.13 | 141 | 4/7/2022 |
6.0.5-beta.12 | 134 | 4/6/2022 |
6.0.5-beta.11 | 135 | 4/6/2022 |
6.0.5-beta.10 | 136 | 3/31/2022 |
6.0.5-beta.9 | 143 | 3/26/2022 |
6.0.5-beta.8 | 138 | 3/22/2022 |
6.0.5-beta.7 | 128 | 3/21/2022 |
6.0.5-beta.6 | 128 | 3/14/2022 |
6.0.5-beta.5 | 125 | 3/2/2022 |
6.0.5-beta.4 | 127 | 2/22/2022 |