DH.NRemoting
3.91.2024.1109-beta0233
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.5
This package targets .NET Framework 4.5. The package is compatible with this framework or higher.
This is a prerelease version of DH.NRemoting.
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DH.NRemoting --version 3.91.2024.1109-beta0233
NuGet\Install-Package DH.NRemoting -Version 3.91.2024.1109-beta0233
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="DH.NRemoting" Version="3.91.2024.1109-beta0233" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DH.NRemoting --version 3.91.2024.1109-beta0233
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DH.NRemoting, 3.91.2024.1109-beta0233"
#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 DH.NRemoting as a Cake Addin #addin nuget:?package=DH.NRemoting&version=3.91.2024.1109-beta0233&prerelease // Install DH.NRemoting as a Cake Tool #tool nuget:?package=DH.NRemoting&version=3.91.2024.1109-beta0233&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DH.NRemoting - 协议通信库
协议通信库,包含RPC架构和HTTP架构,提供客户端服务端通信的基础框架,内置SRMP协议实现,并支持实现各种自定义协议。
参考目录:
RPC架构
客户端:ApiClient
服务端:ApiServer
应用客户端:ClientBase
特点:
- 服务端根据Action把请求转发给各个Controller,用法跟WebApi一致。
- 简单高性能,通信报文使用二进制序列化,中间没有任何损耗
- 接口出入参支持灵活的Json序列化(常规接口),同时也支持高效的二进制序列化(图片视频)
- TCP/UDP长会话,支持服务端主动下发消息
- 典型连接数,单机1万TCP长连接,最高400万
- 典型吞吐数,单机10万TPS,最高2266万TPS
- 服务端可寄宿于控制台、Web项目、桌面应用、IoT嵌入式应用
- 支持集群部署横向扩展,每个客户端跟其中一个服务端维持长连接,所有请求落到该服务器
代表性应用(蚂蚁调度AntJob):
- 客户端AntClient继承自ClientBase,通过Tcp/Udp等协议连接服务端ApiServer,进行登录、心跳等操作。
- 客户端使用应用AppId和AppSecret登录,获得令牌,后续无需携带或验证令牌,直到令牌过期重新登录。
HTTP架构
客户端:ApiHttpClient
服务端:ASP.NET WebApi
应用客户端:ClientBase
应用服务端:BaseDeviceController
特点:
- 标准ASP.NET WebApi作为服务端,重用现有技术栈,包括接口测试和集群部署管理。
- 客户端ApiHttpClient是标准HttpClient的进一步封装,支持多服务端地址负载均衡。
- 默认通信使用Json序列化,不适合传输文件、图片和视频等二进制数据。
- 服务端提供BaseController基类,封装了令牌验证等鉴权机制
- 服务端提供BaseDeviceController基类,封装常见的登录、心跳和更新等接口
- 通过WebSocket长连接实现指令下发,心跳保活
- 典型连接数,单机1000并发连接
- 典型吞吐数,单机1万TPS
- 服务端仅寄宿于 Kestrel和IIS
- 支持集群部署横向扩展,客户端每次请求都可能分流到不同应用服务器
代表性应用(轻量级IoT平台ZeroIoT):
- 客户端HttpDevice继承自ClientBase,通过Http/Https协议连接服务端WebApi,进行登录、注销、心跳和更新等操作。
- 客户端使用设备DeviceCode和DeviceSecret登录,获得令牌,后续每次请求头都需要带上令牌。
- 在心跳时检测并维持WebSocket长连接。
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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 is compatible. 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 is compatible. 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. net9.0 is compatible. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.5
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
.NETFramework 4.6.1
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
.NETStandard 2.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
.NETStandard 2.1
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
net5.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
net6.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
net7.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
net8.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
-
net9.0
- DH.NCore (>= 3.91.2024.1109-beta0218)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on DH.NRemoting:
Package | Downloads |
---|---|
DH.NStardust
星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心 |
|
DH.NMQTT
流行的物联网通信协议MQTT,包括客户端、服务端 |
|
DH.NRemoting.Extensions
提供WebApi应用级服务端 |
|
DH.NAntJob
分布式任务调度系统,纯NET打造的重量级大数据实时计算平台,万亿级调度经验积累。 |
|
DH.NMQ
轻量级消息队列,无延迟分发,支持消费组和消息去重,不支持集群部署 |
GitHub repositories
This package is not used by any popular GitHub repositories.
第三代协议通信库,增强RPC,引入主流Http/WebSockt/WebApi应用级封装