Files
CommTester/README.md
Holger Börchers 894fbbfa5a Initial commit
2026-01-30 15:31:43 +01:00

53 lines
1.6 KiB
Markdown
Raw 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 **WPF Elternanwendung** und **mehreren Kindprozessen** inklusive **Streaming** (fortlaufende Log-/Progress-Nachrichten).
## Architektur
- **Parent (WPF)**: `ParentWpf`
- startet mehrere Child-Prozesse
- hostet pro Child einen **Named Pipe Server** (Windows)
- 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 `ParentWpf` (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