NewLife.Remoting.Extensions 4.0.2026.1129-beta0949

This is a prerelease version of NewLife.Remoting.Extensions.
dotnet add package NewLife.Remoting.Extensions --version 4.0.2026.1129-beta0949
                    
NuGet\Install-Package NewLife.Remoting.Extensions -Version 4.0.2026.1129-beta0949
                    
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.Extensions" Version="4.0.2026.1129-beta0949" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NewLife.Remoting.Extensions" Version="4.0.2026.1129-beta0949" />
                    
Directory.Packages.props
<PackageReference Include="NewLife.Remoting.Extensions" />
                    
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.Extensions --version 4.0.2026.1129-beta0949
                    
#r "nuget: NewLife.Remoting.Extensions, 4.0.2026.1129-beta0949"
                    
#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.Extensions@4.0.2026.1129-beta0949
                    
#: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.Extensions&version=4.0.2026.1129-beta0949&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NewLife.Remoting.Extensions&version=4.0.2026.1129-beta0949&prerelease
                    
Install as a Cake Tool

NewLife.Remoting — Unified Remoting Framework (RPC + HTTP + WebSocket + SRMP)

GitHub License NuGet Downloads NuGet NuGet prerelease NuGet Downloads (Extensions) NuGet (Extensions) NuGet prerelease (Extensions) NativeAOT test

AOT smoke TFM locales

platform arch contributors

🌐 简体中文 | 繁體中文 | Español | Deutsch | 日本語 | Français | Português | Русский | 한국어 | العربية

NewLife.Remoting is the unified remoting infrastructure of the NewLife stack, shipped as two NuGet packages:

Package Role Coverage
NewLife.Remoting Core communication library RPC client/server, protocol codecs, connection management, streaming calls, client base classes, command dispatch pipeline, auto-update
NewLife.Remoting.Extensions Extension library Server controller base classes, minimal API host, device management services, token authentication, command response bus

Source: https://github.com/NewLifeX/NewLife.Remoting

NuGet: NewLife.Remoting / NewLife.Remoting.Extensions

Documentation Index

