NewLife.Remoting 3.2.2025.101-beta0602

This is a prerelease version of NewLife.Remoting.
There is a newer version of this package available.
See the version list below for details.
dotnet add package NewLife.Remoting --version 3.2.2025.101-beta0602
                    
NuGet\Install-Package NewLife.Remoting -Version 3.2.2025.101-beta0602
                    
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="NewLife.Remoting" Version="3.2.2025.101-beta0602" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NewLife.Remoting" Version="3.2.2025.101-beta0602" />
                    
Directory.Packages.props
<PackageReference Include="NewLife.Remoting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NewLife.Remoting --version 3.2.2025.101-beta0602
                    
#r "nuget: NewLife.Remoting, 3.2.2025.101-beta0602"
                    
#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.
#:package NewLife.Remoting@3.2.2025.101-beta0602
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NewLife.Remoting&version=3.2.2025.101-beta0602&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NewLife.Remoting&version=3.2.2025.101-beta0602&prerelease
                    
Install as a Cake Tool

NewLife.Remoting - 协议通信库

GitHub top language GitHub License Nuget Downloads Nuget Nuget (with prereleases)

Nuget Downloads Nuget Nuget (with prereleases)

协议通信库,包含RPC架构和HTTP架构,提供客户端服务端通信的基础框架,内置SRMP协议实现,并支持实现各种自定义协议。

源码: https://github.com/NewLifeX/NewLife.Remoting
Nuget:NewLife.Remoting / NewLife.Remoting.Extensions

参考目录:

RPC架构

客户端:ApiClient

服务端:ApiServer

应用客户端:ClientBase

特点:

  1. 服务端根据Action把请求转发给各个Controller,用法跟WebApi一致。
  2. 简单高性能,通信报文使用二进制序列化,中间没有任何损耗
  3. 接口出入参支持灵活的Json序列化(常规接口),同时也支持高效的二进制序列化(图片视频)
  4. TCP/UDP长会话,支持服务端主动下发消息
  5. 典型连接数,单机1万TCP长连接,最高400万
  6. 典型吞吐数,单机10万TPS,最高2266万TPS
  7. 服务端可寄宿于控制台、Web项目、桌面应用、IoT嵌入式应用
  8. 支持集群部署横向扩展,每个客户端跟其中一个服务端维持长连接,所有请求落到该服务器

代表性应用(蚂蚁调度AntJob):

  1. 客户端AntClient继承自ClientBase,通过Tcp/Udp等协议连接服务端ApiServer,进行登录、心跳等操作。
  2. 客户端使用应用AppId和AppSecret登录,获得令牌,后续无需携带或验证令牌,直到令牌过期重新登录。

HTTP架构

客户端:ApiHttpClient

服务端:ASP.NET WebApi

应用客户端:ClientBase

应用服务端:BaseDeviceController

特点:

  1. 标准ASP.NET WebApi作为服务端,重用现有技术栈,包括接口测试和集群部署管理。
  2. 客户端ApiHttpClient是标准HttpClient的进一步封装,支持多服务端地址负载均衡。
  3. 默认通信使用Json序列化,不适合传输文件、图片和视频等二进制数据。
  4. 服务端提供BaseController基类,封装了令牌验证等鉴权机制
  5. 服务端提供BaseDeviceController基类,封装常见的登录、心跳和更新等接口
  6. 通过WebSocket长连接实现指令下发,心跳保活
  7. 典型连接数,单机1000并发连接
  8. 典型吞吐数,单机1万TPS
  9. 服务端仅寄宿于 Kestrel和IIS
  10. 支持集群部署横向扩展,客户端每次请求都可能分流到不同应用服务器

代表性应用(轻量级IoT平台ZeroIoT):

  1. 客户端HttpDevice继承自ClientBase,通过Http/Https协议连接服务端WebApi,进行登录、注销、心跳和更新等操作。
  2. 客户端使用设备DeviceCode和DeviceSecret登录,获得令牌,后续每次请求头都需要带上令牌。
  3. 在心跳时检测并维持WebSocket长连接。

