Files
CommTester/README.md
Holger Börchers 7182061a5f Switched to Avalonia
2026-01-30 15:55:58 +01:00

57 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CommTester Prototype: bidirektionale IPC + Streaming (C#)
Dieser Prototyp zeigt **bidirektionale Interprozesskommunikation** zwischen einer **Avalonia Elternanwendung (Desktop, cross-platform)** und **mehreren Kindprozessen** inklusive **Streaming** (fortlaufende Log-/Progress-Nachrichten).
## Architektur
- **Parent (Avalonia Desktop)**: `ParentAvalonia`
- startet mehrere Child-Prozesse
- hostet pro Child einen **Named Pipe Server** (Windows/Linux/macOS via .NET)
- sendet Commands (Ping, StartWork, CancelWork)
- empfängt Streaming-Events (Log, Progress, Result)
- **Child (Console)**: `ChildWorker`
- verbindet sich als **Named Pipe Client**
- verarbeitet Commands
- streamt Log/Progress/Result zurück
- **Shared IPC**: `CommIpc`
- Protokoll: **4-Byte Längenprefix (Little Endian)** + **UTF-8 JSON** (`System.Text.Json`)
- Message-Envelope: `IpcFrame { kind, correlationId, payload, timestamp }`
## Quickstart
1. Build (einmalig):
- Solution: `CommTester.slnx`
2. Parent starten:
- Starte `ParentAvalonia` (Debug oder Run).
3. In der UI:
- **Start 3 Children**: startet 3 Kindprozesse und verbindet per Pipe
- **Ping Selected**: Ping/Pong roundtrip
- **Start Work**: Child streamt Progress + Logs (mehrere Frames)
- **Cancel Work**: cancelt laufende Arbeit im Child
## Pipe-Namen
Der Pipe-Name wird pro Child eindeutig gebildet:
- `CommTester_<parentPid>_<childId>`
Damit kann ein Parent mehrere Childs parallel bedienen.
## Erweiterungsideen
- Request/Response-Routing (CorrelationId) mit Awaitables im Parent
- Reconnect-Strategien / Heartbeats
- Backpressure (Channel für Outbound Frames)
- Auth/ACL (bei Bedarf), Logging, Telemetrie
## Hinweis zu NuGet-Feeds
Im Repo liegt eine `NuGet.config`, die die Paketquelle explizit auf **nuget.org** setzt. Das verhindert Restore-Fehler, falls im globalen Setup eine private (authentifizierte) Quelle konfiguriert ist.