ColorVision.SocketProtocol 1.6.0

dotnet add package ColorVision.SocketProtocol --version 1.6.0
                    
NuGet\Install-Package ColorVision.SocketProtocol -Version 1.6.0
                    
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="ColorVision.SocketProtocol" Version="1.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ColorVision.SocketProtocol" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="ColorVision.SocketProtocol" />
                    
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 ColorVision.SocketProtocol --version 1.6.0
                    
#r "nuget: ColorVision.SocketProtocol, 1.6.0"
                    
#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.6.0
                    
#: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.6.0
                    
Install as a Cake Addin
#tool nuget:?package=ColorVision.SocketProtocol&version=1.6.0
                    
Install as a Cake Tool

ColorVision.SocketProtocol

ColorVision 桌面端 TCP 服务模块,负责监听、JSON/Text 分发、SQLite 消息记录和调试窗口。目标框架为 Windows WPF net8.0-windows7.0 / net10.0-windows7.0;依赖以 ColorVision.SocketProtocol.csproj 为准。

使用前提

  • 宿主需要 ColorVision.UI、ColorVision.Database 及项目声明的运行时依赖。
  • SocketConfig.IsServerEnabled 默认关闭;启用后按启动时的地址、端口、缓冲区和解析模式建立服务。修改配置后需要重新启动服务才能应用。
  • 默认地址为 0.0.0.0、端口为 6666,监听可能对其他设备开放;此模块不提供通用鉴权、TLS 或 TCP 分帧协议。
  • 消息保存在 %AppData%/ColorVision/Config/SocketMessages.db;收发只将快照入队,后台顺序提交,业务处理不等待落库。队列在内存中,正常退出会在 Socket 关闭期限内等待排空,强制退出或超时可能留下未提交记录。重发可能选择首个可写客户端并触发业务动作,必须确认目标与授权。

配置与扩展入口

任务 入口
配置监听、启停服务 SocketConfig、SocketInitializer、SocketManager
实现 JSON 指令 ISocketJsonHandler.EventName 与 Handle(NetworkStream, SocketRequest)
实现文本分发 ISocketTextDispatcher、SocketTextDispatcher
查询消息与连接诊断 SocketManagerWindow、SocketMessageManager

完整的配置默认值、分发、消息边界、重发和失败语义见TCP 监听、协议分发与消息记录。JSON handler 在 dispatcher 构造前完成程序集加载;文本模式只调用首个发现的 handler。消息记录中的 Sent 不代表对端完成业务。

构建

在仓库根目录运行,生成本地构建和包产物:

dotnet build .\UI\ColorVision.SocketProtocol\ColorVision.SocketProtocol.csproj -p:Platform=x64

SQLite 存储与维护说明消息正文迁移、备份与空间回收;客户业务命令由所属项目协议定义。仓库文档链接需要匹配版本的完整源码,单独使用发布包时应同时查阅对应版本的文档。

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 65 10/7/2026
1.5.8 137 8/18/2026
1.5.7 129 7/28/2026
1.5.6.1 121 7/8/2026
1.5.5.3 128 6/11/2026
1.5.5.2 130 5/31/2026
1.5.5.1 138 4/13/2026
1.5.4.1 146 3/31/2026
1.5.1.1 144 2/16/2026
1.4.1.1 142 2/3/2026
1.3.10.2 155 1/29/2026
1.3.10.1 148 1/14/2026
1.3.9.2 732 12/1/2025
1.3.9.1 342 11/16/2025
1.3.8.4 330 11/12/2025
1.3.8.3 252 9/30/2025
1.3.8.2 245 9/29/2025
1.3.8.1 227 9/25/2025
1.3.6.1 223 9/5/2025
1.3.5.2 272 9/3/2025
Loading failed