Document Description
Doc/需求文档.md Requirements: vision, core goals, functional requirements (RPC/STRM/CLNT/UPGD/SRV/CMD/AOT/L10N/EXT)
Doc/架构设计.md Architecture: layering, core module design, memory management, test strategy, design decisions
Doc/SRV-服务端架构.md Server business architecture: service layer, core flows (login/register/logout/heartbeat/upgrade/event upload/command push), online session lifecycle, cluster deployment
Doc/功能清单.md Feature tracking: status, in-progress items and backlog (release TODOs / pending fixes)
Doc/竞品分析.md Competitive analysis: RPC framework comparison + IoT command push matrix
Doc/SRMP.MD SRMP protocol specification
Doc/RPC内存管理设计.md Zero-copy memory management
Doc/自动更新机制.md End-to-end auto-update design
Doc/重试策略.md Retry policy: IRetryPolicy and exponential backoff samples
Doc/AOT兼容性分析.md NativeAOT support scope, 23 verified scenarios (smoke 23/23), downstream guidance and known limits
Doc/多语言本地化接入.md English runtime messages, Locales/*.yml tables and L.T integration guide
Doc/README多语言规范.md Ordering rules, generator scripts and CI gate for the 11 README languages

Highlights

Capability Description
RPC core SRMP protocol, JSON/binary codecs, request pipeline, client/server, cluster connection management, metadata propagation, retry policy, fully asynchronous server path, TraceId call-chain tracing
STRM streaming Server streaming: IAsyncEnumerable<T> pushed item by item over SRMP and SSE
CLNT client base Login/heartbeat/upgrade/command/event in one place, automatic WS/SSE channel switching
UPGD auto-update Detect → download → verify → extract → overwrite → restart
SRV server base ApiController/BaseController/BaseDeviceController, TokenService, IDeviceService; the same endpoint protocol has both MVC and minimal API hosts (mirrored implementations locked by tests)
CMD command push SessionManager + event bus broadcast + WS/SSE/Ping channels
L10N localization Runtime messages use English as the source text; Locales/*.yml ship 31 built-in languages (including Simplified and Traditional Chinese), missing entries fall back to English; no ResourceManager or satellite assemblies
AOT support Always-on AOT analysis for net8.0+ (0 warnings in the core library and Extensions) + in-house source generator (action dispatch table, stream pumps, signature type preservation); NativeAOT verified for 23 core scenarios, 11 minimal-API host scenarios and 6 XCode device-service scenarios (see AOT doc §8)

Quick Start

Five lines on the server, five on the client, and RPC works:

// === Server ===
var server = new ApiServer(12345);
server.Register<MyController>();
server.Start();

public class MyController : ApiController
{
    public String Ping(String name) => $"Hello {name}, {DateTime.Now:HH:mm:ss}";
    // Streaming: returning IAsyncEnumerable<T> pushes items one by one
    public async IAsyncEnumerable<String> StreamLogs(Int32 count)
    {
        for (var i = 0; i < count; i++)
        {
            await Task.Delay(100);
            yield return $"Log #{i}: {DateTime.Now:HH:mm:ss}";
        }
    }
}

// === Client ===
var client = new ApiClient("tcp://127.0.0.1:12345");
client.Open();

// Regular call
var rs = await client.InvokeAsync<String>("My/Ping", new { name = "dev" });

// Streaming call — receive server pushes one by one
await foreach (var log in client.InvokeStreamAsync<String>("My/StreamLogs", new { count = 10 }))
    Console.WriteLine(log);

// Metadata propagation (TraceId is injected automatically)
client.Headers["TenantId"] = "tenant-01";

Performance

Metric Typical Peak in lab
TCP long connections 10,000 4,000,000
RPC throughput 100,000 TPS 455,000 msg/s
Single RPC latency ~41 μs —
Framework support net45 / net461 / netstandard2.0 / netstandard2.1 / net6.0 / net8.0 / net10.0 / net11.0 (aligned with NewLife.Core v12; NativeAOT on net8.0+)

Upgrading to v4

v4 aligns with NewLife.Core v12 and changes the network layering. Before upgrading:

  • Dual ports: the main port serves SRMP only; set HttpPort explicitly to enable HTTP (disabled by default).
  • No SRMP over WebSocket: ws:///wss:// addresses now throw NotSupportedException; use tcp:///udp:// for SRMP and http(s):// for HTTP calls.
  • Codec types removed: WsClient, HttpCodec, WebSocketClientCodec, WebSocketServerCodec and the HttpMessage frame methods are gone; HTTP is handled by Core HttpServer, and custom framing should implement IMessageCodec.
  • English message keys: runtime messages use English source text as locale keys; match ApiCode or error codes instead of localized text.
  • Target frameworks: net5.0/net7.0/net9.0 assets are no longer shipped; NuGet automatically falls back to the nearest supported framework.

See ChangeLog.md for the complete list.


Working with Other NewLife Components

Component Value
NewLife.Core Logging, configuration, serialization, localization, object pooling, TimerX, performance tracing
NewLife.Net High-performance network stack, WebSocket/codecs, port reuse
NewLife.Redis Distributed cache / message queue for shared sessions or push fan-out
Stardust Node registration, config center, APM, release center; can host ApiServer nodes
AntJob Job scheduling and distributed computing via ClientBase
NewLife.MQTT / Modbus / IoT Collect device protocols and report upstream through Remoting

Contributing and Feedback

Contributions welcome: bug reports, performance PRs, new protocol codecs, controller samples, documentation and new translations. When opening an issue, please include: runtime environment, target framework, minimal repro and log excerpt.


Ecosystem Map

NewLife is a layered ecosystem of independently versioned open-source projects. The map below is shared verbatim by every NewLife repository; each project links to its repository and its primary NuGet package.

Project What it does Downloads
基础底座
NewLife.Core 日志、配置、缓存、网络、序列化、定时调度与 APM 追踪。 NuGet
NewLife.XCode 数据中间件:单表百亿级、自动分表、读写分离,支持 10 多种数据库。 NuGet
NewLife.Net 高性能网络库:单机 177 万 pps、14.5 Gbps(TCP 1KB,2026-10 实测),400 万 Tcp 长连接。 NuGet
NewLife.Remoting 协议通信与 RPC 框架,面向 CS 应用与物联网设备。 NuGet
NewLife.Agent 把 .NET 应用安装为操作系统守护进程:Windows 服务与 Linux systemd。 NuGet
NewLife.Templates dotnet new 项目模板:控制台、Web、WebApi、服务、数据与物联网。 NuGet
数据存储与消息
NewLife.Redis Redis 客户端:微秒级延迟、百万级吞吐,内置消息队列。 NuGet
NewLife.RocketMQ 纯托管 RocketMQ 客户端,支持 Apache RocketMQ 与阿里云消息队列。 NuGet
NewLife.MQTT MQTT 客户端与服务端,客户端支持阿里云物联网。 NuGet
NewLife.NovaDb C# 混合数据库:嵌入/网络双模,关系型、时序、消息队列与 KV 于一体。 NuGet
NewLife.MySql MySql 驱动与数据访问辅助层,基于 NewLife 数据栈实现。 NuGet
NewLife.TDengine 纯托管 TDengine ADO.NET 驱动:REST、WebSocket 与原生 RPC 三种连接方式,零本机依赖。 NuGet
NewLife.Presto 纯 C# Presto/Trino ADO.NET 驱动,零第三方依赖,支持 XCode ORM 集成。 NuGet
Web 与分布式
NewLife.Cube 魔方快速开发平台:用户权限、SSO、OAuth 服务端与 CRUD 脚手架。 NuGet
NewLife.Cube.React 魔方前后端分离示例:WebAPI 后端 + Swagger + React/Vue/Blazor 前端。 NuGet
Stardust 星尘分布式服务平台:节点管理、APM、配置中心、注册中心与发布中心。 NuGet
AntJob 蚂蚁调度:分布式任务与实时数据平台,支持分片、重试与回溯补算。 NuGet
AI 与视觉
NewLife.AI 统一接入 46 家大模型服务商,附带开箱即用的 ChatAI Web 对话应用。 NuGet
NewLife.Imaging 纯托管图像基础库:像素模型、编解码契约、绘制与元数据,零原生依赖。 —
NewLife.Vision 视觉算法库:OCR、条码、目标检测与人脸识别,构建在 NewLife.Imaging 之上。 —
NewLife.ML 面向 .NET 的表格机器学习:把数据库表与 Excel 变成可部署的预测与分类模型。 —
工业与物联网
NewLife.IoT IoT 标准库,定义物联网通信协议契约与设备抽象。 NuGet
NewLife.Modbus Modbus TCP/RTU/ASCII,基于 NewLife.IoT 实现。 NuGet
NewLife.Siemens 西门子 PLC 协议,基于 NewLife.IoT 实现。 NuGet
NewLife.Omron 欧姆龙 PLC 协议,基于 NewLife.IoT 实现。 NuGet
NewLife.Melsec 三菱 Melsec PLC 协议,基于 NewLife.IoT 实现。 NuGet
NewLife.Schneider 施耐德 PLC 通信驱动,基于 Modbus TCP。 NuGet
NewLife.OPC OPC 客户端,用于工业数据采集。 —
NewLife.BACnet BACnet 楼宇自控协议栈。 NuGet
NewLife.LoRa 超低功耗物联网远程通信协议 LoRaWAN。 NuGet
ZeroIoT 开源轻量级 IoT 平台,含网关与设备管理。 —
车联网
NewLife.JT808 JT/T 808 车辆定位协议:70+ 消息体,覆盖 2011/2013/2019 三个版本。 NuGet
NewLife.JT809 JT/T 809 部标平台互联协议,面向运输管理部门。 NuGet
NewLife.JT1078 JT/T 1078 车载视频:RTP 解析、FLV/fMP4 转封装与直播推送。 NuGet
领域组件
NewLife.Office 一个包覆盖 Excel、Word、PPT、PDF 等 15+ 文档格式。 NuGet
NewLife.Audio 跨平台音频:编解码、设备 IO、DSP、容器与流式处理。 NuGet
NewLife.Video 视频编解码、封装格式、帧处理与流媒体。 NuGet
NewLife.Map 百度/高德/腾讯/天地图统一接口,支持地理编码与坐标转换。 NuGet
NewLife.IP IPv4 归属地:离线内存映射库 + 在线 API 双源。 NuGet
NewLife.Holiday 中国假期识别库:内置每年假期与调休数据,支持农历节日,完全离线。 NuGet
工具与产品
CrazyCoder 码神工具:网络、串口、加解密、正则、Modbus 与 MQTT。 NuGet
NewLife.UnitTest 单元测试扩展库:测试基类、数据驱动与依赖注入辅助。 NuGet
GitCandy 自托管 Git 源代码管理系统。 —
LuckyClover 从低版本宿主启动时,自动安装匹配的 .NET 运行时。 —

徽章取各项目主包;主题包、扩展包与卫星包见对应 NuGet 页面。未在表中列出的 30 多个包(FTP、Office 扩展、各类协议驱动等)见 NewLifeX 组织 与 newlifex.com。


Team

<img src="https://newlifex.com/logo.png" width="48" align="right" alt="NewLife" />

Founded in 2002, the NewLife team has spent more than two decades on the .NET and IoT ecosystem, maintains nearly 100 open-source projects (44 of them core to this map), and delivers integrated software and hardware solutions for power, logistics, healthcare, industrial control and internet industries. We live by the motto "learning has no seniority — mastery earns respect".

Open-source components have been downloaded 6.48M times from NuGet (ecosystem-wide, as of 2026-10).

Website: https://newlifex.com · Open source organization: https://github.com/NewLifeX

<details> <summary>WeChat Official Account: 智能大石头 (scan to follow)</summary>

智能大石头

</details>


License

MIT © NewLife. Commercial use and secondary development are welcome.

Product 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 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 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 was computed.  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 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

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

Package Downloads
AntWeb

AntJob 可视化管理平台,提供任务调度、监控、日志查询和集群管理功能。

GitHub repositories (2)

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

Repository Stars
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
星尘,轻量级分布式服务框架。配置中心、集群管理、远程自动发布、服务治理。服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。
Version Downloads Last Updated
4.0.2026.1129-beta0949 0 11/29/2026
4.0.2026.1122-beta1417 97 11/22/2026
4.0.2026.1116-beta1043 83 11/16/2026
4.0.2026.1116-beta1031 90 11/16/2026
4.0.2026.1115-beta0408 108 11/15/2026
4.0.2026.1109-beta0753 107 11/9/2026
4.0.2026.1108-beta1710 102 11/8/2026
4.0.2026.1024 335 10/24/2026
4.0.2026.1024-beta0457 110 10/24/2026
3.9.2026.1022-beta0147 129 10/22/2026
3.9.2026.1021-beta0410 108 10/21/2026
3.9.2026.1019-beta1013 115 10/19/2026
3.9.2026.1019-beta0326 102 10/19/2026
3.9.2026.1019-beta0215 116 10/19/2026
3.9.2026.1017-beta1444 124 10/17/2026
3.9.2026.1016-beta0206 113 10/16/2026
3.9.2026.1015-beta1355 116 10/15/2026
3.9.2026.1009-beta1312 113 10/9/2026
3.9.2026.901 184 9/1/2026
3.9.2026.901-beta0431 126 9/1/2026
Loading failed

v4 大版本:对齐 NewLife.Core v12 网络层,主端口仅跑 SRMP、HTTP 需显式 HttpPort,移除 ws:// 承载 SRMP 与自研 HTTP/WS 帧栈;支持 NativeAOT 并内置源生成器;新增令牌吊销与访问/刷新令牌分离,GetUserHost 支持可信代理防伪造;新增最小 API 端点宿主,与 MVC 控制器镜像实现同一协议;运行时词表扩展至 31 种语言;升级 NewLife.Core 12.0.2026.1024