CSoft.Parser
10.0.3
dotnet add package CSoft.Parser --version 10.0.3
NuGet\Install-Package CSoft.Parser -Version 10.0.3
<PackageReference Include="CSoft.Parser" Version="10.0.3" />
<PackageVersion Include="CSoft.Parser" Version="10.0.3" />
<PackageReference Include="CSoft.Parser" />
paket add CSoft.Parser --version 10.0.3
#r "nuget: CSoft.Parser, 10.0.3"
#:package CSoft.Parser@10.0.3
#addin nuget:?package=CSoft.Parser&version=10.0.3
#tool nuget:?package=CSoft.Parser&version=10.0.3
Communication
通讯库
用法详见例子
一、为什么要分割数据包
因为通信的时候,接收到的数据是一个连续的数据流。我们需要从中获取到一个完整的数据包。
二、分割一个数据包的几种方式
1.包头和包尾
例子
头:01 02 尾:04 06(以后的例子中的头和尾都用01 02 和 04 06) 一个完整的数据包 01 02 xx xx … xx 04 06
安全性问题
如果对方只发送了包头,然后一直发送垃圾数据,这些数据中不包含包尾。我们的程序无法丢弃这些垃圾数据,这会导致占用内存越来越大,最终导致程序崩溃
2.包尾
例子
一个完整的数据包 xx xx … xx 04 06
安全性问题
如果对方一直发送垃圾数据,这些数据中不包含包尾。我们的程序无法丢弃这些垃圾数据,这会导致占用内存越来越大,最终导致程序崩溃
3.包头和长度
例子
一个完整的数据包 01 02 03 05 07 其中01 02 是包头(TCP可以不带包头),03代表长度(也可以传入指定长度)。比如协议规定,除包头以外,还有长度为3的数据,本例中是03 05 07。
安全性问题
如果对方一直发送垃圾数据,这些数据中不包含包头。我们的程序可以移除这些无效数据,这样不会使内存占用变大。所以推荐使用这种分割数据包的方式
4.时间
这种方式用于串口通信。不会产生垃圾数据占用内存的问题。一定时间内(比如Modbus是200ms)收到的数据作为一个完整的数据包
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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 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. |
| .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 was computed. |
| .NET Framework | net461 was computed. 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. |
-
.NETStandard 2.0
- CSoft.LogInterface (>= 10.0.0)
- CSoft.Utils (>= 10.0.3)
- System.Threading.Channels (>= 10.0.2)
-
net10.0
- CSoft.LogInterface (>= 10.0.0)
- CSoft.Utils (>= 10.0.3)
-
net9.0
- CSoft.LogInterface (>= 10.0.0)
- CSoft.Utils (>= 10.0.3)
- System.Threading.Channels (>= 10.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CSoft.Parser:
| Package | Downloads |
|---|---|
|
CSoft.TopPortLib
通讯口使用类库 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 10.0.3 | 780 | 1/14/2026 | |
| 10.0.2 | 2,924 | 12/10/2025 | |
| 10.0.1 | 474 | 12/8/2025 | |
| 10.0.0 | 1,051 | 11/12/2025 | |
| 9.5.0 | 441 | 10/20/2025 | |
| 9.4.6 | 808 | 9/8/2025 | |
| 9.4.5 | 1,524 | 8/8/2025 | |
| 9.4.4 | 594 | 8/6/2025 | |
| 9.4.3 | 766 | 8/5/2025 | |
| 9.4.2 | 1,241 | 7/25/2025 | |
| 9.4.1 | 858 | 7/25/2025 | |
| 9.4.0 | 883 | 7/25/2025 | |
| 9.3.3 | 912 | 7/25/2025 | |
| 9.3.2 | 1,816 | 7/22/2025 | |
| 9.3.1 | 754 | 7/22/2025 | |
| 9.2.3 | 562 | 7/17/2025 | |
| 9.2.2 | 746 | 6/27/2025 | |
| 9.2.1 | 349 | 6/25/2025 | |
| 9.2.0 | 1,066 | 5/21/2025 | |
| 9.1.6 | 715 | 3/20/2025 |
更新依赖