新生命项目矩阵

各项目默认支持net9.0/netstandard2.1/netstandard2.0/net4.62/net4.5,旧版(2024.0801)支持net4.0/net2.0

项目 年份 说明
基础组件 支撑其它中间件以及产品项目
NewLife.Core 2002 核心库,日志、配置、缓存、网络、序列化、APM性能追踪
NewLife.XCode 2005 大数据中间件,单表百亿级,MySql/SQLite/SqlServer/Oracle/PostgreSql/达梦,自动分表
NewLife.Net 2005 网络库,单机千万级吞吐率(2266万tps),单机百万级连接(400万Tcp)
NewLife.Remoting 2011 RPC通信框架,内网高吞吐,物联网设备低开销易接入
NewLife.Cube 2010 魔方快速开发平台,集成了用户权限、SSO登录、OAuth服务端等,单表100亿级项目验证
NewLife.Agent 2008 服务管理组件,把应用安装成为操作系统守护进程,Windows服务、Linux的Systemd
NewLife.Zero 2020 Zero零代脚手架,基于NewLife组件生态的项目模板NewLife.Templates,Web、WebApi、Service
中间件 对接知名中间件平台
NewLife.Redis 2017 Redis客户端,微秒级延迟,百万级吞吐,丰富的消息队列,百亿级数据量项目验证
NewLife.RocketMQ 2018 RocketMQ纯托管客户端,支持Apache RocketMQ和阿里云消息队列,十亿级项目验
NewLife.MQTT 2019 物联网消息协议,MqttClient/MqttServer,客户端支持阿里云物联网
NewLife.IoT 2022 IoT标准库,定义物联网领域的各种通信协议标准规范
NewLife.Modbus 2022 ModbusTcp/ModbusRTU/ModbusASCII,基于IoT标准库实现,支持IoT平台和IoTEdge
NewLife.Siemens 2022 西门子PLC协议,基于IoT标准库实现,支持IoT平台和IoTEdge
NewLife.Map 2022 地图组件库,封装百度地图、高德地图、腾讯地图、天地图
NewLife.Audio 2023 音频编解码库,PCM/ADPCMA/G711A/G722U/WAV/AAC
产品平台 产品平台级,编译部署即用,个性化自定义
Stardust 2018 星尘,分布式服务平台,节点管理、APM监控中心、配置中心、注册中心、发布中心
AntJob 2019 蚂蚁调度,分布式大数据计算平台(实时/离线),蚂蚁搬家分片思想,万亿级数据量项目验证
NewLife.ERP 2021 企业ERP,产品管理、客户管理、销售管理、供应商管理
CrazyCoder 2006 码神工具,众多开发者工具,网络、串口、加解密、正则表达式、Modbus
EasyIO 2023 简易文件存储,支持分布式系统中文件集中存储。
XProxy 2005 产品级反向代理,NAT代理、Http代理
HttpMeter 2022 Http压力测试工具
GitCandy 2015 Git源代码管理系统
SmartOS 2014 嵌入式操作系统,完全独立自主,支持ARM Cortex-M芯片架构
SmartA2 2019 嵌入式工业计算机,物联网边缘网关,高性能.NET6主机,应用于工业、农业、交通、医疗
FIoT物联网平台 2020 物联网整体解决方案,建筑、环保、农业,软硬件及大数据分析一体化,单机十万级点位项目验证
UWB高精度室内定位 2020 厘米级(10~20cm)高精度室内定位,软硬件一体化,与其它系统联动,大型展厅项目验证

新生命开发团队

XCode

新生命团队(NewLife)成立于2002年,是新时代物联网行业解决方案提供者,致力于提供软硬件应用方案咨询、系统架构规划与开发服务。
团队主导的80多个开源项目已被广泛应用于各行业,Nuget累计下载量高达300余万次。
团队开发的大数据中间件NewLife.XCode、蚂蚁调度计算平台AntJob、星尘分布式平台Stardust、缓存队列组件NewLife.Redis以及物联网平台FIoT,均成功应用于电力、高校、互联网、电信、交通、物流、工控、医疗、文博等行业,为客户提供了大量先进、可靠、安全、高质量、易扩展的产品和系统集成服务。

