From 81879b8b7a81308ba13abe3b70f3824088afcd9f Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Fri, 6 Nov 2026 13:44:19 +0100 Subject: [PATCH] docs: describe the TCP transport, multiplexing and TCPStreamJoin in README, architecture and StreamHub docs Co-Authored-By: Claude Opus 4.6 --- ARCHITECTURE.md | 32 +++++++++++++++++++++++++++++++- Docs/E2E-Suite.md | 5 +++++ Docs/StreamHub-API.md | 4 ++++ Docs/StreamHub-UserGuide.md | 4 ++++ README.md | 24 ++++++++++++++++++++++-- 5 files changed, 66 insertions(+), 3 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 22c25ca..6957763 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -246,6 +246,32 @@ DebugServiceI *svc = DebugServiceI::GetInstance(); // broker wrapper retrieves i 5. Applies quantization (`QuantizedType`, `RangeMin`, `RangeMax`) per signal 6. Supports unicast and multicast UDP delivery (configurable per instance) +### TCP variant + +`TCPStreamer` / `TCPStreamerClient` subclass the UDP DataSources and replace the transport +(`TCPSServer` / `TCPSClient`) behind the `UDPSServerI` / `UDPSClientI` seam +(`UDPSTransportI.h`). Framing is unchanged (`totalFragments` is always 1); each client has +a bounded queue, so a slow client drops only its own frames. + +`TCPStreamService` (`Source/Components/Interfaces/TCPStreamService/`) is an optional +in-process server: one acceptor plus `Workers` I/O threads serve many `TCPSServiceStream`s +(one per `TCPStreamer` with `Service=`/`StreamName=`). Producers only copy frames into +per-connection queues and wake the worker via a self-pipe. Lock order: topology, stream, +connection. A client picks streams with a `SUBSCRIBE` frame (type 5): + +- **Multiplexing**: the payload may be a comma separated list; each server frame carries the + stream's list index in `fragmentIdx`; queues are accounted per stream. `TCPSClient` + demultiplexes into per-stream listeners (`GetStream(i)` facades), and StreamHub creates + one session per stream over one shared client. +- **Joining**: `TCPStreamJoin` taps several streams (`TCPSStreamTapI`), watches the service + for (un)registration (`TCPSStreamObserverI`) and publishes a merged Strict stream: CONFIG = + concatenated descriptors named `_`; one DATA frame per master frame with + the other sources held at their last value. No extra thread. Accumulate sources and + differing HRT frequencies are refused. Lock order: source tap, join, output stream, + connection queue. + +See `Docs/TCPStreamer.md`. + ### Packed Signals (Accumulate mode) When a signal has `NumberOfElements > 1` and `SamplingRate` is configured: @@ -387,9 +413,13 @@ Hub = { } ``` +A TCP source sets `Transport = "tcp"` and, for a `TCPStreamService`, `StreamName = ""`; +a comma list (`"a,b"`) takes several streams over one connection and creates one session per +stream (label `