Packet.Rhp2 0.15.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Packet.Rhp2 --version 0.15.0
                    
NuGet\Install-Package Packet.Rhp2 -Version 0.15.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="Packet.Rhp2" Version="0.15.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Packet.Rhp2" Version="0.15.0" />
                    
Directory.Packages.props
<PackageReference Include="Packet.Rhp2" />
                    
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 Packet.Rhp2 --version 0.15.0
                    
#r "nuget: Packet.Rhp2, 0.15.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 Packet.Rhp2@0.15.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=Packet.Rhp2&version=0.15.0
                    
Install as a Cake Addin
#tool nuget:?package=Packet.Rhp2&version=0.15.0
                    
Install as a Cake Tool

Packet.Rhp2

The RHPv2 (Radio Host Protocol v2 — PWP-0222 / PWP-0245) JSON-over-TCP wire codec: the single source of truth for the RHPv2 wire format, with no engine, no transport, and no client/server policy. It is the shared codec layer both pdn's RHPv2 server (Packet.Rhp2.Server) and RHPv2 clients build on.

What it does

  • Framing (RhpFraming): each message is a 2-byte big-endian unsigned length prefix followed by exactly that many bytes of UTF-8 JSON. A zero-length frame is legal; the reader bounds a mid-frame stall (slowloris) without bounding idle-between-frames waits.
  • Message catalogue (RhpMessage + the per-type DTOs): auth, open, socket, bind, listen, connect, send, sendto, recv, accept, status, close, and their replies. An unrecognised type becomes an UnknownMessage carrying the raw JSON (forward-compatible) rather than throwing.
  • JSON codec (RhpJson): type-first key emission, WhenWritingNull omission (matching XRouter, which never writes JSON nulls), case-insensitive reads.
  • Payload encoding (RhpDataEncoding): bytes ↔ a Latin-1 string in the JSON data field — one byte per code unit, JSON escaping does the rest. Not base64.
  • Constants (RhpConstants): ProtocolFamily, SocketMode, OpenFlags, StatusFlags, RhpErrorCode (with canonical Text()), RhpMessageType.

Wire fidelity

The shapes here are pinned against live XRouter, not just the published spec — capital errCode/errText on every reply, the connectReply PascalCase-typo tolerance on read, port string-or-number normalisation, errCode 17 "Not connected", and the Latin-1 (not base64) data encoding. See docs/rhp2-server.md in the source repo for the full spec-vs-wire delta table.

Relationship to rhp2lib

Packet.Rhp2 and rhp2lib-net's embedded codec (RhpV2.Client.Protocol) are byte-identical on the wire — same framing, same Latin-1 encoding, same RhpErrorCode values and text, same type-first dispatch. This package is published so the two can converge onto one codec instead of maintaining divergent copies (packet-net/packet.net#474).

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

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
0.24.0 80 7/20/2026
0.23.0 87 7/14/2026
0.22.0 97 7/14/2026
0.21.0 91 7/9/2026
0.20.0 94 7/5/2026
0.19.0 104 7/5/2026
0.18.0 98 7/5/2026
0.17.0 116 6/23/2026
0.16.0 107 6/23/2026
0.15.0 111 6/23/2026