rhp2lib-net¶
A .NET 10 client library, in-process mock server, and command-line toolkit for RHPv2 — the JSON-over-TCP "Remote Host Protocol" used by XRouter to expose its multi-protocol packet-radio engine to applications.
-
A real client library
Strongly-typed messages, async request/reply correlation, asynchronous notifications surfaced as .NET events. Targets
net10.0. -
A useful CLI
rhp probe,rhp chat,rhp mon,rhp send,rhp serve— one binary, sub-commands. Self-contained single-file builds for seven RIDs. -
A mock server for tests
MockRhpServerlets your code talk to a real TCP socket without an XRouter. 31 xunit tests in the project use it; yours can too. -
Spec-faithful
Implements PWP-0222 and PWP-0245 verbatim, with quirks (
errCodevserrcode,ConnectReplyPascalCase) tolerated on read.
At a glance¶
using RhpV2.Client;
using RhpV2.Client.Protocol;
await using var rhp = await RhpClient.ConnectAsync("xrouter.local");
await rhp.AuthenticateAsync("g8pzt", "secret");
rhp.Received += (_, e) =>
Console.WriteLine($"<- {e.Message.Data}");
var handle = await rhp.OpenAsync(
ProtocolFamily.Ax25, SocketMode.Stream,
port: "1", local: "G8PZT", remote: "GB7PZT",
flags: OpenFlags.Active);
await rhp.SendOnHandleAsync(handle, "hello\r");
What is RHPv2?¶
RHPv2 is a JSON-over-TCP protocol used by Paula Dowie's
XRouter packet engine. An RHPv2
client opens a TCP connection (default port 9000), sends framed JSON
messages such as OPEN, SEND, CLOSE, and receives OPENREPLY,
SENDREPLY, async RECV / ACCEPT / STATUS notifications.
Each frame is preceded by a two-byte big-endian length, capped at
0xFFFF bytes. Up to that boundary the payload is a single JSON object
whose type field discriminates the message kind.
The protocol therefore lets a regular application speak AX.25, NetRom, APRS, raw TCP, ICMP and more, by talking JSON to XRouter.
Project layout¶
| Path | Purpose |
|---|---|
src/RhpV2.Client/ |
The library + MockRhpServer. |
src/RhpV2.Tools/ |
The rhp CLI. |
tests/RhpV2.Client.Tests/ |
xunit suite (31 tests). |
.github/workflows/ |
CI, release, docs. |
Status¶
Pre-release
This is 0.x software. The wire protocol it implements is stable, but the
.NET API surface — particularly anything in RhpV2.Client.Testing — may
still shift before 1.0.