docs: describe the TCP transport, multiplexing and TCPStreamJoin in README, architecture and StreamHub docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino FerrariandClaude Opus 4.6 committed 2026-11-06 13:44:19 +01:00
1 parent 05b9490b06
commit 81879b8b7a
5 files changed
+66 -3

No files matched your search

+31 -1
View File
@@ -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 `<stream>_<signal>`; 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 = "<stream>"`;
a comma list (`"a,b"`) takes several streams over one connection and creates one session per
stream (label `<Label>_<stream>`, id `<node>_<stream>`).
Sources added at runtime (`addSource`) get generated ids `s1, s2, …`;
`saveSources` persists them to `SourcesFile` (JSON array of
`{label, addr, multicastGroup?, dataPort?}`), reloaded at start-up.
`{label, addr, multicastGroup?, dataPort?, transport?, streamName?}`), reloaded at start-up.
`AllowedOrigins` is a comma/space-separated allowlist of `scheme://host[:port]`
values accepted in the WebSocket `Origin` header (max 8 entries, 128 chars