ColorVision.SocketProtocol
1.3.10.2
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 ColorVision.SocketProtocol --version 1.3.10.2
NuGet\Install-Package ColorVision.SocketProtocol -Version 1.3.10.2
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.
For projects that support PackageReference, copy this XML node into the project file to reference the package.
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 ColorVision.SocketProtocol --version 1.3.10.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ColorVision.SocketProtocol, 1.3.10.2"
#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 ColorVision.SocketProtocol@1.3.10.2
#: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=ColorVision.SocketProtocol&version=1.3.10.2
#tool nuget:?package=ColorVision.SocketProtocol&version=1.3.10.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ColorVision.SocketProtocol
🎯 功能定位
网络通信协议模块,提供Socket和串口通信功能。
作用范围
通信协议层,为设备通信提供统一的网络接口。
主要功能点
- Socket通信 - TCP/UDP网络通信协议
- 串口通信 - RS232/RS485串口设备通信
- 协议封装 - 统一的通信协议接口
- 连接管理 - 自动重连和连接状态监控
- 数据缓冲 - 高效的数据收发缓冲机制
- 异步通信 - 支持异步通信避免界面阻塞
与主程序的依赖关系
被引用方式:
- ColorVision.Engine 引用用于设备通信
- 各插件和项目引用用于外部通信
引用的程序集:
- System.IO.Ports - 串口通信
- System.Net.Sockets - Socket通信
使用方式
引用方式
在主程序中的启用
- 通过设备配置自动启用对应通信方式
- 支持插件化通信协议扩展
开发调试
dotnet build UI/ColorVision.SocketProtocol/ColorVision.SocketProtocol.csproj
通信示例
Socket通信示例
// 创建TCP客户端
var client = new SocketClient("192.168.1.100", 8080);
// 连接服务器
await client.ConnectAsync();
// 发送数据
await client.SendAsync(data);
// 接收数据
var response = await client.ReceiveAsync();
串口通信示例
// 配置串口
var serialPort = new SerialPortClient
{
PortName = "COM3",
BaudRate = 9600,
DataBits = 8,
Parity = Parity.None,
StopBits = StopBits.One
};
// 打开串口
serialPort.Open();
// 发送数据
serialPort.Write(data);
// 接收数据
var response = serialPort.Read();
相关文档链接
维护者
ColorVision 通信团队
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-windows7.0
- ColorVision.Database (>= 1.3.10.1)
- ColorVision.UI (>= 1.3.10.2)
- log4net (>= 3.2.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.0 | 0 | 10/7/2026 |
| 1.5.8 | 114 | 8/18/2026 |
| 1.5.7 | 124 | 7/28/2026 |
| 1.5.6.1 | 117 | 7/8/2026 |
| 1.5.5.3 | 124 | 6/11/2026 |
| 1.5.5.2 | 125 | 5/31/2026 |
| 1.5.5.1 | 131 | 4/13/2026 |
| 1.5.4.1 | 139 | 3/31/2026 |
| 1.5.1.1 | 140 | 2/16/2026 |
| 1.4.1.1 | 139 | 2/3/2026 |
| 1.3.10.2 | 151 | 1/29/2026 |
| 1.3.10.1 | 144 | 1/14/2026 |
| 1.3.9.2 | 728 | 12/1/2025 |
| 1.3.9.1 | 337 | 11/16/2025 |
| 1.3.8.4 | 325 | 11/12/2025 |
| 1.3.8.3 | 248 | 9/30/2025 |
| 1.3.8.2 | 240 | 9/29/2025 |
| 1.3.8.1 | 223 | 9/25/2025 |
| 1.3.6.1 | 218 | 9/5/2025 |
| 1.3.5.2 | 268 | 9/3/2025 |
Loading failed