DH.NRemoting.Extensions
3.91.2024.1012-beta0242
This is a prerelease version of DH.NRemoting.Extensions.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package DH.NRemoting.Extensions --version 3.91.2024.1012-beta0242
NuGet\Install-Package DH.NRemoting.Extensions -Version 3.91.2024.1012-beta0242
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.Extensions" Version="3.91.2024.1012-beta0242" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DH.NRemoting.Extensions --version 3.91.2024.1012-beta0242
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DH.NRemoting.Extensions, 3.91.2024.1012-beta0242"
#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.Extensions as a Cake Addin #addin nuget:?package=DH.NRemoting.Extensions&version=3.91.2024.1012-beta0242&prerelease // Install DH.NRemoting.Extensions as a Cake Tool #tool nuget:?package=DH.NRemoting.Extensions&version=3.91.2024.1012-beta0242&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 | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- DH.NRemoting (>= 3.91.2024.1012-beta0242)
-
net7.0
- DH.NRemoting (>= 3.91.2024.1012-beta0242)
-
net8.0
- DH.NRemoting (>= 3.91.2024.1012-beta0242)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
第三代协议通信库,增强RPC,引入主流Http/WebSockt/WebApi应用级封装