我们将不断通过服务的持续改进,成为客户长期信赖的合作伙伴,通过不断的创新和发展,成为国内优秀的IoT服务供应商。

新生命团队始于2002年,部分开源项目具有20年以上漫长历史,源码库保留有2010年以来所有修改记录
网站:https://newlifex.com
开源:https://github.com/newlifex
QQ群:1600800/1600838
微信公众号:
智能大石头

Product 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.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.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.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on NewLife.Remoting:

Package Downloads
NewLife.Stardust

星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心

NewLife.MQTT

流行的物联网通信协议MQTT,包括客户端、服务端

NewLife.Net

网络通讯基础框架及各种协议实现。

NewLife.AntJob

分布式任务调度系统,纯NET打造的重量级大数据实时计算平台,万亿级调度经验积累。

NewLife.Remoting.Extensions

提供WebApi应用级服务端

GitHub repositories (6)

Showing the top 6 popular GitHub repositories that depend on NewLife.Remoting:

Repository Stars
NewLifeX/X
Core basic components: log (file / network), configuration (XML / JSON / HTTP), cache (memory / redis), network (TCP / UDP / HTTP), RPC framework, serialization (binary / XML / JSON), APM performance tracking. 核心基础组件,日志(文件/网络)、配置(XML/Json/Http)、缓存(内存/Redis)、网络(Tcp/Udp/Http)、RPC框架、序列化(Binary/XML/Json)、APM性能追踪。
NewLifeX/AntJob
高吞吐 .NET 分布式任务与实时数据调度平台:时间/数据/消息/Cron/SQL/脚本切片,自动重试与弹性扩缩,回溯补算 + Web 控制台。High‑throughput .NET distributed job & real‑time scheduler with fine‑grained slicing, retries, elastic scaling & web console.
NewLifeX/Stardust
星尘,轻量级分布式服务框架。配置中心、集群管理、远程自动发布、服务治理。服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。
NewLifeX/XCoder
新生命码神工具,代码生成、网络工具、API工具、串口工具、正则工具、图标工具、加解密工具、地图接口。
NewLifeX/NewLife.Net
单机吞吐2266万tps的网络通信框架
NewLifeX/NewLife.MQTT
最流行的物联网通信协议MQTT,包括客户端、服务端和Web管理平台
Version Downloads Last Updated
3.5.2025.1026-beta0602 141 10/26/2025
3.5.2025.1001 1,492 10/1/2025
3.5.2025.1001-beta1720 180 10/1/2025
3.5.2025.921-beta1556 217 9/21/2025
3.5.2025.915-beta1636 351 9/15/2025
3.5.2025.914-beta1424 222 9/14/2025
3.5.2025.903-beta1229 186 9/3/2025
3.5.2025.901 1,883 9/1/2025
3.5.2025.901-beta1137 171 9/1/2025
3.5.2025.901-beta0603 174 9/1/2025
3.5.2025.830-beta1611 282 8/30/2025
3.5.2025.827-beta1704 224 8/27/2025
3.5.2025.826-beta0442 599 8/26/2025
3.5.2025.825-beta2351 208 8/25/2025
3.5.2025.824-beta1236 204 8/24/2025
3.5.2025.822-beta0944 152 8/22/2025
3.5.2025.820-beta1825 177 8/20/2025
3.5.2025.818-beta1634 511 8/18/2025
3.5.2025.812-beta1259 357 8/12/2025
3.4.2025.812-beta1032 179 8/12/2025
3.4.2025.812-beta1003 174 8/12/2025
3.4.2025.808-beta1105 732 8/8/2025
3.4.2025.805-beta1659 269 8/5/2025
3.4.2025.805-beta1531 248 8/5/2025
3.4.2025.801 1,608 8/1/2025
3.4.2025.801-beta0218 133 8/1/2025
3.4.2025.731-beta0004 158 7/31/2025
3.4.2025.722-beta0820 765 7/22/2025
3.4.2025.719-beta0004 95 7/19/2025
3.4.2025.713-beta1545 705 7/13/2025
3.4.2025.713-beta1351 316 7/13/2025
3.4.2025.713-beta1335 174 7/13/2025
3.3.2025.709-beta0306 180 7/9/2025
3.3.2025.701 2,138 7/1/2025
3.3.2025.701-beta0355 188 7/1/2025
3.3.2025.616-beta1415 328 6/16/2025
3.3.2025.610-beta0350 332 6/10/2025
3.3.2025.601 2,312 6/1/2025
3.3.2025.601-beta0800 141 6/1/2025
3.3.2025.527-beta1716 268 5/27/2025
3.3.2025.521-beta1200 504 5/21/2025
3.3.2025.519-beta1620 248 5/19/2025
3.3.2025.515-beta1338 517 5/15/2025
3.3.2025.514-beta0417 264 5/14/2025
3.3.2025.501 2,510 5/1/2025
3.3.2025.501-beta1629 195 5/1/2025
3.3.2025.428-beta0633 208 4/28/2025
3.3.2025.426-beta1312 302 4/26/2025
3.3.2025.417-beta1306 244 4/17/2025
3.3.2025.415-beta1725 229 4/15/2025
3.3.2025.415-beta1203 445 4/15/2025
3.3.2025.415-beta1143 246 4/15/2025
3.3.2025.412-beta0428 180 4/12/2025
3.3.2025.401 5,561 4/1/2025
3.3.2025.401-beta0524 202 4/1/2025
3.3.2025.329-beta1224 150 3/29/2025
3.3.2025.301 1,828 3/1/2025
3.3.2025.301-beta0131 144 3/1/2025
3.3.2025.226-beta0837 253 2/26/2025
3.3.2025.225-beta1354 152 2/25/2025
3.3.2025.225-beta1254 133 2/25/2025
3.3.2025.225-beta0533 147 2/25/2025
3.3.2025.224-beta1623 152 2/24/2025
3.2.2025.224-beta1147 143 2/24/2025
3.2.2025.221-beta0925 145 2/21/2025
3.2.2025.212-beta1257 162 2/12/2025
3.2.2025.207-beta0905 134 2/7/2025
3.2.2025.201 1,688 2/1/2025
3.2.2025.201-beta1615 146 2/1/2025
3.2.2025.109-beta1236 1,700 1/9/2025
3.2.2025.103-beta1513 357 1/3/2025
3.2.2025.101 10,579 1/1/2025
3.2.2025.101-beta0602 158 1/1/2025
3.2.2024.1225-beta1616 294 12/25/2024
3.2.2024.1206 2,158 12/6/2024
3.1.2024.1103-beta0605 140 11/3/2024
3.1.2024.1101 3,249 11/1/2024
3.1.2024.1002 1,650 10/2/2024
3.1.2024.923-beta0435 254 9/23/2024
3.1.2024.914-beta0002 299 9/14/2024
3.1.2024.913-beta0902 165 9/13/2024
3.1.2024.912-beta0006 167 9/12/2024
3.0.2024.902 2,174 9/2/2024
3.0.2024.812-beta0813 284 8/12/2024
3.0.2024.811-beta0608 176 8/11/2024
3.0.2024.806-beta0146 203 8/6/2024
3.0.2024.805 2,689 8/5/2024
3.0.2024.729-beta0815 952 7/29/2024
3.0.2024.710-beta1226 790 7/10/2024
3.0.2024.708 22,602 7/8/2024
3.0.2024.708-beta1003 163 7/8/2024
3.0.2024.703-beta0048 175 7/3/2024
3.0.2024.701 688 7/1/2024
3.0.2024.701-beta0219 156 7/1/2024
3.0.2024.630-beta0606 176 6/30/2024
3.0.2024.628-beta0626 359 6/28/2024
3.0.2024.627-beta1636 366 6/27/2024
3.0.2024.627-beta0009 182 6/27/2024
3.0.2024.626-beta1337 268 6/26/2024
3.0.2024.625-beta1714 274 6/25/2024
3.0.2024.625-beta1600 154 6/25/2024
3.0.2024.625-beta0716 182 6/25/2024
3.0.2024.624-beta1110 380 6/24/2024
3.0.2024.624-beta0627 183 6/24/2024
3.0.2024.624-beta0109 160 6/24/2024
3.0.2024.623-beta0607 291 6/23/2024
3.0.2024.622-beta1613 203 6/22/2024
2.8.2024.428-beta0930 1,190 4/28/2024
2.8.2024.402 14,795 4/2/2024
2.7.2024.202 1,631 2/2/2024
2.7.2024.101 2,199 1/1/2024
2.7.2024.101-beta0500 162 1/1/2024
2.7.2023.1218-beta1127 173 12/18/2023
2.7.2023.1209-beta1634 785 12/9/2023
2.7.2023.1201 2,639 12/1/2023
2.7.2023.1201-beta0310 129 12/1/2023
2.6.2023.1128-beta0013 150 11/28/2023
2.6.2023.1111-beta1140 178 11/11/2023
2.6.2023.1110-beta1323 172 11/10/2023
2.5.2023.1102 3,042 11/2/2023
2.5.2023.1102-beta0640 157 11/2/2023
2.5.2023.1101-beta0904 152 11/1/2023
2.5.2023.1031-beta0703 141 10/31/2023
2.4.2023.1028-beta0057 171 10/28/2023
2.4.2023.1001 4,316 10/1/2023
2.3.2023.907 879 9/7/2023
2.3.2023.903-beta1652 191 9/3/2023
2.3.2023.902-beta1701 316 9/2/2023
2.2.2023.902-beta1549 187 9/2/2023
2.2.2023.814 862 8/14/2023
2.2.2023.814-beta1331 193 8/14/2023
2.2.2023.707 3,528 7/7/2023
2.2.2023.707-beta0102 245 7/7/2023
2.1.2023.705-beta1042 234 7/5/2023
2.1.2023.704-beta0222 209 7/4/2023
2.1.2023.601 3,087 6/1/2023
2.1.2023.601-beta1433 227 6/1/2023
2.1.2023.516-beta0658 1,132 5/16/2023
2.1.2023.512 1,064 5/12/2023
2.1.2023.512-beta1533 219 5/12/2023
2.1.2023.401 3,051 4/1/2023
2.1.2023.401-beta1728 248 4/1/2023
2.1.2023.325-beta0151 497 3/25/2023
2.1.2023.301 3,194 3/1/2023
2.1.2023.301-beta0446 247 3/1/2023
2.0.2023.218-beta0230 518 2/18/2023
2.0.2023.214-beta1534 812 2/14/2023
2.0.2023.203 3,610 2/3/2023
2.0.2023.203-beta1355 222 2/3/2023
2.0.2023.203-beta1201 244 2/3/2023
2.0.2023.101 2,060 1/1/2023
2.0.2023.101-beta0306 256 1/1/2023
2.0.2022.1223-beta0408 1,954 12/23/2022
2.0.2022.1201 2,779 12/1/2022
2.0.2022.1201-beta1441 217 12/1/2022
2.0.2022.1127-beta0246 1,774 11/27/2022
2.0.2022.1109-beta0328 525 11/9/2022
2.0.2022.1101 3,574 11/1/2022
2.0.2022.1101-beta0755 277 11/1/2022
2.0.2022.1004 1,299 10/4/2022
2.0.2022.1004-beta0332 253 10/4/2022
2.0.2022.901 7,339 9/1/2022
2.0.2022.901-beta0405 272 9/1/2022
2.0.2022.813-beta1441 769 8/13/2022
2.0.2022.810-beta0529 383 8/10/2022

对标v11核心库,提升内存效率,降低GC