NeoNix-QtPy-Sdk-Serialization 2.0.2

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

NeoNix-QtPy-Sdk-Serialization

A .NET 8 library for JSON‑based messaging over TCP and JSON Schema generation for IMessage types.

Features

  • MessageHub: Singleton for bi‑directional JSON messaging over TCP via MessageHub.Init, SendAsync and background receive loop :contentReference[oaicite:11]{index=11}.
  • Dispatchable Handlers: Register, override or unregister typed callbacks implementing IDispatchable (Register, Override, UnRegiste) to process incoming messages :contentReference[oaicite:12]{index=12}.
  • SchemaManager: Scan assemblies or the executing assembly, generate JSON Schemas for all concrete IMessage implementations, and write them to individual .json files :contentReference[oaicite:13]{index=13}.
  • SocketManager: Robust TCP wrapper with length‑prefixed JSON send/receive and timeout support :contentReference[oaicite:14]{index=14}.

Getting Started

Install from NuGet

<PackageReference Include="NeoNix-QtPy-Sdk-Serialization" Version="1.0.0" />

Then restore and build:

dotnet restore
dotnet build -c Release

Basic Usage

using NeoNix_QtPy_Sdk_Serialization;
using NeoNix_QtPy_Sdk_Serialization.Services;
using NeoNix_QtPy_Sdk_Serialization.Interfaces;

// 1) Initialize connection
await MessageHub.Instance.Init("host.example.com", 12345);

// 2) Register a handler for IMessage types
var inbox = new MyDispatchableHandler();   // implements IDispatchable
MessageHub.Instance.Register(inbox);

// 3) Send a message
await MessageHub.Instance.SendAsync(inbox);

// 4) Export JSON Schemas to disk
MessageHub.ExportSchemas("schemas");

API Overview

  • IMessage: Contract for payload types with a Title property .
  • IDispatchable: Handler interface exposing Name, Message, ToJson(), and Invoke() .
  • DispatchableBaseClass<T>: Base implementation with typed callback and OnReceived event .
  • MessageDispatcher: Internal router that invokes registered IDispatchable by message name .
  • SocketManager: Low‑level TCP socket helper with connect/send/receive and timeout logic .
  • SchemaManager: Static class to generate and write JSON Schema files from IMessage types in assemblies .

Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feature/YourFeature
  3. Add tests and update docs
  4. Open a Pull Request against main

Please follow existing code style and include unit tests where applicable.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET 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 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. 
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
2.0.2 130 8/17/2025
2.0.1 233 8/5/2025
2.0.0 104 8/3/2025
1.1.4 80 7/19/2025
1.1.3 105 7/18/2025
1.1.2 149 7/17/2025