Packet.Rhp2
0.15.0
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
<PackageReference Include="Packet.Rhp2" Version="0.15.0" />
<PackageVersion Include="Packet.Rhp2" Version="0.15.0" />
<PackageReference Include="Packet.Rhp2" />
paket add Packet.Rhp2 --version 0.15.0
#r "nuget: Packet.Rhp2, 0.15.0"
#:package Packet.Rhp2@0.15.0
#addin nuget:?package=Packet.Rhp2&version=0.15.0
#tool nuget:?package=Packet.Rhp2&version=0.15.0
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 unrecognisedtypebecomes anUnknownMessagecarrying the raw JSON (forward-compatible) rather than throwing. - JSON codec (
RhpJson): type-first key emission,WhenWritingNullomission (matching XRouter, which never writes JSON nulls), case-insensitive reads. - Payload encoding (
RhpDataEncoding): bytes ↔ a Latin-1 string in the JSONdatafield — one byte per code unit, JSON escaping does the rest. Not base64. - Constants (
RhpConstants):ProtocolFamily,SocketMode,OpenFlags,StatusFlags,RhpErrorCode(with canonicalText()),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 | Versions 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. |
-
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.